]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/IpIoLib.h
Fixed GCC 4.4 build issues due to EFIAPI not being used when required.
[mirror_edk2.git] / MdeModulePkg / Include / Library / IpIoLib.h
index 000e8158098133ed1192a2f4adcc6df15ea60672..537915b882ff2458622c9670fc0bf844f9e771ae 100644 (file)
@@ -2,13 +2,13 @@
   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 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+Copyright (c) 2005 - 2010, Intel Corporation.  All rights reserved<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                            \r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
@@ -49,9 +49,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   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
+  @param[out] HdrPtr   A pointer to EFI_IP4_HEADER.\r
   \r
-  @return The IP header length\r
+  @return The IP header length.\r
 **/\r
 #define EFI_IP4_HEADER_LEN(HdrPtr) ((HdrPtr)->HeaderLength << 2)\r
 \r
@@ -60,9 +60,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   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
+  @param[in] IpHdr   A pointer to EFI_IP4_HEADER.\r
   \r
-  @return The ICMP error length\r
+  @return The ICMP error length.\r
 **/\r
 #define ICMP_ERRLEN(IpHdr) \\r
   (sizeof(IP4_ICMP_HEAD) + EFI_IP4_HEADER_LEN(IpHdr) + 8)\r
@@ -70,10 +70,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 /**\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
+  @param[out]  Buf    A pointer to NET_BUF.\r
+  @param[in]   Type   Header type.\r
   \r
-  @return The pointer to packet header\r
+  @return The pointer to packet header.\r
 **/\r
 #define NET_PROTO_HDR(Buf, Type)  ((Type *) ((Buf)->BlockOp[0].Head))\r
 \r
