]>
The Tcpdump Group git mirrors - tcpdump/blob - aodv.h
1 /* @(#) $Header: /tcpdump/master/tcpdump/aodv.h,v 1.1 2003-08-06 06:49:39 guy Exp $ (LBL) */
3 * Copyright (c) 2003 Bruce M. Simpson <bms@spc.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Bruce M. Simpson.
17 * 4. Neither the name of Bruce M. Simpson nor the names of co-
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
37 u_char rreq_type
; /* AODV message type (1) */
38 u_char rreq_flags
; /* various flags */
39 u_char rreq_zero0
; /* reserved, set to zero */
40 u_char rreq_hops
; /* number of hops from originator */
41 u_long rreq_id
; /* request ID */
42 u_long rreq_da
; /* destination IPv4 address */
43 u_long rreq_ds
; /* destination sequence number */
44 u_long rreq_oa
; /* originator IPv4 address */
45 u_long rreq_os
; /* originator sequence number */
49 u_char rreq_type
; /* AODV message type (1) */
50 u_char rreq_flags
; /* various flags */
51 u_char rreq_zero0
; /* reserved, set to zero */
52 u_char rreq_hops
; /* number of hops from originator */
53 u_long rreq_id
; /* request ID */
54 struct in6_addr rreq_da
; /* destination IPv6 address */
55 u_long rreq_ds
; /* destination sequence number */
56 struct in6_addr rreq_oa
; /* originator IPv6 address */
57 u_long rreq_os
; /* originator sequence number */
61 #define RREQ_JOIN 0x80 /* join (reserved for multicast */
62 #define RREQ_REPAIR 0x40 /* repair (reserved for multicast */
63 #define RREQ_GRAT 0x20 /* gratuitous RREP */
64 #define RREQ_DEST 0x10 /* destination only */
65 #define RREQ_UNKNOWN 0x08 /* unknown destination sequence num */
66 #define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */
69 u_char rrep_type
; /* AODV message type (2) */
70 u_char rrep_flags
; /* various flags */
71 u_char rrep_ps
; /* prefix size */
72 u_char rrep_hops
; /* number of hops from o to d */
73 u_long rrep_da
; /* destination IPv4 address */
74 u_long rrep_ds
; /* destination sequence number */
75 u_long rrep_oa
; /* originator IPv4 address */
76 u_long rrep_life
; /* lifetime of this route */
80 u_char rrep_type
; /* AODV message type (2) */
81 u_char rrep_flags
; /* various flags */
82 u_char rrep_ps
; /* prefix size */
83 u_char rrep_hops
; /* number of hops from o to d */
84 struct in6_addr rrep_da
; /* destination IPv6 address */
85 u_long rrep_ds
; /* destination sequence number */
86 struct in6_addr rrep_oa
; /* originator IPv6 address */
87 u_long rrep_life
; /* lifetime of this route */
91 #define RREP_REPAIR 0x80 /* repair (reserved for multicast */
92 #define RREP_ACK 0x40 /* acknowledgement required */
93 #define RREP_FLAGS_MASK 0xC0 /* mask for rrep_flags */
94 #define RREP_PREFIX_MASK 0x1F /* mask for prefix size */
97 u_long u_da
; /* IPv4 address */
98 u_long u_ds
; /* sequence number */
101 struct rerr_unreach6
{
102 struct in6_addr u_da
; /* IPv6 address */
103 u_long u_ds
; /* sequence number */
108 u_char rerr_type
; /* AODV message type (3) */
109 u_char rerr_flags
; /* various flags */
110 u_char rerr_zero0
; /* reserved, set to zero */
111 u_char rerr_dc
; /* destination count */
113 struct rerr_unreach dest
[1];
115 struct rerr_unreach6 dest6
[1];
120 #define RERR_NODELETE 0x80 /* don't delete the link */
121 #define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */
123 struct aodv_rrep_ack
{
129 struct aodv_rreq rreq
;
130 struct aodv_rrep rrep
;
131 struct aodv_rerr rerr
;
132 struct aodv_rrep_ack rrep_ack
;
134 struct aodv_rreq6 rreq6
;
135 struct aodv_rrep6 rrep6
;
139 #define AODV_RREQ 1 /* route request */
140 #define AODV_RREP 2 /* route response */
141 #define AODV_RERR 3 /* error report */
142 #define AODV_RREP_ACK 4 /* route response acknowledgement */
145 u_char type
; /* extension type */
146 u_char length
; /* extension length */
150 struct aodv_ext eh
; /* extension header */
151 u_long interval
; /* expect my next hello in
155 #define AODV_EXT_HELLO 1
157 #endif /* _AODV_H_ */