]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
2 | \r | |
dfc1f033 | 3 | Copyright (c) 2005 - 2006, Intel Corporation<BR>\r |
83cbd279 | 4 | All rights reserved. This program and the accompanying materials\r |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
dfc1f033 | 7 | http://opensource.org/licenses/bsd-license.php<BR>\r |
83cbd279 | 8 | \r |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT 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 | 39 | VOID\r |
40 | SockFreeFoo (\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 | 55 | EFI_STATUS\r |
56 | SockProcessTcpSndData (\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 | 70 | VOID\r |
71 | SockSetTcpRxData (\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 | 87 | UINT32\r |
88 | SockProcessRcvToken (\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 | 99 | VOID\r |
100 | SockConnFlush (\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 | 112 | SOCKET *\r |
83cbd279 | 113 | SockCreate (\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 | 123 | VOID\r |
124 | SockDestroy (\r | |
77f00155 | 125 | IN OUT SOCKET *Sock\r |
83cbd279 | 126 | );\r |
127 | \r | |
128 | #endif\r |