TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpOption.h File Reference

Go to the source code of this file.

Data Structures

struct  _TCP_OPTION
 

Macros

#define TCP_OPTION_EOP   0
 End Of oPtion.
 
#define TCP_OPTION_NOP   1
 No-Option.
 
#define TCP_OPTION_MSS   2
 Maximum Segment Size.
 
#define TCP_OPTION_WS   3
 Window scale.
 
#define TCP_OPTION_TS   8
 Timestamp.
 
#define TCP_OPTION_MSS_LEN   4
 Length of MSS option.
 
#define TCP_OPTION_WS_LEN   3
 Length of window scale option.
 
#define TCP_OPTION_TS_LEN   10
 Length of timestamp option.
 
#define TCP_OPTION_WS_ALIGNED_LEN   4
 Length of window scale option, aligned.
 
#define TCP_OPTION_TS_ALIGNED_LEN   12
 Length of timestamp option, aligned.
 
#define TCP_OPTION_TS_FAST
 
#define TCP_OPTION_WS_FAST
 
#define TCP_OPTION_MSS_FAST   ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16))
 
#define TCP_OPTION_RCVD_MSS   0x01
 
#define TCP_OPTION_RCVD_WS   0x02
 
#define TCP_OPTION_RCVD_TS   0x04
 
#define TCP_OPTION_MAX_WS   14
 Maximum window scale value.
 
#define TCP_OPTION_MAX_WIN   0xffff
 Max window size in TCP header.
 

Typedefs

typedef struct _TCP_OPTION TCP_OPTION
 

Functions

UINT8 TcpComputeScale (IN TCP_CB *Tcb)
 
UINT16 TcpSynBuildOption (IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
 
UINT16 TcpBuildOption (IN TCP_CB *Tcb, IN NET_BUF *Nbuf)
 
INTN TcpParseOption (IN TCP_HEAD *Tcp, IN OUT TCP_OPTION *Option)
 

Detailed Description

Tcp option's routine header file.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TcpOption.h.

Macro Definition Documentation

◆ TCP_OPTION_EOP

#define TCP_OPTION_EOP   0

End Of oPtion.

Definition at line 16 of file TcpOption.h.

◆ TCP_OPTION_MAX_WIN

#define TCP_OPTION_MAX_WIN   0xffff

Max window size in TCP header.

Definition at line 49 of file TcpOption.h.

◆ TCP_OPTION_MAX_WS

#define TCP_OPTION_MAX_WS   14

Maximum window scale value.

Definition at line 48 of file TcpOption.h.

◆ TCP_OPTION_MSS

#define TCP_OPTION_MSS   2

Maximum Segment Size.

Definition at line 18 of file TcpOption.h.

◆ TCP_OPTION_MSS_FAST

#define TCP_OPTION_MSS_FAST   ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16))

Definition at line 40 of file TcpOption.h.

◆ TCP_OPTION_MSS_LEN

#define TCP_OPTION_MSS_LEN   4

Length of MSS option.

Definition at line 21 of file TcpOption.h.

◆ TCP_OPTION_NOP

#define TCP_OPTION_NOP   1

No-Option.

Definition at line 17 of file TcpOption.h.

◆ TCP_OPTION_RCVD_MSS

#define TCP_OPTION_RCVD_MSS   0x01

Definition at line 45 of file TcpOption.h.

◆ TCP_OPTION_RCVD_TS

#define TCP_OPTION_RCVD_TS   0x04

Definition at line 47 of file TcpOption.h.

◆ TCP_OPTION_RCVD_WS

#define TCP_OPTION_RCVD_WS   0x02

Definition at line 46 of file TcpOption.h.

◆ TCP_OPTION_TS

#define TCP_OPTION_TS   8

Timestamp.

Definition at line 20 of file TcpOption.h.

◆ TCP_OPTION_TS_ALIGNED_LEN

#define TCP_OPTION_TS_ALIGNED_LEN   12

Length of timestamp option, aligned.

Definition at line 25 of file TcpOption.h.

◆ TCP_OPTION_TS_FAST

#define TCP_OPTION_TS_FAST
Value:
((TCP_OPTION_NOP << 24) |\
(TCP_OPTION_NOP << 16) | \
(TCP_OPTION_TS << 8) | \
#define TCP_OPTION_TS_LEN
Length of timestamp option.
Definition: TcpOption.h:23
#define TCP_OPTION_TS
Timestamp.
Definition: TcpOption.h:20
#define TCP_OPTION_NOP
No-Option.
Definition: TcpOption.h:17

Definition at line 31 of file TcpOption.h.

◆ TCP_OPTION_TS_LEN

#define TCP_OPTION_TS_LEN   10

Length of timestamp option.

Definition at line 23 of file TcpOption.h.

◆ TCP_OPTION_WS

#define TCP_OPTION_WS   3

Window scale.

Definition at line 19 of file TcpOption.h.

◆ TCP_OPTION_WS_ALIGNED_LEN

#define TCP_OPTION_WS_ALIGNED_LEN   4

Length of window scale option, aligned.

Definition at line 24 of file TcpOption.h.

◆ TCP_OPTION_WS_FAST

#define TCP_OPTION_WS_FAST
Value:
((TCP_OPTION_NOP << 24) | \
(TCP_OPTION_WS << 16) | \
#define TCP_OPTION_WS_LEN
Length of window scale option.
Definition: TcpOption.h:22
#define TCP_OPTION_WS
Window scale.
Definition: TcpOption.h:19

Definition at line 36 of file TcpOption.h.

◆ TCP_OPTION_WS_LEN

#define TCP_OPTION_WS_LEN   3

Length of window scale option.

Definition at line 22 of file TcpOption.h.

Typedef Documentation

◆ TCP_OPTION

typedef struct _TCP_OPTION TCP_OPTION

The structure to store the parse option value. ParseOption only parses the options, doesn't process them.

Function Documentation

◆ TcpBuildOption()

UINT16 TcpBuildOption ( IN TCP_CB Tcb,
IN NET_BUF Nbuf 
)

Build the TCP option in synchronized states.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the buffer to store the options.
Returns
The total length of the TCP option field.

Definition at line 185 of file TcpOption.c.

◆ TcpComputeScale()

UINT8 TcpComputeScale ( IN TCP_CB Tcb)

Compute the window scale value according to the given buffer size.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
Returns
The scale value.

Definition at line 76 of file TcpOption.c.

◆ TcpParseOption()

INTN TcpParseOption ( IN TCP_HEAD Tcp,
IN OUT TCP_OPTION Option 
)

Parse the supported options.

Parameters
[in]TcpPointer to the TCP_CB of this TCP instance.
[in,out]OptionPointer to the TCP_OPTION used to store the successfully pasrsed options.
Return values
0The options successfully pasrsed.
-1Illegal option was found.

Parse the supported options.

Parameters
[in]TcpPointer to the TCP_CB of this TCP instance.
[in,out]OptionPointer to the TCP_OPTION used to store the successfully pasrsed options.
Return values
0The options are successfully pasrsed.
-1Illegal option was found.

Definition at line 232 of file TcpOption.c.

◆ TcpSynBuildOption()

UINT16 TcpSynBuildOption ( IN TCP_CB Tcb,
IN NET_BUF Nbuf 
)

Build the TCP option in three-way handshake.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the buffer to store the options.
Returns
The total length of the TCP option field.

Definition at line 105 of file TcpOption.c.