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