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