@@ -157,31 +157,31 @@ typedef union {
 /// 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
+  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
+  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        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           Packet received\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
-(*PKT_RCVD_NOTIFY) (\r
+(EFIAPI *PKT_RCVD_NOTIFY) (\r
   IN EFI_STATUS           Status, \r
   IN UINT8                IcmpErr,\r
   IN EFI_NET_SESSION_DATA *NetSession,\r
@@ -192,16 +192,16 @@ VOID
 /**\r
   The prototype is called back when an IP packet is sent.\r
   \r
-  @param[in] Status        Result of the sending\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 pointer to EFI_IP4_PROTOCOL or EFI_IP6_PROTOCOL\r
-  @param[in] NotifyData    Context data specified when calling IpIoSend()\r
+  @param[in] Sender        A pointer to EFI_IP4_PROTOCOL or EFI_IP6_PROTOCOL.\r
+  @param[in] NotifyData    The Context data specified when calling IpIoSend()\r
   \r
 **/\r
 typedef\r
 VOID\r
-(*PKT_SENT_NOTIFY) (\r
+(EFIAPI *PKT_SENT_NOTIFY) (\r
   IN EFI_STATUS  Status,\r
   IN VOID        *Context,\r
   IN VOID        *Sender,\r
@@ -233,27 +233,27 @@ typedef struct _IP_IO {
   BOOLEAN                       IsConfigured;\r
 \r
   ///\r
-  /// Some ip config data can be changed\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
+  /// 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
+  /// 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
+  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
 } IP_IO;\r
 \r
@@ -262,11 +262,11 @@ typedef struct _IP_IO {
 /// 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_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
@@ -313,7 +313,7 @@ typedef struct _IP_IO_IP_INFO {
   @param[in]  IpVersion         The version of the IP protocol to use, either\r
                                 IPv4 or IPv6.                            \r
 \r
-  @return Pointer to a newly created IP_IO instance, or NULL if failed.\r
+  @return The pointer to a newly created IP_IO instance, or NULL if failed.\r
 \r
 **/\r
 IP_IO *\r
@@ -330,11 +330,11 @@ IpIoCreate (
   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         Pointer to the IP_IO instance that needs to be\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 destroyed successfully.\r
-  @retval          Others       Error condition occurred.\r
+  @retval          EFI_SUCCESS  The IP_IO instance was destroyed successfully.\r
+  @retval          Others       An error condition occurred.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -349,10 +349,10 @@ IpIoDestroy (
   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            Pointer to the IP_IO instance that needs to stop.\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          Others          Error condition occurred.\r
+  @retval          Others          Anrror condition occurred.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -368,16 +368,16 @@ IpIoStop (
   instance and register the callbacks and their context data for sending and\r
   receiving IP packets.\r
 \r
-  @param[in, out]  IpIo               Pointer to an IP_IO instance that needs\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          Others             Error condition occurred.\r
+  @retval          EFI_ACCESS_DENIED  The IP_IO instance is configured; avoid  \r
+                                      reopening it.\r
+  @retval          Others             An error condition occurred.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -395,19 +395,19 @@ IpIoOpen (
   overriden by Sender. Other sending configurations, such as source address and gateway\r
   address, are specified in OverrideData.\r
 \r
-  @param[in, out]  IpIo                  Pointer to an IP_IO instance used for sending IP\r
+  @param[in, out]  IpIo                  The 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, out]  Pkt                   The pointer to the IP packet to be sent.\r
   @param[in]       Sender                Optional. The IP protocol instance used for sending.\r
-  @param[in]       Context               Optional context data.\r
-  @param[in]       NotifyData            Optional notify data.\r
+  @param[in]       Context               The optional context data.\r
+  @param[in]       NotifyData            The optional notify data.\r
   @param[in]       Dest                  The destination IP address to send this packet to.\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_SUCCESS           The operation completed successfully.\r
   @retval          EFI_NOT_STARTED       The IpIo is not configured.\r
-  @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limit.\r
+  @retval          EFI_OUT_OF_RESOURCES  Failed due to resource limitations.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -423,10 +423,10 @@ IpIoSend (
   );\r
 \r
 /**\r
-  Cancel the IP transmit token which wraps this Packet.\r
+  Cancel the IP transmit token that wraps this Packet.\r
 \r
-  @param[in]  IpIo                  Pointer to the IP_IO instance.\r
-  @param[in]  Packet                Pointer to the packet of NET_BUF to cancel.\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
@@ -443,10 +443,10 @@ IpIoCancelTxToken (
   can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send\r
   data.\r
 \r
-  @param[in, out]  IpIo               Pointer to an IP_IO instance to add a new IP\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 Pointer to the created IP_IO_IP_INFO structure, NULL if failed.\r
+  @return The pointer to the created IP_IO_IP_INFO structure; NULL if failed.\r
 \r
 **/\r
 IP_IO_IP_INFO *\r
@@ -459,16 +459,16 @@ IpIoAddIp (
   Configure the IP instance of this IpInfo and start the receiving if IpConfigData\r
   is not NULL.\r
 \r
-  @param[in, out]  IpInfo          Pointer to the IP_IO_IP_INFO instance.\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 is configured successfully,\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          Configuration failed.\r
+  @retval          Others          The configuration failed.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -486,8 +486,8 @@ IpIoConfigIp (
   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                  Pointer to the IP_IO instance.\r
-  @param[in]  IpInfo                Pointer to the IpInfo to be removed.\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
@@ -504,12 +504,12 @@ IpIoRemoveIp (
   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              Pointer to the pointer of the IP_IO instance.\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 Pointer to the IP protocol can be used for sending purpose and its local\r
+  @return The pointer to the IP protocol can be used for sending purpose and its local\r
           address is the same with Src.\r
 \r
 **/\r
@@ -529,12 +529,11 @@ IpIoFindSender (
 \r
   @param[in]   IcmpError             IcmpError Type.\r
   @param[in]   IpVersion             The version of the IP protocol to use,\r
-                                     either IPv4 or IPv6.\r
-  \r
-  @param[out]  IsHard                Whether it is a hard error.\r
-  @param[out]  Notify                Whether it need to notify SockError.\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
-  @return ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.\r
+  @return The ICMP Error Status, such as EFI_NETWORK_UNREACHABLE.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -554,20 +553,20 @@ IpIoGetIcmpErrStatus (
   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                  Pointer to an IP_IO instance\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               Time in 100-ns units that this entry will\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 is completed successfully.\r
+  @retval      EFI_SUCCESS           The operation completed successfully.\r
   @retval      EFI_NOT_STARTED       The IpIo is not configured.\r
-  @retval      EFI_INVALID_PARAMETER Neighbor Address is invalid.\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_OUT_OF_RESOURCES  Failed due to resource limit.\r
+  @retval      EFI_OUT_OF_RESOURCES  Failed due to resource limitations.\r
 \r
 **/\r
 EFI_STATUS\r