Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_ICMP_H |
| 8 | #define _UAPI_LINUX_ICMP_H |
| 9 | #include <linux/types.h> |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 10 | #include <asm/byteorder.h> |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 11 | #include <linux/if.h> |
| 12 | #include <linux/in6.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 13 | #define ICMP_ECHOREPLY 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 14 | #define ICMP_DEST_UNREACH 3 |
| 15 | #define ICMP_SOURCE_QUENCH 4 |
| 16 | #define ICMP_REDIRECT 5 |
| 17 | #define ICMP_ECHO 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 18 | #define ICMP_TIME_EXCEEDED 11 |
| 19 | #define ICMP_PARAMETERPROB 12 |
| 20 | #define ICMP_TIMESTAMP 13 |
| 21 | #define ICMP_TIMESTAMPREPLY 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 22 | #define ICMP_INFO_REQUEST 15 |
| 23 | #define ICMP_INFO_REPLY 16 |
| 24 | #define ICMP_ADDRESS 17 |
| 25 | #define ICMP_ADDRESSREPLY 18 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 26 | #define NR_ICMP_TYPES 18 |
| 27 | #define ICMP_NET_UNREACH 0 |
| 28 | #define ICMP_HOST_UNREACH 1 |
| 29 | #define ICMP_PROT_UNREACH 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 30 | #define ICMP_PORT_UNREACH 3 |
| 31 | #define ICMP_FRAG_NEEDED 4 |
| 32 | #define ICMP_SR_FAILED 5 |
| 33 | #define ICMP_NET_UNKNOWN 6 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 34 | #define ICMP_HOST_UNKNOWN 7 |
| 35 | #define ICMP_HOST_ISOLATED 8 |
| 36 | #define ICMP_NET_ANO 9 |
| 37 | #define ICMP_HOST_ANO 10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 42 | #define ICMP_PREC_CUTOFF 15 |
| 43 | #define NR_ICMP_UNREACH 15 |
| 44 | #define ICMP_REDIR_NET 0 |
| 45 | #define ICMP_REDIR_HOST 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 46 | #define ICMP_REDIR_NETTOS 2 |
| 47 | #define ICMP_REDIR_HOSTTOS 3 |
| 48 | #define ICMP_EXC_TTL 0 |
| 49 | #define ICMP_EXC_FRAGTIME 1 |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | struct icmphdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 65 | __u8 type; |
| 66 | __u8 code; |
| 67 | __sum16 checksum; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | union { |
| 69 | struct { |
| 70 | __be16 id; |
| 71 | __be16 sequence; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | } echo; |
| 73 | __be32 gateway; |
| 74 | struct { |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 75 | #ifdef __BIONIC__ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | __be16 __linux_unused; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 77 | #else |
| 78 | __be16 __linux_unused; |
| 79 | #endif |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | __be16 mtu; |
| 81 | } frag; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 82 | __u8 reserved[4]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | } un; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 84 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | #define ICMP_FILTER 1 |
| 86 | struct icmp_filter { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __u32 data; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 88 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 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 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 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 { |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 118 | __be32 ipv4_addr; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 119 | struct in6_addr ipv6_addr; |
| 120 | } ip_addr; |
| 121 | } addr; |
| 122 | } ident; |
| 123 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | #endif |