GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / proto / bcmipv6.h
blob8f239fbfb0944c51913756a0e4310d7c15f916d9
1 /*
2 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 * Fundamental constants relating to Neighbor Discovery Protocol
18 * $Id: bcmipv6.h 352279 2012-08-22 07:21:57Z $
21 #ifndef _bcmipv6_h_
22 #define _bcmipv6_h_
24 #ifndef _TYPEDEFS_H_
25 #include <typedefs.h>
26 #endif
28 /* This marks the start of a packed structure section. */
29 #include <packed_section_start.h>
31 #define ICMPV6_HEADER_TYPE 0x3A
32 #define ICMPV6_PKT_TYPE_NS 135
33 #define ICMPV6_PKT_TYPE_NA 136
35 #define ICMPV6_ND_OPT_TYPE_TARGET_MAC 2
36 #define ICMPV6_ND_OPT_TYPE_SRC_MAC 1
38 #define IPV6_VERSION 6
39 #define IPV6_HOP_LIMIT 255
41 #define IPV6_ADDR_NULL(a) ((a[0] | a[1] | a[2] | a[3] | a[4] | \
42 a[5] | a[6] | a[7] | a[8] | a[9] | \
43 a[10] | a[11] | a[12] | a[13] | \
44 a[14] | a[15]) == 0)
46 #define IPV6_ADDR_LOCAL(a) (((a[0] == 0xfe) && (a[1] & 0x80))? TRUE: FALSE)
48 /* IPV6 address */
49 BWL_PRE_PACKED_STRUCT struct ipv6_addr {
50 uint8 addr[16];
51 } BWL_POST_PACKED_STRUCT;
53 #ifndef IL_BIGENDIAN
55 /* ICMPV6 Header */
56 BWL_PRE_PACKED_STRUCT struct icmp6_hdr {
57 uint8 icmp6_type;
58 uint8 icmp6_code;
59 uint16 icmp6_cksum;
60 BWL_PRE_PACKED_STRUCT union {
61 uint32 reserved;
62 BWL_PRE_PACKED_STRUCT struct nd_advt {
63 uint32 reserved1:5,
64 override:1,
65 solicited:1,
66 router:1,
67 reserved2:24;
68 } BWL_POST_PACKED_STRUCT nd_advt;
69 } BWL_POST_PACKED_STRUCT opt;
70 } BWL_POST_PACKED_STRUCT;
72 /* Ipv6 Header Format */
73 BWL_PRE_PACKED_STRUCT struct ipv6_hdr {
74 uint8 priority:4,
75 version:4;
76 uint8 flow_lbl[3];
77 uint16 payload_len;
78 uint8 nexthdr;
79 uint8 hop_limit;
80 struct ipv6_addr saddr;
81 struct ipv6_addr daddr;
82 } BWL_POST_PACKED_STRUCT;
84 /* Neighbor Advertisement/Solicitation Packet Structure */
85 BWL_PRE_PACKED_STRUCT struct nd_msg {
86 struct icmp6_hdr icmph;
87 struct ipv6_addr target;
88 } BWL_POST_PACKED_STRUCT;
91 /* Neighibor Solicitation/Advertisement Optional Structure */
92 BWL_PRE_PACKED_STRUCT struct nd_msg_opt {
93 uint8 type;
94 uint8 len;
95 uint8 mac_addr[ETHER_ADDR_LEN];
96 } BWL_POST_PACKED_STRUCT;
98 #endif /* IL_BIGENDIAN */
100 /* This marks the end of a packed structure section. */
101 #include <packed_section_end.h>
103 #endif /* !defined(_bcmipv6_h_) */