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