Updates arp entries for a given IP address.
int arpupdate (ac, m, hp, action, prm)
register struct arpcom *ac;
struct mbuf *m;
caddr_t hp;
int action;
struct arpupdate_parm *prm;
The arpupdate subroutine updates arp entries for a given IP address. It is called by arpinput from the IF layer of the interface. This subroutine searches the arp table for an entry that matches the IP address. It then updates the arp entry for the given IP address. The arpupdate subroutine also performs reverse arp lookups.
The arpupdate subroutine enters a new address in arptab, pushing out the oldest entry from the bucket if there is no room. This subroutine always succeeds because no bucket can be completely filled with permanent entries (except when arpioctl tests whether another permanent entry can fit).
Depending on the action specified, the prm IP addresses isaddr, itaddr, and myaddr are used by the arpupdate subroutine.
Item | Description |
---|---|
ac | Points to the arpcom structure. |
m | Points to the memory buffer (mbuf), that contains the arp response packet received by the interface. |
hp | Points to the buffer that is passed by the interrupt handler. |
action | Returns a value that indicates which action
is taken:
|
prm | Points to the arpudpate_parm structure.
The values are:
|
Item | Description |
---|---|
ARP_OK | Lookup or update was successful. |
ARP_FAIL | Lookup or update failed. |
ARP_NEWF | New arp entry could not be created. |