TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpOption.h
Go to the documentation of this file.
1
10#ifndef _TCP_OPTION_H_
11#define _TCP_OPTION_H_
12
13//
14// Supported TCP option types and their length.
15//
16#define TCP_OPTION_EOP 0
17#define TCP_OPTION_NOP 1
18#define TCP_OPTION_MSS 2
19#define TCP_OPTION_WS 3
20#define TCP_OPTION_TS 8
21#define TCP_OPTION_MSS_LEN 4
22#define TCP_OPTION_WS_LEN 3
23#define TCP_OPTION_TS_LEN 10
24#define TCP_OPTION_WS_ALIGNED_LEN 4
25#define TCP_OPTION_TS_ALIGNED_LEN 12
26
27//
28// recommend format of timestamp window scale
29// option for fast process.
30//
31#define TCP_OPTION_TS_FAST ((TCP_OPTION_NOP << 24) |\
32 (TCP_OPTION_NOP << 16) | \
33 (TCP_OPTION_TS << 8) | \
34 (TCP_OPTION_TS_LEN))
35
36#define TCP_OPTION_WS_FAST ((TCP_OPTION_NOP << 24) | \
37 (TCP_OPTION_WS << 16) | \
38 (TCP_OPTION_WS_LEN << 8))
39
40#define TCP_OPTION_MSS_FAST ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16))
41
42//
43// Other misc definitions
44//
45#define TCP_OPTION_RCVD_MSS 0x01
46#define TCP_OPTION_RCVD_WS 0x02
47#define TCP_OPTION_RCVD_TS 0x04
48#define TCP_OPTION_MAX_WS 14
49#define TCP_OPTION_MAX_WIN 0xffff
50
55typedef struct _TCP_OPTION {
56 UINT8 Flag;
57 UINT8 WndScale;
58 UINT16 Mss;
59 UINT32 TSVal;
60 UINT32 TSEcr;
62
71UINT8
73 IN TCP_CB *Tcb
74 );
75
85UINT16
87 IN TCP_CB *Tcb,
88 IN NET_BUF *Nbuf
89 );
90
100UINT16
102 IN TCP_CB *Tcb,
103 IN NET_BUF *Nbuf
104 );
105
117INTN
119 IN TCP_HEAD *Tcp,
120 IN OUT TCP_OPTION *Option
121 );
122
123#endif
INT64 INTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
struct _TCP_OPTION TCP_OPTION
UINT16 TcpBuildOption(IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
Definition: TcpOption.c:185
UINT16 TcpSynBuildOption(IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
Definition: TcpOption.c:105
INTN TcpParseOption(IN TCP_HEAD *Tcp, IN OUT TCP_OPTION *Option)
Definition: TcpOption.c:232
UINT8 TcpComputeScale(IN TCP_CB *Tcb)
Definition: TcpOption.c:76
UINT32 TSEcr
The TSEcr field in a timestamp option.
Definition: TcpOption.h:60
UINT8 Flag
Flag such as TCP_OPTION_RCVD_MSS.
Definition: TcpOption.h:56
UINT8 WndScale
The WndScale received.
Definition: TcpOption.h:57
UINT32 TSVal
The TSVal field in a timestamp option.
Definition: TcpOption.h:59
UINT16 Mss
The Mss received.
Definition: TcpOption.h:58