blob: 72619bce4f9456bbc0ffa9f59877a1acdf4a7055 [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
Ben Cheng655a7c02013-10-16 16:09:24 -0700102struct tcp_repair_opt {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 opt_code;
105 __u32 opt_val;
Ben Cheng655a7c02013-10-16 16:09:24 -0700106};
107enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 TCP_NO_QUEUE,
110 TCP_RECV_QUEUE,
111 TCP_SEND_QUEUE,
Tao Baod7db5942015-01-28 10:07:51 -0800112 TCP_QUEUES_NR,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700114};
Christopher Ferris38062f92014-07-09 15:33:25 -0700115#define TCPI_OPT_TIMESTAMPS 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#define TCPI_OPT_SACK 2
117#define TCPI_OPT_WSCALE 4
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define TCPI_OPT_ECN 8
Christopher Ferris38062f92014-07-09 15:33:25 -0700120#define TCPI_OPT_ECN_SEEN 16
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define TCPI_OPT_SYN_DATA 32
122enum tcp_ca_state {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 TCP_CA_Open = 0,
125#define TCPF_CA_Open (1 << TCP_CA_Open)
126 TCP_CA_Disorder = 1,
Tao Baod7db5942015-01-28 10:07:51 -0800127#define TCPF_CA_Disorder (1 << TCP_CA_Disorder)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 TCP_CA_CWR = 2,
130#define TCPF_CA_CWR (1 << TCP_CA_CWR)
131 TCP_CA_Recovery = 3,
Tao Baod7db5942015-01-28 10:07:51 -0800132#define TCPF_CA_Recovery (1 << TCP_CA_Recovery)
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_Loss = 4
135#define TCPF_CA_Loss (1 << TCP_CA_Loss)
Ben Cheng655a7c02013-10-16 16:09:24 -0700136};
137struct tcp_info {
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 __u8 tcpi_state;
140 __u8 tcpi_ca_state;
141 __u8 tcpi_retransmits;
Tao Baod7db5942015-01-28 10:07:51 -0800142 __u8 tcpi_probes;
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 __u8 tcpi_backoff;
145 __u8 tcpi_options;
146 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u32 tcpi_rto;
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 __u32 tcpi_ato;
150 __u32 tcpi_snd_mss;
151 __u32 tcpi_rcv_mss;
Tao Baod7db5942015-01-28 10:07:51 -0800152 __u32 tcpi_unacked;
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 __u32 tcpi_sacked;
155 __u32 tcpi_lost;
156 __u32 tcpi_retrans;
Tao Baod7db5942015-01-28 10:07:51 -0800157 __u32 tcpi_fackets;
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_last_data_sent;
160 __u32 tcpi_last_ack_sent;
161 __u32 tcpi_last_data_recv;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u32 tcpi_last_ack_recv;
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_pmtu;
165 __u32 tcpi_rcv_ssthresh;
166 __u32 tcpi_rtt;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u32 tcpi_rttvar;
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_snd_ssthresh;
170 __u32 tcpi_snd_cwnd;
171 __u32 tcpi_advmss;
Tao Baod7db5942015-01-28 10:07:51 -0800172 __u32 tcpi_reordering;
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_rcv_rtt;
175 __u32 tcpi_rcv_space;
176 __u32 tcpi_total_retrans;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u64 tcpi_pacing_rate;
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 __u64 tcpi_max_pacing_rate;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800180 __u64 tcpi_bytes_acked;
181 __u64 tcpi_bytes_received;
182 __u32 tcpi_segs_out;
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 __u32 tcpi_segs_in;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700185 __u32 tcpi_notsent_bytes;
186 __u32 tcpi_min_rtt;
187 __u32 tcpi_data_segs_in;
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 __u32 tcpi_data_segs_out;
Ben Cheng655a7c02013-10-16 16:09:24 -0700190};
191#define TCP_MD5SIG_MAXKEYLEN 80
Christopher Ferris38062f92014-07-09 15:33:25 -0700192struct tcp_md5sig {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800194 struct __kernel_sockaddr_storage tcpm_addr;
195 __u16 __tcpm_pad1;
196 __u16 tcpm_keylen;
Tao Baod7db5942015-01-28 10:07:51 -0800197 __u32 __tcpm_pad2;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN];
Ben Cheng655a7c02013-10-16 16:09:24 -0700200};
201#endif