]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/IpIoLib.h
Fix function header
[mirror_edk2.git] / MdeModulePkg / Include / Library / IpIoLib.h
index 640e5f7b49c3070dd13a3ebbf26df9ff0eac3da5..0ef93ed9e57279f20044d04f09d10fd330fdb563 100644 (file)
@@ -1,25 +1,24 @@
-/** @file
+/** @file\r
   This library provides IpIo layer upon EFI IP4 Protocol.\r
-
-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
-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.
-
-**/
-
-#ifndef _IP_IO_H_
-#define _IP_IO_H_
-
-#include <PiDxe.h>
+\r
+Copyright (c) 2005 - 2008, Intel Corporation\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
+\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
+\r
+#ifndef _IP_IO_H_\r
+#define _IP_IO_H_\r
+\r
 #include <Protocol/Ip4.h>\r
 #include <Library/IpIoLib.h>\r
-#include <Library/NetLib.h>
-
+#include <Library/NetLib.h>\r
+\r
 //\r
 // type and code define for ICMP protocol error got\r
 // from IP\r
@@ -65,111 +64,111 @@ typedef struct _ICMP_ERROR_INFO {
   BOOLEAN     IsHard;\r
   BOOLEAN     Notify;\r
 } ICMP_ERROR_INFO;\r
