-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdsr-rreq.h
54 lines (44 loc) · 1.54 KB
/
dsr-rreq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* Copyright (C) Uppsala University
*
* This file is distributed under the terms of the GNU general Public
* License (GPL), see the file LICENSE
*
* Author: Erik Nordström, <[email protected]>
*/
#ifndef _DSR_RREQ_H
#define _DSR_RREQ_H
#include "dsr.h"
#ifdef NS2
#include "endian.h"
#endif
#ifndef NO_GLOBALS
struct dsr_rreq_opt {
u_int8_t type;
u_int8_t length;
u_int16_t id;
u_int32_t target;
u_int32_t addrs[0];
};
#define DSR_RREQ_HDR_LEN sizeof(struct dsr_rreq_opt)
#define DSR_RREQ_OPT_LEN (DSR_RREQ_HDR_LEN - 2)
#define DSR_RREQ_TOT_LEN IP_HDR_LEN + sizeof(struct dsr_opt_hdr) + sizeof(struct dsr_rreq_opt)
#define DSR_RREQ_ADDRS_LEN(rreq_opt) (rreq_opt->length - 6)
#endif /* NO_GLOBALS */
#ifndef NO_DECLS
void rreq_tbl_set_max_len(unsigned int max_len);
int dsr_rreq_opt_recv(struct dsr_pkt *dp, struct dsr_rreq_opt *rreq_opt);
int rreq_tbl_route_discovery_cancel(struct in_addr dst);
int dsr_rreq_route_discovery(struct in_addr target);
int dsr_rreq_send(struct in_addr target, int ttl);
void rreq_tbl_timeout(unsigned long data);
struct rreq_tbl_entry *__rreq_tbl_entry_create(struct in_addr node_addr);
struct rreq_tbl_entry *__rreq_tbl_add(struct in_addr node_addr);
int rreq_tbl_add_id(struct in_addr initiator, struct in_addr target,
unsigned short id);
int dsr_rreq_duplicate(struct in_addr initiator, struct in_addr target,
unsigned int id);
int rreq_tbl_init(void);
void rreq_tbl_cleanup(void);
#endif /* NO_DECLS */
#endif /* _DSR_RREQ */