Jump to main content

##

# TCPIP_ARP_EntryGet Function

## C

    TCPIP_ARP_RESULT TCPIP_ARP_EntryGet(
        TCPIP_NET_HANDLE hNet,
        IPV4_ADDR* ipAdd,
        TCPIP_MAC_ADDR* pHwAdd,
        bool probe
    );

## Description

If probe == false The function behaves identical to TCPIP_ARP_IsResolved(): If the corresponding MAC address exists in the cache it is copied to the user supplied pHwAdd.

If probe == true, the function behaves identical to TCPIP_ARP_Resolve():

- If the corresponding MAC address does not exist in the cache this function transmits and ARP request. Upon the address resolution it calls the registered handler (if available) with the supplied notification parameter (if != 0)
- If the hardware address exists in the cache, the result is written to pHwAdd and no network ARP request is sent.

## Preconditions

The ARP module should have been initialized.

## Parameters

Parameters | Description
--- | ---
hNet | Interface to use.
ipAdd | IP Address to get entries for.
pHwAdd | Pointer to store the hardware address.
probe | Boolean to specify if ARP probing is initiated or not.

## Returns

- ARP_RES_ENTRY_SOLVED - if the required entry is already solved.
- ARP_RES_ENTRY_QUEUED - if the required entry was already queued.
- ARP_RES_ENTRY_NEW - if the operation succeeded and a new entry was added (and queued for resolving).
- ARP_RES_CACHE_FULL - if new entry could not be inserted, the cache was full.
- ARP_RES_BAD_ADDRESS - bad address specified.
- ARP_RES_NO_INTERFACE - no such interface.

## Remarks

Similar to TCPIP_ARP_Resolve + TCPIP_ARP_IsResolved, it avoids a double hash search when the mapping exists.