]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/TcpDxe/SockImpl.h
NetworkPkg: Add wnd scale check before shrinking window.
[mirror_edk2.git] / NetworkPkg / TcpDxe / SockImpl.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 The function declaration that provided for Socket Interface.\r
3\r
d555699b 4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
a3bcde70
HT
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php.\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _SOCK_IMPL_H_\r
17#define _SOCK_IMPL_H_\r
18\r
19#include "Socket.h"\r
d555699b 20#include "TcpMain.h"\r
a3bcde70
HT
21\r
22/**\r
23 Signal a event with the given status.\r
24\r
25 @param[in] Token The token's event is to be signaled.\r
26 @param[in] TokenStatus The status to be sent with the event.\r
27\r
28**/\r
29#define SIGNAL_TOKEN(Token, TokenStatus) \\r
30 do { \\r
31 (Token)->Status = (TokenStatus); \\r
32 gBS->SignalEvent ((Token)->Event); \\r
33 } while (0)\r
34\r
35#define SOCK_HEADER_SPACE (60 + 60 + 72)\r
36\r
37/**\r
38 Process the TCP send data, buffer the tcp txdata and append\r
39 the buffer to socket send buffer, then try to send it.\r
40\r
41 @param[in] Sock Pointer to the socket.\r
42 @param[in] TcpTxData Pointer to the application provided send buffer.\r
43\r
44 @retval EFI_SUCCESS The operation completed successfully.\r
45 @retval EFI_OUT_OF_RESOURCES Failed due to resource limits.\r
46\r
47**/\r
48EFI_STATUS\r
49SockProcessTcpSndData (\r
50 IN SOCKET *Sock,\r
51 IN VOID *TcpTxData\r
52 );\r
53\r
54/**\r
55 Get received data from the socket layer to the receive token.\r
56\r
57 @param[in, out] Sock Pointer to the socket.\r
58 @param[in, out] RcvToken Pointer to the application provided receive token.\r
59\r
60 @return The length of data received in this token.\r
61\r
62**/\r
63UINT32\r
64SockProcessRcvToken (\r
65 IN OUT SOCKET *Sock,\r
66 IN OUT SOCK_IO_TOKEN *RcvToken\r
67 );\r
68\r
69/**\r
70 Flush the sndBuffer and rcvBuffer of socket.\r
71\r
72 @param[in, out] Sock Pointer to the socket.\r
73\r
74**/\r
75VOID\r
76SockConnFlush (\r
77 IN OUT SOCKET *Sock\r
78 );\r
79\r
5ffe214a
JW
80/**\r
81 Cancel the tokens in the specific token list.\r
82\r
83 @param[in] Token Pointer to the Token. If NULL, all tokens \r
84 in SpecifiedTokenList will be canceled. \r
85 @param[in, out] SpecifiedTokenList Pointer to the token list to be checked.\r
86 \r
87 @retval EFI_SUCCESS Cancel the tokens in the specific token listsuccessfully.\r
88 @retval EFI_NOT_FOUND The Token is not found in SpecifiedTokenList.\r
89 \r
90**/\r
91EFI_STATUS\r
92SockCancelToken (\r
93 IN SOCK_COMPLETION_TOKEN *Token,\r
94 IN OUT LIST_ENTRY *SpecifiedTokenList\r
95 );\r
96\r
a3bcde70
HT
97/**\r
98 Create a socket with initial data SockInitData.\r
99\r
100 @param[in] SockInitData Pointer to the initial data of the socket.\r
101\r
102 @return Pointer to the newly created socket, return NULL when exception occured.\r
103\r
104**/\r
105SOCKET *\r
106SockCreate (\r
107 IN SOCK_INIT_DATA *SockInitData\r
108 );\r
109\r
110/**\r
111 Destroy a socket.\r
112\r
113 @param[in, out] Sock Pointer to the socket.\r
114\r
115**/\r
116VOID\r
117SockDestroy (\r
118 IN OUT SOCKET *Sock\r
119 );\r
120\r
121#endif\r