📄 rdisclib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/rdiscLib.html - generated by refgen from rdiscLib.c --> <title> rdiscLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>rdiscLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdiscLib</strong> - ICMP router discovery server library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./rdiscLib.html#rdiscLibInit">rdiscLibInit</a>( )</b> - Initialize router discovery<br><b><a href="./rdiscLib.html#rdiscInit">rdiscInit</a>( )</b> - initialize the ICMP router discovery function<br><b><a href="./rdiscLib.html#sendAdvert">sendAdvert</a>( )</b> - send an advertisement to one location<br><b><a href="./rdiscLib.html#sendAdvertAll">sendAdvertAll</a>( )</b> - send an advertisement to all active locations<br><b><a href="./rdiscLib.html#rdiscTimerEvent">rdiscTimerEvent</a>( )</b> - called after watchdog timeout<br><b><a href="./rdiscLib.html#rdisc">rdisc</a>( )</b> - implement the ICMP router discovery function<br><b><a href="./rdiscLib.html#rdCtl">rdCtl</a>( )</b> - implement the ICMP router discovery control function <br><b><a href="./rdiscLib.html#rdiscIfReset">rdiscIfReset</a>( )</b> - check for new or removed interfaces for router discovery<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b> contains code to implement ICMP Router Discovery. This featureallows routers to advertise an address to the hosts on each of the routersinterfaces. This address is placed by the host into its route table asa default router. A host may also solicit the address by multicastingthe request to the <b>ALL_ROUTERS</b> address (224.0.0.2), to which a routerwould respond with a unicast version of the advertisement.<p>There are three routines in this implementation of router discovery:<b><a href="./rdiscLib.html#rdiscInit">rdiscInit</a>( )</b>, <b><a href="./rdiscLib.html#rdisc">rdisc</a>( )</b> and <b><a href="./rdiscLib.html#rdCtl">rdCtl</a>( )</b>. <b><a href="./rdiscLib.html#rdiscInit">rdiscInit</a>( )</b> is the initializationroutine, <b><a href="./rdiscLib.html#rdisc">rdisc</a>( )</b> handles the periodic transmission of advertisementsand processing of solicitations, and <b><a href="./rdiscLib.html#rdCtl">rdCtl</a>( )</b> sets/gets user parameters.<p><hr><a name="rdiscLibInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdiscLibInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdiscLibInit( )</strong> - Initialize router discovery</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void rdiscLibInit ( int priority, /* Priority of router discovery task. */ int options, /* Options to taskSpawn(1) for router */ /* discovery task. */ int stackSize /* Stack size for router discovery task. */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine links the ICMP Router Discovery facility into the VxWorks system.The arguments are the task's priority, options and stackSize.<p>Returns: N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="rdiscInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdiscInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdiscInit( )</strong> - initialize the ICMP router discovery function</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rdiscInit ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates resources for the router discovery function. Since itcalled in the <b><a href="./rdiscLib.html#rdisc">rdisc</a>( )</b> routine, it should not be called subsequently <p>Returns: OK on successful initialization, ERROR otherwise</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="sendAdvert"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>sendAdvert( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>sendAdvert( )</strong> - send an advertisement to one location</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void sendAdvert ( int index, struct in_addr dstAddr )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sends a router advertisement using the data stored for its'corresponding interface. Only the primary network address of the interfaceis used as the advertised router address.<p>Returns: NA</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="sendAdvertAll"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>sendAdvertAll( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>sendAdvertAll( )</strong> - send an advertisement to all active locations</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void sendAdvertAll ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sends a router advertisement using the data stored for eachcorresponding interface. Only the primary network address of the interfaceis used as the advertised router address.<p>Returns: NA</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="rdiscTimerEvent"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdiscTimerEvent( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdiscTimerEvent( )</strong> - called after watchdog timeout</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>#ifdef VIRTUAL_STACK void rdiscTimerEventRestart ( int stackNum )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called when a new advertisement is to be sent. <p>Returns: NA</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="rdisc"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdisc( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdisc( )</strong> - implement the ICMP router discovery function</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void rdisc ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is the entry point for the router discovery function. Itallocates and initializes resources, listens for solicitation messages on the <b>ALL_ROUTERS</b> (224.0.0.1) multicast address and processes themessages.<p>This routine usually runs until explicitly killed by a system operator, butcan also be terminated cleanly (see <b><a href="./rdiscLib.html#rdCtl">rdCtl</a>( )</b> routine).<p>Returns: NA</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="rdCtl"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdCtl( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdCtl( )</strong> - implement the ICMP router discovery control function </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rdCtl ( char * ifName, int cmd, void* value /* my be an int (set-cmds) or an int* */ /* (get-cmds) */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allows a user to get and set router discovery parameters, andcontrol the mode of operation. <p></blockquote><h4>OPTIONS</h4><blockquote><p>The following section discuss the various flags that may be passedto <b><a href="./rdiscLib.html#rdCtl">rdCtl</a>( )</b>.<p></blockQuote><h4>SET_MODE -- Set debug mode or exit router discovery</h4><blockQuote>This flag does not require an <i>interface</i> to be specifiedit is best to specify NULL.<p>This flag is used in conjunction with the following values:<p></blockQuote><h4>MODE_DEBUG_ON -- Turn debugging messages on. </h4><blockQuote><p><pre> rdCtl (NULL, SET_MODE, MODE_DEBUG_ON);</pre></blockQuote><h4>MODE_DEBUG_OFF -- Turn debugging messages off.</h4><blockQuote><p><pre> rdCtl (NULL, SET_MODE, MODE_DEBUG_OFF);</pre></blockQuote><h4>MODE_STOP -- Exit from router discovery.</h4><blockQuote><p><pre> rdCtl (NULL, SET_MODE, MODE_STOP);</pre></blockQuote><h4>SET_MIN_ADVERT_INT -- set minimum advertisement interval in seconds</h4><blockQuote>Specify the minimum time between advertisements in seconds. The minimumvalue allowed is 4 seconds, the maximum is 1800.<p><pre> rdCtl (NULL, SET_MIN_ADVERT_INT, <seconds>);</pre></blockQuote><h4>SET_MAX_ADVERT_INT -- set maximum advertisement interval in seconds</h4><blockQuote>Specify the maximum time between advertisements in seconds. The minimumvalue allowed is 4 seconds, the maximum is 1800.<p><pre> rdCtl (NULL, SET_MAX_ADVERT_INT, <seconds>);</pre></blockQuote><h4>SET_FLAG -- Set whether advertisements are sent on an interface.</h4><blockQuote>If this flag is 1 then advertisements are sent on this interface. If it is 0 then they are not.<p><pre> rdCtl (<interface>, SET_FLAG, <0 or 1>);</pre></blockQuote><h4>SET_ADVERT_ADDRESS -- Set the IP address to which advertisements are sent. </h4><blockQuote><br> Set the multicast IP address to which advertisements are sent.<p><pre> rdCtl (<interface>, SET_ADVERT_ADDRESS, <multicast address>);</pre></blockQuote><h4>SET_ADVERT_LIFETIME -- Set the lifetime for advertisements in seconds. </h4><blockQuote>Set the lifetime in seconds to be contained in each advertisement.<p><pre> rdCtl (<interface>, SET_ADVERT_LIFETIME, seconds);</pre></blockQuote><h4>SET_ADVERT_PREF -- Set the preference level contained in advertisements.</h4><blockQuote>Set the preference level contained in advertisements.<p><pre> rdCtl (<interface>, SET_ADVERT_PREF, value);</pre></blockQuote><h4>GET_MIN_ADVERT_INT -- Get the minimum advertisement interval. </h4><blockQuote><pre> rdCtl (NULL, GET_MIN_ADVERT_INT, &value);</pre></blockQuote><h4>GET_MAX_ADVERT_INT -- Get the maximum advertisement interval. </h4><blockQuote><pre> rdCtl (NULL, GET_MAX_ADVERT_INT, &value);</pre></blockQuote><h4>GET_FLAG -- Get the flag on an interface.. </h4><blockQuote><pre> rdCtl (<interface>, GET_FLAG, &value);</pre></blockQuote><h4>GET_ADVERT_ADDRESS -- Get the advertisement address for an interface. </h4><blockQuote><pre> rdCtl (<interface>, GET_ADVERT_ADDRESS, &value);</pre></blockQuote><h4>GET_ADVERT_LIFETIME -- Get the advertisement lifetime. </h4><blockQuote><pre> rdCtl (<interface>, GET_ADVERT_LIFETIME, &value);</pre></blockQuote><h4>GET_ADVERT_PREF -- Get the advertisement preference. </h4><blockQuote><pre> rdCtl (<interface>, GET_ADVERT_PREF, value);</pre>Returns: OK on success, ERROR on failure</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b><hr><a name="rdiscIfReset"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>rdiscIfReset( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>rdiscIfReset( )</strong> - check for new or removed interfaces for router discovery</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS rdiscIfReset ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine MUST be called any time an interface is added to or removedfrom the system so that the router discovery code can deal with thiscase. Failure to do so will cause the sending of packets on missinginterfaces to fail as well as no transmission of packets on new interfaces.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./rdiscLib.html#top">rdiscLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -