File: ntcph.inc

package info (click to toggle)
fpc 2.0.0-4
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 89,476 kB
  • ctags: 133,433
  • sloc: pascal: 1,075,377; makefile: 310,704; xml: 64,343; perl: 7,703; yacc: 3,297; ansic: 2,265; lex: 839; php: 447; sh: 412; sed: 132; asm: 71; csh: 34; cpp: 26; tcl: 7
file content (119 lines) | stat: -rw-r--r-- 2,915 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119


const
   TCP_NODELAY = 1;
   TCP_MAXSEG = 2;
   TCP_CORK = 3;
   TCP_KEEPIDLE = 4;
   TCP_KEEPINTVL = 5;
   TCP_KEEPCNT = 6;
   TCP_SYNCNT = 7;
   TCP_LINGER2 = 8;
   TCP_DEFER_ACCEPT = 9;
   TCP_WINDOW_CLAMP = 10;
   TCP_INFO = 11;
   TCP_QUICKACK = 12;

const
   TH_FIN = $01;
   TH_SYN = $02;
   TH_RST = $04;
   TH_PUSH = $08;
   TH_ACK = $10;
   TH_URG = $20;

type
   Ptcphdr = ^tcphdr;
   tcphdr = record
        source : u_int16_t;
        dest : u_int16_t;
        seq : u_int32_t;
        ack_seq : u_int32_t;
        flag0 : u_int16_t;
        window : u_int16_t;
        check : u_int16_t;
        urg_ptr : u_int16_t;
     end;

   Const
     TCP_ESTABLISHED = 1;
     TCP_SYN_SENT = 2;
     TCP_SYN_RECV = 3;
     TCP_FIN_WAIT1 = 4;
     TCP_FIN_WAIT2 = 5;
     TCP_TIME_WAIT = 6;
     TCP_CLOSE = 7;
     TCP_CLOSE_WAIT = 8;
     TCP_LAST_ACK = 9;
     TCP_LISTEN = 10;
     TCP_CLOSING = 11;

   TCPOPT_EOL = 0;
   TCPOPT_NOP = 1;
   TCPOPT_MAXSEG = 2;
   TCPOLEN_MAXSEG = 4;
   TCPOPT_WINDOW = 3;
   TCPOLEN_WINDOW = 3;
   TCPOPT_SACK_PERMITTED = 4;
   TCPOLEN_SACK_PERMITTED = 2;
   TCPOPT_SACK = 5;
   TCPOPT_TIMESTAMP = 8;
   TCPOLEN_TIMESTAMP = 10;
   TCPOLEN_TSTAMP_APPA = TCPOLEN_TIMESTAMP + 2;
   TCPOPT_TSTAMP_HDR = (((TCPOPT_NOP shl 24) or (TCPOPT_NOP shl 16)) or (TCPOPT_TIMESTAMP shl 8)) or TCPOLEN_TIMESTAMP;
   TCP_MSS = 512;
   TCP_MAXWIN = 65535;
   TCP_MAX_WINSHIFT = 14;

   SOL_TCP = 6;

   TCPI_OPT_TIMESTAMPS = 1;
   TCPI_OPT_SACK = 2;
   TCPI_OPT_WSCALE = 4;
   TCPI_OPT_ECN = 8;
type
   tcp_ca_state = (
     TCP_CA_Open := 0,
     TCP_CA_Disorder := 1,
     TCP_CA_CWR := 2,
     TCP_CA_Recovery := 3,
     TCP_CA_Loss := 4);

type
   Ptcp_info = ^_tcp_info;
   _tcp_info = record // Renamed, conflicts with TCP_INFO
        tcpi_state : u_int8_t;
        tcpi_ca_state : u_int8_t;
        tcpi_retransmits : u_int8_t;
        tcpi_probes : u_int8_t;
        tcpi_backoff : u_int8_t;
        tcpi_options : u_int8_t;
        flag0 : u_int8_t;
        tcpi_rto : u_int32_t;
        tcpi_ato : u_int32_t;
        tcpi_snd_mss : u_int32_t;
        tcpi_rcv_mss : u_int32_t;
        tcpi_unacked : u_int32_t;
        tcpi_sacked : u_int32_t;
        tcpi_lost : u_int32_t;
        tcpi_retrans : u_int32_t;
        tcpi_fackets : u_int32_t;
        tcpi_last_data_sent : u_int32_t;
        tcpi_last_ack_sent : u_int32_t;
        tcpi_last_data_recv : u_int32_t;
        tcpi_last_ack_recv : u_int32_t;
        tcpi_pmtu : u_int32_t;
        tcpi_rcv_ssthresh : u_int32_t;
        tcpi_rtt : u_int32_t;
        tcpi_rttvar : u_int32_t;
        tcpi_snd_ssthresh : u_int32_t;
        tcpi_snd_cwnd : u_int32_t;
        tcpi_advmss : u_int32_t;
        tcpi_reordering : u_int32_t;
     end;

{ ---------------------------------------------------------------------
    Borland compatibility types
  ---------------------------------------------------------------------}

// Type