3 Copyright (c) 2005 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #ifndef _TCP4_OPTION_H_
22 #define _TCP4_OPTION_H_
25 // The structure to store the parse option value.
26 // ParseOption only parse the options, don't process them.
28 typedef struct s_TCP_OPTION
{
29 UINT8 Flag
; // flag such as TCP_OPTION_RCVD_MSS
30 UINT8 WndScale
; // the WndScale received
31 UINT16 Mss
; // the Mss received
32 UINT32 TSVal
; // the TSVal field in a timestamp option
33 UINT32 TSEcr
; // the TSEcr field in a timestamp option
39 // supported TCP option type and their length
41 TCP_OPTION_EOP
= 0, // End Of oPtion
42 TCP_OPTION_NOP
= 1, // No-Option.
43 TCP_OPTION_MSS
= 2, // Maximum Segment Size
44 TCP_OPTION_WS
= 3, // Window scale
45 TCP_OPTION_TS
= 8, // Timestamp
46 TCP_OPTION_MSS_LEN
= 4, // length of MSS option
47 TCP_OPTION_WS_LEN
= 3, // length of window scale option
48 TCP_OPTION_TS_LEN
= 10, // length of timestamp option
49 TCP_OPTION_WS_ALIGNED_LEN
= 4, // length of window scale option, aligned
50 TCP_OPTION_TS_ALIGNED_LEN
= 12, // length of timestamp option, aligned
53 // recommend format of timestamp window scale
54 // option for fast process.
56 TCP_OPTION_TS_FAST
= ((TCP_OPTION_NOP
<< 24) |
57 (TCP_OPTION_NOP
<< 16) |
58 (TCP_OPTION_TS
<< 8) |
61 TCP_OPTION_WS_FAST
= ((TCP_OPTION_NOP
<< 24) |
62 (TCP_OPTION_WS
<< 16) |
63 (TCP_OPTION_WS_LEN
<< 8)),
65 TCP_OPTION_MSS_FAST
= ((TCP_OPTION_MSS
<< 24) |
66 (TCP_OPTION_MSS_LEN
<< 16)),
69 // Other misc definations
71 TCP_OPTION_MAX_WS
= 14, // Maxium window scale value
72 TCP_OPTION_MAX_WIN
= 0xffff, // max window size in TCP header
73 TCP_OPTION_RCVD_MSS
= 0x01,
74 TCP_OPTION_RCVD_WS
= 0x02,
75 TCP_OPTION_RCVD_TS
= 0x04,