TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpOption.c File Reference
#include "TcpMain.h"

Go to the source code of this file.

Functions

UINT16 TcpGetUint16 (IN UINT8 *Buf)
 
UINT32 TcpGetUint32 (IN UINT8 *Buf)
 
VOID TcpPutUint32 (OUT UINT8 *Buf, IN UINT32 Data)
 
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

Routines to process TCP option.

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

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

Definition in file TcpOption.c.

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.

◆ TcpGetUint16()

UINT16 TcpGetUint16 ( IN UINT8 *  Buf)

Get a UINT16 value from buffer.

Parameters
[in]BufPointer to input buffer.
Returns
The UINT16 value obtained from the buffer.

Definition at line 21 of file TcpOption.c.

◆ TcpGetUint32()

UINT32 TcpGetUint32 ( IN UINT8 *  Buf)

Get a UINT32 value from buffer.

Parameters
[in]BufPointer to input buffer.
Returns
The UINT32 value obtained from the buffer.

Definition at line 40 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 are successfully pasrsed.
-1Illegal option was found.

Definition at line 232 of file TcpOption.c.

◆ TcpPutUint32()

VOID TcpPutUint32 ( OUT UINT8 *  Buf,
IN UINT32  Data 
)

Put a UINT32 value in buffer.

Parameters
[out]BufPointer to the buffer.
[in]DataThe UINT32 Date to put in the buffer.

Definition at line 58 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.