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