blob: f8bf99731445e5afda8cc84510c135b40cf6505a [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_TCP_H
20#define _UAPI_LINUX_TCP_H
21#include <linux/types.h>
22#include <asm/byteorder.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <linux/socket.h>
25struct tcphdr {
Tao Baod7db5942015-01-28 10:07:51 -080026 __be16 source;
27 __be16 dest;
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 __be32 seq;
30 __be32 ack_seq;
Ben Cheng655a7c02013-10-16 16:09:24 -070031#ifdef __LITTLE_ENDIAN_BITFIELD
Tao Baod7db5942015-01-28 10:07:51 -080032 __u16 res1 : 4, doff : 4, fin : 1, syn : 1, rst : 1, psh : 1, ack : 1, urg : 1, ece : 1, cwr : 1;
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070034#elif defined(__BIG_ENDIAN_BITFIELD)
Tao Baod7db5942015-01-28 10:07:51 -080035 __u16 doff : 4, res1 : 4, cwr : 1, ece : 1, urg : 1, ack : 1, psh : 1, rst : 1, syn : 1, fin : 1;
Ben Cheng655a7c02013-10-16 16:09:24 -070036#else
37#error "Adjust your <asm/byteorder.h> defines"
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039#endif
40 __be16 window;
41 __sum16 check;
42 __be16 urg_ptr;
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
45union tcp_word_hdr {
Tao Baod7db5942015-01-28 10:07:51 -080046 struct tcphdr hdr;
47 __be32 words[5];
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070049};
Tao Baod7db5942015-01-28 10:07:51 -080050#define tcp_flag_word(tp) (((union tcp_word_hdr *) (tp))->words[3])
Ben Cheng655a7c02013-10-16 16:09:24 -070051enum {
Tao Baod7db5942015-01-28 10:07:51 -080052 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
55 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
56 TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
57 TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
60 TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
61 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
62 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
Ben Cheng655a7c02013-10-16 16:09:24 -070065};
Ben Cheng655a7c02013-10-16 16:09:24 -070066#define TCP_MSS_DEFAULT 536U
67#define TCP_MSS_DESIRED 1220U
Tao Baod7db5942015-01-28 10:07:51 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define TCP_NODELAY 1
70#define TCP_MAXSEG 2
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define TCP_CORK 3
72#define TCP_KEEPIDLE 4
Tao Baod7db5942015-01-28 10:07:51 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070074#define TCP_KEEPINTVL 5
75#define TCP_KEEPCNT 6
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define TCP_SYNCNT 7
77#define TCP_LINGER2 8
Tao Baod7db5942015-01-28 10:07:51 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define TCP_DEFER_ACCEPT 9
80#define TCP_WINDOW_CLAMP 10
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define TCP_INFO 11
82#define TCP_QUICKACK 12
Tao Baod7db5942015-01-28 10:07:51 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define TCP_CONGESTION 13
85#define TCP_MD5SIG 14
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define TCP_THIN_LINEAR_TIMEOUTS 16
87#define TCP_THIN_DUPACK 17
Tao Baod7db5942015-01-28 10:07:51 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define TCP_USER_TIMEOUT 18
90#define TCP_REPAIR 19
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define TCP_REPAIR_QUEUE 20
92#define TCP_QUEUE_SEQ 21
Tao Baod7db5942015-01-28 10:07:51 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define TCP_REPAIR_OPTIONS 22
95#define TCP_FASTOPEN 23
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define TCP_TIMESTAMP 24
Christopher Ferris38062f92014-07-09 15:33:25 -070097#define TCP_NOTSENT_LOWAT 25
Tao Baod7db5942015-01-28 10:07:51 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080099#define TCP_CC_INFO 26
100#define TCP_SAVE_SYN 27
101#define TCP_SAVED_SYN 28
Christopher Ferris49f525c2016-12-12 14:55:36 -0800102#define TCP_REPAIR_WINDOW 29
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris49f525c2016-12-12 14:55:36 -0800104struct tcp_repair_opt {
Tao Baod7db5942015-01-28 10:07:51 -0800105 __u32 opt_code;
106 __u32 opt_val;
Ben Cheng655a7c02013-10-16 16:09:24 -0700107};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109struct tcp_repair_window {
110 __u32 snd_wl1;
111 __u32 snd_wnd;
112 __u32 max_window;
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 __u32 rcv_wnd;
115 __u32 rcv_wup;
116};
Ben Cheng655a7c02013-10-16 16:09:24 -0700117enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 TCP_NO_QUEUE,
120 TCP_RECV_QUEUE,
121 TCP_SEND_QUEUE,
Tao Baod7db5942015-01-28 10:07:51 -0800122 TCP_QUEUES_NR,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700124};
Christopher Ferris38062f92014-07-09 15:33:25 -0700125#define TCPI_OPT_TIMESTAMPS 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700126#define TCPI_OPT_SACK 2
127#define TCPI_OPT_WSCALE 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define TCPI_OPT_ECN 8
Christopher Ferris38062f92014-07-09 15:33:25 -0700130#define TCPI_OPT_ECN_SEEN 16
Ben Cheng655a7c02013-10-16 16:09:24 -0700131#define TCPI_OPT_SYN_DATA 32
132enum tcp_ca_state {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 TCP_CA_Open = 0,
135#define TCPF_CA_Open (1 << TCP_CA_Open)
136 TCP_CA_Disorder = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800137#define TCPF_CA_Disorder (1 << TCP_CA_Disorder)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 TCP_CA_CWR = 2,
140#define TCPF_CA_CWR (1 << TCP_CA_CWR)
141 TCP_CA_Recovery = 3,
Tao Baod7db5942015-01-28 10:07:51 -0800142#define TCPF_CA_Recovery (1 << TCP_CA_Recovery)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800144 TCP_CA_Loss = 4
145#define TCPF_CA_Loss (1 << TCP_CA_Loss)
Ben Cheng655a7c02013-10-16 16:09:24 -0700146};
147struct tcp_info {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 __u8 tcpi_state;
150 __u8 tcpi_ca_state;
151 __u8 tcpi_retransmits;
Tao Baod7db5942015-01-28 10:07:51 -0800152 __u8 tcpi_probes;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u8 tcpi_backoff;
155 __u8 tcpi_options;
156 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u32 tcpi_rto;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800159 __u32 tcpi_ato;
160 __u32 tcpi_snd_mss;
161 __u32 tcpi_rcv_mss;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u32 tcpi_unacked;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 __u32 tcpi_sacked;
165 __u32 tcpi_lost;
166 __u32 tcpi_retrans;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u32 tcpi_fackets;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u32 tcpi_last_data_sent;
170 __u32 tcpi_last_ack_sent;
171 __u32 tcpi_last_data_recv;
Tao Baod7db5942015-01-28 10:07:51 -0800172 __u32 tcpi_last_ack_recv;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u32 tcpi_pmtu;
175 __u32 tcpi_rcv_ssthresh;
176 __u32 tcpi_rtt;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 tcpi_rttvar;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u32 tcpi_snd_ssthresh;
180 __u32 tcpi_snd_cwnd;
181 __u32 tcpi_advmss;
Tao Baod7db5942015-01-28 10:07:51 -0800182 __u32 tcpi_reordering;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u32 tcpi_rcv_rtt;
185 __u32 tcpi_rcv_space;
186 __u32 tcpi_total_retrans;
Tao Baod7db5942015-01-28 10:07:51 -0800187 __u64 tcpi_pacing_rate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u64 tcpi_max_pacing_rate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800190 __u64 tcpi_bytes_acked;
191 __u64 tcpi_bytes_received;
192 __u32 tcpi_segs_out;
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 __u32 tcpi_segs_in;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700195 __u32 tcpi_notsent_bytes;
196 __u32 tcpi_min_rtt;
197 __u32 tcpi_data_segs_in;
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 __u32 tcpi_data_segs_out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201#define TCP_MD5SIG_MAXKEYLEN 80
Christopher Ferris38062f92014-07-09 15:33:25 -0700202struct tcp_md5sig {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800204 struct __kernel_sockaddr_storage tcpm_addr;
205 __u16 __tcpm_pad1;
206 __u16 tcpm_keylen;
Tao Baod7db5942015-01-28 10:07:51 -0800207 __u32 __tcpm_pad2;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN];
Ben Cheng655a7c02013-10-16 16:09:24 -0700210};
211#endif