2 * Copyright (C) 2012, 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 352279 2012-08-22 07:21:57Z $
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] | \
46 #define IPV6_ADDR_LOCAL(a) (((a[0] == 0xfe) && (a[1] & 0x80))? TRUE: FALSE)
49 BWL_PRE_PACKED_STRUCT
struct ipv6_addr
{
51 } BWL_POST_PACKED_STRUCT
;
56 BWL_PRE_PACKED_STRUCT
struct icmp6_hdr
{
60 BWL_PRE_PACKED_STRUCT
union {
62 BWL_PRE_PACKED_STRUCT
struct nd_advt
{
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
{
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
{
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_) */