VxWorks API Reference : OS Libraries

routeEntryLib

NAME

routeEntryLib - route interface library for multiple matching entries

ROUTINES

routeTableWalk( ) - traverse the IP routing table


OS Libraries : Routines

routeTableWalk( )

NAME

routeTableWalk( ) - traverse the IP routing table

SYNOPSIS

STATUS routeTableWalk
    (
    struct sockaddr * pDest,   /* destination address, or NULL if none. */
    int               protoId, /* route source, or 0 for any. */
    VOIDFUNCPTR       pFunc,   /* callback function */
    void *            pArg     /* optional callback function argument */
    )

DESCRIPTION

This routine applies the provided function to every entry in the IP routing table which meets the criteria indicated by the pDest and protoId arguments. If a destination address is specified, the given function executes for each route table entry which matches the destination. If a protocol identifer is supplied, the function executes for each entry created by the protocol instead. If no value is specified, the routine displays every entry in the table. The supplied argument pArg is passed back to callback function.

RETURNS

OK if traversal completes, or ERROR otherwise.

NOTE

Only one of the two values pDest and protoId should be specified.
      Specifying both results in ERROR being returned.

NOTE

The provided routine executes while the system holds internal locks
      which restrict all network stack activity and any routing operations
      to the calling task. That routine MUST NOT perform any operations
      which alter the existing routing table. This walk routine relies on
      a fixed order of all route entries to complete. Creating or removing
      route entries could corrupt the table, causing the calling task to
      enter an endless loop or halt completely. That behavior would
      deadlock the entire network system, since other tasks would wait
      indefinitely for the unavailable locks.

SEE ALSO

routeEntryLib