]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/IpIoLib.h
Code scrube for MdeModule Definitions.
[mirror_edk2.git] / MdeModulePkg / Include / Library / IpIoLib.h
index 682036f25261bdbe540858166775cb05b08a69bb..640e5f7b49c3070dd13a3ebbf26df9ff0eac3da5 100644 (file)
@@ -1,6 +1,7 @@
 /** @file
+  This library provides IpIo layer upon EFI IP4 Protocol.\r
 
-Copyright (c) 2005 - 2007, Intel Corporation
+Copyright (c) 2005 - 2008, Intel Corporation
 All rights reserved. This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -9,13 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
-Module Name:
-
-  IpIo.h
-
-Abstract:
-
-
 **/
 
 #ifndef _IP_IO_H_
@@ -107,11 +101,11 @@ typedef struct _IP_IO {
   //
   // the node used to link this IpIo to the active IpIo list.
   //
-  NET_LIST_ENTRY                Entry;
+  LIST_ENTRY                    Entry;
 
   // the list used to maintain the IP instance for different sending purpose.
   //
-  NET_LIST_ENTRY                IpList;
+  LIST_ENTRY                    IpList;
 
   //
   // the ip instance consumed by this IP IO
@@ -135,7 +129,7 @@ typedef struct _IP_IO {
   //
   // list entry used to link the token passed to IP_IO
   //
-  NET_LIST_ENTRY                PendingSndList;
+  LIST_ENTRY                    PendingSndList;
 
   //
   // User interface used to get notify from IP_IO
@@ -155,7 +149,7 @@ typedef struct _IP_IO_OPEN_DATA {
 } IP_IO_OPEN_DATA;
 
 typedef struct _IP_IO_SEND_ENTRY {
-  NET_LIST_ENTRY            Entry;
+  LIST_ENTRY                Entry;
   IP_IO                     *IpIo;
   VOID                      *Context;
   VOID                      *NotifyData;
@@ -169,36 +163,98 @@ typedef EFI_IP4_OVERRIDE_DATA IP_IO_OVERRIDE;
 typedef struct _IP_IO_IP_INFO {
   IP4_ADDR                  Addr;
   IP4_ADDR                  SubnetMask;
-  NET_LIST_ENTRY            Entry;
+  LIST_ENTRY                Entry;
   EFI_HANDLE                ChildHandle;
   EFI_IP4_PROTOCOL          *Ip;
   EFI_IP4_COMPLETION_TOKEN  DummyRcvToken;
   INTN                      RefCnt;
 } IP_IO_IP_INFO;
 
+/**\r
+  Create a new IP_IO instance.\r
+\r
+  @param  Image                 The image handle of an IP_IO consumer protocol.\r
+  @param  Controller            The controller handle of an IP_IO consumer protocol\r
+                                installed on.\r
+\r
+  @return Pointer to a newly created IP_IO instance.\r
+\r
+**/
 IP_IO *
+EFIAPI
 IpIoCreate (
   IN EFI_HANDLE Image,
   IN EFI_HANDLE Controller
   );
 
+/**\r
+  Destroy an IP_IO instance.\r
+\r
+  @param  IpIo                  Pointer to the IP_IO instance that needs to\r
+                                destroy.\r
+\r
+  @retval EFI_SUCCESS           The IP_IO instance destroyed successfully.\r
+  @retval other                 Error condition occurred.\r
+\r
+**/
 EFI_STATUS
+EFIAPI
 IpIoDestroy (
   IN IP_IO *IpIo
   );
 
+/**\r
+  Stop an IP_IO instance.\r
+\r
+  @param  IpIo                  Pointer to the IP_IO instance that needs to stop.\r
+\r
+  @retval EFI_SUCCESS           The IP_IO instance stopped successfully.\r
+  @retval other                 Error condition occurred.\r
+\r
+**/
 EFI_STATUS
+EFIAPI
 IpIoStop (
   IN IP_IO *IpIo
   );
 
+/**\r
+  Open an IP_IO instance for use.\r
+\r
+  @param  IpIo                  Pointer to an IP_IO instance that needs to open.\r
+  @param  OpenData              The configuration data for the IP_IO instance.\r
+\r
+  @retval EFI_SUCCESS           The IP_IO instance opened with OpenData\r
+                                successfully.\r
+  @retval other                 Error condition occurred.\r
+\r
+**/
 EFI_STATUS
 IpIoOpen (
   IN IP_IO           *IpIo,
   IN IP_IO_OPEN_DATA *OpenData
   );
 
+/**\r
+  Send out an IP packet.\r
+\r
+  @param  IpIo                  Pointer to an IP_IO instance used for sending IP\r
+                                packet.\r
+  @param  Pkt                   Pointer to the IP packet to be sent.\r
+  @param  Sender                The IP protocol instance used for sending.\r
+  @param  Context               
+  @param  NotifyData            \r
+  @param  Dest                  The destination IP address to send this packet to.\r
+  @param  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_NOT_STARTED       The IpIo is not configured.\r
+  @retval EFI_OUT_OF_RESOURCES  Failed due to resource limit.\r
+\r
+**/
 EFI_STATUS
+EFIAPI
 IpIoSend (
   IN IP_IO           *IpIo,
   IN NET_BUF         *Pkt,
@@ -209,36 +265,107 @@ IpIoSend (
   IN IP_IO_OVERRIDE  *OverrideData
   );
 
+/**\r
+  Cancel the IP transmit token which wraps this Packet.\r
+\r
+  @param  IpIo                  Pointer to the IP_IO instance.\r
+  @param  Packet                Pointer to the packet to cancel.\r
+
+**/
 VOID
+EFIAPI
 IpIoCancelTxToken (
   IN IP_IO  *IpIo,
   IN VOID   *Packet
   );
 
+/**\r
+  Add a new IP instance for sending data.\r
+\r
+  @param  IpIo                  Pointer to a IP_IO instance to add a new IP\r
+                                instance for sending purpose.\r
+\r
+  @return Pointer to the created IP_IO_IP_INFO structure, NULL is failed.\r
+\r
+**/
 IP_IO_IP_INFO *
+EFIAPI
 IpIoAddIp (
   IN IP_IO  *IpIo
   );
 
+/**\r
+  Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData\r
+  is not NULL.\r
+\r
+  @param  IpInfo                Pointer to the IP_IO_IP_INFO instance.\r
+  @param  Ip4ConfigData         The IP4 configure data used to configure the ip\r
+                                instance, if NULL the ip instance is reseted. If\r
+                                UseDefaultAddress is set to TRUE, and the configure\r
+                                operation succeeds, the default address information\r
+                                is written back in this Ip4ConfigData.\r
+\r
+  @retval EFI_STATUS            The status returned by IP4->Configure or\r
+                                IP4->Receive.\r
+\r
+**/
 EFI_STATUS
+EFIAPI
 IpIoConfigIp (
   IN     IP_IO_IP_INFO        *IpInfo,
   IN OUT EFI_IP4_CONFIG_DATA  *Ip4ConfigData OPTIONAL
   );
 
+/**\r
+  Destroy an IP instance maintained in IpIo->IpList for\r
+  sending purpose.\r
+\r
+  @param  IpIo                  Pointer to the IP_IO instance.\r
+  @param  IpInfo                Pointer to the IpInfo to be removed.\r
+\r
+  @return None.\r
+\r
+**/
 VOID
+EFIAPI
 IpIoRemoveIp (
   IN IP_IO            *IpIo,
   IN IP_IO_IP_INFO    *IpInfo
   );
 
+/**\r
+  Find the first IP protocol maintained in IpIo whose local\r
+  address is the same with Src.\r
+\r
+  @param  IpIo                  Pointer to the pointer of the IP_IO instance.\r
+  @param  Src                   The local IP address.\r
+\r
+  @return Pointer to the IP protocol can be used for sending purpose and its local\r
+  @return address is the same with Src.\r
+\r
+**/
 IP_IO_IP_INFO *
+EFIAPI
 IpIoFindSender (
   IN OUT IP_IO     **IpIo,
   IN     IP4_ADDR  Src
   );
 
+/**\r
+  Get the ICMP error map information, the ErrorStatus will be returned.\r
+  The IsHard and Notify are optional. If they are not NULL, this rouine will\r
+  fill them.\r
+  We move IcmpErrMap[] to local variable to enable EBC build.\r
+\r
+  @param  IcmpError             IcmpError Type\r
+  @param  IsHard                Whether it is a hard error\r
+  @param  Notify                Whether it need to notify SockError\r
+\r
+  @return ICMP Error Status\r
+\r
+**/\r
 EFI_STATUS
+EFIAPI
 IpIoGetIcmpErrStatus (
   IN  ICMP_ERROR  IcmpError,
   OUT BOOLEAN     *IsHard, OPTIONAL