• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifdef __BIONIC__
88       __be16 __linux_unused;
89 #else
90       __be16 __linux_unused;
91 #endif
92       __be16 mtu;
93     } frag;
94     __u8 reserved[4];
95   } un;
96 };
97 #define ICMP_FILTER 1
98 struct icmp_filter {
99   __u32 data;
100 };
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 };
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 {
130         __be32 ipv4_addr;
131         struct in6_addr ipv6_addr;
132       } ip_addr;
133     } addr;
134   } ident;
135 };
136 #endif
137