/* Fill the addresses in the CacheEntry using the information passed in by HwAddr and SwAddr. */
VOID ArpFillAddressInCacheEntry(IN ARP_CACHE_ENTRY *CacheEntry, IN NET_ARP_ADDRESS *HwAddr OPTIONAL, IN NET_ARP_ADDRESS *SwAddr OPTIONAL)
/* Fill the addresses in the CacheEntry using the information passed in by HwAddr and SwAddr. */
VOID ArpFillAddressInCacheEntry(IN ARP_CACHE_ENTRY *CacheEntry, IN NET_ARP_ADDRESS *HwAddr OPTIONAL, IN NET_ARP_ADDRESS *SwAddr OPTIONAL)
{
  NET_ARP_ADDRESS  *Address[2];
  NET_ARP_ADDRESS  *CacheAddress;
  UINT32           Index;
  Address[Hardware] = HwAddr;
  Address[Protocol] = SwAddr;
  for (Index = 0; Index < 2; Index++) {
    if (Address[Index] != NULL) {
      CacheAddress = &CacheEntry->Addresses[Index];
      CacheAddress->Type   = Address[Index]->Type;
      CacheAddress->Length = Address[Index]->Length;
      if (Address[Index]->AddressPtr != NULL) {
        CopyMem (
          CacheAddress->AddressPtr,
          Address[Index]->AddressPtr,
          CacheAddress->Length
          );
      } else {
        ZeroMem (CacheAddress->AddressPtr, CacheAddress->Length);
      }
    }
  }
}