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> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define ICMP_ECHOREPLY 0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define ICMP_DEST_UNREACH 3 |
| 25 | #define ICMP_SOURCE_QUENCH 4 |
| 26 | #define ICMP_REDIRECT 5 |
| 27 | #define ICMP_ECHO 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define ICMP_TIME_EXCEEDED 11 |
| 29 | #define ICMP_PARAMETERPROB 12 |
| 30 | #define ICMP_TIMESTAMP 13 |
| 31 | #define ICMP_TIMESTAMPREPLY 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define ICMP_INFO_REQUEST 15 |
| 33 | #define ICMP_INFO_REPLY 16 |
| 34 | #define ICMP_ADDRESS 17 |
| 35 | #define ICMP_ADDRESSREPLY 18 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define NR_ICMP_TYPES 18 |
| 37 | #define ICMP_NET_UNREACH 0 |
| 38 | #define ICMP_HOST_UNREACH 1 |
| 39 | #define ICMP_PROT_UNREACH 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #define ICMP_PORT_UNREACH 3 |
| 41 | #define ICMP_FRAG_NEEDED 4 |
| 42 | #define ICMP_SR_FAILED 5 |
| 43 | #define ICMP_NET_UNKNOWN 6 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #define ICMP_HOST_UNKNOWN 7 |
| 45 | #define ICMP_HOST_ISOLATED 8 |
| 46 | #define ICMP_NET_ANO 9 |
| 47 | #define ICMP_HOST_ANO 10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define ICMP_NET_UNR_TOS 11 |
| 49 | #define ICMP_HOST_UNR_TOS 12 |
| 50 | #define ICMP_PKT_FILTERED 13 |
| 51 | #define ICMP_PREC_VIOLATION 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | #define ICMP_PREC_CUTOFF 15 |
| 53 | #define NR_ICMP_UNREACH 15 |
| 54 | #define ICMP_REDIR_NET 0 |
| 55 | #define ICMP_REDIR_HOST 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | #define ICMP_REDIR_NETTOS 2 |
| 57 | #define ICMP_REDIR_HOSTTOS 3 |
| 58 | #define ICMP_EXC_TTL 0 |
| 59 | #define ICMP_EXC_FRAGTIME 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | struct icmphdr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 61 | __u8 type; |
| 62 | __u8 code; |
| 63 | __sum16 checksum; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | union { |
| 65 | struct { |
| 66 | __be16 id; |
| 67 | __be16 sequence; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | } echo; |
| 69 | __be32 gateway; |
| 70 | struct { |
| 71 | __be16 __linux_unused; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | __be16 mtu; |
| 73 | } frag; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 74 | __u8 reserved[4]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | } un; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 76 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | #define ICMP_FILTER 1 |
| 78 | struct icmp_filter { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | __u32 data; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 80 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 81 | struct icmp_ext_hdr { |
| 82 | #ifdef __LITTLE_ENDIAN_BITFIELD |
| 83 | __u8 reserved1 : 4, version : 4; |
| 84 | #elif defined(__BIG_ENDIAN_BITFIELD) |
| 85 | __u8 version : 4, reserved1 : 4; |
| 86 | #else |
| 87 | #error "Please fix <asm/byteorder.h>" |
| 88 | #endif |
| 89 | __u8 reserved2; |
| 90 | __sum16 checksum; |
| 91 | }; |
| 92 | struct icmp_extobj_hdr { |
| 93 | __be16 length; |
| 94 | __u8 class_num; |
| 95 | __u8 class_type; |
| 96 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #endif |