Clean codes per ECC.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5384 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
Copyright (c) 2006 - 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
|
||||
@@ -45,7 +45,6 @@ EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding = {
|
||||
@retval other Failed to initialize the arp service context.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
ArpCreateService (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
@@ -200,7 +199,6 @@ ERROR_EXIT:
|
||||
@return None.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
VOID
|
||||
ArpCleanService (
|
||||
IN ARP_SERVICE_DATA *ArpService
|
||||
@@ -706,31 +704,23 @@ ArpServiceBindingDestroyChild (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
The entry point for Arp driver which installs the driver binding and component name
|
||||
protocol on its ImageHandle.
|
||||
|
||||
@param ImageHandle The image handle of the driver.
|
||||
@param SystemTable The system table.
|
||||
|
||||
@retval EFI_SUCCES if the driver binding and component name protocols are successfully
|
||||
@retval Others Failed to install the protocols.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpDriverEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
The entry point for Arp driver which installs the driver binding and component name
|
||||
protocol on its ImageHandle.
|
||||
|
||||
Arguments:
|
||||
|
||||
ImageHandle - The image handle of the driver.
|
||||
SystemTable - The system table.
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - if the driver binding and component name protocols are successfully
|
||||
installed, otherwise if failed.
|
||||
|
||||
--*/
|
||||
{
|
||||
return EfiLibInstallDriverBindingComponentName2 (
|
||||
ImageHandle,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
Copyright (c) 2006 - 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
|
||||
@@ -41,6 +41,19 @@ extern EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gArpComponentName;
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL gArpComponentName2;
|
||||
|
||||
/**
|
||||
Test to see if this driver supports ControllerHandle.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to test.
|
||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||
device to start.
|
||||
|
||||
@retval EFI_SUCCES This driver supports this device
|
||||
@retval EFI_ALREADY_STARTED This driver is already running on this device.
|
||||
@retval other This driver does not support this device.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpDriverBindingSupported (
|
||||
@@ -49,6 +62,19 @@ ArpDriverBindingSupported (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Start this driver on ControllerHandle.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to bind driver to
|
||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||
device to start.
|
||||
|
||||
@retval EFI_SUCCES This driver is added to ControllerHandle
|
||||
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
|
||||
@retval other This driver does not support this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpDriverBindingStart (
|
||||
@@ -57,6 +83,19 @@ ArpDriverBindingStart (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to stop driver on
|
||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number
|
||||
of children is zero stop the entire bus driver.
|
||||
@param ChildHandleBuffer List of Child Handles to Stop.
|
||||
|
||||
@retval EFI_SUCCES This driver is removed ControllerHandle
|
||||
@retval other This driver was not removed from this device
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpDriverBindingStop (
|
||||
@@ -66,6 +105,22 @@ ArpDriverBindingStop (
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Creates a child handle with a set of I/O services.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ChildHandle Pointer to the handle of the child to create. If
|
||||
it is NULL, then a new handle is created. If it is
|
||||
not NULL, then the I/O services are added to the
|
||||
existing child handle.
|
||||
|
||||
@retval EFI_SUCCES The child handle was created with the I/O
|
||||
services.
|
||||
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
|
||||
the child.
|
||||
@retval other The child handle was not created.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpServiceBindingCreateChild (
|
||||
@@ -73,6 +128,22 @@ ArpServiceBindingCreateChild (
|
||||
IN EFI_HANDLE *ChildHandle
|
||||
);
|
||||
|
||||
/**
|
||||
Destroys a child handle with a set of I/O services.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ChildHandle Handle of the child to destroy.
|
||||
|
||||
@retval EFI_SUCCES The I/O services were removed from the child
|
||||
handle.
|
||||
@retval EFI_UNSUPPORTED The child handle does not support the I/O services
|
||||
that are being removed.
|
||||
@retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.
|
||||
@retval EFI_ACCESS_DENIED The child handle could not be destroyed because
|
||||
its I/O services are being used.
|
||||
@retval other The child handle was not destroyed.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpServiceBindingDestroyChild (
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
Copyright (c) 2006 - 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
|
||||
@@ -531,7 +531,6 @@ ArpTimerHandler (
|
||||
@return The two addresses match or not.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
ArpMatchAddress (
|
||||
IN NET_ARP_ADDRESS *AddressOne,
|
||||
@@ -597,7 +596,7 @@ ArpFindNextCacheEntryInTable (
|
||||
for (Entry = StartEntry->ForwardLink; Entry != CacheTable; Entry = Entry->ForwardLink) {
|
||||
CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);
|
||||
|
||||
if (FindOpType & MATCH_SW_ADDRESS) {
|
||||
if ((FindOpType & MATCH_SW_ADDRESS) != 0) {
|
||||
//
|
||||
// Find by the software address.
|
||||
//
|
||||
@@ -609,7 +608,7 @@ ArpFindNextCacheEntryInTable (
|
||||
}
|
||||
}
|
||||
|
||||
if (FindOpType & MATCH_HW_ADDRESS) {
|
||||
if ((FindOpType & MATCH_HW_ADDRESS) != 0) {
|
||||
//
|
||||
// Find by the hardware address.
|
||||
//
|
||||
@@ -930,7 +929,7 @@ ArpConfigureInstance (
|
||||
// The instance is not configured.
|
||||
//
|
||||
|
||||
if (ConfigData->SwAddressType == IPv4_ETHER_PROTO_TYPE) {
|
||||
if (ConfigData->SwAddressType == IPV4_ETHER_PROTO_TYPE) {
|
||||
CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));
|
||||
|
||||
if (!Ip4IsUnicast (NTOHL (Ip), 0)) {
|
||||
@@ -1224,7 +1223,6 @@ CLEAN_EXIT:
|
||||
@return The count of the deleted cache entries.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
UINTN
|
||||
ArpDeleteCacheEntryInTable (
|
||||
IN LIST_ENTRY *CacheTable,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation
|
||||
Copyright (c) 2006 - 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
|
||||
@@ -39,8 +39,8 @@ Abstract:
|
||||
|
||||
|
||||
#define ARP_ETHER_PROTO_TYPE 0x0806
|
||||
#define IPv4_ETHER_PROTO_TYPE 0x0800
|
||||
#define IPv6_ETHER_PROTO_TYPE 0x86DD
|
||||
#define IPV4_ETHER_PROTO_TYPE 0x0800
|
||||
#define IPV6_ETHER_PROTO_TYPE 0x86DD
|
||||
|
||||
#define ARP_OPCODE_REQUEST 0x0001
|
||||
#define ARP_OPCODE_REPLY 0x0002
|
||||
@@ -172,6 +172,27 @@ typedef struct _ARP_CACHE_ENTRY {
|
||||
LIST_ENTRY UserRequestList;
|
||||
} ARP_CACHE_ENTRY;
|
||||
|
||||
/**
|
||||
This function is used to assign a station address to the ARP cache for this instance
|
||||
of the ARP driver. A call to this function with the ConfigData field set to NULL
|
||||
will reset this ARP instance.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure.
|
||||
|
||||
@retval EFI_SUCCESS The new station address was successfully
|
||||
registered.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
||||
This is NULL. SwAddressLength is zero when
|
||||
ConfigData is not NULL. StationAddress is NULL
|
||||
when ConfigData is not NULL.
|
||||
@retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
|
||||
StationAddress is different from the one that is
|
||||
already registered.
|
||||
@retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be
|
||||
allocated.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpConfigure (
|
||||
@@ -179,6 +200,40 @@ ArpConfigure (
|
||||
IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
This function is used to insert entries into the ARP cache.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param DenyFlag Set to TRUE if this entry is a deny entry. Set to
|
||||
FALSE if this entry is a normal entry.
|
||||
@param TargetSwAddress Pointer to a protocol address to add (or deny).
|
||||
May be set to NULL if DenyFlag is TRUE.
|
||||
@param TargetHwAddress Pointer to a hardware address to add (or deny).
|
||||
May be set to NULL if DenyFlag is TRUE.
|
||||
@param TimeoutValue Time in 100-ns units that this entry will remain
|
||||
in the ARP cache. A value of zero means that the
|
||||
entry is permanent. A nonzero value will override
|
||||
the one given by Configure() if the entry to be
|
||||
added is a dynamic entry.
|
||||
@param Overwrite If TRUE, the matching cache entry will be
|
||||
overwritten with the supplied parameters. If
|
||||
FALSE, EFI_ACCESS_DENIED is returned if the
|
||||
corresponding cache entry already exists.
|
||||
|
||||
@retval EFI_SUCCESS The entry has been added or updated.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
||||
This is NULL. DenyFlag is FALSE and
|
||||
TargetHwAddress is NULL. DenyFlag is FALSE and
|
||||
TargetSwAddress is NULL. TargetHwAddress is NULL
|
||||
and TargetSwAddress is NULL. Both TargetSwAddress
|
||||
and TargetHwAddress are not NULL when DenyFlag is
|
||||
TRUE.
|
||||
@retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
|
||||
@retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite
|
||||
is not true.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpAdd (
|
||||
@@ -190,6 +245,33 @@ ArpAdd (
|
||||
IN BOOLEAN Overwrite
|
||||
);
|
||||
|
||||
/**
|
||||
This function searches the ARP cache for matching entries and allocates a buffer into
|
||||
which those entries are copied.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param BySwAddress Set to TRUE to look for matching software protocol
|
||||
addresses. Set to FALSE to look for matching
|
||||
hardware protocol addresses.
|
||||
@param AddressBuffer Pointer to address buffer. Set to NULL to match
|
||||
all addresses.
|
||||
@param EntryLength The size of an entry in the entries buffer.
|
||||
@param EntryCount The number of ARP cache entries that are found by
|
||||
the specified criteria.
|
||||
@param Entries Pointer to the buffer that will receive the ARP
|
||||
cache entries.
|
||||
@param Refresh Set to TRUE to refresh the timeout value of the
|
||||
matching ARP cache entry.
|
||||
|
||||
@retval EFI_SUCCESS The requested ARP cache entries were copied into
|
||||
the buffer.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
||||
This is NULL. Both EntryCount and EntryLength are
|
||||
NULL, when Refresh is FALSE.
|
||||
@retval EFI_NOT_FOUND No matching entries were found.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpFind (
|
||||
@@ -202,6 +284,23 @@ ArpFind (
|
||||
IN BOOLEAN Refresh
|
||||
);
|
||||
|
||||
/**
|
||||
This function removes specified ARP cache entries.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param BySwAddress Set to TRUE to delete matching protocol addresses.
|
||||
Set to FALSE to delete matching hardware
|
||||
addresses.
|
||||
@param AddressBuffer Pointer to the address buffer that is used as a
|
||||
key to look for the cache entry. Set to NULL to
|
||||
delete all entries.
|
||||
|
||||
@retval EFI_SUCCESS The entry was removed from the ARP cache.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL.
|
||||
@retval EFI_NOT_FOUND The specified deletion key was not found.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpDelete (
|
||||
@@ -210,12 +309,46 @@ ArpDelete (
|
||||
IN VOID *AddressBuffer OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
This function delete all dynamic entries from the ARP cache that match the specified
|
||||
software protocol type.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
|
||||
@retval EFI_SUCCESS The cache has been flushed.
|
||||
@retval EFI_INVALID_PARAMETER This is NULL.
|
||||
@retval EFI_NOT_FOUND There are no matching dynamic cache entries.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpFlush (
|
||||
IN EFI_ARP_PROTOCOL *This
|
||||
);
|
||||
|
||||
/**
|
||||
This function tries to resolve the TargetSwAddress and optionally returns a
|
||||
TargetHwAddress if it already exists in the ARP cache.
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param TargetSwAddress Pointer to the protocol address to resolve.
|
||||
@param ResolvedEvent Pointer to the event that will be signaled when
|
||||
the address is resolved or some error occurs.
|
||||
@param TargetHwAddress Pointer to the buffer for the resolved hardware
|
||||
address in network byte order.
|
||||
|
||||
@retval EFI_SUCCESS The data is copied from the ARP cache into the
|
||||
TargetHwAddress buffer.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
||||
This is NULL. TargetHwAddress is NULL.
|
||||
@retval EFI_ACCESS_DENIED The requested address is not present in the normal
|
||||
ARP cache but is present in the deny address list.
|
||||
Outgoing traffic to that address is forbidden.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
@retval EFI_NOT_READY The request has been started and is not finished.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpRequest (
|
||||
@@ -225,6 +358,27 @@ ArpRequest (
|
||||
OUT VOID *TargetHwAddress
|
||||
);
|
||||
|
||||
/**
|
||||
This function aborts the previous ARP request (identified by This, TargetSwAddress
|
||||
and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().
|
||||
|
||||
@param This Pointer to the EFI_ARP_PROTOCOL instance.
|
||||
@param TargetSwAddress Pointer to the protocol address in previous
|
||||
request session.
|
||||
@param ResolvedEvent Pointer to the event that is used as the
|
||||
notification event in previous request session.
|
||||
|
||||
@retval EFI_SUCCESS The pending request session(s) is/are aborted and
|
||||
corresponding event(s) is/are signaled.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
|
||||
This is NULL. TargetSwAddress is not NULL and
|
||||
ResolvedEvent is NULL. TargetSwAddress is NULL and
|
||||
ResolvedEvent is not NULL.
|
||||
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
|
||||
@retval EFI_NOT_FOUND The request is not issued by
|
||||
EFI_ARP_PROTOCOL.Request().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ArpCancel (
|
||||
@@ -233,12 +387,41 @@ ArpCancel (
|
||||
IN EFI_EVENT ResolvedEvent OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Configure the instance using the ConfigData. ConfigData is already validated.
|
||||
|
||||
@param Instance Pointer to the instance context data to be
|
||||
configured.
|
||||
@param ConfigData Pointer to the configuration data used to
|
||||
configure the instance.
|
||||
|
||||
@retval EFI_SUCCESS The instance is configured with the ConfigData.
|
||||
@retval EFI_ACCESS_DENIED The instance is already configured and the
|
||||
ConfigData tries to reset some unchangeable
|
||||
fields.
|
||||
@retval EFI_INVALID_PARAMETER The ConfigData provides a non-unicast IPv4 address
|
||||
when the SwAddressType is IPv4.
|
||||
@retval EFI_OUT_OF_RESOURCES The instance fails to configure due to memory
|
||||
limitation.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ArpConfigureInstance (
|
||||
IN ARP_INSTANCE_DATA *Instance,
|
||||
IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Find the CacheEntry, using ProtocolAddress or HardwareAddress or both, as the keyword,
|
||||
in the DeniedCacheTable.
|
||||
|
||||
@param ArpService Pointer to the arp service context data.
|
||||
@param ProtocolAddress Pointer to the protocol address.
|
||||
@param HardwareAddress Pointer to the hardware address.
|
||||
|
||||
@return Pointer to the matched cache entry, if NULL no match is found.
|
||||
|
||||
**/
|
||||
ARP_CACHE_ENTRY *
|
||||
ArpFindDeniedCacheEntry (
|
||||
IN ARP_SERVICE_DATA *ArpService,
|
||||
@@ -246,6 +429,19 @@ ArpFindDeniedCacheEntry (
|
||||
IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Find the CacheEntry which matches the requirements in the specified CacheTable.
|
||||
|
||||
@param CacheTable Pointer to the arp cache table.
|
||||
@param StartEntry Pointer to the start entry this search begins with
|
||||
in the cache table.
|
||||
@param FindOpType The search type.
|
||||
@param ProtocolAddress Pointer to the protocol address to match.
|
||||
@param HardwareAddress Pointer to the hardware address to match.
|
||||
|
||||
@return Pointer to the matched arp cache entry, if NULL, no match is found.
|
||||
|
||||
**/
|
||||
ARP_CACHE_ENTRY *
|
||||
ArpFindNextCacheEntryInTable (
|
||||
IN LIST_ENTRY *CacheTable,
|
||||
@@ -255,11 +451,30 @@ ArpFindNextCacheEntryInTable (
|
||||
IN NET_ARP_ADDRESS *HardwareAddress OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Allocate a cache entry and initialize it.
|
||||
|
||||
@param Instance Pointer to the instance context data.
|
||||
|
||||
@return Pointer to the new created cache entry.
|
||||
|
||||
**/
|
||||
ARP_CACHE_ENTRY *
|
||||
ArpAllocCacheEntry (
|
||||
IN ARP_INSTANCE_DATA *Instance
|
||||
);
|
||||
|
||||
/**
|
||||
Fill the addresses in the CacheEntry using the information passed in by
|
||||
HwAddr and SwAddr.
|
||||
|
||||
@param CacheEntry Pointer to the cache entry.
|
||||
@param HwAddr Pointer to the software address.
|
||||
@param SwAddr Pointer to the hardware address.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ArpFillAddressInCacheEntry (
|
||||
IN ARP_CACHE_ENTRY *CacheEntry,
|
||||
@@ -267,6 +482,16 @@ ArpFillAddressInCacheEntry (
|
||||
IN NET_ARP_ADDRESS *SwAddr OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Turn the CacheEntry into the resolved status.
|
||||
|
||||
@param CacheEntry Pointer to the resolved cache entry.
|
||||
@param Instance Pointer to the instance context data.
|
||||
@param UserEvent Pointer to the UserEvent to notify.
|
||||
|
||||
@return The count of notifications sent to the instance.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
ArpAddressResolved (
|
||||
IN ARP_CACHE_ENTRY *CacheEntry,
|
||||
@@ -274,6 +499,19 @@ ArpAddressResolved (
|
||||
IN EFI_EVENT UserEvent OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Delete cache entries in all the cache tables.
|
||||
|
||||
@param Instance Pointer to the instance context data.
|
||||
@param BySwAddress Delete the cache entry by software address or by
|
||||
hardware address.
|
||||
@param AddressBuffer Pointer to the buffer containing the address to
|
||||
match for the deletion.
|
||||
@param Force This deletion is forced or not.
|
||||
|
||||
@return The count of the deleted cache entries.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
ArpDeleteCacheEntry (
|
||||
IN ARP_INSTANCE_DATA *Instance,
|
||||
@@ -282,6 +520,18 @@ ArpDeleteCacheEntry (
|
||||
IN BOOLEAN Force
|
||||
);
|
||||
|
||||
/**
|
||||
Send out an arp frame using the CachEntry and the ArpOpCode.
|
||||
|
||||
@param Instance Pointer to the instance context data.
|
||||
@param CacheEntry Pointer to the configuration data used to
|
||||
configure the instance.
|
||||
@param ArpOpCode The opcode used to send out this Arp frame, either
|
||||
request or reply.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ArpSendFrame (
|
||||
IN ARP_INSTANCE_DATA *Instance,
|
||||
@@ -289,18 +539,47 @@ ArpSendFrame (
|
||||
IN UINT16 ArpOpCode
|
||||
);
|
||||
|
||||
/**
|
||||
Initialize the instance context data.
|
||||
|
||||
@param ArpService Pointer to the arp service context data this
|
||||
instance belongs to.
|
||||
@param Instance Pointer to the instance context data.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
ArpInitInstance (
|
||||
IN ARP_SERVICE_DATA *ArpService,
|
||||
IN ARP_INSTANCE_DATA *Instance
|
||||
);
|
||||
|
||||
/**
|
||||
Process the Arp packets received from Mnp, the procedure conforms to RFC826.
|
||||
|
||||
@param Context Pointer to the context data registerd to the
|
||||
Event.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ArpOnFrameRcvdDpc (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.
|
||||
|
||||
@param Event The Event this notify function registered to.
|
||||
@param Context Pointer to the context data registerd to the
|
||||
Event.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ArpOnFrameRcvd (
|
||||
@@ -308,12 +587,31 @@ ArpOnFrameRcvd (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Process the already sent arp packets.
|
||||
|
||||
@param Context Pointer to the context data registerd to the
|
||||
Event.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ArpOnFrameSentDpc (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.
|
||||
|
||||
@param Event The Event this notify function registered to.
|
||||
@param Context Pointer to the context data registerd to the
|
||||
Event.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ArpOnFrameSent (
|
||||
@@ -321,6 +619,16 @@ ArpOnFrameSent (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Process the arp cache olding and drive the retrying arp requests.
|
||||
|
||||
@param Event The Event this notify function registered to.
|
||||
@param Context Pointer to the context data registerd to the
|
||||
Event.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ArpTimerHandler (
|
||||
@@ -328,6 +636,18 @@ ArpTimerHandler (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
Cancel the arp request.
|
||||
|
||||
@param Instance Pointer to the instance context data.
|
||||
@param TargetSwAddress Pointer to the buffer containing the target
|
||||
software address to match the arp request.
|
||||
@param UserEvent The user event used to notify this request
|
||||
cancellation.
|
||||
|
||||
@return The count of the cancelled requests.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
ArpCancelRequest (
|
||||
IN ARP_INSTANCE_DATA *Instance,
|
||||
@@ -335,6 +655,29 @@ ArpCancelRequest (
|
||||
IN EFI_EVENT UserEvent OPTIONAL
|
||||
);
|
||||
|
||||
/**
|
||||
Find the cache entry in the cache table.
|
||||
|
||||
@param Instance Pointer to the instance context data.
|
||||
@param BySwAddress Set to TRUE to look for matching software protocol
|
||||
addresses. Set to FALSE to look for matching
|
||||
hardware protocol addresses.
|
||||
@param AddressBuffer Pointer to address buffer. Set to NULL to match
|
||||
all addresses.
|
||||
@param EntryLength The size of an entry in the entries buffer.
|
||||
@param EntryCount The number of ARP cache entries that are found by
|
||||
the specified criteria.
|
||||
@param Entries Pointer to the buffer that will receive the ARP
|
||||
cache entries.
|
||||
@param Refresh Set to TRUE to refresh the timeout value of the
|
||||
matching ARP cache entry.
|
||||
|
||||
@retval EFI_SUCCESS The requested ARP cache entries are copied into
|
||||
the buffer.
|
||||
@retval EFI_NOT_FOUND No matching entries found.
|
||||
@retval EFI_OUT_OF_RESOURCE There is a memory allocation failure.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
ArpFindCacheEntry (
|
||||
IN ARP_INSTANCE_DATA *Instance,
|
||||
|
@@ -495,7 +495,7 @@ ArpRequest (
|
||||
SnpMode = &ArpService->SnpMode;
|
||||
|
||||
if ((TargetSwAddress == NULL) ||
|
||||
((Instance->ConfigData.SwAddressType == IPv4_ETHER_PROTO_TYPE) &&
|
||||
((Instance->ConfigData.SwAddressType == IPV4_ETHER_PROTO_TYPE) &&
|
||||
IP4_IS_LOCAL_BROADCAST (*((UINT32 *)TargetSwAddress)))) {
|
||||
//
|
||||
// Return the hardware broadcast address.
|
||||
@@ -505,7 +505,7 @@ ArpRequest (
|
||||
goto SIGNAL_USER;
|
||||
}
|
||||
|
||||
if ((Instance->ConfigData.SwAddressType == IPv4_ETHER_PROTO_TYPE) &&
|
||||
if ((Instance->ConfigData.SwAddressType == IPV4_ETHER_PROTO_TYPE) &&
|
||||
IP4_IS_MULTICAST (NTOHL (*((UINT32 *)TargetSwAddress)))) {
|
||||
//
|
||||
// If the software address is an IPv4 multicast address, invoke Mnp to
|
||||
|
Reference in New Issue
Block a user