blob: d1be8cded28f1d3bb2223f2420f1fbba17806923 [file] [log] [blame]
Steinar H. Gunderson06880232011-01-20 00:12:30 +01001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_ICMPV6_H
13#define _LINUX_ICMPV6_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
Steinar H. Gunderson06880232011-01-20 00:12:30 +010015#include <linux/types.h>
16#include <asm/byteorder.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080017
Steinar H. Gunderson06880232011-01-20 00:12:30 +010018struct icmp6hdr {
Ben Cheng4b29af02012-03-07 16:14:53 -080019
Steinar H. Gunderson06880232011-01-20 00:12:30 +010020 __u8 icmp6_type;
21 __u8 icmp6_code;
22 __sum16 icmp6_cksum;
Ben Cheng4b29af02012-03-07 16:14:53 -080023
Steinar H. Gunderson06880232011-01-20 00:12:30 +010024 union {
25 __be32 un_data32[1];
26 __be16 un_data16[2];
27 __u8 un_data8[4];
Ben Cheng4b29af02012-03-07 16:14:53 -080028
Steinar H. Gunderson06880232011-01-20 00:12:30 +010029 struct icmpv6_echo {
30 __be16 identifier;
31 __be16 sequence;
32 } u_echo;
Ben Cheng4b29af02012-03-07 16:14:53 -080033
Steinar H. Gunderson06880232011-01-20 00:12:30 +010034 struct icmpv6_nd_advt {
35#ifdef __LITTLE_ENDIAN_BITFIELD
36 __u32 reserved:5,
37 override:1,
38 solicited:1,
39 router:1,
40 reserved2:24;
41#elif defined(__BIG_ENDIAN_BITFIELD)
42 __u32 router:1,
43 solicited:1,
44 override:1,
45 reserved:29;
46#else
47#error "Please fix <asm/byteorder.h>"
48#endif
49 } u_nd_advt;
Ben Cheng4b29af02012-03-07 16:14:53 -080050
Steinar H. Gunderson06880232011-01-20 00:12:30 +010051 struct icmpv6_nd_ra {
52 __u8 hop_limit;
53#ifdef __LITTLE_ENDIAN_BITFIELD
54 __u8 reserved:3,
55 router_pref:2,
56 home_agent:1,
57 other:1,
58 managed:1;
Ben Cheng4b29af02012-03-07 16:14:53 -080059
Steinar H. Gunderson06880232011-01-20 00:12:30 +010060#elif defined(__BIG_ENDIAN_BITFIELD)
61 __u8 managed:1,
62 other:1,
63 home_agent:1,
64 router_pref:2,
65 reserved:3;
66#else
67#error "Please fix <asm/byteorder.h>"
68#endif
69 __be16 rt_lifetime;
70 } u_nd_ra;
Ben Cheng4b29af02012-03-07 16:14:53 -080071
Steinar H. Gunderson06880232011-01-20 00:12:30 +010072 } icmp6_dataun;
Ben Cheng4b29af02012-03-07 16:14:53 -080073
Steinar H. Gunderson06880232011-01-20 00:12:30 +010074#define icmp6_identifier icmp6_dataun.u_echo.identifier
75#define icmp6_sequence icmp6_dataun.u_echo.sequence
76#define icmp6_pointer icmp6_dataun.un_data32[0]
77#define icmp6_mtu icmp6_dataun.un_data32[0]
78#define icmp6_unused icmp6_dataun.un_data32[0]
79#define icmp6_maxdelay icmp6_dataun.un_data16[0]
80#define icmp6_router icmp6_dataun.u_nd_advt.router
81#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
82#define icmp6_override icmp6_dataun.u_nd_advt.override
83#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
84#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
85#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
86#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
87#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
88#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
89};
Ben Cheng4b29af02012-03-07 16:14:53 -080090
Steinar H. Gunderson06880232011-01-20 00:12:30 +010091#define ICMPV6_ROUTER_PREF_LOW 0x3
92#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
93#define ICMPV6_ROUTER_PREF_HIGH 0x1
94#define ICMPV6_ROUTER_PREF_INVALID 0x2
Ben Cheng4b29af02012-03-07 16:14:53 -080095
Steinar H. Gunderson06880232011-01-20 00:12:30 +010096#define ICMPV6_DEST_UNREACH 1
97#define ICMPV6_PKT_TOOBIG 2
98#define ICMPV6_TIME_EXCEED 3
99#define ICMPV6_PARAMPROB 4
Ben Cheng4b29af02012-03-07 16:14:53 -0800100
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100101#define ICMPV6_INFOMSG_MASK 0x80
Ben Cheng4b29af02012-03-07 16:14:53 -0800102
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100103#define ICMPV6_ECHO_REQUEST 128
104#define ICMPV6_ECHO_REPLY 129
105#define ICMPV6_MGM_QUERY 130
106#define ICMPV6_MGM_REPORT 131
107#define ICMPV6_MGM_REDUCTION 132
Ben Cheng4b29af02012-03-07 16:14:53 -0800108
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100109#define ICMPV6_NI_QUERY 139
110#define ICMPV6_NI_REPLY 140
Ben Cheng4b29af02012-03-07 16:14:53 -0800111
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100112#define ICMPV6_MLD2_REPORT 143
Ben Cheng4b29af02012-03-07 16:14:53 -0800113
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100114#define ICMPV6_DHAAD_REQUEST 144
115#define ICMPV6_DHAAD_REPLY 145
116#define ICMPV6_MOBILE_PREFIX_SOL 146
117#define ICMPV6_MOBILE_PREFIX_ADV 147
Ben Cheng4b29af02012-03-07 16:14:53 -0800118
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100119#define ICMPV6_NOROUTE 0
120#define ICMPV6_ADM_PROHIBITED 1
121#define ICMPV6_NOT_NEIGHBOUR 2
122#define ICMPV6_ADDR_UNREACH 3
123#define ICMPV6_PORT_UNREACH 4
Ben Cheng4b29af02012-03-07 16:14:53 -0800124
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100125#define ICMPV6_EXC_HOPLIMIT 0
126#define ICMPV6_EXC_FRAGTIME 1
Ben Cheng4b29af02012-03-07 16:14:53 -0800127
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100128#define ICMPV6_HDR_FIELD 0
129#define ICMPV6_UNK_NEXTHDR 1
130#define ICMPV6_UNK_OPTION 2
Ben Cheng4b29af02012-03-07 16:14:53 -0800131
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100132#define ICMPV6_FILTER 1
Ben Cheng4b29af02012-03-07 16:14:53 -0800133
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100134#define ICMPV6_FILTER_BLOCK 1
135#define ICMPV6_FILTER_PASS 2
136#define ICMPV6_FILTER_BLOCKOTHERS 3
137#define ICMPV6_FILTER_PASSONLY 4
Ben Cheng4b29af02012-03-07 16:14:53 -0800138
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100139struct icmp6_filter {
140 __u32 data[8];
141};
Ben Cheng4b29af02012-03-07 16:14:53 -0800142
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100143#define MLD2_MODE_IS_INCLUDE 1
144#define MLD2_MODE_IS_EXCLUDE 2
145#define MLD2_CHANGE_TO_INCLUDE 3
146#define MLD2_CHANGE_TO_EXCLUDE 4
147#define MLD2_ALLOW_NEW_SOURCES 5
148#define MLD2_BLOCK_OLD_SOURCES 6
Ben Cheng4b29af02012-03-07 16:14:53 -0800149
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100150#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
Ben Cheng4b29af02012-03-07 16:14:53 -0800151
Steinar H. Gunderson06880232011-01-20 00:12:30 +0100152#endif