]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | This library is only intended to be used by UEFI network stack modules.\r | |
3 | It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 protocol.\r | |
4 | \r | |
5 | Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r | |
6 | All rights reserved. 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 _IP_IO_H_\r | |
17 | #define _IP_IO_H_\r | |
18 | \r | |
19 | #include <Protocol/Ip4.h>\r | |
20 | #include <Protocol/Ip6.h>\r | |
21 | \r | |
22 | #include <Library/NetLib.h>\r | |
23 | \r | |
24 | //\r | |
25 | // type and code define for ICMP protocol error \r | |
26 | // from IP\r | |
27 | //\r | |
28 | #define ICMP_TYPE_UNREACH 3\r | |
29 | #define ICMP_TYPE_TIMXCEED 11\r | |
30 | #define ICMP_TYPE_PARAMPROB 12\r | |
31 | #define ICMP_TYPE_SOURCEQUENCH 4\r | |
32 | \r | |
33 | #define ICMP_CODE_UNREACH_NET 0\r | |
34 | #define ICMP_CODE_UNREACH_HOST 1\r | |
35 | #define ICMP_CODE_UNREACH_PROTOCOL 2\r | |
36 | #define ICMP_CODE_UNREACH_PORT 3\r | |
37 | #define ICMP_CODE_UNREACH_NEEDFRAG 4\r | |
38 | #define ICMP_CODE_UNREACH_SRCFAIL 5\r | |
39 | #define ICMP_CODE_UNREACH_NET_UNKNOWN 6\r | |
40 | #define ICMP_CODE_UNREACH_HOST_UNKNOWN 7\r | |
41 | #define ICMP_CODE_UNREACH_ISOLATED 8\r | |
42 | #define ICMP_CODE_UNREACH_NET_PROHIB 9\r | |
43 | #define ICMP_CODE_UNREACH_HOST_PROHIB 10\r | |
44 | #define ICMP_CODE_UNREACH_TOSNET 11\r | |
45 | #define ICMP_CODE_UNREACH_TOSHOST 12\r | |
46 | \r | |
47 | /**\r | |
48 | Get the IP header length from the struct EFI_IP4_HEADER. HeaderLength is\r | |
49 | Internet header length in 32-bit words, so HeaderLength<<2 is the real\r | |
50 | length of IP header.\r | |
51 | \r | |
52 | @param[out] HdrPtr A pointer to EFI_IP4_HEADER\r | |
53 | \r | |
54 | @return The IP header length\r | |
55 | **/\r | |
56 | #define EFI_IP4_HEADER_LEN(HdrPtr) ((HdrPtr)->HeaderLength << 2)\r | |
57 | \r | |
58 | /**\r | |
59 | To types of ICMP error which consist of ICMP header, IP header and original \r | |
60 | datagram's data, get length from sum of ICMP header length, IP header length \r | |
61 | and first 64 bits of datagram's data length.\r | |
62 | \r | |
63 | @param[in] IpHdr A pointer to EFI_IP4_HEADER\r | |
64 | \r | |
65 | @return The ICMP error length\r | |
66 | **/\r | |
67 | #define ICMP_ERRLEN(IpHdr) \\r | |
68 | (sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)\r | |
69 | \r | |
70 | /**\r | |
71 | Get the packet header from NET_BUF.\r | |
72 | \r | |
73 | @param[out] Buf A pointer to NET_BUF\r | |
74 | @param[in] Type Header type\r | |
75 | \r | |
76 | @return The pointer to packet header\r | |
77 | **/\r | |
78 | #define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head))\r | |
79 | \r | |
80 | \r | |
81 | extern EFI_IP4_CONFIG_DATA mIp4IoDefaultIpConfigData;\r | |
82 | extern EFI_IP6_CONFIG_DATA mIp6IoDefaultIpConfigData;\r | |
83 | \r | |
84 | \r | |
85 | ///\r | |
86 | /// This error will be delivered to the\r | |
87 | /// listening transportation layer protocol\r | |
88 | /// that consumes IpIO.\r | |
89 | ///\r | |
90 | \r | |
91 | #define ICMP_ERR_UNREACH_NET 0\r | |
92 | #define ICMP_ERR_UNREACH_HOST 1\r | |
93 | #define ICMP_ERR_UNREACH_PROTOCOL 2\r | |
94 | #define ICMP_ERR_UNREACH_PORT 3\r | |
95 | #define ICMP_ERR_MSGSIZE 4\r | |
96 | #define ICMP_ERR_UNREACH_SRCFAIL 5\r | |
97 | #define ICMP_ERR_TIMXCEED_INTRANS 6\r | |
98 | #define ICMP_ERR_TIMXCEED_REASS 7\r | |
99 | #define ICMP_ERR_QUENCH 8\r | |
100 | #define ICMP_ERR_PARAMPROB 9\r | |
101 | \r | |
102 | #define ICMP6_ERR_UNREACH_NET 0\r | |
103 | #define ICMP6_ERR_UNREACH_HOST 1\r | |
104 | #define ICMP6_ERR_UNREACH_PROTOCOL 2\r | |
105 | #define ICMP6_ERR_UNREACH_PORT 3\r | |
106 | #define ICMP6_ERR_PACKAGE_TOOBIG 4\r | |
107 | #define ICMP6_ERR_TIMXCEED_HOPLIMIT 5\r | |
108 | #define ICMP6_ERR_TIMXCEED_REASS 6\r | |
109 | #define ICMP6_ERR_PARAMPROB_HEADER 7\r | |
110 | #define ICMP6_ERR_PARAMPROB_NEXHEADER 8\r | |
111 | #define ICMP6_ERR_PARAMPROB_IPV6OPTION 9\r | |
112 | \r | |
113 | ///\r | |
114 | /// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only.\r | |
115 | ///\r | |
116 | typedef struct {\r | |
117 | BOOLEAN IsHard;\r | |
118 | BOOLEAN Notify;\r | |
119 | } ICMP_ERROR_INFO;\r | |
120 | \r | |
121 | typedef union {\r | |
122 | EFI_IP4_COMPLETION_TOKEN Ip4Token;\r | |
123 | EFI_IP6_COMPLETION_TOKEN Ip6Token;\r | |
124 | } IP_IO_IP_COMPLETION_TOKEN;\r | |
125 | \r | |
126 | typedef union {\r | |
127 | EFI_IP4_TRANSMIT_DATA Ip4TxData;\r | |
128 | EFI_IP6_TRANSMIT_DATA Ip6TxData;\r | |
129 | } IP_IO_IP_TX_DATA;\r | |
130 | \r | |
131 | typedef union {\r | |
132 | EFI_IP4_RECEIVE_DATA Ip4RxData;\r | |
133 | EFI_IP6_RECEIVE_DATA Ip6RxData;\r | |
134 | } IP_IO_IP_RX_DATA;\r | |
135 | \r | |
136 | typedef union {\r | |
137 | EFI_IP4_OVERRIDE_DATA Ip4OverrideData;\r | |
138 | EFI_IP6_OVERRIDE_DATA Ip6OverrideData;\r | |
139 | } IP_IO_OVERRIDE;\r | |
140 | \r | |
141 | typedef union {\r | |
142 | EFI_IP4_CONFIG_DATA Ip4CfgData;\r | |
143 | EFI_IP6_CONFIG_DATA Ip6CfgData;\r | |
144 | } IP_IO_IP_CONFIG_DATA;\r | |
145 | \r | |
146 | typedef union {\r | |
147 | EFI_IP4_HEADER *Ip4Hdr;\r | |
148 | EFI_IP6_HEADER *Ip6Hdr;\r | |
149 | } IP_IO_IP_HEADER;\r | |
150 | \r | |
151 | typedef union {\r | |
152 | IP4_ADDR SubnetMask;\r | |
153 | UINT8 PrefixLength;\r | |
154 | } IP_IO_IP_MASK;\r | |
155 | \r | |
156 | ///\r | |
157 | /// The IP session for an IP receive packet.\r | |
158 | ///\r | |
159 | typedef struct _EFI_NET_SESSION_DATA {\r | |
160 | EFI_IP_ADDRESS Source; ///< Source IP of the received packet\r | |
161 | EFI_IP_ADDRESS Dest; ///< Destination IP of the received packet\r | |
162 | IP_IO_IP_HEADER IpHdr; ///< IP header of the received packet\r | |
163 | UINT32 IpHdrLen; ///< IP header length of the received packet. \r | |
164 | ///< For IPv6, it includes the IP6 header \r | |
165 | ///< length and extension header length. For\r | |
166 | ///< IPv4, it includes the IP4 header length\r | |
167 | ///< and options length.\r | |
168 | UINT8 IpVersion; ///< The IP version of the received packet\r | |
169 | } EFI_NET_SESSION_DATA;\r | |
170 | \r | |
171 | /**\r | |
172 | The prototype is called back when an IP packet is received.\r | |
173 | \r | |
174 | @param[in] Status Result of the receive request\r | |
175 | @param[in] IcmpErr Valid when Status is EFI_ICMP_ERROR\r | |
176 | @param[in] NetSession The IP session for the received packet\r | |
177 | @param[in] Pkt Packet received\r | |
178 | @param[in] Context The data provided by the user for the received packet when\r | |
179 | the callback is registered in IP_IO_OPEN_DATA::RcvdContext.\r | |
180 | \r | |
181 | **/\r | |
182 | typedef\r | |
183 | VOID\r | |
184 | (*PKT_RCVD_NOTIFY) (\r | |
185 | IN EFI_STATUS Status, \r | |
186 | IN UINT8 IcmpErr,\r | |
187 | IN EFI_NET_SESSION_DATA *NetSession,\r | |
188 | IN NET_BUF *Pkt,\r | |
189 | IN VOID *Context\r | |
190 | );\r | |
191 | \r | |
192 | /**\r | |
193 | The prototype is called back when an IP packet is sent.\r | |
194 | \r | |
195 | @param[in] Status Result of the sending\r | |
196 | @param[in] Context The data provided by user for the received packet when\r | |
197 | the callback is registered in IP_IO_OPEN_DATA::SndContext.\r | |
198 | @param[in] Sender A pointer to EFI_IP4_PROTOCOL or EFI_IP6_PROTOCOL\r | |
199 | @param[in] NotifyData Context data specified when calling IpIoSend()\r | |
200 | \r | |
201 | **/\r | |
202 | typedef\r | |
203 | VOID\r | |
204 | (*PKT_SENT_NOTIFY) (\r | |
205 | IN EFI_STATUS Status,\r | |
206 | IN VOID *Context,\r | |
207 | IN VOID *Sender,\r | |
208 | IN VOID *NotifyData\r | |
209 | );\r | |
210 | \r | |
211 | ///\r | |
212 | /// This data structure wraps Ip4/Ip6 instances. The IpIo Library uses it for all\r | |
213 | /// Ip4/Ip6 operations.\r | |
214 | ///\r | |
215 | typedef struct _IP_IO {\r | |
216 | ///\r | |
217 | /// The node used to link this IpIo to the active IpIo list.\r | |
218 | ///\r | |
219 | LIST_ENTRY Entry;\r | |
220 | \r | |
221 | ///\r | |
222 | /// The list used to maintain the IP instance for different sending purpose.\r | |
223 | ///\r | |
224 | LIST_ENTRY IpList;\r | |
225 | \r | |
226 | EFI_HANDLE Controller;\r | |
227 | EFI_HANDLE Image;\r | |
228 | EFI_HANDLE ChildHandle;\r | |
229 | //\r | |
230 | // The IP instance consumed by this IP_IO\r | |
231 | //\r | |
232 | VOID *Ip;\r | |
233 | BOOLEAN IsConfigured;\r | |
234 | \r | |
235 | ///\r | |
236 | /// Some ip config data can be changed\r | |
237 | ///\r | |
238 | UINT8 Protocol;\r | |
239 | \r | |
240 | ///\r | |
241 | /// Token and event used to get data from IP\r | |
242 | ///\r | |
243 | IP_IO_IP_COMPLETION_TOKEN RcvToken; \r | |
244 | \r | |
245 | ///\r | |
246 | /// List entry used to link the token passed to IP_IO\r | |
247 | ///\r | |
248 | LIST_ENTRY PendingSndList;\r | |
249 | \r | |
250 | //\r | |
251 | // User interface used to get notify from IP_IO\r | |
252 | //\r | |
253 | VOID *RcvdContext; ///< See IP_IO_OPEN_DATA::RcvdContext\r | |
254 | VOID *SndContext; ///< See IP_IO_OPEN_DATA::SndContext\r | |
255 | PKT_RCVD_NOTIFY PktRcvdNotify; ///< See IP_IO_OPEN_DATA::PktRcvdNotify\r | |
256 | PKT_SENT_NOTIFY PktSentNotify; ///< See IP_IO_OPEN_DATA::PktSentNotify\r | |
257 | UINT8 IpVersion;\r | |
258 | } IP_IO;\r | |
259 | \r | |
260 | ///\r | |
261 | /// The struct is for the user to pass IP configuration and callbacks to IP_IO.\r | |
262 | /// It is used by IpIoOpen().\r | |
263 | ///\r | |
264 | typedef struct _IP_IO_OPEN_DATA {\r | |
265 | IP_IO_IP_CONFIG_DATA IpConfigData; ///< Configuration of the IP instance\r | |
266 | VOID *RcvdContext; ///< Context data used by receive callback\r | |
267 | VOID *SndContext; ///< Context data used by send callback\r | |
268 | PKT_RCVD_NOTIFY PktRcvdNotify; ///< Receive callback\r | |
269 | PKT_SENT_NOTIFY PktSentNotify; ///< Send callback\r | |
270 | } IP_IO_OPEN_DATA;\r | |
271 | \r | |
272 | ///\r | |
273 | /// Internal struct book-keeping send request of IP_IO.\r | |
274 | ///\r | |
275 | /// An IP_IO_SEND_ENTRY will be created each time a send request is issued to\r | |
276 | /// IP_IO via IpIoSend().\r | |
277 | ///\r | |
278 | typedef struct _IP_IO_SEND_ENTRY {\r | |
279 | LIST_ENTRY Entry;\r | |
280 | IP_IO *IpIo;\r | |
281 | VOID *Context;\r | |
282 | VOID *NotifyData;\r | |
283 | VOID *Ip;\r | |
284 | NET_BUF *Pkt;\r | |
285 | IP_IO_IP_COMPLETION_TOKEN SndToken;\r | |
286 | } IP_IO_SEND_ENTRY;\r | |
287 | \r | |
288 | ///\r | |
289 | /// The IP_IO_IP_INFO is used in IpIoSend() to override the default IP instance\r | |
290 | /// in IP_IO.\r | |
291 | ///\r | |
292 | typedef struct _IP_IO_IP_INFO {\r | |
293 | EFI_IP_ADDRESS Addr;\r | |
294 | IP_IO_IP_MASK PreMask;\r | |
295 | LIST_ENTRY Entry;\r | |
296 | EFI_HANDLE ChildHandle;\r | |
297 | VOID *Ip;\r | |
298 | IP_IO_IP_COMPLETION_TOKEN DummyRcvToken;\r | |
299 | INTN RefCnt;\r | |
300 | UINT8 IpVersion;\r | |
301 | } IP_IO_IP_INFO;\r | |
302 | \r | |
303 | /**\r | |
304 | Create a new IP_IO instance.\r | |
305 | \r | |
306 | This function uses IP4/IP6 service binding protocol in Controller to create\r | |
307 | an IP4/IP6 child (aka IP4/IP6 instance).\r | |
308 | \r | |
309 | @param[in] Image The image handle of the driver or application that\r | |
310 | consumes IP_IO.\r | |
311 | @param[in] Controller The controller handle that has IP4 or IP6 service\r | |
312 | binding protocol installed.\r | |
313 | @param[in] IpVersion The version of the IP protocol to use, either\r | |
314 | IPv4 or IPv6. \r | |
315 | \r | |
316 | @return Pointer to a newly created IP_IO instance, or NULL if failed.\r | |
317 | \r | |
318 | **/\r | |
319 | IP_IO *\r | |
320 | EFIAPI\r | |
321 | IpIoCreate (\r | |
322 | IN EFI_HANDLE Image,\r | |
323 | IN EFI_HANDLE Controller,\r | |
324 | IN UINT8 IpVersion\r | |
325 | );\r | |
326 | \r | |
327 | /**\r | |
328 | Destroy an IP_IO instance.\r | |
329 | \r | |
330 | This function is paired with IpIoCreate(). The IP_IO will be closed first.\r | |
331 | Resource will be freed afterwards. See IpIoClose().\r | |
332 | \r | |
333 | @param[in, out] IpIo Pointer to the IP_IO instance that needs to be\r | |
334 | destroyed.\r | |
335 | \r | |
336 | @retval EFI_SUCCESS The IP_IO instance destroyed successfully.\r | |
337 | @retval Others Error condition occurred.\r | |
338 | \r | |
339 | **/\r | |
340 | EFI_STATUS\r | |
341 | EFIAPI\r | |
342 | IpIoDestroy (\r | |
343 | IN OUT IP_IO *IpIo\r | |
344 | );\r | |
345 | \r | |
346 | /**\r | |
347 | Stop an IP_IO instance.\r | |
348 | \r | |
349 | This function is paired with IpIoOpen(). The IP_IO will be unconfigured, and all\r | |
350 | pending send/receive tokens will be canceled.\r | |
351 | \r | |
352 | @param[in, out] IpIo Pointer to the IP_IO instance that needs to stop.\r | |
353 | \r | |
354 | @retval EFI_SUCCESS The IP_IO instance stopped successfully.\r | |
355 | @retval Others Error condition occurred.\r | |
356 | \r | |
357 | **/\r | |
358 | EFI_STATUS\r | |
359 | EFIAPI\r | |
360 | IpIoStop (\r | |
361 | IN OUT IP_IO *IpIo\r | |
362 | );\r | |
363 | \r | |
364 | /**\r | |
365 | Open an IP_IO instance for use.\r | |
366 | \r | |
367 | This function is called after IpIoCreate(). It is used for configuring the IP\r | |
368 | instance and register the callbacks and their context data for sending and\r | |
369 | receiving IP packets.\r | |
370 | \r | |
371 | @param[in, out] IpIo Pointer to an IP_IO instance that needs\r | |
372 | to open.\r | |
373 | @param[in] OpenData The configuration data and callbacks for\r | |
374 | the IP_IO instance.\r | |
375 | \r | |
376 | @retval EFI_SUCCESS The IP_IO instance opened with OpenData\r | |
377 | successfully.\r | |
378 | @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to \r | |
379 | reopen it.\r | |
380 | @retval Others Error condition occurred.\r | |
381 | \r | |
382 | **/\r | |
383 | EFI_STATUS\r | |
384 | EFIAPI\r | |
385 | IpIoOpen (\r | |
386 | IN OUT IP_IO *IpIo,\r | |
387 | IN IP_IO_OPEN_DATA *OpenData\r | |
388 | );\r | |
389 | \r | |
390 | /**\r | |
391 | Send out an IP packet.\r | |
392 | \r | |
393 | This function is called after IpIoOpen(). The data to be sent are wrapped in\r | |
394 | Pkt. The IP instance wrapped in IpIo is used for sending by default, but can be\r | |
395 | overriden by Sender. Other sending configurations, such as source address and gateway\r | |
396 | address, are specified in OverrideData.\r | |
397 | \r | |
398 | @param[in, out] IpIo Pointer to an IP_IO instance used for sending IP\r | |
399 | packet.\r | |
400 | @param[in, out] Pkt Pointer to the IP packet to be sent.\r | |
401 | @param[in] Sender Optional. The IP protocol instance used for sending.\r | |
402 | @param[in] Context Optional context data.\r | |
403 | @param[in] NotifyData Optional notify data.\r | |
404 | @param[in] Dest The destination IP address to send this packet to.\r | |
405 | @param[in] OverrideData The data to override some configuration of the IP\r | |
406 | instance used for sending.\r | |
407 | \r | |
408 | @retval EFI_SUCCESS The operation is completed successfully.\r | |
409 | @retval EFI_NOT_STARTED The IpIo is not configured.\r | |
410 | @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r | |
411 | \r | |
412 | **/\r | |
413 | EFI_STATUS\r | |
414 | EFIAPI\r | |
415 | IpIoSend (\r | |
416 | IN OUT IP_IO *IpIo,\r | |
417 | IN OUT NET_BUF *Pkt,\r | |
418 | IN IP_IO_IP_INFO *Sender OPTIONAL,\r | |
419 | IN VOID *Context OPTIONAL,\r | |
420 | IN VOID *NotifyData OPTIONAL,\r | |
421 | IN EFI_IP_ADDRESS *Dest,\r | |
422 | IN IP_IO_OVERRIDE *OverrideData OPTIONAL\r | |
423 | );\r | |
424 | \r | |
425 | /**\r | |
426 | Cancel the IP transmit token which wraps this Packet.\r | |
427 | \r | |
428 | @param[in] IpIo Pointer to the IP_IO instance.\r | |
429 | @param[in] Packet Pointer to the packet of NET_BUF to cancel.\r | |
430 | \r | |
431 | **/\r | |
432 | VOID\r | |
433 | EFIAPI\r | |
434 | IpIoCancelTxToken (\r | |
435 | IN IP_IO *IpIo,\r | |
436 | IN VOID *Packet\r | |
437 | );\r | |
438 | \r | |
439 | /**\r | |
440 | Add a new IP instance for sending data.\r | |
441 | \r | |
442 | The function is used to add the IP_IO to the IP_IO sending list. The caller\r | |
443 | can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send\r | |
444 | data.\r | |
445 | \r | |
446 | @param[in, out] IpIo Pointer to an IP_IO instance to add a new IP\r | |
447 | instance for sending purposes.\r | |
448 | \r | |
449 | @return Pointer to the created IP_IO_IP_INFO structure, NULL if failed.\r | |
450 | \r | |
451 | **/\r | |
452 | IP_IO_IP_INFO *\r | |
453 | EFIAPI\r | |
454 | IpIoAddIp (\r | |
455 | IN OUT IP_IO *IpIo\r | |
456 | );\r | |
457 | \r | |
458 | /**\r | |
459 | Configure the IP instance of this IpInfo and start the receiving if IpConfigData\r | |
460 | is not NULL.\r | |
461 | \r | |
462 | @param[in, out] IpInfo Pointer to the IP_IO_IP_INFO instance.\r | |
463 | @param[in, out] IpConfigData The IP4 or IP6 configure data used to configure \r | |
464 | the IP instance. If NULL, the IP instance is reset.\r | |
465 | If UseDefaultAddress is set to TRUE, and the configure\r | |
466 | operation succeeds, the default address information\r | |
467 | is written back in this IpConfigData.\r | |
468 | \r | |
469 | @retval EFI_SUCCESS The IP instance of this IpInfo is configured successfully,\r | |
470 | or there is no need to reconfigure it.\r | |
471 | @retval Others Configuration failed.\r | |
472 | \r | |
473 | **/\r | |
474 | EFI_STATUS\r | |
475 | EFIAPI\r | |
476 | IpIoConfigIp (\r | |
477 | IN OUT IP_IO_IP_INFO *IpInfo,\r | |
478 | IN OUT VOID *IpConfigData OPTIONAL\r | |
479 | );\r | |
480 | \r | |
481 | /**\r | |
482 | Destroy an IP instance maintained in IpIo->IpList for\r | |
483 | sending purpose.\r | |
484 | \r | |
485 | This function pairs with IpIoAddIp(). The IpInfo is previously created by\r | |
486 | IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance\r | |
487 | will be dstroyed if the RefCnt is zero.\r | |
488 | \r | |
489 | @param[in] IpIo Pointer to the IP_IO instance.\r | |
490 | @param[in] IpInfo Pointer to the IpInfo to be removed.\r | |
491 | \r | |
492 | **/\r | |
493 | VOID\r | |
494 | EFIAPI\r | |
495 | IpIoRemoveIp (\r | |
496 | IN IP_IO *IpIo,\r | |
497 | IN IP_IO_IP_INFO *IpInfo\r | |
498 | );\r | |
499 | \r | |
500 | /**\r | |
501 | Find the first IP protocol maintained in IpIo whose local\r | |
502 | address is the same as Src.\r | |
503 | \r | |
504 | This function is called when the caller needs the IpIo to send data to the\r | |
505 | specified Src. The IpIo was added previously by IpIoAddIp().\r | |
506 | \r | |
507 | @param[in, out] IpIo Pointer to the pointer of the IP_IO instance.\r | |
508 | @param[in] IpVersion The version of the IP protocol to use, either\r | |
509 | IPv4 or IPv6.\r | |
510 | @param[in] Src The local IP address.\r | |
511 | \r | |
512 | @return Pointer to the IP protocol can be used for sending purpose and its local\r | |
513 | address is the same with Src.\r | |
514 | \r | |
515 | **/\r | |
516 | IP_IO_IP_INFO *\r | |
517 | EFIAPI\r | |
518 | IpIoFindSender (\r | |
519 | IN OUT IP_IO **IpIo,\r | |
520 | IN UINT8 IpVersion,\r | |
521 | IN EFI_IP_ADDRESS *Src\r | |
522 | );\r | |
523 | \r | |
524 | /**\r | |
525 | Get the ICMP error map information.\r | |
526 | \r | |
527 | The ErrorStatus will be returned. The IsHard and Notify are optional. If they\r | |
528 | are not NULL, this routine will fill them.\r | |
529 | \r | |
530 | @param[in] IcmpError IcmpError Type.\r | |
531 | @param[in] IpVersion The version of the IP protocol to use,\r | |
532 | either IPv4 or IPv6.\r | |
533 | \r | |
534 | @param[out] IsHard Whether it is a hard error.\r | |
535 | @param[out] Notify Whether it need to notify SockError.\r | |
536 | \r | |
537 | @return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.\r | |
538 | \r | |
539 | **/\r | |
540 | EFI_STATUS\r | |
541 | EFIAPI\r | |
542 | IpIoGetIcmpErrStatus (\r | |
543 | IN UINT8 IcmpError,\r | |
544 | IN UINT8 IpVersion,\r | |
545 | OUT BOOLEAN *IsHard OPTIONAL,\r | |
546 | OUT BOOLEAN *Notify OPTIONAL\r | |
547 | );\r | |
548 | \r | |
549 | /**\r | |
550 | Refresh the remote peer's Neighbor Cache entries.\r | |
551 | \r | |
552 | This function is called when the caller needs the IpIo to refresh the existing\r | |
553 | IPv6 neighbor cache entries since the neighbor is considered reachable by the \r | |
554 | node has recently received a confirmation that packets sent recently to the \r | |
555 | neighbor were received by its IP layer. \r | |
556 | \r | |
557 | @param[in] IpIo Pointer to an IP_IO instance\r | |
558 | @param[in] Neighbor The IP address of the neighbor\r | |
559 | @param[in] Timeout Time in 100-ns units that this entry will\r | |
560 | remain in the neighbor cache. A value of \r | |
561 | zero means that the entry is permanent. \r | |
562 | A value of non-zero means that the entry is \r | |
563 | dynamic and will be deleted after Timeout.\r | |
564 | \r | |
565 | @retval EFI_SUCCESS The operation is completed successfully.\r | |
566 | @retval EFI_NOT_STARTED The IpIo is not configured.\r | |
567 | @retval EFI_INVALID_PARAMETER Neighbor Address is invalid.\r | |
568 | @retval EFI_NOT_FOUND The neighbor cache entry is not in the \r | |
569 | neighbor table. \r | |
570 | @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r | |
571 | \r | |
572 | **/\r | |
573 | EFI_STATUS\r | |
574 | IpIoRefreshNeighbor (\r | |
575 | IN IP_IO *IpIo,\r | |
576 | IN EFI_IP_ADDRESS *Neighbor,\r | |
577 | IN UINT32 Timeout \r | |
578 | );\r | |
579 | \r | |
580 | #endif\r | |
581 | \r |