source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/icmpv6.h @ 8

Last change on this file since 8 was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 3.4 KB
Line 
1#ifndef _LINUX_ICMPV6_H
2#define _LINUX_ICMPV6_H
3
4#include <asm/types.h>
5
6#include <endian.h>
7#include <byteswap.h>
8
9struct icmp6hdr {
10
11        __u8            icmp6_type;
12        __u8            icmp6_code;
13        __u16           icmp6_cksum;
14
15
16        union {
17                __u32                   un_data32[1];
18                __u16                   un_data16[2];
19                __u8                    un_data8[4];
20
21                struct icmpv6_echo {
22                        __u16           identifier;
23                        __u16           sequence;
24                } u_echo;
25
26                struct icmpv6_nd_advt {
27#if defined(__LITTLE_ENDIAN)
28                        __u32           reserved:5,
29                                        override:1,
30                                        solicited:1,
31                                        router:1,
32                                        reserved2:24;
33#elif defined(__BIG_ENDIAN)
34                        __u32           router:1,
35                                        solicited:1,
36                                        override:1,
37                                        reserved:29;
38#else
39#error  "Endian problem - this didn't happen"
40#endif                                         
41                } u_nd_advt;
42
43                struct icmpv6_nd_ra {
44                        __u8            hop_limit;
45#if defined(__LITTLE_ENDIAN)
46                        __u8            reserved:6,
47                                        other:1,
48                                        managed:1;
49
50#elif defined(__BIG_ENDIAN)
51                        __u8            managed:1,
52                                        other:1,
53                                        reserved:6;
54#else
55#error  "Endian problem - this didn't happen"
56#endif
57                        __u16           rt_lifetime;
58                } u_nd_ra;
59
60        } icmp6_dataun;
61
62#define icmp6_identifier        icmp6_dataun.u_echo.identifier
63#define icmp6_sequence          icmp6_dataun.u_echo.sequence
64#define icmp6_pointer           icmp6_dataun.un_data32[0]
65#define icmp6_mtu               icmp6_dataun.un_data32[0]
66#define icmp6_unused            icmp6_dataun.un_data32[0]
67#define icmp6_maxdelay          icmp6_dataun.un_data16[0]
68#define icmp6_router            icmp6_dataun.u_nd_advt.router
69#define icmp6_solicited         icmp6_dataun.u_nd_advt.solicited
70#define icmp6_override          icmp6_dataun.u_nd_advt.override
71#define icmp6_ndiscreserved     icmp6_dataun.u_nd_advt.reserved
72#define icmp6_hop_limit         icmp6_dataun.u_nd_ra.hop_limit
73#define icmp6_addrconf_managed  icmp6_dataun.u_nd_ra.managed
74#define icmp6_addrconf_other    icmp6_dataun.u_nd_ra.other
75#define icmp6_rt_lifetime       icmp6_dataun.u_nd_ra.rt_lifetime
76};
77
78
79#define ICMPV6_DEST_UNREACH             1
80#define ICMPV6_PKT_TOOBIG               2
81#define ICMPV6_TIME_EXCEED              3
82#define ICMPV6_PARAMPROB                4
83
84#define ICMPV6_INFOMSG_MASK             0x80
85
86#define ICMPV6_ECHO_REQUEST             128
87#define ICMPV6_ECHO_REPLY               129
88#define ICMPV6_MGM_QUERY                130
89#define ICMPV6_MGM_REPORT               131
90#define ICMPV6_MGM_REDUCTION            132
91
92#define ICMPV6_NI_QUERY                 139
93#define ICMPV6_NI_REPLY                 140
94
95#define ICMPV6_MLD2_REPORT              143
96
97#define ICMPV6_DHAAD_REQUEST            144
98#define ICMPV6_DHAAD_REPLY              145
99#define ICMPV6_MOBILE_PREFIX_SOL        146
100#define ICMPV6_MOBILE_PREFIX_ADV        147
101
102/*
103 *      Codes for Destination Unreachable
104 */
105#define ICMPV6_NOROUTE                  0
106#define ICMPV6_ADM_PROHIBITED           1
107#define ICMPV6_NOT_NEIGHBOUR            2
108#define ICMPV6_ADDR_UNREACH             3
109#define ICMPV6_PORT_UNREACH             4
110
111/*
112 *      Codes for Time Exceeded
113 */
114#define ICMPV6_EXC_HOPLIMIT             0
115#define ICMPV6_EXC_FRAGTIME             1
116
117/*
118 *      Codes for Parameter Problem
119 */
120#define ICMPV6_HDR_FIELD                0
121#define ICMPV6_UNK_NEXTHDR              1
122#define ICMPV6_UNK_OPTION               2
123
124/*
125 *      constants for (set|get)sockopt
126 */
127
128#define ICMPV6_FILTER                   1
129
130/*
131 *      ICMPV6 filter
132 */
133
134#define ICMPV6_FILTER_BLOCK             1
135#define ICMPV6_FILTER_PASS              2
136#define ICMPV6_FILTER_BLOCKOTHERS       3
137#define ICMPV6_FILTER_PASSONLY          4
138
139struct icmp6_filter {
140        __u32           data[8];
141};
142
143/*
144 *      Definitions for MLDv2
145 */
146#define MLD2_MODE_IS_INCLUDE    1
147#define MLD2_MODE_IS_EXCLUDE    2
148#define MLD2_CHANGE_TO_INCLUDE  3
149#define MLD2_CHANGE_TO_EXCLUDE  4
150#define MLD2_ALLOW_NEW_SOURCES  5
151#define MLD2_BLOCK_OLD_SOURCES  6
152
153#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
154
155#endif
Note: See TracBrowser for help on using the repository browser.