blob: d8c089cfc4477ab5e72d26e7a75bd95b3b1d88fd [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Ferris25c18d42020-10-14 17:42:58 -070022#include <asm/byteorder.h>
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000023#include <linux/in.h>
24#include <linux/if.h>
25#include <linux/in6.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070026#define ICMP_ECHOREPLY 0
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define ICMP_DEST_UNREACH 3
28#define ICMP_SOURCE_QUENCH 4
29#define ICMP_REDIRECT 5
30#define ICMP_ECHO 8
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define ICMP_TIME_EXCEEDED 11
32#define ICMP_PARAMETERPROB 12
33#define ICMP_TIMESTAMP 13
34#define ICMP_TIMESTAMPREPLY 14
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define ICMP_INFO_REQUEST 15
36#define ICMP_INFO_REPLY 16
37#define ICMP_ADDRESS 17
38#define ICMP_ADDRESSREPLY 18
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define NR_ICMP_TYPES 18
40#define ICMP_NET_UNREACH 0
41#define ICMP_HOST_UNREACH 1
42#define ICMP_PROT_UNREACH 2
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define ICMP_PORT_UNREACH 3
44#define ICMP_FRAG_NEEDED 4
45#define ICMP_SR_FAILED 5
46#define ICMP_NET_UNKNOWN 6
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define ICMP_HOST_UNKNOWN 7
48#define ICMP_HOST_ISOLATED 8
49#define ICMP_NET_ANO 9
50#define ICMP_HOST_ANO 10
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define ICMP_NET_UNR_TOS 11
52#define ICMP_HOST_UNR_TOS 12
53#define ICMP_PKT_FILTERED 13
54#define ICMP_PREC_VIOLATION 14
Ben Cheng655a7c02013-10-16 16:09:24 -070055#define ICMP_PREC_CUTOFF 15
56#define NR_ICMP_UNREACH 15
57#define ICMP_REDIR_NET 0
58#define ICMP_REDIR_HOST 1
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define ICMP_REDIR_NETTOS 2
60#define ICMP_REDIR_HOSTTOS 3
61#define ICMP_EXC_TTL 0
62#define ICMP_EXC_FRAGTIME 1
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +000063#define ICMP_EXT_ECHO 42
64#define ICMP_EXT_ECHOREPLY 43
65#define ICMP_EXT_CODE_MAL_QUERY 1
66#define ICMP_EXT_CODE_NO_IF 2
67#define ICMP_EXT_CODE_NO_TABLE_ENT 3
68#define ICMP_EXT_CODE_MULT_IFS 4
69#define ICMP_EXT_ECHOREPLY_ACTIVE (1 << 2)
70#define ICMP_EXT_ECHOREPLY_IPV4 (1 << 1)
71#define ICMP_EXT_ECHOREPLY_IPV6 1
72#define ICMP_EXT_ECHO_CTYPE_NAME 1
73#define ICMP_EXT_ECHO_CTYPE_INDEX 2
74#define ICMP_EXT_ECHO_CTYPE_ADDR 3
75#define ICMP_AFI_IP 1
76#define ICMP_AFI_IP6 2
Ben Cheng655a7c02013-10-16 16:09:24 -070077struct icmphdr {
Tao Baod7db5942015-01-28 10:07:51 -080078 __u8 type;
79 __u8 code;
80 __sum16 checksum;
Tao Baod7db5942015-01-28 10:07:51 -080081 union {
82 struct {
83 __be16 id;
84 __be16 sequence;
Tao Baod7db5942015-01-28 10:07:51 -080085 } echo;
86 __be32 gateway;
87 struct {
88 __be16 __linux_unused;
Tao Baod7db5942015-01-28 10:07:51 -080089 __be16 mtu;
90 } frag;
Christopher Ferris49f525c2016-12-12 14:55:36 -080091 __u8 reserved[4];
Tao Baod7db5942015-01-28 10:07:51 -080092 } un;
Christopher Ferris49f525c2016-12-12 14:55:36 -080093};
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define ICMP_FILTER 1
95struct icmp_filter {
Tao Baod7db5942015-01-28 10:07:51 -080096 __u32 data;
Christopher Ferris49f525c2016-12-12 14:55:36 -080097};
Christopher Ferris25c18d42020-10-14 17:42:58 -070098struct icmp_ext_hdr {
99#ifdef __LITTLE_ENDIAN_BITFIELD
100 __u8 reserved1 : 4, version : 4;
101#elif defined(__BIG_ENDIAN_BITFIELD)
102 __u8 version : 4, reserved1 : 4;
103#else
104#error "Please fix <asm/byteorder.h>"
105#endif
106 __u8 reserved2;
107 __sum16 checksum;
108};
109struct icmp_extobj_hdr {
110 __be16 length;
111 __u8 class_num;
112 __u8 class_type;
113};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000114struct icmp_ext_echo_ctype3_hdr {
115 __be16 afi;
116 __u8 addrlen;
117 __u8 reserved;
118};
119struct icmp_ext_echo_iio {
120 struct icmp_extobj_hdr extobj_hdr;
121 union {
122 char name[IFNAMSIZ];
123 __be32 ifindex;
124 struct {
125 struct icmp_ext_echo_ctype3_hdr ctype3_hdr;
126 union {
127 struct in_addr ipv4_addr;
128 struct in6_addr ipv6_addr;
129 } ip_addr;
130 } addr;
131 } ident;
132};
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#endif