]>
Commit | Line | Data |
---|---|---|
83cbd279 | 1 | /** @file\r |
dab714aa | 2 | Socket implementation header file.\r |
83cbd279 | 3 | \r |
dfc1f033 | 4 | Copyright (c) 2005 - 2006, Intel Corporation<BR>\r |
83cbd279 | 5 | All rights reserved. This program and the accompanying materials\r |
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 |
41 | SockFreeFoo (\r | |
42 | IN EFI_EVENT Event\r | |
43 | );\r | |
44 | \r | |
dfc1f033 | 45 | /**\r |
46 | Process the TCP send data, buffer the tcp txdata and append\r | |
47 | the buffer to socket send buffer,then try to send it.\r | |
48 | \r | |
49 | @param Sock Pointer to the socket.\r | |
50 | @param TcpTxData Pointer to the tcp txdata.\r | |
51 | \r | |
52 | @retval EFI_SUCCESS The operation is completed successfully.\r | |
53 | @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r | |
54 | \r | |
55 | **/\r | |
83cbd279 | 56 | EFI_STATUS\r |
57 | SockProcessTcpSndData (\r | |
dfc1f033 | 58 | IN SOCKET *Sock,\r |
59 | IN VOID *TcpTxData\r | |
83cbd279 | 60 | );\r |
61 | \r | |
dfc1f033 | 62 | /**\r |
63 | Copy data from socket buffer to application provided receive buffer.\r | |
64 | \r | |
65 | @param Sock Pointer to the socket.\r | |
66 | @param TcpRxData Pointer to the application provided receive buffer.\r | |
67 | @param RcvdBytes The maximum length of the data can be copied.\r | |
68 | @param IsOOB If TURE the data is OOB, else the data is normal.\r | |
69 | \r | |
70 | **/\r | |
83cbd279 | 71 | VOID\r |
72 | SockSetTcpRxData (\r | |
dfc1f033 | 73 | IN SOCKET *Sock,\r |
74 | IN VOID *TcpRxData,\r | |
75 | IN UINT32 RcvdBytes,\r | |
76 | IN BOOLEAN IsOOB\r | |
83cbd279 | 77 | );\r |
78 | \r | |
dfc1f033 | 79 | /**\r |
80 | Get received data from the socket layer to the receive token.\r | |
81 | \r | |
82 | @param Sock Pointer to the socket.\r | |
83 | @param RcvToken Pointer to the application provided receive token.\r | |
84 | \r | |
85 | @return The length of data received in this token.\r | |
86 | \r | |
87 | **/\r | |
83cbd279 | 88 | UINT32\r |
89 | SockProcessRcvToken (\r | |
77f00155 | 90 | IN SOCKET *Sock,\r |
91 | IN OUT SOCK_IO_TOKEN *RcvToken\r | |
83cbd279 | 92 | );\r |
93 | \r | |
dfc1f033 | 94 | /**\r |
95 | Flush the socket.\r | |
96 | \r | |
97 | @param Sock Pointer to the socket.\r | |
98 | \r | |
99 | **/\r | |
83cbd279 | 100 | VOID\r |
101 | SockConnFlush (\r | |
77f00155 | 102 | IN OUT SOCKET *Sock\r |
83cbd279 | 103 | );\r |
104 | \r | |
dfc1f033 | 105 | /**\r |
106 | Create a socket with initial data SockInitData.\r | |
107 | \r | |
108 | @param SockInitData Pointer to the initial data of the socket.\r | |
109 | \r | |
110 | @return Pointer to the newly created socket.\r | |
111 | \r | |
112 | **/\r | |
120db52c | 113 | SOCKET *\r |
83cbd279 | 114 | SockCreate (\r |
115 | IN SOCK_INIT_DATA *SockInitData\r | |
116 | );\r | |
117 | \r | |
dfc1f033 | 118 | /**\r |
119 | Destroy a socket.\r | |
120 | \r | |
121 | @param Sock Pointer to the socket.\r | |
122 | \r | |
123 | **/\r | |
83cbd279 | 124 | VOID\r |
125 | SockDestroy (\r | |
77f00155 | 126 | IN OUT SOCKET *Sock\r |
83cbd279 | 127 | );\r |
128 | \r | |
129 | #endif\r |