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_TCP_H 20 #define _UAPI_LINUX_TCP_H 21 #include <linux/types.h> 22 #include <asm/byteorder.h> 23 #include <linux/socket.h> 24 struct tcphdr { 25 __be16 source; 26 __be16 dest; 27 __be32 seq; 28 __be32 ack_seq; 29 #ifdef __LITTLE_ENDIAN_BITFIELD 30 __u16 res1 : 4, doff : 4, fin : 1, syn : 1, rst : 1, psh : 1, ack : 1, urg : 1, ece : 1, cwr : 1; 31 #elif defined(__BIG_ENDIAN_BITFIELD) 32 __u16 doff : 4, res1 : 4, cwr : 1, ece : 1, urg : 1, ack : 1, psh : 1, rst : 1, syn : 1, fin : 1; 33 #else 34 #error "Adjust your <asm/byteorder.h> defines" 35 #endif 36 __be16 window; 37 __sum16 check; 38 __be16 urg_ptr; 39 }; 40 union tcp_word_hdr { 41 struct tcphdr hdr; 42 __be32 words[5]; 43 }; 44 #define tcp_flag_word(tp) (((union tcp_word_hdr *) (tp))->words[3]) 45 enum { 46 TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000), 47 TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000), 48 TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000), 49 TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000), 50 TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000), 51 TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000), 52 TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000), 53 TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000), 54 TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000), 55 TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000) 56 }; 57 #define TCP_MSS_DEFAULT 536U 58 #define TCP_MSS_DESIRED 1220U 59 #define TCP_NODELAY 1 60 #define TCP_MAXSEG 2 61 #define TCP_CORK 3 62 #define TCP_KEEPIDLE 4 63 #define TCP_KEEPINTVL 5 64 #define TCP_KEEPCNT 6 65 #define TCP_SYNCNT 7 66 #define TCP_LINGER2 8 67 #define TCP_DEFER_ACCEPT 9 68 #define TCP_WINDOW_CLAMP 10 69 #define TCP_INFO 11 70 #define TCP_QUICKACK 12 71 #define TCP_CONGESTION 13 72 #define TCP_MD5SIG 14 73 #define TCP_THIN_LINEAR_TIMEOUTS 16 74 #define TCP_THIN_DUPACK 17 75 #define TCP_USER_TIMEOUT 18 76 #define TCP_REPAIR 19 77 #define TCP_REPAIR_QUEUE 20 78 #define TCP_QUEUE_SEQ 21 79 #define TCP_REPAIR_OPTIONS 22 80 #define TCP_FASTOPEN 23 81 #define TCP_TIMESTAMP 24 82 #define TCP_NOTSENT_LOWAT 25 83 #define TCP_CC_INFO 26 84 #define TCP_SAVE_SYN 27 85 #define TCP_SAVED_SYN 28 86 #define TCP_REPAIR_WINDOW 29 87 #define TCP_FASTOPEN_CONNECT 30 88 #define TCP_ULP 31 89 #define TCP_MD5SIG_EXT 32 90 #define TCP_FASTOPEN_KEY 33 91 #define TCP_FASTOPEN_NO_COOKIE 34 92 struct tcp_repair_opt { 93 __u32 opt_code; 94 __u32 opt_val; 95 }; 96 struct tcp_repair_window { 97 __u32 snd_wl1; 98 __u32 snd_wnd; 99 __u32 max_window; 100 __u32 rcv_wnd; 101 __u32 rcv_wup; 102 }; 103 enum { 104 TCP_NO_QUEUE, 105 TCP_RECV_QUEUE, 106 TCP_SEND_QUEUE, 107 TCP_QUEUES_NR, 108 }; 109 #define TCPI_OPT_TIMESTAMPS 1 110 #define TCPI_OPT_SACK 2 111 #define TCPI_OPT_WSCALE 4 112 #define TCPI_OPT_ECN 8 113 #define TCPI_OPT_ECN_SEEN 16 114 #define TCPI_OPT_SYN_DATA 32 115 enum tcp_ca_state { 116 TCP_CA_Open = 0, 117 #define TCPF_CA_Open (1 << TCP_CA_Open) 118 TCP_CA_Disorder = 1, 119 #define TCPF_CA_Disorder (1 << TCP_CA_Disorder) 120 TCP_CA_CWR = 2, 121 #define TCPF_CA_CWR (1 << TCP_CA_CWR) 122 TCP_CA_Recovery = 3, 123 #define TCPF_CA_Recovery (1 << TCP_CA_Recovery) 124 TCP_CA_Loss = 4 125 #define TCPF_CA_Loss (1 << TCP_CA_Loss) 126 }; 127 struct tcp_info { 128 __u8 tcpi_state; 129 __u8 tcpi_ca_state; 130 __u8 tcpi_retransmits; 131 __u8 tcpi_probes; 132 __u8 tcpi_backoff; 133 __u8 tcpi_options; 134 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; 135 __u8 tcpi_delivery_rate_app_limited : 1; 136 __u32 tcpi_rto; 137 __u32 tcpi_ato; 138 __u32 tcpi_snd_mss; 139 __u32 tcpi_rcv_mss; 140 __u32 tcpi_unacked; 141 __u32 tcpi_sacked; 142 __u32 tcpi_lost; 143 __u32 tcpi_retrans; 144 __u32 tcpi_fackets; 145 __u32 tcpi_last_data_sent; 146 __u32 tcpi_last_ack_sent; 147 __u32 tcpi_last_data_recv; 148 __u32 tcpi_last_ack_recv; 149 __u32 tcpi_pmtu; 150 __u32 tcpi_rcv_ssthresh; 151 __u32 tcpi_rtt; 152 __u32 tcpi_rttvar; 153 __u32 tcpi_snd_ssthresh; 154 __u32 tcpi_snd_cwnd; 155 __u32 tcpi_advmss; 156 __u32 tcpi_reordering; 157 __u32 tcpi_rcv_rtt; 158 __u32 tcpi_rcv_space; 159 __u32 tcpi_total_retrans; 160 __u64 tcpi_pacing_rate; 161 __u64 tcpi_max_pacing_rate; 162 __u64 tcpi_bytes_acked; 163 __u64 tcpi_bytes_received; 164 __u32 tcpi_segs_out; 165 __u32 tcpi_segs_in; 166 __u32 tcpi_notsent_bytes; 167 __u32 tcpi_min_rtt; 168 __u32 tcpi_data_segs_in; 169 __u32 tcpi_data_segs_out; 170 __u64 tcpi_delivery_rate; 171 __u64 tcpi_busy_time; 172 __u64 tcpi_rwnd_limited; 173 __u64 tcpi_sndbuf_limited; 174 }; 175 enum { 176 TCP_NLA_PAD, 177 TCP_NLA_BUSY, 178 TCP_NLA_RWND_LIMITED, 179 TCP_NLA_SNDBUF_LIMITED, 180 TCP_NLA_DATA_SEGS_OUT, 181 TCP_NLA_TOTAL_RETRANS, 182 TCP_NLA_PACING_RATE, 183 TCP_NLA_DELIVERY_RATE, 184 TCP_NLA_SND_CWND, 185 TCP_NLA_REORDERING, 186 TCP_NLA_MIN_RTT, 187 TCP_NLA_RECUR_RETRANS, 188 TCP_NLA_DELIVERY_RATE_APP_LMT, 189 }; 190 #define TCP_MD5SIG_MAXKEYLEN 80 191 #define TCP_MD5SIG_FLAG_PREFIX 1 192 struct tcp_md5sig { 193 struct sockaddr_storage tcpm_addr; 194 __u8 tcpm_flags; 195 __u8 tcpm_prefixlen; 196 __u16 tcpm_keylen; 197 __u32 __tcpm_pad; 198 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; 199 }; 200 struct tcp_diag_md5sig { 201 __u8 tcpm_family; 202 __u8 tcpm_prefixlen; 203 __u16 tcpm_keylen; 204 __be32 tcpm_addr[4]; 205 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; 206 }; 207 #endif 208