--- /dev/null
+/** @file\r
+ Copyright (c) 2006, 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
+ Module Name: Arp.h\r
+ \r
+**/\r
+\r
+#ifndef __EFI_ARP_PROTOCOL_H__\r
+#define __EFI_ARP_PROTOCOL_H__\r
+\r
+#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \\r
+ { \\r
+ 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \\r
+ }\r
+\r
+#define EFI_ARP_PROTOCOL_GUID \\r
+ { \\r
+ 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \\r
+ }\r
+\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
+} EFI_ARP_FIND_DATA;\r
+\r
+typedef struct {\r
+ UINT16 SwAddressType; // Host byte order\r
+ UINT8 SwAddressLength;\r
+ VOID *StationAddress; // Network byte order\r
+ UINT32 EntryTimeOut;\r
+ UINT32 RetryCount;\r
+ UINT32 RetryTimeOut;\r
+} EFI_ARP_CONFIG_DATA;\r
+\r
+\r
+/**\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
+\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
+ @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or\r
+ StationAddress is different from the one that is already\r
+ registered.\r
+ @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be allocated.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_CONFIGURE) (\r
+ IN EFI_ARP_PROTOCOL *This,\r
+ IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL\r
+ )\r
+; \r
+\r
+/**\r
+ Inserts an entry to the ARP cache.\r
+\r
+ @param This A pointer to the EFI_ARP_PROTOCOL instance. \r
+ @param DenyFlag Set to TRUE if this entry is a "deny" entry. Set to FALSE if this\r
+ entry is a "normal" entry.\r
+ @param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r
+ NULL if DenyFlag is TRUE.\r
+ @param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r
+ NULL if DenyFlag is TRUE.\r
+ @param TimeoutValue Time in 100-ns units that this entry will remain in the ARP\r
+ cache. A value of zero means that the entry is permanent. A\r
+ 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
+\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
+ @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
+\r
+**/\r
+typedef\r
+EFI_STATUS\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
+ Locates one or more entries in the ARP cache.\r
+\r
+ @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
+ @param BySwAddress Set to TRUE to look for matching software protocol addresses.\r
+ Set to FALSE to look for matching hardware protocol addresses.\r
+ @param AddressBuffer Pointer to address buffer. Set to NULL to match all addresses.\r
+ @param EntryLength The size of an entry in the entries buffer. To keep the\r
+ EFI_ARP_FIND_DATA structure properly aligned, this field\r
+ may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r
+ the length of the software and hardware addresses.\r
+ @param EntryCount The number of ARP cache entries that are found by the specified criteria.\r
+ @param Entries Pointer to the buffer that will receive the ARP cache entries.\r
+ @param Refresh Set to TRUE to refresh the timeout value of the matching ARP\r
+ cache entry.\r
+\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
+ @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
+ IN EFI_ARP_PROTOCOL *This,\r
+ IN BOOLEAN BySwAddress,\r
+ IN VOID *AddressBuffer OPTIONAL,\r
+ OUT UINT32 *EntryLength OPTIONAL,\r
+ OUT UINT32 *EntryCount OPTIONAL,\r
+ OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,\r
+ IN BOOLEAN Refresh\r
+ )\r
+; \r
+\r
+\r
+/**\r
+ Removes entries from the ARP cache.\r
+\r
+ @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
+ @param BySwAddress Set to TRUE to delete matching protocol addresses.\r
+ Set to FALSE to delete matching hardware addresses.\r
+ @param AddressBuffer Pointer to the address buffer that is used as a key to look for the\r
+ cache entry. Set to NULL to delete all entries.\r
+\r
+ @retval EFI_SUCCESS The entry was removed from the ARP cache.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NOT_FOUND The specified deletion key was not 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_DELETE) (\r
+ IN EFI_ARP_PROTOCOL *This,\r
+ IN BOOLEAN BySwAddress,\r
+ IN VOID *AddressBuffer OPTIONAL\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
+ \r
+ @retval EFI_SUCCESS The cache has been flushed.\r
+ @retval EFI_INVALID_PARAMETER This is NULL.\r
+ @retval EFI_NOT_FOUND There are no matching dynamic cache entries.\r
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_FLUSH) (\r
+ IN EFI_ARP_PROTOCOL *This\r
+ )\r
+; \r
+\r
+/**\r
+ Starts an ARP request session.\r
+\r
+ @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
+ @param TargetSwAddress Pointer to the protocol address to resolve.\r
+ @param ResolvedEvent Pointer to the event that will be signaled when the address is\r
+ resolved or some error occurs.\r
+ @param TargetHwAddress Pointer to the buffer for the resolved hardware address in\r
+ network byte order. The buffer must be large enough to hold the\r
+ resulting hardware address. TargetHwAddress must not be\r
+ NULL.\r
+\r
+ @retval EFI_SUCCESS The data was copied from the ARP cache into the\r
+ TargetHwAddress buffer.\r
+ @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r
+ @retval EFI_ACCESS_DENIED The requested address is not present in the normal ARP cache but\r
+ is present in the deny address list. Outgoing traffic to that address is\r
+ forbidden.\r
+ @retval EFI_NOT_STARTED The ARP driver instance has not been configured.\r
+ @retval EFI_NOT_READY The request has been started and is not finished.\r
+ @retval EFI_UNSUPPORTED The requested conversion is not supported in this implementation or\r
+ configuration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\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
+ Cancels an ARP request session.\r
+\r
+ @param This A pointer to the EFI_ARP_PROTOCOL instance.\r
+ @param TargetSwAddress Pointer to the protocol address in previous request session.\r
+ @param ResolvedEvent Pointer to the event that is used as the notification event in\r
+ previous request session.\r
+\r
+ @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
+ @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
+\r
+**/\r
+typedef\r
+EFI_STATUS\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
+struct _EFI_ARP_PROTOCOL {\r
+ EFI_ARP_CONFIGURE Configure;\r
+ EFI_ARP_ADD Add;\r
+ EFI_ARP_FIND Find;\r
+ EFI_ARP_DELETE Delete;\r
+ EFI_ARP_FLUSH Flush;\r
+ EFI_ARP_REQUEST Request;\r
+ EFI_ARP_CANCEL Cancel;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiArpServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiArpProtocolGuid;\r
+\r
+#endif\r