]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/Arp.h
Add comments for most of enum data type.
[mirror_edk2.git] / MdePkg / Include / Protocol / Arp.h
index ddcc740eb48755b583899c082e63f3fafa06f810..f4fe49e6be523ce8bdca508279f600f3a35c21a0 100644 (file)
@@ -1,5 +1,15 @@
 /** @file\r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  \r
+  EFI ARP Protocol Definition\r
+  \r
+  The EFI ARP Service Binding Protocol is used to locate EFI\r
+  ARP Protocol drivers to create and destroy child of the\r
+  driver to communicate with other host using ARP protocol.\r
+  \r
+  The EFI ARP Protocol provides services to map IP network\r
+  address to hardware address used by a data link protocol.\r
+  \r
+  Copyright (c) 2006 - 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
@@ -8,8 +18,6 @@
   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
-  Module Name:  Arp.h\r
-  \r
 **/\r
 \r
 #ifndef __EFI_ARP_PROTOCOL_H__\r
 typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;\r
 \r
 typedef struct {\r
-UINT32                      Size;\r
-BOOLEAN                     DenyFlag;\r
-BOOLEAN                     StaticFlag;\r
-UINT16                      HwAddressType;\r
-UINT16                      SwAddressType;\r
-UINT8                       HwAddressLength;\r
-UINT8                       SwAddressLength;\r
+  ///\r
+  /// Length in bytes of this entry.\r
+  ///\r
+  UINT32                      Size;\r
+\r
+  ///\r
+  /// Set to TRUE if this entry is a "deny" entry.\r
+  /// Set to FALSE if this entry is a "normal" entry.\r
+  ///\r
+  BOOLEAN                     DenyFlag;\r
+\r
+  ///\r
+  /// Set to TRUE if this entry will not time out.\r
+  /// Set to FALSE if this entry will time out.\r
+  ///\r
+  BOOLEAN                     StaticFlag;\r
+\r
+  ///\r
+  /// 16-bit ARP hardware identifier number.\r
+  ///\r
+  UINT16                      HwAddressType;\r
+\r
+  ///\r
+  /// 16-bit protocol type number.\r
+  ///\r
+  UINT16                      SwAddressType;\r
+\r
+  ///\r
+  /// Length of the hardware address.\r
+  ///\r
+  UINT8                       HwAddressLength;\r
+\r
+  ///\r
+  /// Length of the protocol address.\r
+  ///\r
+  UINT8                       SwAddressLength;\r
 } EFI_ARP_FIND_DATA;\r
 \r
 typedef struct {\r
-  UINT16                    SwAddressType;      // Host byte order\r
+  ///\r
+  /// 16-bit protocol type number in host byte order.\r
+  ///\r
+  UINT16                    SwAddressType;\r
+\r
+  ///\r
+  /// Length in bytes of the station's protocol address to register.\r
+  ///\r
   UINT8                     SwAddressLength;\r
-  VOID                      *StationAddress;    // Network byte order\r
+\r
+  ///\r
+  /// Pointer to the first byte of the protocol address to register. For\r
+  /// example, if SwAddressType is 0x0800 (IP), then\r
+  /// StationAddress points to the first byte of this station's IP\r
+  /// address stored in network byte order.\r
+  ///\r
+  VOID                      *StationAddress;\r
+\r
+  ///\r
+  /// The timeout value in 100-ns units that is associated with each\r
+  /// new dynamic ARP cache entry. If it is set to zero, the value is\r
+  /// implementation-specific.\r
+  ///\r
   UINT32                    EntryTimeOut;\r
+\r
+  ///\r
+  /// The number of retries before a MAC address is resolved. If it is\r
+  /// set to zero, the value is implementation-specific.\r
+  ///\r
   UINT32                    RetryCount;\r
+\r
+  ///\r
+  /// The timeout value in 100-ns units that is used to wait for the ARP\r
+  /// reply packet or the timeout value between two retries. Set to zero\r
+  /// to use implementation-specific value.\r
+  ///\r
   UINT32                    RetryTimeOut;\r
 } EFI_ARP_CONFIG_DATA;\r
 \r
