TcpOption.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Tcp option's routine header file.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _TCP_OPTION_H_
#define _TCP_OPTION_H_
//
// Supported TCP option types and their length.
//
#define TCP_OPTION_EOP 0 ///< End Of oPtion
//
// recommend format of timestamp window scale
// option for fast process.
//
(TCP_OPTION_NOP << 16) | \
(TCP_OPTION_TS << 8) | \
(TCP_OPTION_WS << 16) | \
(TCP_OPTION_WS_LEN << 8))
//
// Other misc definations
//
#define TCP_OPTION_RCVD_MSS 0x01
#define TCP_OPTION_RCVD_WS 0x02
#define TCP_OPTION_RCVD_TS 0x04
///
/// The structure to store the parse option value.
/// ParseOption only parses the options, doesn't process them.
///
typedef struct _TCP_OPTION {
} TCP_OPTION;
/**
Compute the window scale value according to the given buffer size.
@param[in] Tcb Pointer to the TCP_CB of this TCP instance.
@return The scale value.
**/
);
/**
Build the TCP option in three-way handshake.
@param[in] Tcb Pointer to the TCP_CB of this TCP instance.
@param[in] Nbuf Pointer to the buffer to store the options.
@return The total length of the TCP option field.
**/
);
/**
Build the TCP option in synchronized states.
@param[in] Tcb Pointer to the TCP_CB of this TCP instance.
@param[in] Nbuf Pointer to the buffer to store the options.
@return The total length of the TCP option field.
**/
);
/**
Parse the supported options.
@param[in] Tcp Pointer to the TCP_CB of this TCP instance.
@param[in, out] Option Pointer to the TCP_OPTION used to store the
successfully pasrsed options.
@retval 0 The options successfully pasrsed.
@retval -1 Ilegal option was found.
**/
);
/**
Check the segment against PAWS.
@param[in] Tcb Pointer to the TCP_CB of this TCP instance.
@param[in] TSVal The timestamp value.
@retval 1 The segment passed the PAWS check.
@retval 0 The segment failed to pass the PAWS check.
**/
);
#endif