-
-#define EFI_IP4_HEADER_LEN(HdrPtr) ((HdrPtr)->HeaderLength << 2)
-
-extern EFI_IP4_CONFIG_DATA  mIpIoDefaultIpConfigData;
-
-typedef struct _EFI_NET_SESSION_DATA {
-  IP4_ADDR        Source;
-  IP4_ADDR        Dest;
-  EFI_IP4_HEADER  *IpHdr;
-} EFI_NET_SESSION_DATA;
-
-typedef
-VOID
-(*PKT_RCVD_NOTIFY) (
-  IN EFI_STATUS           Status,  // rcvd pkt result
-  IN ICMP_ERROR           IcmpErr, // if Status == EFI_ICMP_ERROR, this
-                                  // field is valid for user
-  IN EFI_NET_SESSION_DATA *NetSession, // the communication point
-  IN NET_BUF              *Pkt,    // packet received
-  IN VOID                 *Context // the Context provided by user for recive data
-  );
-
-typedef
-VOID
-(*PKT_SENT_NOTIFY) (
-  IN EFI_STATUS  Status,      // sent pkt result
-  IN VOID        *Context,    // the context provided by user for sending data
-  IN VOID        *Sender,     // the sender to be notified
-  IN VOID        *NotifyData  // sent pkt related data to notify
-  );
-
-typedef struct _IP_IO {
-
-  //
-  // the node used to link this IpIo to the active IpIo list.
-  //
-  LIST_ENTRY                    Entry;
-
-  // the list used to maintain the IP instance for different sending purpose.
-  //
-  LIST_ENTRY                    IpList;
-
-  //
-  // the ip instance consumed by this IP IO
-  //
-  EFI_HANDLE                    Controller;
-  EFI_HANDLE                    Image;
-  EFI_HANDLE                    ChildHandle;
-  EFI_IP4_PROTOCOL              *Ip;
-  BOOLEAN                       IsConfigured;
-
-  //
-  // some ip config data can be changed
-  //
-  UINT8                         Protocol;
-
-  //
-  // token and event used to get data from IP
-  //
-  EFI_IP4_COMPLETION_TOKEN      RcvToken;
-
-  //
-  // list entry used to link the token passed to IP_IO
-  //
-  LIST_ENTRY                    PendingSndList;
-
-  //
-  // User interface used to get notify from IP_IO
-  //
-  VOID                          *RcvdContext;
-  VOID                          *SndContext;
-  PKT_RCVD_NOTIFY               PktRcvdNotify;
-  PKT_SENT_NOTIFY               PktSentNotify;
-} IP_IO;
-
-typedef struct _IP_IO_OPEN_DATA {
-  EFI_IP4_CONFIG_DATA IpConfigData;
-  VOID                *RcvdContext;
-  VOID                *SndContext;
-  PKT_RCVD_NOTIFY     PktRcvdNotify;
-  PKT_SENT_NOTIFY     PktSentNotify;
-} IP_IO_OPEN_DATA;
-
-typedef struct _IP_IO_SEND_ENTRY {
-  LIST_ENTRY                Entry;
-  IP_IO                     *IpIo;
-  VOID                      *Context;
-  VOID                      *NotifyData;
-  EFI_IP4_PROTOCOL          *Ip;
-  NET_BUF                   *Pkt;
-  EFI_IP4_COMPLETION_TOKEN  *SndToken;
-} IP_IO_SEND_ENTRY;
-
-typedef EFI_IP4_OVERRIDE_DATA IP_IO_OVERRIDE;
-
-typedef struct _IP_IO_IP_INFO {
-  IP4_ADDR                  Addr;
-  IP4_ADDR                  SubnetMask;
-  LIST_ENTRY                Entry;
-  EFI_HANDLE                ChildHandle;
-  EFI_IP4_PROTOCOL          *Ip;
-  EFI_IP4_COMPLETION_TOKEN  DummyRcvToken;
-  INTN                      RefCnt;
-} IP_IO_IP_INFO;
-
+\r
+#define EFI_IP4_HEADER_LEN(HdrPtr) ((HdrPtr)->HeaderLength << 2)\r
+\r
+extern EFI_IP4_CONFIG_DATA  mIpIoDefaultIpConfigData;\r
+\r
+typedef struct _EFI_NET_SESSION_DATA {\r
+  IP4_ADDR        Source;\r
+  IP4_ADDR        Dest;\r
+  EFI_IP4_HEADER  *IpHdr;\r
+} EFI_NET_SESSION_DATA;\r
+\r
+typedef\r
+VOID\r
+(*PKT_RCVD_NOTIFY) (\r
+  IN EFI_STATUS           Status,  // rcvd pkt result\r
+  IN ICMP_ERROR           IcmpErr, // if Status == EFI_ICMP_ERROR, this\r
+                                  // field is valid for user\r
+  IN EFI_NET_SESSION_DATA *NetSession, // the communication point\r
+  IN NET_BUF              *Pkt,    // packet received\r
+  IN VOID                 *Context // the Context provided by user for receive data\r
+  );\r
+\r
+typedef\r
+VOID\r
+(*PKT_SENT_NOTIFY) (\r
+  IN EFI_STATUS  Status,      // sent pkt result\r
+  IN VOID        *Context,    // the context provided by user for sending data\r
+  IN VOID        *Sender,     // the sender to be notified\r
+  IN VOID        *NotifyData  // sent pkt related data to notify\r
+  );\r
+\r
+typedef struct _IP_IO {\r
+\r
+  //\r
+  // the node used to link this IpIo to the active IpIo list.\r
+  //\r
+  LIST_ENTRY                    Entry;\r
+\r
+  // the list used to maintain the IP instance for different sending purpose.\r
+  //\r
+  LIST_ENTRY                    IpList;\r
+\r
+  //\r
+  // the ip instance consumed by this IP IO\r
+  //\r
+  EFI_HANDLE                    Controller;\r
+  EFI_HANDLE                    Image;\r
+  EFI_HANDLE                    ChildHandle;\r
+  EFI_IP4_PROTOCOL              *Ip;\r
+  BOOLEAN                       IsConfigured;\r
+\r
+  //\r
+  // some ip config data can be changed\r
+  //\r
+  UINT8                         Protocol;\r
+\r
+  //\r
+  // token and event used to get data from IP\r
+  //\r
+  EFI_IP4_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;\r
+  VOID                          *SndContext;\r
+  PKT_RCVD_NOTIFY               PktRcvdNotify;\r
+  PKT_SENT_NOTIFY               PktSentNotify;\r
+} IP_IO;\r
+\r
+typedef struct _IP_IO_OPEN_DATA {\r
+  EFI_IP4_CONFIG_DATA IpConfigData;\r
+  VOID                *RcvdContext;\r
+  VOID                *SndContext;\r
+  PKT_RCVD_NOTIFY     PktRcvdNotify;\r
+  PKT_SENT_NOTIFY     PktSentNotify;\r
+} IP_IO_OPEN_DATA;\r
+\r
+typedef struct _IP_IO_SEND_ENTRY {\r
+  LIST_ENTRY                Entry;\r
+  IP_IO                     *IpIo;\r
+  VOID                      *Context;\r
+  VOID                      *NotifyData;\r
+  EFI_IP4_PROTOCOL          *Ip;\r
+  NET_BUF                   *Pkt;\r
+  EFI_IP4_COMPLETION_TOKEN  *SndToken;\r
+} IP_IO_SEND_ENTRY;\r
+\r
+typedef EFI_IP4_OVERRIDE_DATA IP_IO_OVERRIDE;\r
+\r
+typedef struct _IP_IO_IP_INFO {\r
+  IP4_ADDR                  Addr;\r
+  IP4_ADDR                  SubnetMask;\r
+  LIST_ENTRY                Entry;\r
+  EFI_HANDLE                ChildHandle;\r
+  EFI_IP4_PROTOCOL          *Ip;\r
+  EFI_IP4_COMPLETION_TOKEN  DummyRcvToken;\r
+  INTN                      RefCnt;\r
+} IP_IO_IP_INFO;\r
+\r
 /**\r
   Create a new IP_IO instance.\r
 \r
@@ -179,14 +178,14 @@ typedef struct _IP_IO_IP_INFO {
 \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
+IP_IO *\r
+EFIAPI\r
+IpIoCreate (\r
+  IN EFI_HANDLE Image,\r
+  IN EFI_HANDLE Controller\r
+  );\r
+\r
 /**\r
   Destroy an IP_IO instance.\r
 \r
@@ -196,13 +195,13 @@ IpIoCreate (
   @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
+EFI_STATUS\r
+EFIAPI\r
+IpIoDestroy (\r
+  IN IP_IO *IpIo\r
+  );\r
+\r
 /**\r
   Stop an IP_IO instance.\r
 \r
@@ -211,13 +210,13 @@ IpIoDestroy (
   @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
+EFI_STATUS\r
+EFIAPI\r
+IpIoStop (\r
+  IN IP_IO *IpIo\r
+  );\r
+\r
 /**\r
   Open an IP_IO instance for use.\r
 \r
@@ -228,13 +227,13 @@ IpIoStop (
                                 successfully.\r
   @retval other                 Error condition occurred.\r
 \r
-**/
-EFI_STATUS
-IpIoOpen (
-  IN IP_IO           *IpIo,
-  IN IP_IO_OPEN_DATA *OpenData
-  );
-
+**/\r
+EFI_STATUS\r
+IpIoOpen (\r
+  IN IP_IO           *IpIo,\r
+  IN IP_IO_OPEN_DATA *OpenData\r
+  );\r
+\r
 /**\r
   Send out an IP packet.\r
 \r
@@ -242,7 +241,7 @@ IpIoOpen (
                                 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  Context               \r
   @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
@@ -252,33 +251,33 @@ IpIoOpen (
   @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,
-  IN IP_IO_IP_INFO   *Sender,
-  IN VOID            *Context    OPTIONAL,
-  IN VOID            *NotifyData OPTIONAL,
-  IN IP4_ADDR        Dest,
-  IN IP_IO_OVERRIDE  *OverrideData
-  );
-
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IpIoSend (\r
+  IN IP_IO           *IpIo,\r
+  IN NET_BUF         *Pkt,\r
+  IN IP_IO_IP_INFO   *Sender,\r
+  IN VOID            *Context    OPTIONAL,\r
+  IN VOID            *NotifyData OPTIONAL,\r
+  IN IP4_ADDR        Dest,\r
+  IN IP_IO_OVERRIDE  *OverrideData\r
+  );\r
+\r
 /**\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
+**/\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
@@ -287,13 +286,13 @@ IpIoCancelTxToken (
 \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
+IP_IO_IP_INFO *\r
+EFIAPI\r
+IpIoAddIp (\r
+  IN IP_IO  *IpIo\r
+  );\r
+\r
 /**\r
   Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData\r
   is not NULL.\r
@@ -308,14 +307,14 @@ IpIoAddIp (
   @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
+EFI_STATUS\r
+EFIAPI\r
+IpIoConfigIp (\r
+  IN     IP_IO_IP_INFO        *IpInfo,\r
+  IN OUT EFI_IP4_CONFIG_DATA  *Ip4ConfigData OPTIONAL\r
+  );\r
+\r
 /**\r
   Destroy an IP instance maintained in IpIo->IpList for\r
   sending purpose.\r
@@ -325,14 +324,14 @@ IpIoConfigIp (
 \r
   @return None.\r
 \r
-**/
-VOID
-EFIAPI
-IpIoRemoveIp (
-  IN IP_IO            *IpIo,
-  IN IP_IO_IP_INFO    *IpInfo
-  );
-
+**/\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 with Src.\r
@@ -343,14 +342,14 @@ IpIoRemoveIp (
   @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
+IP_IO_IP_INFO *\r
+EFIAPI\r
+IpIoFindSender (\r
+  IN OUT IP_IO     **IpIo,\r
+  IN     IP4_ADDR  Src\r
+  );\r
+\r
 /**\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
@@ -364,12 +363,12 @@ IpIoFindSender (
   @return ICMP Error Status\r
 \r
 **/\r
-EFI_STATUS
-EFIAPI
-IpIoGetIcmpErrStatus (
-  IN  ICMP_ERROR  IcmpError,
-  OUT BOOLEAN     *IsHard, OPTIONAL
-  OUT BOOLEAN     *Notify OPTIONAL
-  );
-
-#endif
+EFI_STATUS\r
+EFIAPI\r
+IpIoGetIcmpErrStatus (\r
+  IN  ICMP_ERROR  IcmpError,\r
+  OUT BOOLEAN     *IsHard, OPTIONAL\r
+  OUT BOOLEAN     *Notify OPTIONAL\r
+  );\r
+\r
+#endif\r