NetworkPkg/TcpDxe/TcpOption.h File Reference


Data Structures

struct  _TCP_OPTION

Defines

#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
 Maxium 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)
UINT32 TcpPawsOK (IN TCP_CB *Tcb, IN UINT32 TSVal)

Detailed Description

Tcp option's routine header file.

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

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define TCP_OPTION_EOP   0

End Of oPtion.

Referenced by TcpParseOption().

#define TCP_OPTION_MAX_WIN   0xffff

Max window size in TCP header.

Referenced by TcpComputeScale().

#define TCP_OPTION_MAX_WS   14

Maxium window scale value.

Referenced by TcpComputeScale().

#define TCP_OPTION_MSS   2

Maximum Segment Size.

Referenced by TcpParseOption().

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

Referenced by TcpSynBuildOption().

#define TCP_OPTION_MSS_LEN   4

Length of MSS option.

Referenced by TcpParseOption(), and TcpSynBuildOption().

#define TCP_OPTION_NOP   1

No-Option.

Referenced by TcpParseOption().

#define TCP_OPTION_RCVD_MSS   0x01

Referenced by TcpInitTcbPeer(), and TcpParseOption().

#define TCP_OPTION_RCVD_TS   0x04

#define TCP_OPTION_RCVD_WS   0x02

Referenced by TcpInitTcbPeer(), and TcpParseOption().

#define TCP_OPTION_TS   8

Timestamp.

Referenced by TcpParseOption().

#define TCP_OPTION_TS_ALIGNED_LEN   12

Length of timestamp option, aligned.

Referenced by TcpBuildOption(), TcpInitTcbPeer(), TcpParseOption(), and TcpSynBuildOption().

#define TCP_OPTION_TS_FAST

Value:

((TCP_OPTION_NOP << 24) | \
                            (TCP_OPTION_NOP << 16) | \
                            (TCP_OPTION_TS << 8)   | \
                            (TCP_OPTION_TS_LEN))

Referenced by TcpBuildOption(), TcpParseOption(), and TcpSynBuildOption().

#define TCP_OPTION_TS_LEN   10

Length of timestamp option.

Referenced by TcpParseOption().

#define TCP_OPTION_WS   3

Window scale.

Referenced by TcpParseOption().

#define TCP_OPTION_WS_ALIGNED_LEN   4

Length of window scale option, aligned.

Referenced by TcpSynBuildOption().

#define TCP_OPTION_WS_FAST

Value:

((TCP_OPTION_NOP << 24) | \
                              (TCP_OPTION_WS << 16)  | \
                              (TCP_OPTION_WS_LEN << 8))

Referenced by TcpSynBuildOption().

#define TCP_OPTION_WS_LEN   3

Length of window scale option.

Referenced by TcpParseOption().


Typedef Documentation

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

UINT16 TcpBuildOption ( IN TCP_CB Tcb,
IN NET_BUF *  Nbuf 
)

Build the TCP option in synchronized states.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the buffer to store the options.
Returns:
The total length of the TCP option field.

References mTcpTick, TCP_CTRL_SND_TS, TCP_FLG_ON, TCP_FLG_RST, TCP_OPTION_TS_ALIGNED_LEN, TCP_OPTION_TS_FAST, TcpPutUint32(), and TCPSEG_NETBUF.

Referenced by TcpTransmitSegment().

UINT8 TcpComputeScale ( IN TCP_CB Tcb  ) 

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

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

References GET_RCV_BUFFSIZE, TCP_OPTION_MAX_WIN, and TCP_OPTION_MAX_WS.

Referenced by TcpInitTcbPeer(), and TcpSynBuildOption().

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

Parse the supported options.

Parameters:
[in] Tcp Pointer to the TCP_CB of this TCP instance.
[in,out] Option Pointer to the TCP_OPTION used to store the successfully pasrsed options.
Return values:
0 The options successfully pasrsed.
-1 Ilegal option was found.
Parse the supported options.

Parameters:
[in] Tcp Pointer to the TCP_CB of this TCP instance.
[in,out] Option Pointer to the TCP_OPTION used to store the successfully pasrsed options.
Return values:
0 The options are successfully pasrsed.
-1 Ilegal option was found.

References TCP_OPTION_EOP, TCP_OPTION_MSS, TCP_OPTION_MSS_LEN, TCP_OPTION_NOP, TCP_OPTION_RCVD_MSS, TCP_OPTION_RCVD_TS, TCP_OPTION_RCVD_WS, TCP_OPTION_TS, TCP_OPTION_TS_ALIGNED_LEN, TCP_OPTION_TS_FAST, TCP_OPTION_TS_LEN, TCP_OPTION_WS, TCP_OPTION_WS_LEN, TCP_SET_FLG, TcpGetUint16(), and TcpGetUint32().

Referenced by TcpInput().

UINT32 TcpPawsOK ( IN TCP_CB Tcb,
IN UINT32  TSVal 
)

Check the segment against PAWS.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] TSVal The timestamp value.
Return values:
1 The segment passed the PAWS check.
0 The segment failed to pass the PAWS check.

References mTcpTick, TCP_PAWS_24DAY, and TCP_TIME_LT.

UINT16 TcpSynBuildOption ( IN TCP_CB Tcb,
IN NET_BUF *  Nbuf 
)

Build the TCP option in three-way handshake.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the buffer to store the options.
Returns:
The total length of the TCP option field.

References mTcpTick, TCP_CTRL_NO_TS, TCP_CTRL_NO_WS, TCP_CTRL_RCVD_TS, TCP_CTRL_RCVD_WS, TCP_FLG_ACK, TCP_FLG_ON, TCP_OPTION_MSS_FAST, TCP_OPTION_MSS_LEN, TCP_OPTION_TS_ALIGNED_LEN, TCP_OPTION_TS_FAST, TCP_OPTION_WS_ALIGNED_LEN, TCP_OPTION_WS_FAST, TcpComputeScale(), TcpPutUint32(), and TCPSEG_NETBUF.

Referenced by TcpTransmitSegment().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1