VxWorks Reference Manual : Libraries
arpLib - Address Resolution Protocol (ARP) table manipulation library
arpAdd( ) - add an entry to the system ARP table
arpDelete( ) - delete an entry from the system ARP table
arpFlush( ) - flush all entries in the system ARP table
This library provides functionality for manipulating the system Address Resolution Protocol (ARP) table (cache). ARP is used by the networking modules to map dynamically between Internet Protocol (IP) addresses and physical hardware (Ethernet) addresses. Once these addresses get resolved, they are stored in the system ARP table.
Two routines allow the caller to modify this ARP table manually: arpAdd( ) and arpDelete( ). Use arpAdd( ) to add new or modify existing entries in the ARP table. Use arpDelete( ) to delete entries from the ARP table. Use arpShow( ) to show current entries in the ARP table.
arpLib.h
arpLib, inetLib, routeLib, etherLib, netShow, VxWorks Programmer's Guide: Network
arpAdd( ) - add an entry to the system ARP table
STATUS arpAdd ( char * host, /* host name or IP address */ char * eaddr, /* Ethernet address */ int flags /* ARP flags */ )
This routine adds a specified entry to the ARP table. host is a valid host name or Internet address. eaddr is the Ethernet address of the host and has the form "x:x:x:x:x:x" where x is a hexadecimal number between 0 and ff.
The flags parameter specifies the ARP flags for the entry; the following bits are settable:
- ATF_PERM (0x04)
- The ATF_PERM bit makes the ARP entry permanent. A permanent ARP entry does not time out as do normal ARP entries.
- ATF_PUBL (0x08)
- The ATF_PUBL bit causes the entry to be published (i.e., this system responds to ARP requests for this entry, even though it is not the host).
- ATF_USETRAILERS (0x10)
- The ATF_USETRAILERS bit indicates that trailer encapsulations can be sent to this host.
* The following call creates a permanent ARP table entry for the host with IP address 90.0.0.3 and Ethernet address 0:80:f9:1:2:3:
arpAdd ("90.0.0.3", "0:80:f9:1:2:3", 0x4)The following call adds an entry to the ARP table for host "myHost", with an Ethernet address of 0:80:f9:1:2:4; no flags are set for this entry:arpAdd ("myHost", "0:80:f9:1:2:4", 0)
OK, or ERROR if unsuccessful.
S_arpLib_INVALID_ARGUMENT, S_arpLib_INVALID_FLAG
arpDelete( ) - delete an entry from the system ARP table
STATUS arpDelete ( char * host /* host name or IP address */ )
This routine deletes an ARP table entry. host specifies the entry to delete and is a valid host name or Internet address.
arpDelete ("91.0.0.3") arpDelete ("myHost")
OK, or ERROR if unsuccessful.
S_arpLib_INVALID_ARGUMENT
arpFlush( ) - flush all entries in the system ARP table
void arpFlush (void)
This routine flushes all non-permanent entries in the ARP cache.
N/A