blob: 52856989ba1bf4a32844ad4f49d4368419369a76 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_ICMPV6_H
20#define _UAPI_LINUX_ICMPV6_H
21#include <linux/types.h>
22#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct icmp6hdr {
Tao Baod7db5942015-01-28 10:07:51 -080024 __u8 icmp6_type;
25 __u8 icmp6_code;
26 __sum16 icmp6_cksum;
Tao Baod7db5942015-01-28 10:07:51 -080027 union {
28 __be32 un_data32[1];
29 __be16 un_data16[2];
30 __u8 un_data8[4];
Tao Baod7db5942015-01-28 10:07:51 -080031 struct icmpv6_echo {
32 __be16 identifier;
33 __be16 sequence;
34 } u_echo;
Tao Baod7db5942015-01-28 10:07:51 -080035 struct icmpv6_nd_advt {
Ben Cheng655a7c02013-10-16 16:09:24 -070036#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080037 __u32 reserved : 5, override : 1, solicited : 1, router : 1, reserved2 : 24;
Ben Cheng655a7c02013-10-16 16:09:24 -070038#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 router : 1, solicited : 1, override : 1, reserved : 29;
Ben Cheng655a7c02013-10-16 16:09:24 -070040#else
41#error "Please fix <asm/byteorder.h>"
42#endif
Tao Baod7db5942015-01-28 10:07:51 -080043 } u_nd_advt;
44 struct icmpv6_nd_ra {
45 __u8 hop_limit;
Ben Cheng655a7c02013-10-16 16:09:24 -070046#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080047 __u8 reserved : 3, router_pref : 2, home_agent : 1, other : 1, managed : 1;
Ben Cheng655a7c02013-10-16 16:09:24 -070048#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080049 __u8 managed : 1, other : 1, home_agent : 1, router_pref : 2, reserved : 3;
Ben Cheng655a7c02013-10-16 16:09:24 -070050#else
51#error "Please fix <asm/byteorder.h>"
Ben Cheng655a7c02013-10-16 16:09:24 -070052#endif
Tao Baod7db5942015-01-28 10:07:51 -080053 __be16 rt_lifetime;
54 } u_nd_ra;
Tao Baod7db5942015-01-28 10:07:51 -080055 } icmp6_dataun;
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define icmp6_identifier icmp6_dataun.u_echo.identifier
57#define icmp6_sequence icmp6_dataun.u_echo.sequence
58#define icmp6_pointer icmp6_dataun.un_data32[0]
Tao Baod7db5942015-01-28 10:07:51 -080059#define icmp6_mtu icmp6_dataun.un_data32[0]
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define icmp6_unused icmp6_dataun.un_data32[0]
61#define icmp6_maxdelay icmp6_dataun.un_data16[0]
Christopher Ferris25c18d42020-10-14 17:42:58 -070062#define icmp6_datagram_len icmp6_dataun.un_data8[0]
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define icmp6_router icmp6_dataun.u_nd_advt.router
Tao Baod7db5942015-01-28 10:07:51 -080064#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define icmp6_override icmp6_dataun.u_nd_advt.override
66#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
67#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
Tao Baod7db5942015-01-28 10:07:51 -080068#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
70#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
71#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
Tao Baod7db5942015-01-28 10:07:51 -080072};
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define ICMPV6_ROUTER_PREF_LOW 0x3
74#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
75#define ICMPV6_ROUTER_PREF_HIGH 0x1
Tao Baod7db5942015-01-28 10:07:51 -080076#define ICMPV6_ROUTER_PREF_INVALID 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define ICMPV6_DEST_UNREACH 1
78#define ICMPV6_PKT_TOOBIG 2
79#define ICMPV6_TIME_EXCEED 3
Tao Baod7db5942015-01-28 10:07:51 -080080#define ICMPV6_PARAMPROB 4
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070081#define ICMPV6_ERRMSG_MAX 127
Ben Cheng655a7c02013-10-16 16:09:24 -070082#define ICMPV6_INFOMSG_MASK 0x80
83#define ICMPV6_ECHO_REQUEST 128
84#define ICMPV6_ECHO_REPLY 129
Tao Baod7db5942015-01-28 10:07:51 -080085#define ICMPV6_MGM_QUERY 130
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define ICMPV6_MGM_REPORT 131
87#define ICMPV6_MGM_REDUCTION 132
88#define ICMPV6_NI_QUERY 139
Tao Baod7db5942015-01-28 10:07:51 -080089#define ICMPV6_NI_REPLY 140
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define ICMPV6_MLD2_REPORT 143
91#define ICMPV6_DHAAD_REQUEST 144
92#define ICMPV6_DHAAD_REPLY 145
Tao Baod7db5942015-01-28 10:07:51 -080093#define ICMPV6_MOBILE_PREFIX_SOL 146
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define ICMPV6_MOBILE_PREFIX_ADV 147
Christopher Ferris24f97eb2019-05-20 12:58:13 -070095#define ICMPV6_MRDISC_ADV 151
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070096#define ICMPV6_MSG_MAX 255
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define ICMPV6_NOROUTE 0
98#define ICMPV6_ADM_PROHIBITED 1
Tao Baod7db5942015-01-28 10:07:51 -080099#define ICMPV6_NOT_NEIGHBOUR 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define ICMPV6_ADDR_UNREACH 3
101#define ICMPV6_PORT_UNREACH 4
Christopher Ferris38062f92014-07-09 15:33:25 -0700102#define ICMPV6_POLICY_FAIL 5
Tao Baod7db5942015-01-28 10:07:51 -0800103#define ICMPV6_REJECT_ROUTE 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#define ICMPV6_EXC_HOPLIMIT 0
105#define ICMPV6_EXC_FRAGTIME 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define ICMPV6_HDR_FIELD 0
Tao Baod7db5942015-01-28 10:07:51 -0800107#define ICMPV6_UNK_NEXTHDR 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#define ICMPV6_UNK_OPTION 2
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800109#define ICMPV6_HDR_INCOMP 3
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000110#define ICMPV6_EXT_ECHO_REQUEST 160
111#define ICMPV6_EXT_ECHO_REPLY 161
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#define ICMPV6_FILTER 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define ICMPV6_FILTER_BLOCK 1
Tao Baod7db5942015-01-28 10:07:51 -0800114#define ICMPV6_FILTER_PASS 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define ICMPV6_FILTER_BLOCKOTHERS 3
116#define ICMPV6_FILTER_PASSONLY 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700117struct icmp6_filter {
Tao Baod7db5942015-01-28 10:07:51 -0800118 __u32 data[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700119};
120#define MLD2_MODE_IS_INCLUDE 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define MLD2_MODE_IS_EXCLUDE 2
Tao Baod7db5942015-01-28 10:07:51 -0800122#define MLD2_CHANGE_TO_INCLUDE 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#define MLD2_CHANGE_TO_EXCLUDE 4
124#define MLD2_ALLOW_NEW_SOURCES 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#define MLD2_BLOCK_OLD_SOURCES 6
Tao Baod7db5942015-01-28 10:07:51 -0800126#define MLD2_ALL_MCR_INIT { { { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x16 } } }
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#endif