]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
MdeModulePkg/Universal: Fix typos in comments
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / SockImpl.h
... / ...
CommitLineData
1/** @file\r
2 Socket implementation header file.\r
3\r
4Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php<BR>\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _SOCK_IMPL_H_\r
16#define _SOCK_IMPL_H_\r
17\r
18#include "Socket.h"\r
19\r
20/**\r
21 Signal a event with the given status.\r
22 \r
23 @param Token The token's event is to be signaled.\r
24 @param TokenStatus The status to be sent with the event.\r
25 \r
26**/\r
27#define SIGNAL_TOKEN(Token, TokenStatus) \\r
28 do { \\r
29 (Token)->Status = (TokenStatus); \\r
30 gBS->SignalEvent ((Token)->Event); \\r
31 } while (0)\r
32\r
33\r
34/**\r
35 Supporting function for both SockImpl and SockInterface.\r
36\r
37 @param Event The Event this notify function registered to, ignored.\r
38 \r
39**/\r
40VOID\r
41EFIAPI\r
42SockFreeFoo (\r
43 IN EFI_EVENT Event\r
44 );\r
45\r
46/**\r
47 Process the TCP send data, buffer the tcp txdata and append\r
48 the buffer to socket send buffer,then try to send it.\r
49\r
50 @param Sock Pointer to the socket.\r
51 @param TcpTxData Pointer to the tcp txdata.\r
52\r
53 @retval EFI_SUCCESS The operation is completed successfully.\r
54 @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r
55\r
56**/\r
57EFI_STATUS\r
58SockProcessTcpSndData (\r
59 IN SOCKET *Sock,\r
60 IN VOID *TcpTxData\r
61 );\r
62\r
63/**\r
64 Copy data from socket buffer to application provided receive buffer.\r
65\r
66 @param Sock Pointer to the socket.\r
67 @param TcpRxData Pointer to the application provided receive buffer.\r
68 @param RcvdBytes The maximum length of the data can be copied.\r
69 @param IsOOB If TRUE the data is OOB, else the data is normal.\r
70\r
71**/\r
72VOID\r
73SockSetTcpRxData (\r
74 IN SOCKET *Sock,\r
75 IN VOID *TcpRxData,\r
76 IN UINT32 RcvdBytes,\r
77 IN BOOLEAN IsOOB\r
78 );\r
79\r
80/**\r
81 Get received data from the socket layer to the receive token.\r
82\r
83 @param Sock Pointer to the socket.\r
84 @param RcvToken Pointer to the application provided receive token.\r
85\r
86 @return The length of data received in this token.\r
87\r
88**/\r
89UINT32\r
90SockProcessRcvToken (\r
91 IN SOCKET *Sock,\r
92 IN OUT SOCK_IO_TOKEN *RcvToken\r
93 );\r
94\r
95/**\r
96 Flush the socket.\r
97\r
98 @param Sock Pointer to the socket.\r
99\r
100**/\r
101VOID\r
102SockConnFlush (\r
103 IN OUT SOCKET *Sock\r
104 );\r
105\r
106/**\r
107 Create a socket with initial data SockInitData.\r
108\r
109 @param SockInitData Pointer to the initial data of the socket.\r
110\r
111 @return Pointer to the newly created socket.\r
112\r
113**/\r
114SOCKET *\r
115SockCreate (\r
116 IN SOCK_INIT_DATA *SockInitData\r
117 );\r
118\r
119/**\r
120 Destroy a socket.\r
121\r
122 @param Sock Pointer to the socket.\r
123\r
124**/\r
125VOID\r
126SockDestroy (\r
127 IN OUT SOCKET *Sock\r
128 );\r
129\r
130#endif\r