blob: 9df18ada6cf264239127b542973528b1708c24d8 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _UAPI_LINUX_ICMPV6_H
8#define _UAPI_LINUX_ICMPV6_H
9#include <linux/types.h>
10#include <asm/byteorder.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070011struct icmp6hdr {
Tao Baod7db5942015-01-28 10:07:51 -080012 __u8 icmp6_type;
13 __u8 icmp6_code;
14 __sum16 icmp6_cksum;
Tao Baod7db5942015-01-28 10:07:51 -080015 union {
16 __be32 un_data32[1];
17 __be16 un_data16[2];
18 __u8 un_data8[4];
Tao Baod7db5942015-01-28 10:07:51 -080019 struct icmpv6_echo {
20 __be16 identifier;
21 __be16 sequence;
22 } u_echo;
Tao Baod7db5942015-01-28 10:07:51 -080023 struct icmpv6_nd_advt {
Ben Cheng655a7c02013-10-16 16:09:24 -070024#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080025 __u32 reserved : 5, override : 1, solicited : 1, router : 1, reserved2 : 24;
Ben Cheng655a7c02013-10-16 16:09:24 -070026#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080027 __u32 router : 1, solicited : 1, override : 1, reserved : 29;
Ben Cheng655a7c02013-10-16 16:09:24 -070028#else
29#error "Please fix <asm/byteorder.h>"
30#endif
Tao Baod7db5942015-01-28 10:07:51 -080031 } u_nd_advt;
32 struct icmpv6_nd_ra {
33 __u8 hop_limit;
Ben Cheng655a7c02013-10-16 16:09:24 -070034#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 reserved : 3, router_pref : 2, home_agent : 1, other : 1, managed : 1;
Ben Cheng655a7c02013-10-16 16:09:24 -070036#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080037 __u8 managed : 1, other : 1, home_agent : 1, router_pref : 2, reserved : 3;
Ben Cheng655a7c02013-10-16 16:09:24 -070038#else
39#error "Please fix <asm/byteorder.h>"
Ben Cheng655a7c02013-10-16 16:09:24 -070040#endif
Tao Baod7db5942015-01-28 10:07:51 -080041 __be16 rt_lifetime;
42 } u_nd_ra;
Tao Baod7db5942015-01-28 10:07:51 -080043 } icmp6_dataun;
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define icmp6_identifier icmp6_dataun.u_echo.identifier
45#define icmp6_sequence icmp6_dataun.u_echo.sequence
46#define icmp6_pointer icmp6_dataun.un_data32[0]
Tao Baod7db5942015-01-28 10:07:51 -080047#define icmp6_mtu icmp6_dataun.un_data32[0]
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define icmp6_unused icmp6_dataun.un_data32[0]
49#define icmp6_maxdelay icmp6_dataun.un_data16[0]
Christopher Ferris25c18d42020-10-14 17:42:58 -070050#define icmp6_datagram_len icmp6_dataun.un_data8[0]
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define icmp6_router icmp6_dataun.u_nd_advt.router
Tao Baod7db5942015-01-28 10:07:51 -080052#define icmp6_solicited icmp6_dataun.u_nd_advt.solicited
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define icmp6_override icmp6_dataun.u_nd_advt.override
54#define icmp6_ndiscreserved icmp6_dataun.u_nd_advt.reserved
55#define icmp6_hop_limit icmp6_dataun.u_nd_ra.hop_limit
Tao Baod7db5942015-01-28 10:07:51 -080056#define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
58#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
59#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
Tao Baod7db5942015-01-28 10:07:51 -080060};
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define ICMPV6_ROUTER_PREF_LOW 0x3
62#define ICMPV6_ROUTER_PREF_MEDIUM 0x0
63#define ICMPV6_ROUTER_PREF_HIGH 0x1
Tao Baod7db5942015-01-28 10:07:51 -080064#define ICMPV6_ROUTER_PREF_INVALID 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define ICMPV6_DEST_UNREACH 1
66#define ICMPV6_PKT_TOOBIG 2
67#define ICMPV6_TIME_EXCEED 3
Tao Baod7db5942015-01-28 10:07:51 -080068#define ICMPV6_PARAMPROB 4
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070069#define ICMPV6_ERRMSG_MAX 127
Ben Cheng655a7c02013-10-16 16:09:24 -070070#define ICMPV6_INFOMSG_MASK 0x80
71#define ICMPV6_ECHO_REQUEST 128
72#define ICMPV6_ECHO_REPLY 129
Tao Baod7db5942015-01-28 10:07:51 -080073#define ICMPV6_MGM_QUERY 130
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define ICMPV6_MGM_REPORT 131
75#define ICMPV6_MGM_REDUCTION 132
76#define ICMPV6_NI_QUERY 139
Tao Baod7db5942015-01-28 10:07:51 -080077#define ICMPV6_NI_REPLY 140
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define ICMPV6_MLD2_REPORT 143
79#define ICMPV6_DHAAD_REQUEST 144
80#define ICMPV6_DHAAD_REPLY 145
Tao Baod7db5942015-01-28 10:07:51 -080081#define ICMPV6_MOBILE_PREFIX_SOL 146
Ben Cheng655a7c02013-10-16 16:09:24 -070082#define ICMPV6_MOBILE_PREFIX_ADV 147
Christopher Ferris24f97eb2019-05-20 12:58:13 -070083#define ICMPV6_MRDISC_ADV 151
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070084#define ICMPV6_MSG_MAX 255
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define ICMPV6_NOROUTE 0
86#define ICMPV6_ADM_PROHIBITED 1
Tao Baod7db5942015-01-28 10:07:51 -080087#define ICMPV6_NOT_NEIGHBOUR 2
Ben Cheng655a7c02013-10-16 16:09:24 -070088#define ICMPV6_ADDR_UNREACH 3
89#define ICMPV6_PORT_UNREACH 4
Christopher Ferris38062f92014-07-09 15:33:25 -070090#define ICMPV6_POLICY_FAIL 5
Tao Baod7db5942015-01-28 10:07:51 -080091#define ICMPV6_REJECT_ROUTE 6
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define ICMPV6_EXC_HOPLIMIT 0
93#define ICMPV6_EXC_FRAGTIME 1
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define ICMPV6_HDR_FIELD 0
Tao Baod7db5942015-01-28 10:07:51 -080095#define ICMPV6_UNK_NEXTHDR 1
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define ICMPV6_UNK_OPTION 2
Christopher Ferris32ff3f82020-12-14 13:10:04 -080097#define ICMPV6_HDR_INCOMP 3
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000098#define ICMPV6_EXT_ECHO_REQUEST 160
99#define ICMPV6_EXT_ECHO_REPLY 161
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define ICMPV6_FILTER 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define ICMPV6_FILTER_BLOCK 1
Tao Baod7db5942015-01-28 10:07:51 -0800102#define ICMPV6_FILTER_PASS 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700103#define ICMPV6_FILTER_BLOCKOTHERS 3
104#define ICMPV6_FILTER_PASSONLY 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700105struct icmp6_filter {
Tao Baod7db5942015-01-28 10:07:51 -0800106 __u32 data[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
108#define MLD2_MODE_IS_INCLUDE 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define MLD2_MODE_IS_EXCLUDE 2
Tao Baod7db5942015-01-28 10:07:51 -0800110#define MLD2_CHANGE_TO_INCLUDE 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define MLD2_CHANGE_TO_EXCLUDE 4
112#define MLD2_ALLOW_NEW_SOURCES 5
Ben Cheng655a7c02013-10-16 16:09:24 -0700113#define MLD2_BLOCK_OLD_SOURCES 6
Tao Baod7db5942015-01-28 10:07:51 -0800114#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 -0700115#endif