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