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 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _LINUX_TCP_H 13#define _LINUX_TCP_H 14 15#include <linux/types.h> 16#include <asm/byteorder.h> 17 18struct tcphdr { 19 __u16 source; 20 __u16 dest; 21 __u32 seq; 22 __u32 ack_seq; 23#ifdef __LITTLE_ENDIAN_BITFIELD 24 __u16 res1:4, 25 doff:4, 26 fin:1, 27 syn:1, 28 rst:1, 29 psh:1, 30 ack:1, 31 urg:1, 32 ece:1, 33 cwr:1; 34#elif defined(__BIG_ENDIAN_BITFIELD) 35 __u16 doff:4, 36 res1:4, 37 cwr:1, 38 ece:1, 39 urg:1, 40 ack:1, 41 psh:1, 42 rst:1, 43 syn:1, 44 fin:1; 45#else 46#error "Adjust your <asm/byteorder.h> defines" 47#endif 48 __u16 window; 49 __u16 check; 50 __u16 urg_ptr; 51}; 52 53union tcp_word_hdr { 54 struct tcphdr hdr; 55 __u32 words[5]; 56}; 57 58#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 59 60enum { 61 TCP_FLAG_CWR = __constant_htonl(0x00800000), 62 TCP_FLAG_ECE = __constant_htonl(0x00400000), 63 TCP_FLAG_URG = __constant_htonl(0x00200000), 64 TCP_FLAG_ACK = __constant_htonl(0x00100000), 65 TCP_FLAG_PSH = __constant_htonl(0x00080000), 66 TCP_FLAG_RST = __constant_htonl(0x00040000), 67 TCP_FLAG_SYN = __constant_htonl(0x00020000), 68 TCP_FLAG_FIN = __constant_htonl(0x00010000), 69 TCP_RESERVED_BITS = __constant_htonl(0x0F000000), 70 TCP_DATA_OFFSET = __constant_htonl(0xF0000000) 71}; 72 73#define TCP_NODELAY 1 74#define TCP_MAXSEG 2 75#define TCP_CORK 3 76#define TCP_KEEPIDLE 4 77#define TCP_KEEPINTVL 5 78#define TCP_KEEPCNT 6 79#define TCP_SYNCNT 7 80#define TCP_LINGER2 8 81#define TCP_DEFER_ACCEPT 9 82#define TCP_WINDOW_CLAMP 10 83#define TCP_INFO 11 84#define TCP_QUICKACK 12 85#define TCP_CONGESTION 13 86 87#define TCPI_OPT_TIMESTAMPS 1 88#define TCPI_OPT_SACK 2 89#define TCPI_OPT_WSCALE 4 90#define TCPI_OPT_ECN 8 91 92enum tcp_ca_state 93{ 94 TCP_CA_Open = 0, 95#define TCPF_CA_Open (1<<TCP_CA_Open) 96 TCP_CA_Disorder = 1, 97#define TCPF_CA_Disorder (1<<TCP_CA_Disorder) 98 TCP_CA_CWR = 2, 99#define TCPF_CA_CWR (1<<TCP_CA_CWR) 100 TCP_CA_Recovery = 3, 101#define TCPF_CA_Recovery (1<<TCP_CA_Recovery) 102 TCP_CA_Loss = 4 103#define TCPF_CA_Loss (1<<TCP_CA_Loss) 104}; 105 106struct tcp_info 107{ 108 __u8 tcpi_state; 109 __u8 tcpi_ca_state; 110 __u8 tcpi_retransmits; 111 __u8 tcpi_probes; 112 __u8 tcpi_backoff; 113 __u8 tcpi_options; 114 __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; 115 116 __u32 tcpi_rto; 117 __u32 tcpi_ato; 118 __u32 tcpi_snd_mss; 119 __u32 tcpi_rcv_mss; 120 121 __u32 tcpi_unacked; 122 __u32 tcpi_sacked; 123 __u32 tcpi_lost; 124 __u32 tcpi_retrans; 125 __u32 tcpi_fackets; 126 127 __u32 tcpi_last_data_sent; 128 __u32 tcpi_last_ack_sent; 129 __u32 tcpi_last_data_recv; 130 __u32 tcpi_last_ack_recv; 131 132 __u32 tcpi_pmtu; 133 __u32 tcpi_rcv_ssthresh; 134 __u32 tcpi_rtt; 135 __u32 tcpi_rttvar; 136 __u32 tcpi_snd_ssthresh; 137 __u32 tcpi_snd_cwnd; 138 __u32 tcpi_advmss; 139 __u32 tcpi_reordering; 140 141 __u32 tcpi_rcv_rtt; 142 __u32 tcpi_rcv_space; 143 144 __u32 tcpi_total_retrans; 145}; 146 147#endif 148