VxWorks Reference Manual : Libraries

arpLib

NAME

arpLib - Address Resolution Protocol (ARP) table manipulation library

ROUTINES

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

DESCRIPTION

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.

INCLUDE FILES

arpLib.h

SEE ALSO

arpLib, inetLib, routeLib, etherLib, netShow, VxWorks Programmer's Guide: Network


Libraries : Routines

arpAdd( )

NAME

arpAdd( ) - add an entry to the system ARP table

SYNOPSIS

STATUS arpAdd
    (
    char * host,  /* host name or IP address */
    char * eaddr, /* Ethernet address */
    int    flags  /* ARP flags */
    )

DESCRIPTION

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.

EXAMPLE

* 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)

RETURNS

OK, or ERROR if unsuccessful.

ERRNO

S_arpLib_INVALID_ARGUMENT, S_arpLib_INVALID_FLAG

SEE ALSO

arpLib


Libraries : Routines

arpDelete( )

NAME

arpDelete( ) - delete an entry from the system ARP table

SYNOPSIS

STATUS arpDelete
    (
    char * host /* host name or IP address */
    )

DESCRIPTION

This routine deletes an ARP table entry. host specifies the entry to delete and is a valid host name or Internet address.

EXAMPLE

   arpDelete ("91.0.0.3")
   arpDelete ("myHost")

RETURNS

OK, or ERROR if unsuccessful.

ERRNO

S_arpLib_INVALID_ARGUMENT

SEE ALSO

arpLib


Libraries : Routines

arpFlush( )

NAME

arpFlush( ) - flush all entries in the system ARP table

SYNOPSIS


void arpFlush (void)

DESCRIPTION

This routine flushes all non-permanent entries in the ARP cache.

RETURNS

N/A

SEE ALSO

arpLib