2 * Copyright (C) 2011, Broadcom Corporation. All Rights Reserved.
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.
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 305568 2011-12-29 20:21:17Z $
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] | \
47 BWL_PRE_PACKED_STRUCT
struct ipv6_addr
{
49 } BWL_POST_PACKED_STRUCT
;
54 BWL_PRE_PACKED_STRUCT
struct icmp6_hdr
{
58 BWL_PRE_PACKED_STRUCT
union {
60 BWL_PRE_PACKED_STRUCT
struct nd_advt
{
66 } BWL_POST_PACKED_STRUCT nd_advt
;
67 } BWL_POST_PACKED_STRUCT opt
;
68 } BWL_POST_PACKED_STRUCT
;
70 /* Ipv6 Header Format */
71 BWL_PRE_PACKED_STRUCT
struct ipv6_hdr
{
78 struct ipv6_addr saddr
;
79 struct ipv6_addr daddr
;
80 } BWL_POST_PACKED_STRUCT
;
82 /* Neighbor Advertisement/Solicitation Packet Structure */
83 BWL_PRE_PACKED_STRUCT
struct nd_msg
{
84 struct icmp6_hdr icmph
;
85 struct ipv6_addr target
;
86 } BWL_POST_PACKED_STRUCT
;
89 /* Neighibor Solicitation/Advertisement Optional Structure */
90 BWL_PRE_PACKED_STRUCT
struct nd_msg_opt
{
93 uint8 mac_addr
[ETHER_ADDR_LEN
];
94 } BWL_POST_PACKED_STRUCT
;
96 #endif /* IL_BIGENDIAN */
98 /* This marks the end of a packed structure section. */
99 #include <packed_section_end.h>
101 #endif /* !defined(_bcmipv6_h_) */