VxWorks Reference Manual : Libraries

ospfLib

NAME

ospfLib - OSPF version 2 (RFC 1583) routing facilities (OSPF Option)

ROUTINES

m2OspfGeneralGroupGet( ) - get values of OSPF general group objects (OSPF Option)
m2OspfGeneralGroupSet( ) - set values of OSPF general group objects (OSPF Option)
m2OspfAreaEntryGet( ) - get an entry from the OSPF area table (OSPF Option)
m2OspfAreaEntrySet( ) - set values in an OSPF area entry (OSPF Option)
m2OspfStubAreaEntryGet( ) - get an OSPF stub area entry (OSPF Option)
m2OspfStubAreaEntrySet( ) - set values in an OSPF stub area entry (OSPF Option)
m2OspfLsdbEntryGet( ) - get an OSPF link state database entry (OSPF Option)
m2OspfAreaRangeEntryGet( ) - get an OSPF area range entry (OSPF Option)
m2OspfAreaRangeEntrySet( ) - set values in an OSPF area range entry (OSPF Option)
m2OspfHostEntryGet( ) - get an OSPF host entry (OSPF Option)
m2OspfHostEntrySet( ) - set values in an OSPF host entry (OSPF Option)
m2OspfIfEntryGet( ) - get an OSPF interface entry (OSPF Option)
m2OspfIfEntrySet( ) - set values in an OSPF interface entry (OSPF Option)
m2OspfIfMetricEntryGet( ) - get an OSPF interface metric entry (OSPF Option)
m2OspfIfMetricEntrySet( ) - set OSPF interface metric entry values (OSPF Option)
m2OspfVirtIfEntryGet( ) - get an OSPF virtual interface entry (OSPF Option)
m2OspfVirtIfEntrySet( ) - set OSPF virtual interface entry values (OSPF Option)
m2OspfNbrEntryGet( ) - get an OSPF neighbor entry (OSPF Option)
m2OspfNbrEntrySet( ) - set values in an OSPF neighbor entry (OSPF Option)
m2OspfVirtNbrEntryGet( ) - get an OSPF virtual neighbor entry (OSPF Option)
ospfExtRouteAdd( ) - import external route into OSPF domain (OSPF Option)
ospfExtRouteDelete( ) - delete external route imported into OSPF (OSPF Option)
ospfInit( ) - function to initialize OSPF routing (OSPF Option)
ospfNbmaDstAdd( ) - add NBMA destination
ospfNbmaDstDelete( ) - delete NBMA destination
ospfTerminate( ) - free OSPF resources and delete OSPF tasks

DESCRIPTION

This module implements OSPF Version 2 as specified in (RFC 1583). In addition to implementing the routing tasks, this module includes RFC 1253 compliant interfaces that you can use to configure the OSPF MIBs. These may be invoked directly or called by the relevant method routines of an SNMP agent.

To include OSPF in your image you must first define the INCLUDE_OSPF in configAll.h. Once the system is up and running you need to invoke the ospfInit( ) call. This call has the following structure:

    STATUS ospfInit
    (
        int priority,         /* priority of tasks */
        int options,          /* ospf task options */
        int stackSize,        /* task stack size */
        int routerId          /* the ID for this router */
        FUNCPTR ospfAuthHook  /* authentication hook */
    )
After OSPF is up and running, you should configure the OSPF MIB by using the various m2Ospf routines. The parameters to these routines are specified in the OSPF MIB as defined in RFC 1253. Explanations for each of the variables may be obtained from the RFC. For additional information on the MIB-II interfaces, please see the manual pages.

EXAMPLE

This section presents a sample configuration as well as the code necessary to make the example work. In the example system, a router is attached to two subnets 160.10.10.00 and 160.10.11.00 with 0xffffff00 as the subnet mask. The interface addresses are 160.10.10.5 and 160.10.11.5.

----------------------------------- 160.10.11.0 
             160.10.11.5 |
             ---------------------------
             |      Interface A        |
             |                         |
             |         Router          |
             |                         |
             |      Interface B        |
             ---------------------------
             160.10.10.5 |
 ------------------------------------ 160.10.10.0

