VxWorks API Reference : OS Libraries

proxyArpLib

NAME

proxyArpLib - proxy Address Resolution Protocol (ARP) server library

ROUTINES

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

DESCRIPTION

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.

INCLUDE FILES

proxyArpLib.h

SEE ALSO

proxyLib, RFC 925, RFC 1027, RFC 826

VXWORKS AE PROTECTION DOMAINS

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


OS Libraries : Routines

proxyArpLibInit( )

NAME

proxyArpLibInit( ) - initialize proxy ARP

SYNOPSIS

STATUS proxyArpLibInit
    (
    int clientSizeLog2,       /* client table size as power of two */
    int portSizeLog2          /* port table size as power of two */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if unsuccessful.

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyNetCreate( )

NAME

proxyNetCreate( ) - create a proxy ARP network

SYNOPSIS

STATUS proxyNetCreate
    (
    char * proxyAddr,         /* address of proxy network interface */
    char * mainAddr           /* address of main network interface */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if unsuccessful.

ERRNO

 S_proxyArpLib_INVALID_ADDRESS

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyNetDelete( )

NAME

proxyNetDelete( ) - delete a proxy network

SYNOPSIS

STATUS proxyNetDelete
    (
    char * proxyAddr          /* proxy net address */
    )

DESCRIPTION

This routine deletes the proxy network specified by proxyAddr. It also removes all the proxy clients that exist on that network.

RETURNS

OK, or ERROR if unsuccessful.

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyNetShow( )

NAME

proxyNetShow( ) - show proxy ARP networks

SYNOPSIS

void proxyNetShow (void)

DESCRIPTION

This routine displays the proxy networks and their associated clients.

EXAMPLE

    -> proxyNetShow
    main interface 147.11.1.182 proxy interface 147.11.1.183
       client 147.11.1.184

RETURNS

N/A

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyPortFwdOn( )

NAME

proxyPortFwdOn( ) - enable broadcast forwarding for a particular port

SYNOPSIS

STATUS proxyPortFwdOn
    (
    int port                  /* port number */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if unsuccessful.

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyPortFwdOff( )

NAME

proxyPortFwdOff( ) - disable broadcast forwarding for a particular port

SYNOPSIS

STATUS proxyPortFwdOff
    (
    int port                  /* port number */
    )

DESCRIPTION

This routine disables broadcast forwarding on port number port. To disable the (previously enabled) forwarding of all ports via proxyPortFwdOn( ), specify zero for port.

RETURNS

OK, or ERROR if unsuccessful.

SEE ALSO

proxyArpLib


OS Libraries : Routines

proxyPortShow( )

NAME

proxyPortShow( ) - show ports enabled for broadcast forwarding

SYNOPSIS

void proxyPortShow (void)

DESCRIPTION

This routine displays the destination ports for which the proxy ARP server will forward broadcast messages between the physically separate networks.

EXAMPLE

    -> proxyPortShow
    enabled ports:
       port 67

RETURNS

N/A

SEE ALSO

proxyArpLib