Tcp4Option.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/** @file
Tcp option's routine header file.
Copyright (c) 2005 - 2009, 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 _TCP4_OPTION_H_
#define _TCP4_OPTION_H_
///
/// The structure to store the parse option value.
/// ParseOption only parse the options, don't process them.
///
typedef struct _TCP_OPTION {
} TCP_OPTION;
//
// supported TCP option type 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
/**
Compute the window scale value according to the given buffer size.
@param Tcb Pointer to the TCP_CB of this TCP instance.
@return The scale value.
**/
);
/**
Build the TCP option in three-way handshake.
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param 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 Tcb Pointer to the TCP_CB of this TCP instance.
@param Nbuf Pointer to the buffer to store the options.
@return The total length of the TCP option field.
**/
);
/**
Parse the supported options.
@param Tcp Pointer to the TCP_CB of this TCP instance.
@param Option Pointer to the TCP_OPTION used to store the successfully pasrsed
options.
@retval 0 The options are successfully pasrsed.
@retval -1 Ilegal option was found.
**/
);
/**
Check the segment against PAWS.
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param TSVal The timestamp value.
@retval 1 The segment passed the PAWS check.
@retval 0 The segment failed to pass the PAWS check.
**/
);
#endif