]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/TcpDxe/SockImpl.h
Fix a bug about the iSCSI DHCP dependency issue.
[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
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
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
20\r
21/**\r
22 Signal a event with the given status.\r
23\r
24 @param[in] Token The token's event is to be signaled.\r
25 @param[in] TokenStatus The status to be sent with the event.\r
26\r
27**/\r
28#define SIGNAL_TOKEN(Token, TokenStatus) \\r
29 do { \\r
30 (Token)->Status = (TokenStatus); \\r
31 gBS->SignalEvent ((Token)->Event); \\r
32 } while (0)\r
33\r
34#define SOCK_HEADER_SPACE (60 + 60 + 72)\r
35\r
36/**\r
37 Process the TCP send data, buffer the tcp txdata and append\r
38 the buffer to socket send buffer, then try to send it.\r
39\r
40 @param[in] Sock Pointer to the socket.\r
41 @param[in] TcpTxData Pointer to the application provided send buffer.\r
42\r
43 @retval EFI_SUCCESS The operation completed successfully.\r
44 @retval EFI_OUT_OF_RESOURCES Failed due to resource limits.\r
45\r
46**/\r
47EFI_STATUS\r
48SockProcessTcpSndData (\r
49 IN SOCKET *Sock,\r
50 IN VOID *TcpTxData\r
51 );\r
52\r
53/**\r
54 Get received data from the socket layer to the receive token.\r
55\r
56 @param[in, out] Sock Pointer to the socket.\r
57 @param[in, out] RcvToken Pointer to the application provided receive token.\r
58\r
59 @return The length of data received in this token.\r
60\r
61**/\r
62UINT32\r
63SockProcessRcvToken (\r
64 IN OUT SOCKET *Sock,\r
65 IN OUT SOCK_IO_TOKEN *RcvToken\r
66 );\r
67\r
68/**\r
69 Flush the sndBuffer and rcvBuffer of socket.\r
70\r
71 @param[in, out] Sock Pointer to the socket.\r
72\r
73**/\r
74VOID\r
75SockConnFlush (\r
76 IN OUT SOCKET *Sock\r
77 );\r
78\r
79/**\r
80 Create a socket with initial data SockInitData.\r
81\r
82 @param[in] SockInitData Pointer to the initial data of the socket.\r
83\r
84 @return Pointer to the newly created socket, return NULL when exception occured.\r
85\r
86**/\r
87SOCKET *\r
88SockCreate (\r
89 IN SOCK_INIT_DATA *SockInitData\r
90 );\r
91\r
92/**\r
93 Destroy a socket.\r
94\r
95 @param[in, out] Sock Pointer to the socket.\r
96\r
97**/\r
98VOID\r
99SockDestroy (\r
100 IN OUT SOCKET *Sock\r
101 );\r
102\r
103#endif\r