]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Include/Library/IpIoLib.h
NetworkPkg: Move Network library header file from MdeModulePkg to NetworkPkg
[mirror_edk2.git] / NetworkPkg / Include / Library / IpIoLib.h
diff --git a/NetworkPkg/Include/Library/IpIoLib.h b/NetworkPkg/Include/Library/IpIoLib.h
new file mode 100644 (file)
index 0000000..2d6e090
--- /dev/null
@@ -0,0 +1,607 @@
+/** @file\r
+  This library is only intended to be used by UEFI network stack modules.\r
+  It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 protocol.\r
+\r
+Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _IP_IO_H_\r
+#define _IP_IO_H_\r
+\r
+#include <Protocol/Ip4.h>\r
+#include <Protocol/Ip6.h>\r
+\r
+#include <Library/NetLib.h>\r
+\r
+//\r
+// type and code define for ICMP protocol error\r
+// from IP\r
+//\r
+#define ICMP_TYPE_UNREACH              3\r
+#define ICMP_TYPE_TIMXCEED             11\r
+#define ICMP_TYPE_PARAMPROB            12\r
+#define ICMP_TYPE_SOURCEQUENCH         4\r
+\r
+#define ICMP_CODE_UNREACH_NET          0\r
+#define ICMP_CODE_UNREACH_HOST         1\r
+#define ICMP_CODE_UNREACH_PROTOCOL     2\r
+#define ICMP_CODE_UNREACH_PORT         3\r
+#define ICMP_CODE_UNREACH_NEEDFRAG     4\r
+#define ICMP_CODE_UNREACH_SRCFAIL      5\r
+#define ICMP_CODE_UNREACH_NET_UNKNOWN  6\r
+#define ICMP_CODE_UNREACH_HOST_UNKNOWN 7\r
+#define ICMP_CODE_UNREACH_ISOLATED     8\r
+#define ICMP_CODE_UNREACH_NET_PROHIB   9\r
+#define ICMP_CODE_UNREACH_HOST_PROHIB  10\r
+#define ICMP_CODE_UNREACH_TOSNET       11\r
+#define ICMP_CODE_UNREACH_TOSHOST      12\r
+\r
+/**\r
+  Get the IP header length from the struct EFI_IP4_HEADER. HeaderLength is\r
+  Internet header length in 32-bit words, so HeaderLength<<2 is the real\r
+  length of IP header.\r
+\r
+  @param[out] HdrPtr   A pointer to EFI_IP4_HEADER.\r
+\r
+  @return The IP header length.\r
+**/\r
+#define EFI_IP4_HEADER_LEN(HdrPtr) ((HdrPtr)->HeaderLength << 2)\r
+\r
+/**\r
+  To types of ICMP error which consist of ICMP header, IP header and original\r
+  datagram's data, get length from sum of ICMP header length, IP header length\r
+  and first 64 bits of datagram's data length.\r
+\r
+  @param[in] IpHdr   A pointer to EFI_IP4_HEADER.\r
+\r
+  @return The ICMP error length.\r
+**/\r
+#define ICMP_ERRLEN(IpHdr) \\r
+  (sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)\r
+\r
+/**\r
+  Get the packet header from NET_BUF.\r
+\r
+  @param[out]  Buf    A pointer to NET_BUF.\r
+  @param[in]   Type   Header type.\r
+\r
+  @return The pointer to packet header.\r
+**/\r
+#define NET_PROTO_HDR(Buf, Type)  ((Type *) ((Buf)->BlockOp[0].Head))\r
+\r
+\r
+extern EFI_IP4_CONFIG_DATA  mIp4IoDefaultIpConfigData;\r
+extern EFI_IP6_CONFIG_DATA  mIp6IoDefaultIpConfigData;\r
+\r
+\r
+///\r
+/// This error will be delivered to the\r
+/// listening transportation layer protocol\r
+/// that consumes IpIO.\r
+///\r
+\r
+#define  ICMP_ERR_UNREACH_NET           0\r
+#define  ICMP_ERR_UNREACH_HOST          1\r
+#define  ICMP_ERR_UNREACH_PROTOCOL      2\r
+#define  ICMP_ERR_UNREACH_PORT          3\r
+#define  ICMP_ERR_MSGSIZE               4\r
+#define  ICMP_ERR_UNREACH_SRCFAIL       5\r
+#define  ICMP_ERR_TIMXCEED_INTRANS      6\r
+#define  ICMP_ERR_TIMXCEED_REASS        7\r
+#define  ICMP_ERR_QUENCH                8\r
+#define  ICMP_ERR_PARAMPROB             9\r
+\r
+#define  ICMP6_ERR_UNREACH_NET          0\r
+#define  ICMP6_ERR_UNREACH_HOST         1\r
+#define  ICMP6_ERR_UNREACH_PROTOCOL     2\r
+#define  ICMP6_ERR_UNREACH_PORT         3\r
+#define  ICMP6_ERR_PACKAGE_TOOBIG       4\r
+#define  ICMP6_ERR_TIMXCEED_HOPLIMIT    5\r
+#define  ICMP6_ERR_TIMXCEED_REASS       6\r
+#define  ICMP6_ERR_PARAMPROB_HEADER     7\r
+#define  ICMP6_ERR_PARAMPROB_NEXHEADER  8\r
+#define  ICMP6_ERR_PARAMPROB_IPV6OPTION 9\r
+\r
+///\r
+/// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only.\r
+///\r
+typedef struct {\r
+  BOOLEAN                   IsHard;\r
+  BOOLEAN                   Notify;\r
+} ICMP_ERROR_INFO;\r
+\r
+typedef union {\r
+  EFI_IP4_COMPLETION_TOKEN  Ip4Token;\r
+  EFI_IP6_COMPLETION_TOKEN  Ip6Token;\r
+} IP_IO_IP_COMPLETION_TOKEN;\r
+\r
+typedef union {\r
+  EFI_IP4_TRANSMIT_DATA     Ip4TxData;\r
+  EFI_IP6_TRANSMIT_DATA     Ip6TxData;\r
+} IP_IO_IP_TX_DATA;\r
+\r
+typedef union {\r
+  EFI_IP4_RECEIVE_DATA      Ip4RxData;\r
+  EFI_IP6_RECEIVE_DATA      Ip6RxData;\r
+} IP_IO_IP_RX_DATA;\r
+\r
+typedef union {\r
+  EFI_IP4_OVERRIDE_DATA     Ip4OverrideData;\r
+  EFI_IP6_OVERRIDE_DATA     Ip6OverrideData;\r
+} IP_IO_OVERRIDE;\r
+\r
+typedef union {\r
+  EFI_IP4_CONFIG_DATA       Ip4CfgData;\r
+  EFI_IP6_CONFIG_DATA       Ip6CfgData;\r
+} IP_IO_IP_CONFIG_DATA;\r
+\r
+typedef union {\r
+  EFI_IP4_HEADER            *Ip4Hdr;\r
+  EFI_IP6_HEADER            *Ip6Hdr;\r
+} IP_IO_IP_HEADER;\r
+\r
+typedef union {\r
+  IP4_ADDR                  SubnetMask;\r
+  UINT8                     PrefixLength;\r
+} IP_IO_IP_MASK;\r
+\r
+typedef union {\r
+  EFI_IP4_PROTOCOL  *Ip4;\r
+  EFI_IP6_PROTOCOL  *Ip6;\r
+} IP_IO_IP_PROTOCOL;\r
+\r
+///\r
+/// The IP session for an IP receive packet.\r
+///\r
+typedef struct _EFI_NET_SESSION_DATA {\r
+  EFI_IP_ADDRESS        Source;     ///< Source IP of the received packet.\r
+  EFI_IP_ADDRESS        Dest;       ///< Destination IP of the received packet.\r
+  IP_IO_IP_HEADER       IpHdr;      ///< IP header of the received packet.\r
+  UINT32                IpHdrLen;   ///< IP header length of the received packet.\r
+                                    ///< For IPv6, it includes the IP6 header\r
+                                    ///< length and extension header length. For\r
+                                    ///< IPv4, it includes the IP4 header length\r
+                                    ///< and options length.\r
+  UINT8                 IpVersion;  ///< The IP version of the received packet.\r
+} EFI_NET_SESSION_DATA;\r
+\r
+/**\r
+  The prototype is called back when an IP packet is received.\r
+\r
+  @param[in] Status        The result of the receive request.\r
+  @param[in] IcmpErr       Valid when Status is EFI_ICMP_ERROR.\r
+  @param[in] NetSession    The IP session for the received packet.\r
+  @param[in] Pkt           The packet received.\r
+  @param[in] Context       The data provided by the user for the received packet when\r
+                           the callback is registered in IP_IO_OPEN_DATA::RcvdContext.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *PKT_RCVD_NOTIFY) (\r
+  IN EFI_STATUS           Status,\r
+  IN UINT8                IcmpErr,\r
+  IN EFI_NET_SESSION_DATA *NetSession,\r
+  IN NET_BUF              *Pkt,\r
+  IN VOID                 *Context\r
+  );\r
+\r
+/**\r
+  The prototype is called back when an IP packet is sent.\r
+\r
+  @param[in] Status        Result of the IP packet being sent.\r
+  @param[in] Context       The data provided by user for the received packet when\r
+                           the callback is registered in IP_IO_OPEN_DATA::SndContext.\r
+  @param[in] Sender        A Union type to specify a pointer of EFI_IP4_PROTOCOL\r
+                           or EFI_IP6_PROTOCOL.\r
+  @param[in] NotifyData    The Context data specified when calling IpIoSend()\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *PKT_SENT_NOTIFY) (\r
+  IN EFI_STATUS        Status,\r
+  IN VOID              *Context,\r
+  IN IP_IO_IP_PROTOCOL Sender,\r
+  IN VOID              *NotifyData\r
+  );\r
+\r
+///\r
+/// This data structure wraps Ip4/Ip6 instances. The IpIo Library uses it for all\r
+/// Ip4/Ip6 operations.\r
+///\r
+typedef struct _IP_IO {\r
+  ///\r
+  /// The node used to link this IpIo to the active IpIo list.\r
+  ///\r
+  LIST_ENTRY                    Entry;\r
+\r
+  ///\r
+  /// The list used to maintain the IP instance for different sending purpose.\r
+  ///\r
+  LIST_ENTRY                    IpList;\r
+\r
+  EFI_HANDLE                    Controller;\r
+  EFI_HANDLE                    Image;\r
+  EFI_HANDLE                    ChildHandle;\r
+  //\r
+  // The IP instance consumed by this IP_IO\r
+  //\r
+  IP_IO_IP_PROTOCOL             Ip;\r
+  BOOLEAN                       IsConfigured;\r
+\r
+  ///\r
+  /// Some ip configuration data can be changed.\r
+  ///\r
+  UINT8                         Protocol;\r
+\r
+  ///\r
+  /// Token and event used to get data from IP.\r
+  ///\r
+  IP_IO_IP_COMPLETION_TOKEN     RcvToken;\r
+\r
+  ///\r
+  /// List entry used to link the token passed to IP_IO.\r
+  ///\r
+  LIST_ENTRY                    PendingSndList;\r
+\r
+  //\r
+  // User interface used to get notify from IP_IO\r
+  //\r
+  VOID                          *RcvdContext;    ///< See IP_IO_OPEN_DATA::RcvdContext.\r
+  VOID                          *SndContext;     ///< See IP_IO_OPEN_DATA::SndContext.\r
+  PKT_RCVD_NOTIFY               PktRcvdNotify;   ///< See IP_IO_OPEN_DATA::PktRcvdNotify.\r
+  PKT_SENT_NOTIFY               PktSentNotify;   ///< See IP_IO_OPEN_DATA::PktSentNotify.\r
+  UINT8                         IpVersion;\r
+  IP4_ADDR                      StationIp;\r
+  IP4_ADDR                      SubnetMask;\r
+} IP_IO;\r
+\r
+///\r
+/// The struct is for the user to pass IP configuration and callbacks to IP_IO.\r
+/// It is used by IpIoOpen().\r
+///\r
+typedef struct _IP_IO_OPEN_DATA {\r
+  IP_IO_IP_CONFIG_DATA IpConfigData;    ///< Configuration of the IP instance.\r
+  VOID                 *RcvdContext;    ///< Context data used by receive callback.\r
+  VOID                 *SndContext;     ///< Context data used by send callback.\r
+  PKT_RCVD_NOTIFY      PktRcvdNotify;   ///< Receive callback.\r
+  PKT_SENT_NOTIFY      PktSentNotify;   ///< Send callback.\r
+} IP_IO_OPEN_DATA;\r
+\r
+///\r
+/// Internal struct book-keeping send request of IP_IO.\r
+///\r
+/// An IP_IO_SEND_ENTRY will be created each time a send request is issued to\r
+/// IP_IO via IpIoSend().\r
+///\r
+typedef struct _IP_IO_SEND_ENTRY {\r
+  LIST_ENTRY                Entry;\r
+  IP_IO                     *IpIo;\r
+  VOID                      *Context;\r
+  VOID                      *NotifyData;\r
+  IP_IO_IP_PROTOCOL         Ip;\r
+  NET_BUF                   *Pkt;\r
+  IP_IO_IP_COMPLETION_TOKEN SndToken;\r
+} IP_IO_SEND_ENTRY;\r
+\r
+///\r
+/// The IP_IO_IP_INFO is used in IpIoSend() to override the default IP instance\r
+/// in IP_IO.\r
+///\r
+typedef struct _IP_IO_IP_INFO {\r
+  EFI_IP_ADDRESS            Addr;\r
+  IP_IO_IP_MASK             PreMask;\r
+  LIST_ENTRY                Entry;\r
+  EFI_HANDLE                ChildHandle;\r
+  IP_IO_IP_PROTOCOL         Ip;\r
+  IP_IO_IP_COMPLETION_TOKEN DummyRcvToken;\r
+  INTN                      RefCnt;\r
+  UINT8                     IpVersion;\r
+} IP_IO_IP_INFO;\r
+\r
+/**\r
+  Create a new IP_IO instance.\r
+\r
+  If IpVersion is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  This function uses IP4/IP6 service binding protocol in Controller to create\r
+  an IP4/IP6 child (aka IP4/IP6 instance).\r
+\r
+  @param[in]  Image             The image handle of the driver or application that\r
+                                consumes IP_IO.\r
+  @param[in]  Controller        The controller handle that has IP4 or IP6 service\r
+                                binding protocol installed.\r
+  @param[in]  IpVersion         The version of the IP protocol to use, either\r
+                                IPv4 or IPv6.\r
+\r
+  @return The pointer to a newly created IP_IO instance, or NULL if failed.\r
+\r
+**/\r
+IP_IO *\r
+EFIAPI\r
+IpIoCreate (\r
+  IN EFI_HANDLE Image,\r
+  IN EFI_HANDLE Controller,\r
+  IN UINT8      IpVersion\r
+  );\r
+\r
+/**\r
+  Destroy an IP_IO instance.\r
+\r
+  This function is paired with IpIoCreate(). The IP_IO will be closed first.\r
+  Resource will be freed afterwards. See IpIoClose().\r
+\r
+  @param[in, out]  IpIo         The pointer to the IP_IO instance that needs to be\r
+                                destroyed.\r
+\r
+  @retval          EFI_SUCCESS  The IP_IO instance was destroyed successfully.\r
+  @retval          Others       An error condition occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoDestroy (\r
+  IN OUT IP_IO *IpIo\r
+  );\r
+\r
+/**\r
+  Stop an IP_IO instance.\r
+\r
+  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  This function is paired with IpIoOpen(). The IP_IO will be unconfigured, and all\r
+  pending send/receive tokens will be canceled.\r
+\r
+  @param[in, out]  IpIo            The pointer to the IP_IO instance that needs to stop.\r
+\r
+  @retval          EFI_SUCCESS            The IP_IO instance stopped successfully.\r
+  @retval          EFI_INVALID_PARAMETER  Invalid input parameter.\r
+  @retval          Others                 Anrror condition occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoStop (\r
+  IN OUT IP_IO *IpIo\r
+  );\r
+\r
+/**\r
+  Open an IP_IO instance for use.\r
+\r
+  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  This function is called after IpIoCreate(). It is used for configuring the IP\r
+  instance and register the callbacks and their context data for sending and\r
+  receiving IP packets.\r
+\r
+  @param[in, out]  IpIo               The pointer to an IP_IO instance that needs\r
+                                      to open.\r
+  @param[in]       OpenData           The configuration data and callbacks for\r
+                                      the IP_IO instance.\r
+\r
+  @retval          EFI_SUCCESS            The IP_IO instance opened with OpenData\r
+                                          successfully.\r
+  @retval          EFI_ACCESS_DENIED      The IP_IO instance is configured, avoid to\r
+                                          reopen it.\r
+  @retval          EFI_UNSUPPORTED        IPv4 RawData mode is no supported.\r
+  @retval          EFI_INVALID_PARAMETER  Invalid input parameter.\r
+  @retval          Others                 Error condition occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoOpen (\r
+  IN OUT IP_IO           *IpIo,\r
+  IN     IP_IO_OPEN_DATA *OpenData\r
+  );\r
+\r
+/**\r
+  Send out an IP packet.\r
+\r
+  This function is called after IpIoOpen(). The data to be sent is wrapped in\r
+  Pkt. The IP instance wrapped in IpIo is used for sending by default but can be\r
+  overriden by Sender. Other sending configs, like source address and gateway\r
+  address etc., are specified in OverrideData.\r
+\r
+  @param[in, out]  IpIo                  Pointer to an IP_IO instance used for sending IP\r
+                                         packet.\r
+  @param[in, out]  Pkt                   Pointer to the IP packet to be sent.\r
+  @param[in]       Sender                The IP protocol instance used for sending.\r
+  @param[in]       Context               Optional context data.\r
+  @param[in]       NotifyData            Optional notify data.\r
+  @param[in]       Dest                  The destination IP address to send this packet to.\r
+                                         This parameter is optional when using IPv6.\r
+  @param[in]       OverrideData          The data to override some configuration of the IP\r
+                                         instance used for sending.\r
+\r
+  @retval          EFI_SUCCESS           The operation is completed successfully.\r
+  @retval          EFI_INVALID_PARAMETER The input parameter is not correct.\r
+  @retval          EFI_NOT_STARTED       The IpIo is not configured.\r
+  @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limit.\r
+  @retval          Others                Error condition occurred.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoSend (\r
+  IN OUT IP_IO          *IpIo,\r
+  IN OUT NET_BUF        *Pkt,\r
+  IN     IP_IO_IP_INFO  *Sender        OPTIONAL,\r
+  IN     VOID           *Context       OPTIONAL,\r
+  IN     VOID           *NotifyData    OPTIONAL,\r
+  IN     EFI_IP_ADDRESS *Dest          OPTIONAL,\r
+  IN     IP_IO_OVERRIDE *OverrideData  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Cancel the IP transmit token that wraps this Packet.\r
+\r
+  If IpIo is NULL, then ASSERT().\r
+  If Packet is NULL, then ASSERT().\r
+\r
+  @param[in]  IpIo                  The pointer to the IP_IO instance.\r
+  @param[in]  Packet                The pointer to the packet of NET_BUF to cancel.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IpIoCancelTxToken (\r
+  IN IP_IO  *IpIo,\r
+  IN VOID   *Packet\r
+  );\r
+\r
+/**\r
+  Add a new IP instance for sending data.\r
+\r
+  If IpIo is NULL, then ASSERT().\r
+  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  The function is used to add the IP_IO to the IP_IO sending list. The caller\r
+  can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send\r
+  data.\r
+\r
+  @param[in, out]  IpIo               The pointer to an IP_IO instance to add a new IP\r
+                                      instance for sending purposes.\r
+\r
+  @return The pointer to the created IP_IO_IP_INFO structure; NULL if failed.\r
+\r
+**/\r
+IP_IO_IP_INFO *\r
+EFIAPI\r
+IpIoAddIp (\r
+  IN OUT IP_IO  *IpIo\r
+  );\r
+\r
+/**\r
+  Configure the IP instance of this IpInfo and start the receiving if IpConfigData\r
+  is not NULL.\r
+\r
+  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  @param[in, out]  IpInfo          The pointer to the IP_IO_IP_INFO instance.\r
+  @param[in, out]  IpConfigData    The IP4 or IP6 configure data used to configure\r
+                                   the IP instance. If NULL, the IP instance is reset.\r
+                                   If UseDefaultAddress is set to TRUE, and the configure\r
+                                   operation succeeds, the default address information\r
+                                   is written back in this IpConfigData.\r
+\r
+  @retval          EFI_SUCCESS     The IP instance of this IpInfo was configured successfully,\r
+                                   or there is no need to reconfigure it.\r
+  @retval          Others          The configuration failed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoConfigIp (\r
+  IN OUT IP_IO_IP_INFO        *IpInfo,\r
+  IN OUT VOID                 *IpConfigData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Destroy an IP instance maintained in IpIo->IpList for\r
+  sending purpose.\r
+\r
+  If Ip version is not IP_VERSION_4 or IP_VERSION_6, then ASSERT().\r
+\r
+  This function pairs with IpIoAddIp(). The IpInfo is previously created by\r
+  IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance\r
+  will be dstroyed if the RefCnt is zero.\r
+\r
+  @param[in]  IpIo                  The pointer to the IP_IO instance.\r
+  @param[in]  IpInfo                The pointer to the IpInfo to be removed.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IpIoRemoveIp (\r
+  IN IP_IO            *IpIo,\r
+  IN IP_IO_IP_INFO    *IpInfo\r
+  );\r
+\r
+/**\r
+  Find the first IP protocol maintained in IpIo whose local\r
+  address is the same as Src.\r
+\r
+  This function is called when the caller needs the IpIo to send data to the\r
+  specified Src. The IpIo was added previously by IpIoAddIp().\r
+\r
+  @param[in, out]  IpIo              The pointer to the pointer of the IP_IO instance.\r
+  @param[in]       IpVersion         The version of the IP protocol to use, either\r
+                                     IPv4 or IPv6.\r
+  @param[in]       Src               The local IP address.\r
+\r
+  @return The pointer to the IP protocol can be used for sending purpose and its local\r
+          address is the same with Src. NULL if failed.\r
+\r
+**/\r
+IP_IO_IP_INFO *\r
+EFIAPI\r
+IpIoFindSender (\r
+  IN OUT IP_IO           **IpIo,\r
+  IN     UINT8           IpVersion,\r
+  IN     EFI_IP_ADDRESS  *Src\r
+  );\r
+\r
+/**\r
+  Get the ICMP error map information.\r
+\r
+  The ErrorStatus will be returned. The IsHard and Notify are optional. If they\r
+  are not NULL, this routine will fill them.\r
+\r
+  @param[in]   IcmpError             IcmpError Type.\r
+  @param[in]   IpVersion             The version of the IP protocol to use,\r
+                                     either IPv4 or IPv6.\r
+  @param[out]  IsHard                If TRUE, indicates that it is a hard error.\r
+  @param[out]  Notify                If TRUE, SockError needs to be notified.\r
+\r
+  @retval EFI_UNSUPPORTED            Unrecognizable ICMP error code\r
+  @return The ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoGetIcmpErrStatus (\r
+  IN  UINT8       IcmpError,\r
+  IN  UINT8       IpVersion,\r
+  OUT BOOLEAN     *IsHard  OPTIONAL,\r
+  OUT BOOLEAN     *Notify  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Refresh the remote peer's Neighbor Cache entries.\r
+\r
+  This function is called when the caller needs the IpIo to refresh the existing\r
+  IPv6 neighbor cache entries since the neighbor is considered reachable by the\r
+  node has recently received a confirmation that packets sent recently to the\r
+  neighbor were received by its IP layer.\r
+\r
+  @param[in]   IpIo                  The pointer to an IP_IO instance\r
+  @param[in]   Neighbor              The IP address of the neighbor\r
+  @param[in]   Timeout               The time in 100-ns units that this entry will\r
+                                     remain in the neighbor cache. A value of\r
+                                     zero means that the entry is permanent.\r
+                                     A value of non-zero means that the entry is\r
+                                     dynamic and will be deleted after Timeout.\r
+\r
+  @retval      EFI_SUCCESS           The operation completed successfully.\r
+  @retval      EFI_NOT_STARTED       The IpIo is not configured.\r
+  @retval      EFI_INVALID_PARAMETER The Neighbor Address is invalid.\r
+  @retval      EFI_NOT_FOUND         The neighbor cache entry is not in the\r
+                                     neighbor table.\r
+  @retval      EFI_UNSUPPORTED       IP version is IPv4, which doesn't support neighbor cache refresh.\r
+  @retval      EFI_OUT_OF_RESOURCES  Failed due to resource limitations.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoRefreshNeighbor (\r
+  IN IP_IO           *IpIo,\r
+  IN EFI_IP_ADDRESS  *Neighbor,\r
+  IN UINT32          Timeout\r
+  );\r
+\r
+#endif\r
+\r