EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h

Go to the documentation of this file.
00001 
00015 #ifndef _TCP4_OPTION_H_
00016 #define _TCP4_OPTION_H_
00017 
00022 typedef struct _TCP_OPTION {
00023   UINT8   Flag;     
00024   UINT8   WndScale; 
00025   UINT16  Mss;      
00026   UINT32  TSVal;    
00027   UINT32  TSEcr;    
00028 } TCP_OPTION;
00029 
00030 //
00031 // supported TCP option type and their length
00032 //
00033 #define TCP_OPTION_EOP             0  ///< End Of oPtion
00034 #define TCP_OPTION_NOP             1  ///< No-Option.
00035 #define TCP_OPTION_MSS             2  ///< Maximum Segment Size
00036 #define TCP_OPTION_WS              3  ///< Window scale
00037 #define TCP_OPTION_TS              8  ///< Timestamp
00038 #define TCP_OPTION_MSS_LEN         4  ///< Length of MSS option
00039 #define TCP_OPTION_WS_LEN          3  ///< Length of window scale option
00040 #define TCP_OPTION_TS_LEN          10 ///< Length of timestamp option
00041 #define TCP_OPTION_WS_ALIGNED_LEN  4  ///< Length of window scale option, aligned
00042 #define TCP_OPTION_TS_ALIGNED_LEN  12 ///< Length of timestamp option, aligned
00043 
00044 //
00045 // recommend format of timestamp window scale
00046 // option for fast process.
00047 //
00048 #define TCP_OPTION_TS_FAST ((TCP_OPTION_NOP << 24) | \
00049                             (TCP_OPTION_NOP << 16) | \
00050                             (TCP_OPTION_TS << 8)   | \
00051                             (TCP_OPTION_TS_LEN))
00052 
00053 #define TCP_OPTION_WS_FAST   ((TCP_OPTION_NOP << 24) | \
00054                               (TCP_OPTION_WS << 16)  | \
00055                               (TCP_OPTION_WS_LEN << 8))
00056 
00057 #define TCP_OPTION_MSS_FAST  ((TCP_OPTION_MSS << 24) | (TCP_OPTION_MSS_LEN << 16))
00058 
00059 //
00060 // Other misc definations
00061 //
00062 #define TCP_OPTION_RCVD_MSS        0x01
00063 #define TCP_OPTION_RCVD_WS         0x02
00064 #define TCP_OPTION_RCVD_TS         0x04
00065 #define TCP_OPTION_MAX_WS          14      ///< Maxium window scale value
00066 #define TCP_OPTION_MAX_WIN         0xffff  ///< Max window size in TCP header
00067 
00068 
00077 UINT8
00078 TcpComputeScale (
00079   IN TCP_CB *Tcb
00080   );
00081 
00091 UINT16
00092 TcpSynBuildOption (
00093   IN TCP_CB  *Tcb,
00094   IN NET_BUF *Nbuf
00095   );
00096 
00106 UINT16
00107 TcpBuildOption (
00108   IN TCP_CB  *Tcb,
00109   IN NET_BUF *Nbuf
00110   );
00111 
00123 INTN
00124 TcpParseOption (
00125   IN     TCP_HEAD   *Tcp,
00126   IN OUT TCP_OPTION *Option
00127   );
00128 
00139 UINT32
00140 TcpPawsOK (
00141   IN TCP_CB *Tcb,
00142   IN UINT32 TSVal
00143   );
00144 
00145 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines