Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: tcp.h
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* INET An implementation of the TCP/IP protocol suite for the LINUX
[2] Fix | Delete
* operating system. INET is implemented using the BSD Socket
[3] Fix | Delete
* interface as the means of communication with the user level.
[4] Fix | Delete
*
[5] Fix | Delete
* Definitions for the TCP protocol.
[6] Fix | Delete
*
[7] Fix | Delete
* Version: @(#)tcp.h 1.0.2 04/28/93
[8] Fix | Delete
*
[9] Fix | Delete
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
[10] Fix | Delete
*
[11] Fix | Delete
* This program is free software; you can redistribute it and/or
[12] Fix | Delete
* modify it under the terms of the GNU General Public License
[13] Fix | Delete
* as published by the Free Software Foundation; either version
[14] Fix | Delete
* 2 of the License, or (at your option) any later version.
[15] Fix | Delete
*/
[16] Fix | Delete
#ifndef _LINUX_TCP_H
[17] Fix | Delete
#define _LINUX_TCP_H
[18] Fix | Delete
[19] Fix | Delete
#include <linux/types.h>
[20] Fix | Delete
#include <asm/byteorder.h>
[21] Fix | Delete
#include <linux/socket.h>
[22] Fix | Delete
[23] Fix | Delete
struct tcphdr {
[24] Fix | Delete
__be16 source;
[25] Fix | Delete
__be16 dest;
[26] Fix | Delete
__be32 seq;
[27] Fix | Delete
__be32 ack_seq;
[28] Fix | Delete
#if defined(__LITTLE_ENDIAN_BITFIELD)
[29] Fix | Delete
__u16 res1:4,
[30] Fix | Delete
doff:4,
[31] Fix | Delete
fin:1,
[32] Fix | Delete
syn:1,
[33] Fix | Delete
rst:1,
[34] Fix | Delete
psh:1,
[35] Fix | Delete
ack:1,
[36] Fix | Delete
urg:1,
[37] Fix | Delete
ece:1,
[38] Fix | Delete
cwr:1;
[39] Fix | Delete
#elif defined(__BIG_ENDIAN_BITFIELD)
[40] Fix | Delete
__u16 doff:4,
[41] Fix | Delete
res1:4,
[42] Fix | Delete
cwr:1,
[43] Fix | Delete
ece:1,
[44] Fix | Delete
urg:1,
[45] Fix | Delete
ack:1,
[46] Fix | Delete
psh:1,
[47] Fix | Delete
rst:1,
[48] Fix | Delete
syn:1,
[49] Fix | Delete
fin:1;
[50] Fix | Delete
#else
[51] Fix | Delete
#error "Adjust your <asm/byteorder.h> defines"
[52] Fix | Delete
#endif
[53] Fix | Delete
__be16 window;
[54] Fix | Delete
__sum16 check;
[55] Fix | Delete
__be16 urg_ptr;
[56] Fix | Delete
};
[57] Fix | Delete
[58] Fix | Delete
/*
[59] Fix | Delete
* The union cast uses a gcc extension to avoid aliasing problems
[60] Fix | Delete
* (union is compatible to any of its members)
[61] Fix | Delete
* This means this part of the code is -fstrict-aliasing safe now.
[62] Fix | Delete
*/
[63] Fix | Delete
union tcp_word_hdr {
[64] Fix | Delete
struct tcphdr hdr;
[65] Fix | Delete
__be32 words[5];
[66] Fix | Delete
};
[67] Fix | Delete
[68] Fix | Delete
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
[69] Fix | Delete
[70] Fix | Delete
enum {
[71] Fix | Delete
TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
[72] Fix | Delete
TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
[73] Fix | Delete
TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
[74] Fix | Delete
TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
[75] Fix | Delete
TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
[76] Fix | Delete
TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
[77] Fix | Delete
TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
[78] Fix | Delete
TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
[79] Fix | Delete
TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
[80] Fix | Delete
TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
[81] Fix | Delete
};
[82] Fix | Delete
[83] Fix | Delete
/*
[84] Fix | Delete
* TCP general constants
[85] Fix | Delete
*/
[86] Fix | Delete
#define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */
[87] Fix | Delete
#define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */
[88] Fix | Delete
[89] Fix | Delete
/* TCP socket options */
[90] Fix | Delete
#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
[91] Fix | Delete
#define TCP_MAXSEG 2 /* Limit MSS */
[92] Fix | Delete
#define TCP_CORK 3 /* Never send partially complete segments */
[93] Fix | Delete
#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
[94] Fix | Delete
#define TCP_KEEPINTVL 5 /* Interval between keepalives */
[95] Fix | Delete
#define TCP_KEEPCNT 6 /* Number of keepalives before death */
[96] Fix | Delete
#define TCP_SYNCNT 7 /* Number of SYN retransmits */
[97] Fix | Delete
#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
[98] Fix | Delete
#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
[99] Fix | Delete
#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
[100] Fix | Delete
#define TCP_INFO 11 /* Information about this connection. */
[101] Fix | Delete
#define TCP_QUICKACK 12 /* Block/reenable quick acks */
[102] Fix | Delete
#define TCP_CONGESTION 13 /* Congestion control algorithm */
[103] Fix | Delete
#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
[104] Fix | Delete
#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
[105] Fix | Delete
#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
[106] Fix | Delete
#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
[107] Fix | Delete
#define TCP_REPAIR 19 /* TCP sock is under repair right now */
[108] Fix | Delete
#define TCP_REPAIR_QUEUE 20
[109] Fix | Delete
#define TCP_QUEUE_SEQ 21
[110] Fix | Delete
#define TCP_REPAIR_OPTIONS 22
[111] Fix | Delete
#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
[112] Fix | Delete
#define TCP_TIMESTAMP 24
[113] Fix | Delete
#define TCP_NOTSENT_LOWAT 25 /* limit number of unsent bytes in write queue */
[114] Fix | Delete
#define TCP_CC_INFO 26 /* Get Congestion Control (optional) info */
[115] Fix | Delete
#define TCP_SAVE_SYN 27 /* Record SYN headers for new connections */
[116] Fix | Delete
#define TCP_SAVED_SYN 28 /* Get SYN headers recorded for connection */
[117] Fix | Delete
#define TCP_REPAIR_WINDOW 29 /* Get/set window parameters */
[118] Fix | Delete
#define TCP_FASTOPEN_CONNECT 30 /* Attempt FastOpen with connect */
[119] Fix | Delete
#define TCP_ULP 31 /* Attach a ULP to a TCP connection */
[120] Fix | Delete
#define TCP_MD5SIG_EXT 32 /* TCP MD5 Signature with extensions */
[121] Fix | Delete
#define TCP_FASTOPEN_KEY 33 /* Set the key for Fast Open (cookie) */
[122] Fix | Delete
#define TCP_FASTOPEN_NO_COOKIE 34 /* Enable TFO without a TFO cookie */
[123] Fix | Delete
#define TCP_ZEROCOPY_RECEIVE 35
[124] Fix | Delete
#define TCP_INQ 36 /* Notify bytes available to read as a cmsg on read */
[125] Fix | Delete
[126] Fix | Delete
#define TCP_CM_INQ TCP_INQ
[127] Fix | Delete
[128] Fix | Delete
#define TCP_REPAIR_ON 1
[129] Fix | Delete
#define TCP_REPAIR_OFF 0
[130] Fix | Delete
#define TCP_REPAIR_OFF_NO_WP -1 /* Turn off without window probes */
[131] Fix | Delete
[132] Fix | Delete
struct tcp_repair_opt {
[133] Fix | Delete
__u32 opt_code;
[134] Fix | Delete
__u32 opt_val;
[135] Fix | Delete
};
[136] Fix | Delete
[137] Fix | Delete
struct tcp_repair_window {
[138] Fix | Delete
__u32 snd_wl1;
[139] Fix | Delete
__u32 snd_wnd;
[140] Fix | Delete
__u32 max_window;
[141] Fix | Delete
[142] Fix | Delete
__u32 rcv_wnd;
[143] Fix | Delete
__u32 rcv_wup;
[144] Fix | Delete
};
[145] Fix | Delete
[146] Fix | Delete
enum {
[147] Fix | Delete
TCP_NO_QUEUE,
[148] Fix | Delete
TCP_RECV_QUEUE,
[149] Fix | Delete
TCP_SEND_QUEUE,
[150] Fix | Delete
TCP_QUEUES_NR,
[151] Fix | Delete
};
[152] Fix | Delete
[153] Fix | Delete
/* for TCP_INFO socket option */
[154] Fix | Delete
#define TCPI_OPT_TIMESTAMPS 1
[155] Fix | Delete
#define TCPI_OPT_SACK 2
[156] Fix | Delete
#define TCPI_OPT_WSCALE 4
[157] Fix | Delete
#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
[158] Fix | Delete
#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
[159] Fix | Delete
#define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */
[160] Fix | Delete
[161] Fix | Delete
enum tcp_ca_state {
[162] Fix | Delete
TCP_CA_Open = 0,
[163] Fix | Delete
#define TCPF_CA_Open (1<<TCP_CA_Open)
[164] Fix | Delete
TCP_CA_Disorder = 1,
[165] Fix | Delete
#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
[166] Fix | Delete
TCP_CA_CWR = 2,
[167] Fix | Delete
#define TCPF_CA_CWR (1<<TCP_CA_CWR)
[168] Fix | Delete
TCP_CA_Recovery = 3,
[169] Fix | Delete
#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
[170] Fix | Delete
TCP_CA_Loss = 4
[171] Fix | Delete
#define TCPF_CA_Loss (1<<TCP_CA_Loss)
[172] Fix | Delete
};
[173] Fix | Delete
[174] Fix | Delete
struct tcp_info {
[175] Fix | Delete
__u8 tcpi_state;
[176] Fix | Delete
__u8 tcpi_ca_state;
[177] Fix | Delete
__u8 tcpi_retransmits;
[178] Fix | Delete
__u8 tcpi_probes;
[179] Fix | Delete
__u8 tcpi_backoff;
[180] Fix | Delete
__u8 tcpi_options;
[181] Fix | Delete
__u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
[182] Fix | Delete
__u8 tcpi_delivery_rate_app_limited:1;
[183] Fix | Delete
[184] Fix | Delete
__u32 tcpi_rto;
[185] Fix | Delete
__u32 tcpi_ato;
[186] Fix | Delete
__u32 tcpi_snd_mss;
[187] Fix | Delete
__u32 tcpi_rcv_mss;
[188] Fix | Delete
[189] Fix | Delete
__u32 tcpi_unacked;
[190] Fix | Delete
__u32 tcpi_sacked;
[191] Fix | Delete
__u32 tcpi_lost;
[192] Fix | Delete
__u32 tcpi_retrans;
[193] Fix | Delete
__u32 tcpi_fackets;
[194] Fix | Delete
[195] Fix | Delete
/* Times. */
[196] Fix | Delete
__u32 tcpi_last_data_sent;
[197] Fix | Delete
__u32 tcpi_last_ack_sent; /* Not remembered, sorry. */
[198] Fix | Delete
__u32 tcpi_last_data_recv;
[199] Fix | Delete
__u32 tcpi_last_ack_recv;
[200] Fix | Delete
[201] Fix | Delete
/* Metrics. */
[202] Fix | Delete
__u32 tcpi_pmtu;
[203] Fix | Delete
__u32 tcpi_rcv_ssthresh;
[204] Fix | Delete
__u32 tcpi_rtt;
[205] Fix | Delete
__u32 tcpi_rttvar;
[206] Fix | Delete
__u32 tcpi_snd_ssthresh;
[207] Fix | Delete
__u32 tcpi_snd_cwnd;
[208] Fix | Delete
__u32 tcpi_advmss;
[209] Fix | Delete
__u32 tcpi_reordering;
[210] Fix | Delete
[211] Fix | Delete
__u32 tcpi_rcv_rtt;
[212] Fix | Delete
__u32 tcpi_rcv_space;
[213] Fix | Delete
[214] Fix | Delete
__u32 tcpi_total_retrans;
[215] Fix | Delete
[216] Fix | Delete
__u64 tcpi_pacing_rate;
[217] Fix | Delete
__u64 tcpi_max_pacing_rate;
[218] Fix | Delete
__u64 tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
[219] Fix | Delete
__u64 tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
[220] Fix | Delete
__u32 tcpi_segs_out; /* RFC4898 tcpEStatsPerfSegsOut */
[221] Fix | Delete
__u32 tcpi_segs_in; /* RFC4898 tcpEStatsPerfSegsIn */
[222] Fix | Delete
[223] Fix | Delete
__u32 tcpi_notsent_bytes;
[224] Fix | Delete
__u32 tcpi_min_rtt;
[225] Fix | Delete
__u32 tcpi_data_segs_in; /* RFC4898 tcpEStatsDataSegsIn */
[226] Fix | Delete
__u32 tcpi_data_segs_out; /* RFC4898 tcpEStatsDataSegsOut */
[227] Fix | Delete
[228] Fix | Delete
__u64 tcpi_delivery_rate;
[229] Fix | Delete
[230] Fix | Delete
__u64 tcpi_busy_time; /* Time (usec) busy sending data */
[231] Fix | Delete
__u64 tcpi_rwnd_limited; /* Time (usec) limited by receive window */
[232] Fix | Delete
__u64 tcpi_sndbuf_limited; /* Time (usec) limited by send buffer */
[233] Fix | Delete
[234] Fix | Delete
__u32 tcpi_delivered;
[235] Fix | Delete
__u32 tcpi_delivered_ce;
[236] Fix | Delete
[237] Fix | Delete
__u64 tcpi_bytes_sent; /* RFC4898 tcpEStatsPerfHCDataOctetsOut */
[238] Fix | Delete
__u64 tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */
[239] Fix | Delete
__u32 tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */
[240] Fix | Delete
__u32 tcpi_reord_seen; /* reordering events seen */
[241] Fix | Delete
[242] Fix | Delete
__u32 tcpi_rcv_ooopack; /* Out-of-order packets received */
[243] Fix | Delete
[244] Fix | Delete
__u32 tcpi_snd_wnd; /* peer's advertised receive window after
[245] Fix | Delete
* scaling (bytes)
[246] Fix | Delete
*/
[247] Fix | Delete
};
[248] Fix | Delete
[249] Fix | Delete
/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
[250] Fix | Delete
enum {
[251] Fix | Delete
TCP_NLA_PAD,
[252] Fix | Delete
TCP_NLA_BUSY, /* Time (usec) busy sending data */
[253] Fix | Delete
TCP_NLA_RWND_LIMITED, /* Time (usec) limited by receive window */
[254] Fix | Delete
TCP_NLA_SNDBUF_LIMITED, /* Time (usec) limited by send buffer */
[255] Fix | Delete
TCP_NLA_DATA_SEGS_OUT, /* Data pkts sent including retransmission */
[256] Fix | Delete
TCP_NLA_TOTAL_RETRANS, /* Data pkts retransmitted */
[257] Fix | Delete
TCP_NLA_PACING_RATE, /* Pacing rate in bytes per second */
[258] Fix | Delete
TCP_NLA_DELIVERY_RATE, /* Delivery rate in bytes per second */
[259] Fix | Delete
TCP_NLA_SND_CWND, /* Sending congestion window */
[260] Fix | Delete
TCP_NLA_REORDERING, /* Reordering metric */
[261] Fix | Delete
TCP_NLA_MIN_RTT, /* minimum RTT */
[262] Fix | Delete
TCP_NLA_RECUR_RETRANS, /* Recurring retransmits for the current pkt */
[263] Fix | Delete
TCP_NLA_DELIVERY_RATE_APP_LMT, /* delivery rate application limited ? */
[264] Fix | Delete
TCP_NLA_SNDQ_SIZE, /* Data (bytes) pending in send queue */
[265] Fix | Delete
TCP_NLA_CA_STATE, /* ca_state of socket */
[266] Fix | Delete
TCP_NLA_SND_SSTHRESH, /* Slow start size threshold */
[267] Fix | Delete
TCP_NLA_DELIVERED, /* Data pkts delivered incl. out-of-order */
[268] Fix | Delete
TCP_NLA_DELIVERED_CE, /* Like above but only ones w/ CE marks */
[269] Fix | Delete
TCP_NLA_BYTES_SENT, /* Data bytes sent including retransmission */
[270] Fix | Delete
TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */
[271] Fix | Delete
TCP_NLA_DSACK_DUPS, /* DSACK blocks received */
[272] Fix | Delete
TCP_NLA_REORD_SEEN, /* reordering events seen */
[273] Fix | Delete
TCP_NLA_SRTT, /* smoothed RTT in usecs */
[274] Fix | Delete
TCP_NLA_TIMEOUT_REHASH, /* Timeout-triggered rehash attempts */
[275] Fix | Delete
};
[276] Fix | Delete
[277] Fix | Delete
/* for TCP_MD5SIG socket option */
[278] Fix | Delete
#define TCP_MD5SIG_MAXKEYLEN 80
[279] Fix | Delete
[280] Fix | Delete
/* tcp_md5sig extension flags for TCP_MD5SIG_EXT */
[281] Fix | Delete
#define TCP_MD5SIG_FLAG_PREFIX 1 /* address prefix length */
[282] Fix | Delete
[283] Fix | Delete
struct tcp_md5sig {
[284] Fix | Delete
struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
[285] Fix | Delete
__u8 tcpm_flags; /* extension flags */
[286] Fix | Delete
__u8 tcpm_prefixlen; /* address prefix */
[287] Fix | Delete
__u16 tcpm_keylen; /* key length */
[288] Fix | Delete
__u32 __tcpm_pad; /* zero */
[289] Fix | Delete
__u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
[290] Fix | Delete
};
[291] Fix | Delete
[292] Fix | Delete
/* INET_DIAG_MD5SIG */
[293] Fix | Delete
struct tcp_diag_md5sig {
[294] Fix | Delete
__u8 tcpm_family;
[295] Fix | Delete
__u8 tcpm_prefixlen;
[296] Fix | Delete
__u16 tcpm_keylen;
[297] Fix | Delete
__be32 tcpm_addr[4];
[298] Fix | Delete
__u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN];
[299] Fix | Delete
};
[300] Fix | Delete
[301] Fix | Delete
/* setsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...) */
[302] Fix | Delete
[303] Fix | Delete
struct tcp_zerocopy_receive {
[304] Fix | Delete
__u64 address; /* in: address of mapping */
[305] Fix | Delete
__u32 length; /* in/out: number of bytes to map/mapped */
[306] Fix | Delete
__u32 recv_skip_hint; /* out: amount of bytes to skip */
[307] Fix | Delete
};
[308] Fix | Delete
#endif /* _LINUX_TCP_H */
[309] Fix | Delete
[310] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function