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> 22 #include <asm/byteorder.h> 23 #include <linux/if.h> 24 #include <linux/in6.h> 25 #define ICMP_ECHOREPLY 0 26 #define ICMP_DEST_UNREACH 3 27 #define ICMP_SOURCE_QUENCH 4 28 #define ICMP_REDIRECT 5 29 #define ICMP_ECHO 8 30 #define ICMP_TIME_EXCEEDED 11 31 #define ICMP_PARAMETERPROB 12 32 #define ICMP_TIMESTAMP 13 33 #define ICMP_TIMESTAMPREPLY 14 34 #define ICMP_INFO_REQUEST 15 35 #define ICMP_INFO_REPLY 16 36 #define ICMP_ADDRESS 17 37 #define ICMP_ADDRESSREPLY 18 38 #define NR_ICMP_TYPES 18 39 #define ICMP_NET_UNREACH 0 40 #define ICMP_HOST_UNREACH 1 41 #define ICMP_PROT_UNREACH 2 42 #define ICMP_PORT_UNREACH 3 43 #define ICMP_FRAG_NEEDED 4 44 #define ICMP_SR_FAILED 5 45 #define ICMP_NET_UNKNOWN 6 46 #define ICMP_HOST_UNKNOWN 7 47 #define ICMP_HOST_ISOLATED 8 48 #define ICMP_NET_ANO 9 49 #define ICMP_HOST_ANO 10 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 54 #define ICMP_PREC_CUTOFF 15 55 #define NR_ICMP_UNREACH 15 56 #define ICMP_REDIR_NET 0 57 #define ICMP_REDIR_HOST 1 58 #define ICMP_REDIR_NETTOS 2 59 #define ICMP_REDIR_HOSTTOS 3 60 #define ICMP_EXC_TTL 0 61 #define ICMP_EXC_FRAGTIME 1 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 76 struct icmphdr { 77 __u8 type; 78 __u8 code; 79 __sum16 checksum; 80 union { 81 struct { 82 __be16 id; 83 __be16 sequence; 84 } echo; 85 __be32 gateway; 86 struct { 87 __be16 __linux_unused; 88 __be16 mtu; 89 } frag; 90 __u8 reserved[4]; 91 } un; 92 }; 93 #define ICMP_FILTER 1 94 struct icmp_filter { 95 __u32 data; 96 }; 97 struct icmp_ext_hdr { 98 #ifdef __LITTLE_ENDIAN_BITFIELD 99 __u8 reserved1 : 4, version : 4; 100 #elif defined(__BIG_ENDIAN_BITFIELD) 101 __u8 version : 4, reserved1 : 4; 102 #else 103 #error "Please fix <asm/byteorder.h>" 104 #endif 105 __u8 reserved2; 106 __sum16 checksum; 107 }; 108 struct icmp_extobj_hdr { 109 __be16 length; 110 __u8 class_num; 111 __u8 class_type; 112 }; 113 struct icmp_ext_echo_ctype3_hdr { 114 __be16 afi; 115 __u8 addrlen; 116 __u8 reserved; 117 }; 118 struct icmp_ext_echo_iio { 119 struct icmp_extobj_hdr extobj_hdr; 120 union { 121 char name[IFNAMSIZ]; 122 __be32 ifindex; 123 struct { 124 struct icmp_ext_echo_ctype3_hdr ctype3_hdr; 125 union { 126 __be32 ipv4_addr; 127 struct in6_addr ipv6_addr; 128 } ip_addr; 129 } addr; 130 } ident; 131 }; 132 #endif 133