xref: /aosp_15_r20/prebuilts/build-tools/sysroots/x86_64-unknown-linux-musl/include/linux/icmp.h (revision cda5da8d549138a6648c5ee6d7a49cf8f4a657be)
1 /*
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  */
7 #ifndef _UAPI_LINUX_ICMP_H
8 #define _UAPI_LINUX_ICMP_H
9 #include <linux/types.h>
10 #include <asm/byteorder.h>
11 #include <linux/if.h>
12 #include <linux/in6.h>
13 #define ICMP_ECHOREPLY 0
14 #define ICMP_DEST_UNREACH 3
15 #define ICMP_SOURCE_QUENCH 4
16 #define ICMP_REDIRECT 5
17 #define ICMP_ECHO 8
18 #define ICMP_TIME_EXCEEDED 11
19 #define ICMP_PARAMETERPROB 12
20 #define ICMP_TIMESTAMP 13
21 #define ICMP_TIMESTAMPREPLY 14
22 #define ICMP_INFO_REQUEST 15
23 #define ICMP_INFO_REPLY 16
24 #define ICMP_ADDRESS 17
25 #define ICMP_ADDRESSREPLY 18
26 #define NR_ICMP_TYPES 18
27 #define ICMP_NET_UNREACH 0
28 #define ICMP_HOST_UNREACH 1
29 #define ICMP_PROT_UNREACH 2
30 #define ICMP_PORT_UNREACH 3
31 #define ICMP_FRAG_NEEDED 4
32 #define ICMP_SR_FAILED 5
33 #define ICMP_NET_UNKNOWN 6
34 #define ICMP_HOST_UNKNOWN 7
35 #define ICMP_HOST_ISOLATED 8
36 #define ICMP_NET_ANO 9
37 #define ICMP_HOST_ANO 10
38 #define ICMP_NET_UNR_TOS 11
39 #define ICMP_HOST_UNR_TOS 12
40 #define ICMP_PKT_FILTERED 13
41 #define ICMP_PREC_VIOLATION 14
42 #define ICMP_PREC_CUTOFF 15
43 #define NR_ICMP_UNREACH 15
44 #define ICMP_REDIR_NET 0
45 #define ICMP_REDIR_HOST 1
46 #define ICMP_REDIR_NETTOS 2
47 #define ICMP_REDIR_HOSTTOS 3
48 #define ICMP_EXC_TTL 0
49 #define ICMP_EXC_FRAGTIME 1
50 #define ICMP_EXT_ECHO 42
51 #define ICMP_EXT_ECHOREPLY 43
52 #define ICMP_EXT_CODE_MAL_QUERY 1
53 #define ICMP_EXT_CODE_NO_IF 2
54 #define ICMP_EXT_CODE_NO_TABLE_ENT 3
55 #define ICMP_EXT_CODE_MULT_IFS 4
56 #define ICMP_EXT_ECHOREPLY_ACTIVE (1 << 2)
57 #define ICMP_EXT_ECHOREPLY_IPV4 (1 << 1)
58 #define ICMP_EXT_ECHOREPLY_IPV6 1
59 #define ICMP_EXT_ECHO_CTYPE_NAME 1
60 #define ICMP_EXT_ECHO_CTYPE_INDEX 2
61 #define ICMP_EXT_ECHO_CTYPE_ADDR 3
62 #define ICMP_AFI_IP 1
63 #define ICMP_AFI_IP6 2
64 struct icmphdr {
65   __u8 type;
66   __u8 code;
67   __sum16 checksum;
68   union {
69     struct {
70       __be16 id;
71       __be16 sequence;
72     } echo;
73     __be32 gateway;
74     struct {
75 #ifdef __BIONIC__
76       __be16 __linux_unused;
77 #else
78       __be16 __linux_unused;
79 #endif
80       __be16 mtu;
81     } frag;
82     __u8 reserved[4];
83   } un;
84 };
85 #define ICMP_FILTER 1
86 struct icmp_filter {
87   __u32 data;
88 };
89 struct icmp_ext_hdr {
90 #ifdef __LITTLE_ENDIAN_BITFIELD
91   __u8 reserved1 : 4, version : 4;
92 #elif defined(__BIG_ENDIAN_BITFIELD)
93   __u8 version : 4, reserved1 : 4;
94 #else
95 #error "Please fix <asm/byteorder.h>"
96 #endif
97   __u8 reserved2;
98   __sum16 checksum;
99 };
100 struct icmp_extobj_hdr {
101   __be16 length;
102   __u8 class_num;
103   __u8 class_type;
104 };
105 struct icmp_ext_echo_ctype3_hdr {
106   __be16 afi;
107   __u8 addrlen;
108   __u8 reserved;
109 };
110 struct icmp_ext_echo_iio {
111   struct icmp_extobj_hdr extobj_hdr;
112   union {
113     char name[IFNAMSIZ];
114     __be32 ifindex;
115     struct {
116       struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
117       union {
118         __be32 ipv4_addr;
119         struct in6_addr ipv6_addr;
120       } ip_addr;
121     } addr;
122   } ident;
123 };
124 #endif
125