📄 ospflib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ospfLib.html - generated by refgen from ospfLib.c --> <title> ospfLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>ospfLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ospfLib</strong> - OSPF version 2 (RFC 1583) routing facilities (OSPF Option) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ospfLib.html#m2OspfGeneralGroupGet">m2OspfGeneralGroupGet</a></i>( )</b> - get values of OSPF general group objects (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfGeneralGroupSet">m2OspfGeneralGroupSet</a></i>( )</b> - set values of OSPF general group objects (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfAreaEntryGet">m2OspfAreaEntryGet</a></i>( )</b> - get an entry from the OSPF area table (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfAreaEntrySet">m2OspfAreaEntrySet</a></i>( )</b> - set values in an OSPF area entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfStubAreaEntryGet">m2OspfStubAreaEntryGet</a></i>( )</b> - get an OSPF stub area entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfStubAreaEntrySet">m2OspfStubAreaEntrySet</a></i>( )</b> - set values in an OSPF stub area entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfLsdbEntryGet">m2OspfLsdbEntryGet</a></i>( )</b> - get an OSPF link state database entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfAreaRangeEntryGet">m2OspfAreaRangeEntryGet</a></i>( )</b> - get an OSPF area range entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfAreaRangeEntrySet">m2OspfAreaRangeEntrySet</a></i>( )</b> - set values in an OSPF area range entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfHostEntryGet">m2OspfHostEntryGet</a></i>( )</b> - get an OSPF host entry (OSPF Option) <br><b><i><a href="./ospfLib.html#m2OspfHostEntrySet">m2OspfHostEntrySet</a></i>( )</b> - set values in an OSPF host entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfIfEntryGet">m2OspfIfEntryGet</a></i>( )</b> - get an OSPF interface entry (OSPF Option) <br><b><i><a href="./ospfLib.html#m2OspfIfEntrySet">m2OspfIfEntrySet</a></i>( )</b> - set values in an OSPF interface entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfIfMetricEntryGet">m2OspfIfMetricEntryGet</a></i>( )</b> - get an OSPF interface metric entry (OSPF Option) <br><b><i><a href="./ospfLib.html#m2OspfIfMetricEntrySet">m2OspfIfMetricEntrySet</a></i>( )</b> - set OSPF interface metric entry values (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfVirtIfEntryGet">m2OspfVirtIfEntryGet</a></i>( )</b> - get an OSPF virtual interface entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfVirtIfEntrySet">m2OspfVirtIfEntrySet</a></i>( )</b> - set OSPF virtual interface entry values (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfNbrEntryGet">m2OspfNbrEntryGet</a></i>( )</b> - get an OSPF neighbor entry (OSPF Option) <br><b><i><a href="./ospfLib.html#m2OspfNbrEntrySet">m2OspfNbrEntrySet</a></i>( )</b> - set values in an OSPF neighbor entry (OSPF Option)<br><b><i><a href="./ospfLib.html#m2OspfVirtNbrEntryGet">m2OspfVirtNbrEntryGet</a></i>( )</b> - get an OSPF virtual neighbor entry (OSPF Option)<br><b><i><a href="./ospfLib.html#ospfExtRouteAdd">ospfExtRouteAdd</a></i>( )</b> - import external route into OSPF domain (OSPF Option)<br><b><i><a href="./ospfLib.html#ospfExtRouteDelete">ospfExtRouteDelete</a></i>( )</b> - delete external route imported into OSPF (OSPF Option)<br><b><i><a href="./ospfLib.html#ospfInit">ospfInit</a></i>( )</b> - function to initialize OSPF routing (OSPF Option) <br><b><i><a href="./ospfLib.html#ospfNbmaDstAdd">ospfNbmaDstAdd</a></i>( )</b> - add NBMA destination<br><b><i><a href="./ospfLib.html#ospfNbmaDstDelete">ospfNbmaDstDelete</a></i>( )</b> - delete NBMA destination<br><b><i><a href="./ospfLib.html#ospfTerminate">ospfTerminate</a></i>( )</b> - free OSPF resources and delete OSPF tasks<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This module implements OSPF Version 2 as specified in (RFC 1583). In additionto implementing the routing tasks, this module includes RFC 1253 compliant interfaces that you can use to configure the OSPF MIBs. These may be invokeddirectly or called by the relevant method routines of an SNMP agent.<p>To include OSPF in your image you must first define the <b>INCLUDE_OSPF</b> in<b>configAll.h</b>. Once the system is up and running you need to invoke the<b><i><a href="./ospfLib.html#ospfInit">ospfInit</a></i>( )</b> call. This call has the following structure: <pre> 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 */ )</pre>After OSPF is up and running, you should configure the OSPF MIB by using thevarious <b>m2Ospf</b> routines. The parameters to these routines are specified inthe OSPF MIB as defined in RFC 1253. Explanations for each of the variablesmay be obtained from the RFC. For additional information on the MIB-IIinterfaces, please see the manual pages.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>This section presents a sample configuration as well as the code necessaryto make the example work. In the example system, a router is attached totwo 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. <pre>----------------------------------- 160.10.11.0 160.10.11.5 | --------------------------- | Interface A | | | | Router | | | | Interface B | --------------------------- 160.10.10.5 | ------------------------------------ 160.10.10.0</pre>To set this up programmatically, you would execute the following code:<pre>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); } </pre>After this code has executed, the system is set up to use OSPF to routebetween the two interfaces (A and B). The system will now continue toparticipate in the OSPF routing protocol until either the system is shut offor 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). <p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>ospfLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ospfLib.html#top">ospfLib</a></b>, RFC 1583 and RFC 1253<hr><a name="m2OspfGeneralGroupGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>m2OspfGeneralGroupGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>m2OspfGeneralGroupGet</i>( )</strong> - get values of OSPF general group objects (OSPF Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2OspfGeneralGroupGet ( M2_OSPF_GENERAL_GROUP * pInfo /* pointer to general group struct */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine fills in the structure pointed to by <i>pInfo</i> with the MIB-II values for the OSPF general group.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the get request fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ospfLib.html#top">ospfLib</a></b><hr><a name="m2OspfGeneralGroupSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>m2OspfGeneralGroupSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>m2OspfGeneralGroupSet</i>( )</strong> - set values of OSPF general group objects (OSPF Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2OspfGeneralGroupSet ( int varsToSet, /* flags specifying vars to set */ M2_OSPF_GENERAL_GROUP * pInfo /* ptr to general group structure */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the values of the OSPF general group objects. The variablesto set are specified by a bitwise or of one or more of the flags <b>M2_OSPF_ROUTER_ID</b>, <b>M2_OSPF_ADMIN_STAT</b>, <b>M2_OSPF_AS_BDR_RTR_STATUS</b>, and <b>M2_OSPF_TOS_SUPPORT</b>, in the <i>varsToSet</i> parameter.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ospfLib.html#top">ospfLib</a></b><hr><a name="m2OspfAreaEntryGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>m2OspfAreaEntryGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>m2OspfAreaEntryGet</i>( )</strong> - get an entry from the OSPF area table (OSPF Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2OspfAreaEntryGet ( int searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */ M2_OSPF_AREA_ENTRY * pInfo /* ptr to area entry */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The structure pointed to by <i>pInfo</i> is filled with the contents of the areaentry specified by <b>pInfo->ospfAreaId</b> and <i>searchType</i>. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ospfLib.html#top">ospfLib</a></b><hr><a name="m2OspfAreaEntrySet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>m2OspfAreaEntrySet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>m2OspfAreaEntrySet</i>( )</strong> - set values in an OSPF area entry (OSPF Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2OspfAreaEntrySet ( int varsToSet, /* flags specifying vars to set */ M2_OSPF_AREA_ENTRY * pInfo /* ptr to area entry */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The area entry specified by pInfo->ospfAreaId will be updated with the values provided by <i>pInfo</i>. The <i>varsToSet</i> parameter indicates the fields to set and is a bitwise or of one or more of <b>M2_OSPF_AREA_ID</b>, <b>M2_OSPF_AUTH_TYPE</b>, and <b>M2_OSPF_IMPORT_AS_EXTERN</b>.<p>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 <b>M2_OSPF_AREA_ID</b> or <b>M2_OSPF_IMPORT_AS_EXTERN</b> flags with an area ID of 0.0.0.0.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ospfLib.html#top">ospfLib</a></b><hr><a name="m2OspfStubAreaEntryGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>m2OspfStubAreaEntryGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>m2OspfStubAreaEntryGet</i>( )</strong> - get an OSPF stub area entry (OSPF Option)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2OspfStubAreaEntryGet ( int searchType, /* M2_EXACT_VALUE or M2_NEXT_VALUE */ M2_OSPF_STUB_AREA_ENTRY * pInfo /* ptr to stub area entry */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The structure pointed to by <i>pInfo</i> is filled with the contents of the stub area entry specified by <b>pInfo->ospfStubAreaID</b>, <b>pInfo->ospfStubTOS</b>and <i>searchType</i>.<p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -