Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/netinet
File: tcp.h
/*
[0] Fix | Delete
* Copyright (c) 1982, 1986, 1993
[1] Fix | Delete
* The Regents of the University of California. All rights reserved.
[2] Fix | Delete
*
[3] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[4] Fix | Delete
* modification, are permitted provided that the following conditions
[5] Fix | Delete
* are met:
[6] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[7] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[8] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[9] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[10] Fix | Delete
* documentation and/or other materials provided with the distribution.
[11] Fix | Delete
* 4. Neither the name of the University nor the names of its contributors
[12] Fix | Delete
* may be used to endorse or promote products derived from this software
[13] Fix | Delete
* without specific prior written permission.
[14] Fix | Delete
*
[15] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
[16] Fix | Delete
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[17] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[18] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
[19] Fix | Delete
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[20] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
[21] Fix | Delete
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[22] Fix | Delete
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[23] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[24] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[25] Fix | Delete
* SUCH DAMAGE.
[26] Fix | Delete
*
[27] Fix | Delete
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
[28] Fix | Delete
*/
[29] Fix | Delete
[30] Fix | Delete
#ifndef _NETINET_TCP_H
[31] Fix | Delete
#define _NETINET_TCP_H 1
[32] Fix | Delete
[33] Fix | Delete
#include <features.h>
[34] Fix | Delete
[35] Fix | Delete
/*
[36] Fix | Delete
* User-settable options (used with setsockopt).
[37] Fix | Delete
*/
[38] Fix | Delete
#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */
[39] Fix | Delete
#define TCP_MAXSEG 2 /* Set maximum segment size */
[40] Fix | Delete
#define TCP_CORK 3 /* Control sending of partial frames */
[41] Fix | Delete
#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
[42] Fix | Delete
#define TCP_KEEPINTVL 5 /* Interval between keepalives */
[43] Fix | Delete
#define TCP_KEEPCNT 6 /* Number of keepalives before death */
[44] Fix | Delete
#define TCP_SYNCNT 7 /* Number of SYN retransmits */
[45] Fix | Delete
#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
[46] Fix | Delete
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
[47] Fix | Delete
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
[48] Fix | Delete
#define TCP_INFO 11 /* Information about this connection. */
[49] Fix | Delete
#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
[50] Fix | Delete
#define TCP_CONGESTION 13 /* Congestion control algorithm. */
[51] Fix | Delete
#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
[52] Fix | Delete
#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
[53] Fix | Delete
#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
[54] Fix | Delete
#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
[55] Fix | Delete
#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
[56] Fix | Delete
#define TCP_REPAIR 19 /* TCP sock is under repair right now */
[57] Fix | Delete
#define TCP_REPAIR_QUEUE 20 /* Set TCP queue to repair */
[58] Fix | Delete
#define TCP_QUEUE_SEQ 21 /* Set sequence number of repaired queue. */
[59] Fix | Delete
#define TCP_REPAIR_OPTIONS 22 /* Repair TCP connection options */
[60] Fix | Delete
#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
[61] Fix | Delete
#define TCP_TIMESTAMP 24 /* TCP time stamp */
[62] Fix | Delete
#define TCP_NOTSENT_LOWAT 25 /* Limit number of unsent bytes in
[63] Fix | Delete
write queue. */
[64] Fix | Delete
#define TCP_CC_INFO 26 /* Get Congestion Control
[65] Fix | Delete
(optional) info. */
[66] Fix | Delete
#define TCP_SAVE_SYN 27 /* Record SYN headers for new
[67] Fix | Delete
connections. */
[68] Fix | Delete
#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for
[69] Fix | Delete
connection. */
[70] Fix | Delete
#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters. */
[71] Fix | Delete
#define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect. */
[72] Fix | Delete
#define TCP_ULP 31 /* Attach a ULP to a TCP connection. */
[73] Fix | Delete
#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions. */
[74] Fix | Delete
#define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie). */
[75] Fix | Delete
#define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie. */
[76] Fix | Delete
[77] Fix | Delete
#ifdef __USE_MISC
[78] Fix | Delete
# include <sys/types.h>
[79] Fix | Delete
# include <sys/socket.h>
[80] Fix | Delete
# include <stdint.h>
[81] Fix | Delete
[82] Fix | Delete
typedef uint32_t tcp_seq;
[83] Fix | Delete
/*
[84] Fix | Delete
* TCP header.
[85] Fix | Delete
* Per RFC 793, September, 1981.
[86] Fix | Delete
*/
[87] Fix | Delete
struct tcphdr
[88] Fix | Delete
{
[89] Fix | Delete
__extension__ union
[90] Fix | Delete
{
[91] Fix | Delete
struct
[92] Fix | Delete
{
[93] Fix | Delete
uint16_t th_sport; /* source port */
[94] Fix | Delete
uint16_t th_dport; /* destination port */
[95] Fix | Delete
tcp_seq th_seq; /* sequence number */
[96] Fix | Delete
tcp_seq th_ack; /* acknowledgement number */
[97] Fix | Delete
# if __BYTE_ORDER == __LITTLE_ENDIAN
[98] Fix | Delete
uint8_t th_x2:4; /* (unused) */
[99] Fix | Delete
uint8_t th_off:4; /* data offset */
[100] Fix | Delete
# endif
[101] Fix | Delete
# if __BYTE_ORDER == __BIG_ENDIAN
[102] Fix | Delete
uint8_t th_off:4; /* data offset */
[103] Fix | Delete
uint8_t th_x2:4; /* (unused) */
[104] Fix | Delete
# endif
[105] Fix | Delete
uint8_t th_flags;
[106] Fix | Delete
# define TH_FIN 0x01
[107] Fix | Delete
# define TH_SYN 0x02
[108] Fix | Delete
# define TH_RST 0x04
[109] Fix | Delete
# define TH_PUSH 0x08
[110] Fix | Delete
# define TH_ACK 0x10
[111] Fix | Delete
# define TH_URG 0x20
[112] Fix | Delete
uint16_t th_win; /* window */
[113] Fix | Delete
uint16_t th_sum; /* checksum */
[114] Fix | Delete
uint16_t th_urp; /* urgent pointer */
[115] Fix | Delete
};
[116] Fix | Delete
struct
[117] Fix | Delete
{
[118] Fix | Delete
uint16_t source;
[119] Fix | Delete
uint16_t dest;
[120] Fix | Delete
uint32_t seq;
[121] Fix | Delete
uint32_t ack_seq;
[122] Fix | Delete
# if __BYTE_ORDER == __LITTLE_ENDIAN
[123] Fix | Delete
uint16_t res1:4;
[124] Fix | Delete
uint16_t doff:4;
[125] Fix | Delete
uint16_t fin:1;
[126] Fix | Delete
uint16_t syn:1;
[127] Fix | Delete
uint16_t rst:1;
[128] Fix | Delete
uint16_t psh:1;
[129] Fix | Delete
uint16_t ack:1;
[130] Fix | Delete
uint16_t urg:1;
[131] Fix | Delete
uint16_t res2:2;
[132] Fix | Delete
# elif __BYTE_ORDER == __BIG_ENDIAN
[133] Fix | Delete
uint16_t doff:4;
[134] Fix | Delete
uint16_t res1:4;
[135] Fix | Delete
uint16_t res2:2;
[136] Fix | Delete
uint16_t urg:1;
[137] Fix | Delete
uint16_t ack:1;
[138] Fix | Delete
uint16_t psh:1;
[139] Fix | Delete
uint16_t rst:1;
[140] Fix | Delete
uint16_t syn:1;
[141] Fix | Delete
uint16_t fin:1;
[142] Fix | Delete
# else
[143] Fix | Delete
# error "Adjust your <bits/endian.h> defines"
[144] Fix | Delete
# endif
[145] Fix | Delete
uint16_t window;
[146] Fix | Delete
uint16_t check;
[147] Fix | Delete
uint16_t urg_ptr;
[148] Fix | Delete
};
[149] Fix | Delete
};
[150] Fix | Delete
};
[151] Fix | Delete
[152] Fix | Delete
enum
[153] Fix | Delete
{
[154] Fix | Delete
TCP_ESTABLISHED = 1,
[155] Fix | Delete
TCP_SYN_SENT,
[156] Fix | Delete
TCP_SYN_RECV,
[157] Fix | Delete
TCP_FIN_WAIT1,
[158] Fix | Delete
TCP_FIN_WAIT2,
[159] Fix | Delete
TCP_TIME_WAIT,
[160] Fix | Delete
TCP_CLOSE,
[161] Fix | Delete
TCP_CLOSE_WAIT,
[162] Fix | Delete
TCP_LAST_ACK,
[163] Fix | Delete
TCP_LISTEN,
[164] Fix | Delete
TCP_CLOSING /* now a valid state */
[165] Fix | Delete
};
[166] Fix | Delete
[167] Fix | Delete
# define TCPOPT_EOL 0
[168] Fix | Delete
# define TCPOPT_NOP 1
[169] Fix | Delete
# define TCPOPT_MAXSEG 2
[170] Fix | Delete
# define TCPOLEN_MAXSEG 4
[171] Fix | Delete
# define TCPOPT_WINDOW 3
[172] Fix | Delete
# define TCPOLEN_WINDOW 3
[173] Fix | Delete
# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
[174] Fix | Delete
# define TCPOLEN_SACK_PERMITTED 2
[175] Fix | Delete
# define TCPOPT_SACK 5 /* Experimental */
[176] Fix | Delete
# define TCPOPT_TIMESTAMP 8
[177] Fix | Delete
# define TCPOLEN_TIMESTAMP 10
[178] Fix | Delete
# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
[179] Fix | Delete
[180] Fix | Delete
# define TCPOPT_TSTAMP_HDR \
[181] Fix | Delete
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
[182] Fix | Delete
[183] Fix | Delete
/*
[184] Fix | Delete
* Default maximum segment size for TCP.
[185] Fix | Delete
* With an IP MSS of 576, this is 536,
[186] Fix | Delete
* but 512 is probably more convenient.
[187] Fix | Delete
* This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
[188] Fix | Delete
*/
[189] Fix | Delete
# define TCP_MSS 512
[190] Fix | Delete
[191] Fix | Delete
# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
[192] Fix | Delete
[193] Fix | Delete
# define TCP_MAX_WINSHIFT 14 /* maximum window shift */
[194] Fix | Delete
[195] Fix | Delete
# define SOL_TCP 6 /* TCP level */
[196] Fix | Delete
[197] Fix | Delete
[198] Fix | Delete
# define TCPI_OPT_TIMESTAMPS 1
[199] Fix | Delete
# define TCPI_OPT_SACK 2
[200] Fix | Delete
# define TCPI_OPT_WSCALE 4
[201] Fix | Delete
# define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
[202] Fix | Delete
# define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
[203] Fix | Delete
# define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
[204] Fix | Delete
[205] Fix | Delete
/* Values for tcpi_state. */
[206] Fix | Delete
enum tcp_ca_state
[207] Fix | Delete
{
[208] Fix | Delete
TCP_CA_Open = 0,
[209] Fix | Delete
TCP_CA_Disorder = 1,
[210] Fix | Delete
TCP_CA_CWR = 2,
[211] Fix | Delete
TCP_CA_Recovery = 3,
[212] Fix | Delete
TCP_CA_Loss = 4
[213] Fix | Delete
};
[214] Fix | Delete
[215] Fix | Delete
struct tcp_info
[216] Fix | Delete
{
[217] Fix | Delete
uint8_t tcpi_state;
[218] Fix | Delete
uint8_t tcpi_ca_state;
[219] Fix | Delete
uint8_t tcpi_retransmits;
[220] Fix | Delete
uint8_t tcpi_probes;
[221] Fix | Delete
uint8_t tcpi_backoff;
[222] Fix | Delete
uint8_t tcpi_options;
[223] Fix | Delete
uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
[224] Fix | Delete
[225] Fix | Delete
uint32_t tcpi_rto;
[226] Fix | Delete
uint32_t tcpi_ato;
[227] Fix | Delete
uint32_t tcpi_snd_mss;
[228] Fix | Delete
uint32_t tcpi_rcv_mss;
[229] Fix | Delete
[230] Fix | Delete
uint32_t tcpi_unacked;
[231] Fix | Delete
uint32_t tcpi_sacked;
[232] Fix | Delete
uint32_t tcpi_lost;
[233] Fix | Delete
uint32_t tcpi_retrans;
[234] Fix | Delete
uint32_t tcpi_fackets;
[235] Fix | Delete
[236] Fix | Delete
/* Times. */
[237] Fix | Delete
uint32_t tcpi_last_data_sent;
[238] Fix | Delete
uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
[239] Fix | Delete
uint32_t tcpi_last_data_recv;
[240] Fix | Delete
uint32_t tcpi_last_ack_recv;
[241] Fix | Delete
[242] Fix | Delete
/* Metrics. */
[243] Fix | Delete
uint32_t tcpi_pmtu;
[244] Fix | Delete
uint32_t tcpi_rcv_ssthresh;
[245] Fix | Delete
uint32_t tcpi_rtt;
[246] Fix | Delete
uint32_t tcpi_rttvar;
[247] Fix | Delete
uint32_t tcpi_snd_ssthresh;
[248] Fix | Delete
uint32_t tcpi_snd_cwnd;
[249] Fix | Delete
uint32_t tcpi_advmss;
[250] Fix | Delete
uint32_t tcpi_reordering;
[251] Fix | Delete
[252] Fix | Delete
uint32_t tcpi_rcv_rtt;
[253] Fix | Delete
uint32_t tcpi_rcv_space;
[254] Fix | Delete
[255] Fix | Delete
uint32_t tcpi_total_retrans;
[256] Fix | Delete
};
[257] Fix | Delete
[258] Fix | Delete
[259] Fix | Delete
/* For TCP_MD5SIG socket option. */
[260] Fix | Delete
#define TCP_MD5SIG_MAXKEYLEN 80
[261] Fix | Delete
[262] Fix | Delete
/* tcp_md5sig extension flags for TCP_MD5SIG_EXT. */
[263] Fix | Delete
#define TCP_MD5SIG_FLAG_PREFIX 1 /* Address prefix length. */
[264] Fix | Delete
[265] Fix | Delete
struct tcp_md5sig
[266] Fix | Delete
{
[267] Fix | Delete
struct sockaddr_storage tcpm_addr; /* Address associated. */
[268] Fix | Delete
uint8_t tcpm_flags; /* Extension flags. */
[269] Fix | Delete
uint8_t tcpm_prefixlen; /* Address prefix. */
[270] Fix | Delete
uint16_t tcpm_keylen; /* Key length. */
[271] Fix | Delete
uint32_t __tcpm_pad; /* Zero. */
[272] Fix | Delete
uint8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
[273] Fix | Delete
};
[274] Fix | Delete
[275] Fix | Delete
/* For socket repair options. */
[276] Fix | Delete
struct tcp_repair_opt
[277] Fix | Delete
{
[278] Fix | Delete
uint32_t opt_code;
[279] Fix | Delete
uint32_t opt_val;
[280] Fix | Delete
};
[281] Fix | Delete
[282] Fix | Delete
/* Queue to repair, for TCP_REPAIR_QUEUE. */
[283] Fix | Delete
enum
[284] Fix | Delete
{
[285] Fix | Delete
TCP_NO_QUEUE,
[286] Fix | Delete
TCP_RECV_QUEUE,
[287] Fix | Delete
TCP_SEND_QUEUE,
[288] Fix | Delete
TCP_QUEUES_NR,
[289] Fix | Delete
};
[290] Fix | Delete
[291] Fix | Delete
/* For cookie transactions socket options. */
[292] Fix | Delete
#define TCP_COOKIE_MIN 8 /* 64-bits */
[293] Fix | Delete
#define TCP_COOKIE_MAX 16 /* 128-bits */
[294] Fix | Delete
#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
[295] Fix | Delete
[296] Fix | Delete
/* Flags for both getsockopt and setsockopt */
[297] Fix | Delete
#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
[298] Fix | Delete
#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
[299] Fix | Delete
* supercedes everything. */
[300] Fix | Delete
[301] Fix | Delete
/* Flags for getsockopt */
[302] Fix | Delete
#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
[303] Fix | Delete
#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
[304] Fix | Delete
[305] Fix | Delete
#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
[306] Fix | Delete
#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
[307] Fix | Delete
[308] Fix | Delete
struct tcp_cookie_transactions
[309] Fix | Delete
{
[310] Fix | Delete
uint16_t tcpct_flags;
[311] Fix | Delete
uint8_t __tcpct_pad1;
[312] Fix | Delete
uint8_t tcpct_cookie_desired;
[313] Fix | Delete
uint16_t tcpct_s_data_desired;
[314] Fix | Delete
uint16_t tcpct_used;
[315] Fix | Delete
uint8_t tcpct_value[TCP_MSS_DEFAULT];
[316] Fix | Delete
};
[317] Fix | Delete
[318] Fix | Delete
/* For use with TCP_REPAIR_WINDOW. */
[319] Fix | Delete
struct tcp_repair_window
[320] Fix | Delete
{
[321] Fix | Delete
uint32_t snd_wl1;
[322] Fix | Delete
uint32_t snd_wnd;
[323] Fix | Delete
uint32_t max_window;
[324] Fix | Delete
uint32_t rcv_wnd;
[325] Fix | Delete
uint32_t rcv_wup;
[326] Fix | Delete
};
[327] Fix | Delete
[328] Fix | Delete
#endif /* Misc. */
[329] Fix | Delete
[330] Fix | Delete
#endif /* netinet/tcp.h */
[331] Fix | Delete
[332] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function