]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
dab714aa | 2 | Socket implementation header file.\r |
83cbd279 | 3 | \r |
e5eed7d3 HT |
4 | Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
83cbd279 | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
dfc1f033 | 8 | http://opensource.org/licenses/bsd-license.php<BR>\r |
83cbd279 | 9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
83cbd279 | 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 | |
dfc1f033 | 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 | |
83cbd279 | 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 | |
83cbd279 | 33 | \r |
dfc1f033 | 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 | |
83cbd279 | 40 | VOID\r |
e798cd87 | 41 | EFIAPI\r |
83cbd279 | 42 | SockFreeFoo (\r |
43 | IN EFI_EVENT Event\r | |
44 | );\r | |
45 | \r | |
dfc1f033 | 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 | |
83cbd279 | 57 | EFI_STATUS\r |
58 | SockProcessTcpSndData (\r | |
dfc1f033 | 59 | IN SOCKET *Sock,\r |
60 | IN VOID *TcpTxData\r | |
83cbd279 | 61 | );\r |
62 | \r | |
dfc1f033 | 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 TURE the data is OOB, else the data is normal.\r | |
70 | \r | |
71 | **/\r | |
83cbd279 | 72 | VOID\r |
73 | SockSetTcpRxData (\r | |
dfc1f033 | 74 | IN SOCKET *Sock,\r |
75 | IN VOID *TcpRxData,\r | |
76 | IN UINT32 RcvdBytes,\r | |
77 | IN BOOLEAN IsOOB\r | |
83cbd279 | 78 | );\r |
79 | \r | |
dfc1f033 | 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 | |
83cbd279 | 89 | UINT32\r |
90 | SockProcessRcvToken (\r | |
77f00155 | 91 | IN SOCKET *Sock,\r |
92 | IN OUT SOCK_IO_TOKEN *RcvToken\r | |
83cbd279 | 93 | );\r |
94 | \r | |
dfc1f033 | 95 | /**\r |
96 | Flush the socket.\r | |
97 | \r | |
98 | @param Sock Pointer to the socket.\r | |
99 | \r | |
100 | **/\r | |
83cbd279 | 101 | VOID\r |
102 | SockConnFlush (\r | |
77f00155 | 103 | IN OUT SOCKET *Sock\r |
83cbd279 | 104 | );\r |
105 | \r | |
dfc1f033 | 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 | |
120db52c | 114 | SOCKET *\r |
83cbd279 | 115 | SockCreate (\r |
116 | IN SOCK_INIT_DATA *SockInitData\r | |
117 | );\r | |
118 | \r | |
dfc1f033 | 119 | /**\r |
120 | Destroy a socket.\r | |
121 | \r | |
122 | @param Sock Pointer to the socket.\r | |
123 | \r | |
124 | **/\r | |
83cbd279 | 125 | VOID\r |
126 | SockDestroy (\r | |
77f00155 | 127 | IN OUT SOCKET *Sock\r |
83cbd279 | 128 | );\r |
129 | \r | |
130 | #endif\r |