VxWorks API Reference : OS Libraries
proxyArpLib - proxy Address Resolution Protocol (ARP) server library
proxyArpLibInit( ) - initialize proxy ARP
proxyNetCreate( ) - create a proxy ARP network
proxyNetDelete( ) - delete a proxy network
proxyNetShow( ) - show proxy ARP networks
proxyPortFwdOn( ) - enable broadcast forwarding for a particular port
proxyPortFwdOff( ) - disable broadcast forwarding for a particular port
proxyPortShow( ) - show ports enabled for broadcast forwarding
This library implements a proxy ARP server that uses the Address Resolution Protocol (ARP) to make physically distinct networks appear as one logical network (that is, the networks share the same address space). The server forwards ARP messages between the separate networks so that hosts on the main network can access hosts on the proxy network without altering their routing tables.
The proxyArpLibInit( ) initializes the server and adds this library to the VxWorks image. This happens automatically if INCLUDE_PROXY_SERVER is defined at the time the image is built. The proxyNetCreate( ) and proxyNetDelete( ) routines will enable and disable the forwarding of ARP messages between networks. The proxyNetShow( ) routine displays the current set of proxy networks and the main network and known clients for each.
By default, this server automatically adds a client when it first detects an ARP message from that host. A VxWorks target can also register as a client with the proxyReg( ) routine and remove that registration with the proxyUnreg( ) routine. See the proxyLib manual pages for details.
To minimize traffic on the main network, the proxy server will only forward broadcast packets to the specified destination ports visible with the proxyPortShow( ) routine. The proxyPortFwdOn( ) and proxyPortFwdOff( ) routines will alter the current settings. Initially, broadcast forwarding is not active for any ports.
proxyArpLib.h
proxyLib, RFC 925, RFC 1027, RFC 826
Under VxWorks AE, the functions you assign for either proxyArpHook or proxyBroadcastHook must be valid within the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks.
Structure Chart:
v v proxyArpLibInit proxyNetShow (in_arpinput) v ----------------proxyArpInput------------------------------------------ / / | \ \ \ \ v | | | | | | proxyArpReplyFwd------|---------------|--|---------------------|--------> | | v | | | | v | proxyArpRequestFwd---- -|--|---------------------|--------> proxyArpReply | / | | | | | | | | | | | v v v | | | | proxyArpSend | | | | | | | | | | | | (ipintr) | | | | v | | | | --proxyBroadcastInput-----------------|--> | | / | \ | | | | v ------ <-----------/ | (do_protocol) | | proxyBroadcast | | | v | | | | | proxyMsgInput-----> | |----/ | | | | | | | | | | | | | v | | | | | | proxyIsAMainNet | | | | | v | | /---/ | | |proxyNetCreate| | | | | | v | | | v | |proxyNetDelete| ----------------------|-proxyClientAdd| | v v / | v v | | proxyNetFind<-/ |proxyClientDelete| | v v | \ proxyClientFind<-/ ------------\ v | v v proxyPortFwdOn | proxyPortFwdOff proxyPortShow | | | | | \------------------>|<-------/<--------------------/ v v proxyPortPrint proxyPortTblFind
proxyArpLibInit( ) - initialize proxy ARP
STATUS proxyArpLibInit ( int clientSizeLog2, /* client table size as power of two */ int portSizeLog2 /* port table size as power of two */ )
This routine starts the proxy ARP server by initializing the required data structures and installing the necessary input hooks. It should be called
only once; subsequent calls have no effect. The clientSizeLog2 and portSizeLog2 parameters specify the internal hash table sizes. Each must be equal to a power of two, or zero to use a default size value.
OK, or ERROR if unsuccessful.
proxyNetCreate( ) - create a proxy ARP network
STATUS proxyNetCreate ( char * proxyAddr, /* address of proxy network interface */ char * mainAddr /* address of main network interface */ )
This routine activates proxy services between the proxy network connected to the interface with the proxyAddr IP address and the main network connected to the interface with the mainAddr address. Once registration is complete, the proxy server will disguise the physically separated networks as a single logical network.
The corresponding interfaces must be attached and configured with IP addresses before calling this routine. If the proxy network shares the same logical subnet number as the main network, the corresponding interface to the proxy network must use a value of 255.255.255.255 for the netmask.
OK, or ERROR if unsuccessful.
S_proxyArpLib_INVALID_ADDRESS
proxyNetDelete( ) - delete a proxy network
STATUS proxyNetDelete ( char * proxyAddr /* proxy net address */ )
This routine deletes the proxy network specified by proxyAddr. It also removes all the proxy clients that exist on that network.
OK, or ERROR if unsuccessful.
proxyNetShow( ) - show proxy ARP networks
void proxyNetShow (void)
This routine displays the proxy networks and their associated clients.
-> proxyNetShow main interface 147.11.1.182 proxy interface 147.11.1.183 client 147.11.1.184
N/A
proxyPortFwdOn( ) - enable broadcast forwarding for a particular port
STATUS proxyPortFwdOn ( int port /* port number */ )
This routine enables broadcasts destined for the port, port, to be forwarded to and from the proxy network. To enable all ports, specify zero for port.
OK, or ERROR if unsuccessful.
proxyPortFwdOff( ) - disable broadcast forwarding for a particular port
STATUS proxyPortFwdOff ( int port /* port number */ )
This routine disables broadcast forwarding on port number port. To disable the (previously enabled) forwarding of all ports via proxyPortFwdOn( ), specify zero for port.
OK, or ERROR if unsuccessful.
proxyPortShow( ) - show ports enabled for broadcast forwarding
void proxyPortShow (void)
This routine displays the destination ports for which the proxy ARP server will forward broadcast messages between the physically separate networks.
-> proxyPortShow enabled ports: port 67
N/A