1 //==========================================================================
3 // include/netinet6_nd6_protocol.h
7 //==========================================================================
8 //####BSDCOPYRIGHTBEGIN####
10 // -------------------------------------------
12 // Portions of this software may have been derived from OpenBSD or other sources,
13 // and are covered by the appropriate copyright disclaimers included herein.
15 // -------------------------------------------
17 //####BSDCOPYRIGHTEND####
18 //==========================================================================
19 //#####DESCRIPTIONBEGIN####
22 // Contributors: gthomas
28 //####DESCRIPTIONEND####
30 //==========================================================================
34 %%% portions-copyright-nrl-97
35 Portions of this software are Copyright 1997-1998 by Randall Atkinson,
36 Ronald Lee, Daniel McDonald, Bao Phan, and Chris Winters. All Rights
37 Reserved. All rights under this copyright have been assigned to the US
38 Naval Research Laboratory (NRL). The NRL Copyright Notice and License
39 Agreement Version 1.1 (January 17, 1995) applies to these portions of the
41 You should have received a copy of the license with this software. If you
42 didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>.
46 #ifndef _NETINET6_ND6_PROTOCOL_H
47 #define _NETINET6_ND6_PROTOCOL_H 1
49 #include <netinet6/icmpv6.h>
51 #define ND6_ROUTER_SOLICITATION 133
52 #define ND6_ROUTER_ADVERTISEMENT 134
53 #define ND6_NEIGHBOR_SOLICITATION 135
54 #define ND6_NEIGHBOR_ADVERTISEMENT 136
55 #define ND6_REDIRECT 137
58 ND6_OPT_SOURCE_LINKADDR=1,
59 ND6_OPT_TARGET_LINKADDR=2,
60 ND6_OPT_PREFIX_INFORMATION=3,
61 ND6_OPT_REDIRECTED_HEADER=4,
66 struct nd_router_solicit { /* router solicitation */
67 struct icmpv6hdr rsol_hdr;
70 #define rsol_type rsol_hdr.icmpv6_type
71 #define rsol_code rsol_hdr.icmpv6_code
72 #define rsol_cksum rsol_hdr.icmpv6_cksum
73 #define rsol_reserved rsol_hdr.icmpv6_data32[0]
75 struct nd_router_advert { /* router advertisement */
76 struct icmpv6hdr radv_hdr;
77 uint32_t radv_reachable; /* reachable time */
78 uint32_t radv_retransmit; /* reachable retransmit time */
81 #define radv_type radv_hdr.icmpv6_type
82 #define radv_code radv_hdr.icmpv6_code
83 #define radv_cksum radv_hdr.icmpv6_cksum
84 #define radv_maxhoplimit radv_hdr.icmpv6_data8[0]
85 #define radv_m_o_res radv_hdr.icmpv6_data8[1]
86 #define ND6_RADV_M_BIT 0x80
87 #define ND6_RADV_O_BIT 0x40
88 #define radv_router_lifetime radv_hdr.icmpv6_data16[1]
90 struct nd6_nsolicitation { /* neighbor solicitation */
91 struct icmpv6hdr nsol6_hdr;
92 struct in6_addr nsol6_target;
95 struct nd6_nadvertisement { /* neighbor advertisement */
96 struct icmpv6hdr nadv6_hdr;
97 struct in6_addr nadv6_target;
100 #define nadv6_flags nadv6_hdr.icmpv6_data32[0]
101 #define ND6_NADVERFLAG_ISROUTER 0x80
102 #define ND6_NADVERFLAG_SOLICITED 0x40
103 #define ND6_NADVERFLAG_OVERRIDE 0x20
105 struct nd6_redirect { /* redirect */
106 struct icmpv6hdr redirect_hdr;
107 struct in6_addr redirect_target;
108 struct in6_addr redirect_destination;
111 struct nd6_opt_prefix_info { /* prefix information */
114 uint8_t opt_prefix_length;
116 uint32_t opt_valid_life;
117 uint32_t opt_preferred_life;
118 uint32_t opt_reserved2;
119 struct in6_addr opt_prefix;
122 #define ND6_OPT_PI_L_BIT 0x80
123 #define ND6_OPT_PI_A_BIT 0x40
125 struct nd6_opt_mtu { /* MTU option */
128 uint16_t opt_reserved;
132 #endif /* _NETINET6_ND6_PROTOCOL_H */