blob: d7e37af99ccb39b062acd19ff4ecfa19319f09de [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_ICMP_H
8#define _UAPI_LINUX_ICMP_H
9#include <linux/types.h>
Christopher Ferris25c18d42020-10-14 17:42:58 -070010#include <asm/byteorder.h>
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000011#include <linux/if.h>
12#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070013#define ICMP_ECHOREPLY 0
Ben Cheng655a7c02013-10-16 16:09:24 -070014#define ICMP_DEST_UNREACH 3
15#define ICMP_SOURCE_QUENCH 4
16#define ICMP_REDIRECT 5
17#define ICMP_ECHO 8
Ben Cheng655a7c02013-10-16 16:09:24 -070018#define ICMP_TIME_EXCEEDED 11
19#define ICMP_PARAMETERPROB 12
20#define ICMP_TIMESTAMP 13
21#define ICMP_TIMESTAMPREPLY 14
Ben Cheng655a7c02013-10-16 16:09:24 -070022#define ICMP_INFO_REQUEST 15
23#define ICMP_INFO_REPLY 16
24#define ICMP_ADDRESS 17
25#define ICMP_ADDRESSREPLY 18
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define NR_ICMP_TYPES 18
27#define ICMP_NET_UNREACH 0
28#define ICMP_HOST_UNREACH 1
29#define ICMP_PROT_UNREACH 2
Ben Cheng655a7c02013-10-16 16:09:24 -070030#define ICMP_PORT_UNREACH 3
31#define ICMP_FRAG_NEEDED 4
32#define ICMP_SR_FAILED 5
33#define ICMP_NET_UNKNOWN 6
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define ICMP_HOST_UNKNOWN 7
35#define ICMP_HOST_ISOLATED 8
36#define ICMP_NET_ANO 9
37#define ICMP_HOST_ANO 10
Ben Cheng655a7c02013-10-16 16:09:24 -070038#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
Ben Cheng655a7c02013-10-16 16:09:24 -070042#define ICMP_PREC_CUTOFF 15
43#define NR_ICMP_UNREACH 15
44#define ICMP_REDIR_NET 0
45#define ICMP_REDIR_HOST 1
Ben Cheng655a7c02013-10-16 16:09:24 -070046#define ICMP_REDIR_NETTOS 2
47#define ICMP_REDIR_HOSTTOS 3
48#define ICMP_EXC_TTL 0
49#define ICMP_EXC_FRAGTIME 1
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000050#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
Ben Cheng655a7c02013-10-16 16:09:24 -070064struct icmphdr {
Tao Baod7db5942015-01-28 10:07:51 -080065 __u8 type;
66 __u8 code;
67 __sum16 checksum;
Tao Baod7db5942015-01-28 10:07:51 -080068 union {
69 struct {
70 __be16 id;
71 __be16 sequence;
Tao Baod7db5942015-01-28 10:07:51 -080072 } echo;
73 __be32 gateway;
74 struct {
Christopher Ferris80ae69d2022-08-02 16:32:21 -070075#ifdef __BIONIC__
Tao Baod7db5942015-01-28 10:07:51 -080076 __be16 __linux_unused;
Christopher Ferris80ae69d2022-08-02 16:32:21 -070077#else
78 __be16 __linux_unused;
79#endif
Tao Baod7db5942015-01-28 10:07:51 -080080 __be16 mtu;
81 } frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -080082 __u8 reserved[4];
Tao Baod7db5942015-01-28 10:07:51 -080083 } un;
Christopher Ferris49f525c2016-12-12 14:55:36 -080084};
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define ICMP_FILTER 1
86struct icmp_filter {
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 data;
Christopher Ferris49f525c2016-12-12 14:55:36 -080088};
Christopher Ferris25c18d42020-10-14 17:42:58 -070089struct 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};
100struct icmp_extobj_hdr {
101 __be16 length;
102 __u8 class_num;
103 __u8 class_type;
104};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000105struct icmp_ext_echo_ctype3_hdr {
106 __be16 afi;
107 __u8 addrlen;
108 __u8 reserved;
109};
110struct 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 {
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000118 __be32 ipv4_addr;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000119 struct in6_addr ipv6_addr;
120 } ip_addr;
121 } addr;
122 } ident;
123};
Ben Cheng655a7c02013-10-16 16:09:24 -0700124#endif