@@ -50,11 +118,14 @@ typedef struct {
 /**\r
   Assigns a station address (protocol type and network address) to this instance of the ARP cache.\r
 \r
-  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  ConfigData             A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r
+  @param  This                  A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  ConfigData            A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r
 \r
   @retval EFI_SUCCESS           The new station address was successfully registered.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                This is NULL.\r
+                                SwAddressLength is zero when ConfigData is not NULL.\r
+                                StationAddress is NULL when ConfigData is not NULL.\r
   @retval EFI_ACCESS_DENIED     The SwAddressType, SwAddressLength, or\r
                                 StationAddress is different from the one that is already\r
                                 registered.\r
@@ -63,11 +134,10 @@ typedef struct {
 **/\r
 typedef \r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_CONFIGURE) (\r
+(EFIAPI *EFI_ARP_CONFIGURE)(\r
   IN EFI_ARP_PROTOCOL       *This,\r
   IN EFI_ARP_CONFIG_DATA    *ConfigData   OPTIONAL\r
-  )\r
-;  \r
+  );  \r
 \r
 /**\r
   Inserts an entry to the ARP cache.\r
@@ -84,10 +154,14 @@ EFI_STATUS
                           nonzero value will override the one given by Configure() if\r
                           the entry to be added is dynamic entry.\r
   @param  Overwrite       If TRUE, the matching cache entry will be overwritten with the\r
-                          supplied parameters. If FALSE, EFI_ACCESS_DENIED\r
+                          supplied parameters. If FALSE, EFI_ACCESS_DENIED is returned \r
+                          if the corresponding cache entry already exists.\r
 \r
   @retval EFI_SUCCESS           The entry has been added or updated.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                This is NULL. DenyFlag is FALSE and TargetHwAddress is NULL.\r
+                                DenyFlag is FALSE and TargetSwAddress is NULL. TargetHwAddress is NULL and TargetSwAddress is NULL. \r
+                                Both TargetSwAddress and TargetHwAddress are not NULL when DenyFlag is TRUE.\r
   @retval EFI_OUT_OF_RESOURCES  The new ARP cache entry could not be allocated.\r
   @retval EFI_ACCESS_DENIED     The ARP cache entry already exists and Overwrite is not true.\r
   @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
@@ -95,15 +169,14 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_ADD) (\r
+(EFIAPI *EFI_ARP_ADD)(\r
   IN EFI_ARP_PROTOCOL       *This,\r
   IN BOOLEAN                DenyFlag,\r
   IN VOID                   *TargetSwAddress  OPTIONAL,\r
   IN VOID                   *TargetHwAddress  OPTIONAL,\r
   IN UINT32                 TimeoutValue,\r
   IN BOOLEAN                Overwrite\r
-  )\r
-;  \r
+  );  \r
 \r
 /**\r
   Locates one or more entries in the ARP cache.\r
@@ -123,13 +196,15 @@ EFI_STATUS
 \r
   @retval EFI_SUCCESS           The requested ARP cache entries were copied into the buffer.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                This is NULL. Both EntryCount and EntryLength are NULL, \r
+                                when Refresh is FALSE.\r
   @retval EFI_NOT_FOUND         No matching entries were found.\r
   @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
 \r
 **/\r
 typedef \r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_FIND) (\r
+(EFIAPI *EFI_ARP_FIND)(\r
   IN EFI_ARP_PROTOCOL       *This,\r
   IN BOOLEAN                BySwAddress,\r
   IN VOID                   *AddressBuffer    OPTIONAL,\r
@@ -137,8 +212,7 @@ EFI_STATUS
   OUT UINT32                *EntryCount       OPTIONAL,\r
   OUT EFI_ARP_FIND_DATA     **Entries         OPTIONAL,\r
   IN BOOLEAN                Refresh\r
-  )\r
-;  \r
+  );  \r
 \r
 \r
 /**\r
@@ -158,17 +232,16 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_DELETE) (\r
+(EFIAPI *EFI_ARP_DELETE)(\r
   IN EFI_ARP_PROTOCOL       *This,\r
   IN BOOLEAN                BySwAddress,\r
   IN VOID                   *AddressBuffer   OPTIONAL\r
-  )\r
-;  \r
+  );  \r
 \r
 /**\r
   Removes all dynamic ARP cache entries that were added by this interface.\r
 \r
-  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  This                  A pointer to the EFI_ARP_PROTOCOL instance.\r
                                  \r
   @retval EFI_SUCCESS           The cache has been flushed.\r
   @retval EFI_INVALID_PARAMETER This is NULL.\r
@@ -178,10 +251,9 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_FLUSH) (\r
+(EFIAPI *EFI_ARP_FLUSH)(\r
   IN EFI_ARP_PROTOCOL       *This\r
-  )\r
-;  \r
+  );  \r
 \r
 /**\r
   Starts an ARP request session.\r
@@ -209,13 +281,12 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_REQUEST) (\r
+(EFIAPI *EFI_ARP_REQUEST)(\r
   IN EFI_ARP_PROTOCOL       *This, \r
   IN VOID                   *TargetSwAddress  OPTIONAL,\r
   IN EFI_EVENT              ResolvedEvent     OPTIONAL,\r
   OUT VOID                  *TargetHwAddress  \r
-  )\r
-;  \r
+  );  \r
 \r
 /**\r
   Cancels an ARP request session.\r
@@ -228,6 +299,9 @@ EFI_STATUS
   @retval EFI_SUCCESS           The pending request session(s) is/are aborted and corresponding\r
                                 event(s) is/are signaled.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                This is NULL.\r
+                                TargetSwAddress is not NULL and ResolvedEvent is NULL.\r
+                                TargetSwAddress is NULL and ResolvedEvent is not NULL\r
   @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
   @retval EFI_NOT_FOUND         The request is not issued by\r
                                 EFI_ARP_PROTOCOL.Request().\r
@@ -235,13 +309,16 @@ EFI_STATUS
 **/\r
 typedef\r
 EFI_STATUS\r
-(EFIAPI *EFI_ARP_CANCEL) (\r
+(EFIAPI *EFI_ARP_CANCEL)(\r
   IN EFI_ARP_PROTOCOL       *This, \r
   IN VOID                   *TargetSwAddress  OPTIONAL,\r
   IN EFI_EVENT              ResolvedEvent     OPTIONAL\r
-  )\r
-;  \r
+  );  \r
 \r
+///\r
+/// ARP is used to resolve local network protocol addresses into \r
+/// network hardware addresses.\r
+///\r
 struct _EFI_ARP_PROTOCOL {\r
   EFI_ARP_CONFIGURE         Configure;\r
   EFI_ARP_ADD               Add;\r