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) |
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 TCP_OPTION_EOP 0 |
#define TCP_OPTION_MAX_WIN 0xffff |
#define TCP_OPTION_MAX_WS 14 |
#define TCP_OPTION_MSS 2 |
#define TCP_OPTION_MSS_FAST ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16)) |
Referenced by TcpSynBuildOption().
#define TCP_OPTION_MSS_LEN 4 |
#define TCP_OPTION_NOP 1 |
#define TCP_OPTION_RCVD_MSS 0x01 |
Referenced by TcpInitTcbPeer(), and TcpParseOption().
#define TCP_OPTION_RCVD_TS 0x04 |
Referenced by TcpInitTcbPeer(), TcpInput(), and TcpParseOption().
#define TCP_OPTION_RCVD_WS 0x02 |
Referenced by TcpInitTcbPeer(), and TcpParseOption().
#define TCP_OPTION_TS 8 |
#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 |
#define TCP_OPTION_WS 3 |
#define TCP_OPTION_WS_ALIGNED_LEN 4 |
#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 |
typedef struct _TCP_OPTION TCP_OPTION |
The structure to store the parse option value. ParseOption only parses the options, doesn't process them.
UINT16 TcpBuildOption | ( | IN TCP_CB * | Tcb, | |
IN NET_BUF * | Nbuf | |||
) |
Build the TCP option in synchronized states.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Nbuf | Pointer to the buffer to store the options. |
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.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
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.
[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. |
0 | The options successfully pasrsed. | |
-1 | Ilegal option was found. |
[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. |
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.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | TSVal | The timestamp value. |
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.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Nbuf | Pointer to the buffer to store the options. |
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().