To set this up programmatically, you would execute the following code:
void ospfSetup ()
    {
    /* This is a generic setup for all interfaces in the system. */
    M2_OSPF_AREA_ENTRY  area;
    M2_OSPF_IF_ENTRY    intf;

    area.ospfAreaId = 0x2;   /* using area id 2 */
    area.ospfAuthType = 0;   /* no authentication */

    if (m2OspfAreaEntrySet (M2_OSPF_AREA_ID |
        M2_OSPF_AUTH_TYPE, &area) != OK)
        {
        return (ERROR);
        };

    /* First we set up Interface A */
    /* set the interface address */
    intf.ospfIfIpAddress = 0xa00a0a05; /* 160.10.10.5 */
    
    /* address less interface is false */ 
    intf.ospfAddressLessIf = 0;
    
    /* interface area id set to 2 */ 
    intf.ospfIfAreaId =  2;
    
    /* router priority */
    intf.ospfIfRtrPriority = 5;
    
    /* various  time   intervals */
    intf.ospfIfTransitDelay   =   1;
    intf.ospfIfRetransInterval  =  3;
    intf.ospfIfHelloInterval = 10;
    intf.ospfIfRtrDeadInterval = 40;
    intf.ospfIfPollInterval = 30;
    
    /* enable OSPF on interface */
    intf.ospfIfAdminStat = M2_ospfAdminStat_enabled;
    
    /* set the parameters for this interface */
    if(m2OspfIfEntrySet (M2_OSPF_IF_AREA_ID |
        M2_OSPF_IF_RTR_PRIORITY |
        M2_OSPF_IF_RETRANS_INTERVAL |
        M2_OSPF_IF_HELLO_INTERVAL |
        M2_OSPF_IF_RTR_DEAD_INTERVAL |
        M2_OSPF_IF_POLL_INTERVAL |
        M2_OSPF_IF_ADMIN_STAT,
        &intf) != OK)
        {
        return (ERROR);
        }

    /* similar sequence for Interface B */

    intf.ospfIfIpAddress = 0xa00a0b05; /* 160.10.11.5 */
    intf.ospfAddressLessIf  = 0;
    intf.ospfIfAreaId   =    2;
    intf.ospfIfRtrPriority =  0;
    intf.ospfIfTransitDelay  =  1;
    intf.ospfIfRetransInterval  =  3;
    intf.ospfIfHelloInterval = 10;
    intf.ospfIfRtrDeadInterval = 40;
    intf.ospfIfPollInterval = 30;
    intf.ospfIfAdminStat = 1;
    
    if (m2OspfIfEntrySet (M2_OSPF_IF_AREA_ID |
        M2_OSPF_IF_RTR_PRIORITY |
        M2_OSPF_IF_RETRANS_INTERVAL |
        M2_OSPF_IF_HELLO_INTERVAL |
        M2_OSPF_IF_RTR_DEAD_INTERVAL |
        M2_OSPF_IF_POLL_INTERVAL |
        M2_OSPF_IF_ADMIN_STAT, &intf) != OK)
        {
        return (ERROR);
        }
        
After this code has executed, the system is set up to use OSPF to route between the two interfaces (A and B). The system will now continue to participate in the OSPF routing protocol until either the system is shut off or further calls are made into the system using the m2{*} interfaces. Note that it may not be necessary to set all the parameters as shown above if the default value of the parameter is acceptable for your configuration. Default values are as specified in the MIB (RFC 1253).

INCLUDE FILES

ospfLib.h

SEE ALSO

ospfLib, RFC 1583 and RFC 1253


Libraries : Routines

m2OspfGeneralGroupGet( )

NAME

m2OspfGeneralGroupGet( ) - get values of OSPF general group objects (OSPF Option)

SYNOPSIS

STATUS m2OspfGeneralGroupGet
    (
    M2_OSPF_GENERAL_GROUP * pInfo /* pointer to general group struct */
    )

DESCRIPTION

This routine fills in the structure pointed to by pInfo with the MIB-II values for the OSPF general group.

RETURNS

OK, or ERROR if the get request fails.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfGeneralGroupSet( )

NAME

m2OspfGeneralGroupSet( ) - set values of OSPF general group objects (OSPF Option)

SYNOPSIS

STATUS m2OspfGeneralGroupSet
    (
    int                     varsToSet, /* flags specifying vars to set */
    M2_OSPF_GENERAL_GROUP * pInfo      /* ptr to general group structure */
    )

DESCRIPTION

This routine sets the values of the OSPF general group objects. The variables to set are specified by a bitwise or of one or more of the flags M2_OSPF_ROUTER_ID, M2_OSPF_ADMIN_STAT, M2_OSPF_AS_BDR_RTR_STATUS, and M2_OSPF_TOS_SUPPORT, in the varsToSet parameter.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfAreaEntryGet( )

NAME

m2OspfAreaEntryGet( ) - get an entry from the OSPF area table (OSPF Option)

SYNOPSIS

STATUS m2OspfAreaEntryGet
    (
    int                  searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_AREA_ENTRY * pInfo       /* ptr to area entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled with the contents of the area entry specified by pInfo->ospfAreaId and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfAreaEntrySet( )

NAME

m2OspfAreaEntrySet( ) - set values in an OSPF area entry (OSPF Option)

SYNOPSIS

STATUS m2OspfAreaEntrySet
    (
    int                  varsToSet, /* flags specifying vars to set */
    M2_OSPF_AREA_ENTRY * pInfo      /* ptr to area entry */
    )

DESCRIPTION

The area entry specified by pInfo->ospfAreaId will be updated with the values provided by pInfo. The varsToSet parameter indicates the fields to set and is a bitwise or of one or more of M2_OSPF_AREA_ID, M2_OSPF_AUTH_TYPE, and M2_OSPF_IMPORT_AS_EXTERN.

Note that the backbone area (0.0.0.0) is always present and does not need to be created explicitly. It is an error to use the M2_OSPF_AREA_ID or M2_OSPF_IMPORT_AS_EXTERN flags with an area ID of 0.0.0.0.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfStubAreaEntryGet( )

NAME

m2OspfStubAreaEntryGet( ) - get an OSPF stub area entry (OSPF Option)

SYNOPSIS

STATUS m2OspfStubAreaEntryGet
    (
    int                       searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_STUB_AREA_ENTRY * pInfo       /* ptr to stub area entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled with the contents of the stub area entry specified by pInfo->ospfStubAreaID, pInfo->ospfStubTOS and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfStubAreaEntrySet( )

NAME

m2OspfStubAreaEntrySet( ) - set values in an OSPF stub area entry (OSPF Option)

SYNOPSIS

STATUS m2OspfStubAreaEntrySet
    (
    int                       varsToSet, /* flags specifying vars to set */
    M2_OSPF_STUB_AREA_ENTRY * pInfo      /* ptr to stub area entry */
    )

DESCRIPTION

The stub area entry specified by pInfo->ospfStubAreaID and pInfo->ospfStubTOS is updated with the values provided in pInfo. The varsToSet parameter indicates the fields to be modified and is a bitwise or of one or more of M2_OSPF_STUB_AREA_ID, M2_OSPF_STUB_TOS, M2_OSPF_STUB_METRIC, and M2_OSPF_STUB_STATUS.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfLsdbEntryGet( )

NAME

m2OspfLsdbEntryGet( ) - get an OSPF link state database entry (OSPF Option)

SYNOPSIS

STATUS m2OspfLsdbEntryGet
    (
    int                  searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_LSDB_ENTRY * pInfo       /* link state database entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the entry specified by pInfo->ospfLsdbAreaId, pInfo->ospfLsdbType, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfAreaRangeEntryGet( )

NAME

m2OspfAreaRangeEntryGet( ) - get an OSPF area range entry (OSPF Option)

SYNOPSIS

STATUS m2OspfAreaRangeEntryGet
    (
    int                        searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_AREA_RANGE_ENTRY * pInfo       /* ptr to area arange entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the OSPF area range entry specified by pInfo->ospfAreaRangeAreaID, pInfo->ospfAreaRangeNet, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfAreaRangeEntrySet( )

NAME

m2OspfAreaRangeEntrySet( ) - set values in an OSPF area range entry (OSPF Option)

SYNOPSIS

STATUS m2OspfAreaRangeEntrySet
    (
    int                        varsToSet, /* flags specifying vars to set */
    M2_OSPF_AREA_RANGE_ENTRY * pInfo      /* ptr to area range entry */
    )

DESCRIPTION

The OSPF area range entry specified by pInfo->ospfAreaRangeAreaID and pInfo->ospfAreaRangeNet is updated with the values provided in pInfo. The varsToSet parameter specifies the fields to set and is a bitwise or of one or more of M2_OSPF_AREA_RANGE_AREA_ID, M2_OSPF_AREA_RANGE_NET, M2_OSPF_AREA_RANGE_MASK, and M2_OSPF_AREA_RANGE_STATUS.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfHostEntryGet( )

NAME

m2OspfHostEntryGet( ) - get an OSPF host entry (OSPF Option)

SYNOPSIS

STATUS m2OspfHostEntryGet
    (
    int                  searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_HOST_ENTRY * pInfo       /* ptr to host entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the entry specified by pInfo->ospfHostIpAddress, pInfo->ospfHostTOS, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfHostEntrySet( )

NAME

m2OspfHostEntrySet( ) - set values in an OSPF host entry (OSPF Option)

SYNOPSIS

STATUS m2OspfHostEntrySet
    (
    int                  varsToSet, /* flags specifying vars to set */
    M2_OSPF_HOST_ENTRY * pInfo      /* ptr to host entry */
    )

DESCRIPTION

The OSPF host entry specified by pInfo->ospfHostIpAddress and pInfo->ospfHostTOS is updated with the values provided in pInfo. The varsToSet parameter indicates the fields to be set and is a bitwise or of one or more of M2_OSPF_HOST_IP_ADDRESS, M2_OSPF_HOST_TOS, M2_OSPF_HOST_METRIC, and M2_OSPF_HOST_STATUS.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfIfEntryGet( )

NAME

m2OspfIfEntryGet( ) - get an OSPF interface entry (OSPF Option)

SYNOPSIS

STATUS m2OspfIfEntryGet
    (
    int                searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_IF_ENTRY * pInfo       /* ptr ot interface entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the entry specified by pInfo->ospfIfIpAddress, pInfo->ospfAddressLessIf, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfIfEntrySet( )

NAME

m2OspfIfEntrySet( ) - set values in an OSPF interface entry (OSPF Option)

SYNOPSIS

STATUS m2OspfIfEntrySet
    (
    int                varsToSet, /* flags specifying vars to set */
    M2_OSPF_IF_ENTRY * pInfo      /* ptr to interface entry */
    )

DESCRIPTION

This routine updates pInfo->ospfAddressLessIf with the contents of pInfo. The varsToSet parameter indicates the fields to set and is a bitwise or of one or more of:

    M2_OSPF_IF_AREA_ID
    M2_OSPF_IF_ADMIN_STAT
    M2_OSPF_IF_RTR_PRIORITY
    M2_OSPF_IF_TRANSIT_DELAY
    M2_OSPF_IF_RETRANS_INTERVAL
    M2_OSPF_IF_HELLO_INTERVAL
    M2_OSPF_IF_RTR_DEAD_INTERVAL
    M2_OSPF_IF_POLL_INTERVAL
    M2_OSPF_IF_AUTH_KEY

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfIfMetricEntryGet( )

NAME

m2OspfIfMetricEntryGet( ) - get an OSPF interface metric entry (OSPF Option)

SYNOPSIS

STATUS m2OspfIfMetricEntryGet
    (
    int                       searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_IF_METRIC_ENTRY * pInfo       /* ptr to interface metric entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the entry specified by pInfo->ospfIfMetricIpAddress, pInfo->ospfIfMetricAddressLessIf, pInfo->ospfIfMetricTOS, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfIfMetricEntrySet( )

NAME

m2OspfIfMetricEntrySet( ) - set OSPF interface metric entry values (OSPF Option)

SYNOPSIS

STATUS m2OspfIfMetricEntrySet
    (
    int                       varsToSet, /* flags specifying vars to set */
    M2_OSPF_IF_METRIC_ENTRY * pInfo      /* ptr to interface metric entry */
    )

DESCRIPTION

The fields of the OSPF interface metric entry specified by pInfo->ospfIfMetricIpAddress, pInfo->ospfIfMetricAddress, and pInfo->ospfIfMetricTOS is updated with the contents of pInfo. The varsToSet parameter indicates the fields to set and is a bitwise or of one or more of M2_OSPF_IF_METRIC_METRIC or M2_OSPF_IF_METRIC_STATUS.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfVirtIfEntryGet( )

NAME

m2OspfVirtIfEntryGet( ) - get an OSPF virtual interface entry (OSPF Option)

SYNOPSIS

STATUS m2OspfVirtIfEntryGet
    (
    int                     searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_VIRT_IF_ENTRY * pInfo       /* ptr to virtual interface entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the contents of the OSPF virtual interface entry specified by pInfo->ospfVirtIfAreaID, pInfo->ospfVirtIfNeighbor and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfVirtIfEntrySet( )

NAME

m2OspfVirtIfEntrySet( ) - set OSPF virtual interface entry values (OSPF Option)

SYNOPSIS

STATUS m2OspfVirtIfEntrySet
    (
    int                     varsToSet, /* flags specifying vars to set */
    M2_OSPF_VIRT_IF_ENTRY * pInfo      /* ptr to virtual interface entry */
    )

DESCRIPTION

The OSPF virtual interface entry specified by pInfo->ospfVirtIfAreaID and pInfo->ospfVirtIfNeighbor is updated with the contents of pInfo. The varsToSet parameter indicates the fields to be modified and is a bitwise or of one or more of:

    M2_OSPF_VIRT_IF_AREA_ID
    M2_OSPF_VIRT_IF_NEIGHBOR
    M2_OSPF_VIRT_IF_TRANSIT_DELAY 
    M2_OSPF_VIRT_IF_HELLO_INTERVAL
    M2_OSPF_VIRT_IF_RTR_DEAD_INTERVAL
    M2_OSPF_VIRT_IF_STATUS
    M2_OSPF_VIRT_IF_AUTH_KEY

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfNbrEntryGet( )

NAME

m2OspfNbrEntryGet( ) - get an OSPF neighbor entry (OSPF Option)

SYNOPSIS

STATUS m2OspfNbrEntryGet
    (
    int                 searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_NBR_ENTRY * pInfo       /* ptr to neighbor entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the contents of the OSPF neighbor entry specified by pInfo->ospfNbrIpAddr, pInfo->ospfNbrAddressLessIndex and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfNbrEntrySet( )

NAME

m2OspfNbrEntrySet( ) - set values in an OSPF neighbor entry (OSPF Option)

SYNOPSIS

STATUS m2OspfNbrEntrySet
    (
    int                 varsToSet, /* flags specifying vars to set */
    M2_OSPF_NBR_ENTRY * pInfo      /* ptr to neighbor entry */
    )

DESCRIPTION

The OSPF neighbor entry specified by pInfo->ospfNbrIpAddr and pInfo->ospfNbrAddressLessIndex is updated with the contents of pInfo. The varsTosSet parameter indicates the fields to set, which can be M2_OSPF_NBMA_NBR_STATUS.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

m2OspfVirtNbrEntryGet( )

NAME

m2OspfVirtNbrEntryGet( ) - get an OSPF virtual neighbor entry (OSPF Option)

SYNOPSIS

STATUS m2OspfVirtNbrEntryGet
    (
    int                      searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */
    M2_OSPF_VIRT_NBR_ENTRY * pInfo       /* ptr to virtual neighbor entry */
    )

DESCRIPTION

The structure pointed to by pInfo is filled in with the contents of the OSPF virtual neighbor entry specified by pInfo->ospfVirtNbrArea, pInfo->ospfVirtNbrRtrId, and searchType.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfExtRouteAdd( )

NAME

ospfExtRouteAdd( ) - import external route into OSPF domain (OSPF Option)

SYNOPSIS

STATUS ospfExtRouteAdd
    (
    uint32_t destIp,       /* destination IP address */
    uint32_t destMask,     /* destination mask */
    uint32_t nextHopIp,    /* IP address of next hop */
    int      cost,         /* cost to advertise in domain */
    int      extRouteType, /* 1 = external type1, 2 = external type2 */
    int      tos           /* type of service */
    )

DESCRIPTION

This function is used to import an external route into the OSPF domain The destination address and mask are destIp and destMask respectively while nextHopIp is the IP address of the next hop. The cost to advertise in the OSPF domain is cost and route type is routeType, which can have the value 1 or 2 for type 1 and type 2 routes respectively. All IP addresses and masks in this call are in network byte order.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfExtRouteDelete( )

NAME

ospfExtRouteDelete( ) - delete external route imported into OSPF (OSPF Option)

SYNOPSIS

STATUS ospfExtRouteDelete
    (
    uint32_t destIp,       /* destination IP address */
    uint32_t destMask,     /* destination mask */
    int      extRouteType, /* 1 = external type1, 2 = external type2 */
    int      tos           /* type of service */
    )

DESCRIPTION

This function is used to delete an external route imported into the OSPF domain. The destination address and mask are destIp and destMask respectively. The route type is extRouteType which may have the value 1 or 2 for type 1 and type 2 routes, respectively. All IP addresses and masks in this call are in network byte order.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfInit( )

NAME

ospfInit( ) - function to initialize OSPF routing (OSPF Option)

SYNOPSIS

STATUS ospfInit
    (
    int     priority,  /* task priority */
    int     options,   /* task options */
    int     stackSize, /* task stack size */
    int     routerId,  /* routerId, host byte order */
    FUNCPTR pAuthHook  /* ospf authentication hook */
    )

DESCRIPTION

This function initializes the OSPF facilities. This includes creating OSPF tasks, which are created with a priority of priority, options set to options, a stack size of stackSize, and an OSPF router ID of routerid. If routerId is 0, the IP address of one of the interfaces is used as the router ID. The pAuthHook parameter expects a pointer to a user-provided authentication routine. For every received packet, the authentication function:

    (*ospfAuthHook) (pIfkey, pPktKey, ipAddr)
The pIfkey parameter is a pointer to the authorization key associated with the interface. The pPktKey parameter is a pointer to the key in the received packet. The ipAddr is the IP address in network byte order of the interface on which the packet was received. To set the interface authorization key, call m2OspfIfEntrySet( ). The ospfAuthHook( ) routine returns TRUE if the packet is acceptable. Otherwise, it returns FALSE.

After this function has returned, you can use the m2Ospf*Set( ) configuration routines to alter the settings.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfNbmaDstAdd( )

NAME

ospfNbmaDstAdd( ) - add NBMA destination

SYNOPSIS

STATUS ospfNbmaDstAdd
    (
    uint32_t ipAddress,   /* neighbor IP address, network order */
    uint32_t ifIpAddress, /* local interface IP address, network order */
    BOOL     eligible     /* TRUE if neighbor is eligible to be DR */
    )

DESCRIPTION

On a non-broadcast multiple access network, a router capable of becoming designated router must be made aware of the IP addresses of all other routers on the network. The neighbor router is specified by its IP address ipAddress, the local interface IP address is ifIpAddress and eligible specifies if the neighbor is capable of acting as a designated router.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfNbmaDstDelete( )

NAME

ospfNbmaDstDelete( ) - delete NBMA destination

SYNOPSIS

STATUS ospfNbmaDstDelete
    (
    uint32_t ipAddress,  /* neighbor IP address, network order */
    uint32_t ifIpAddress /* local interface IP address, network order */
    )

DESCRIPTION

Delete neighbor on a NBMA network, previously created with ospfNbmaDstAdd( ). The neighbor is specified by its IP address ipAddress and the local interface IP address is ifIpAddress.

RETURNS

OK or ERROR.

SEE ALSO

ospfLib


Libraries : Routines

ospfTerminate( )

NAME

ospfTerminate( ) - free OSPF resources and delete OSPF tasks

SYNOPSIS



void ospfTerminate ()

DESCRIPTION

This function frees all the resources used by OSPF. This includes deleting the two VxWorks tasks used to manage OSPF. You are free to restart OSPF after this function has returned.

RETURNS

N/A

SEE ALSO

ospfLib