📄 dhcpclib.html
字号:
initial lease negotiation until that process is complete. In addition, any addressing information obtained will be applied to that network interface, which will remain disabled if the initial negotiation fails. Finally, theinterface will be disabled if the lease expires.<p></blockquote><h4>NOTE</h4><blockquote><p>If the DHCP client is used to obtain the VxWorks boot parameters, this routine is called automatically during system startup using the automatic reconfiguration. Therefore, any calls to this routine which use the network boot device for message transfer when the DHCP client was used at boot time must not request automatic reconfiguration during initialization. Otherwise, the resulting lease settings will conflict with the configuration maintained by the lease established during system startup. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK if routine completes, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_BAD_OPTION</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcVerify"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcVerify</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcVerify</i>( )</strong> - renew an established lease</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcVerify ( void * pCookie /* identifier returned by dhcpcInit() */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine schedules the lease identified by the <i>pCookie</i> parameterfor immediate renewal according to the process described in RFC 1541.If the renewal is unsuccessful, the lease negotiation process restarts.The routine is valid as long as the lease is currently active. Theroutine is also called automatically in response to a <b><i><a href="./dhcpcLib.html#dhcpcBind">dhcpcBind</a></i>( )</b> callfor an existing lease.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine will disable the underlying network interface if the verification fails and automatic configuration was requested. This mayoccur without warning if no event hook is installed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if verification scheduled, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_NOT_BOUND</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcRelease"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcRelease</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcRelease</i>( )</strong> - relinquish specified lease</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcRelease ( void * pCookie /* identifier returned by dhcpcInit() */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine schedules the lease identified by the <i>pCookie</i> parameterfor immediate release, regardless of time remaining, and removes allthe associated data structures. After the release completes, a newcall to <b><i><a href="./dhcpcLib.html#dhcpcInit">dhcpcInit</a></i>( )</b> is required before attempting another lease.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine will disable the underlying network interface if automatic configuration was requested. This may occur without warning if no event hook is installed.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if release scheduled, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcShutdown"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcShutdown</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcShutdown</i>( )</strong> - disable DHCP client library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcShutdown (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine schedules the lease monitor task to clean up memory and exit,after releasing all currently active leases. The network boot devicewill be disabled if the DHCP client was used to obtain the VxWorks boot parameters and the resulting lease is still active. Any other interfaces using the addressing information from leases set for automatic configurationwill also be disabled. Notification of a disabled interface will not occurunless an event hook has been installed. After the processing started bythis request completes, the DHCP client library is unavailable until restarted with the <b><i><a href="./dhcpcLib.html#dhcpcLibInit">dhcpcLibInit</a></i>( )</b> routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if shutdown scheduled, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_NOT_INITIALIZED</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcOptionGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcOptionGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcOptionGet</i>( )</strong> - retrieve an option provided to a client and store in a buffer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcOptionGet ( void * pCookie, /* identifier returned by dhcpcInit() */ int option, /* RFC 1533 option tag */ int * pLength, /* size of provided buffer and data returned */ char * pBuf /* location for option data */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine retrieves the data for the specified <i>option</i>, if presentfor the lease indicated by <i>pCookie</i>. The data is stored in the provided buffer, whose length must be specified. If the <i>option</i> is found, the amount of data available is stored in the location referenced by the <i>pLength</i> parameter. The option is not available if the DHCP client is not in the bound state or if the server did not provide it. After returning, the provided buffer may contain IP addresses stored in network byte order. All other numeric values are stored in host byte order. See RFC 1533 for specificdetails on the data retrieved. <p></blockquote><h4>RETURNS</h4><blockquote><p>OK if option available, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_NOT_BOUND,<br> S_dhcpcLib_OPTION_NOT_PRESENT<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b>, <b><i><a href="./dhcpcLib.html#dhcpcOptionSet">dhcpcOptionSet</a></i>( )</b><hr><a name="dhcpcServerGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcServerGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcServerGet</i>( )</strong> - retrieve the current DHCP server</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcServerGet ( void * pCookie, /* identifier returned by dhcpcInit() */ struct in_addr * pServerAddr /* location for address of server */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the DHCP server that supplied the configurationparameters for the lease specified by the <i>pCookie</i> argument. This information is available only if the lease is in the bound state.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if in bound state and server available, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_NOT_BOUND</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcTimerGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcTimerGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcTimerGet</i>( )</strong> - retrieve current lease timers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcTimerGet ( void * pCookie, /* identifier returned by dhcpcInit() */ int * pT1, /* time until lease renewal */ int * pT2 /* time until lease rebinding */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the number of clock ticks remaining on the timersgoverning the DHCP lease specified by the <i>pCookie</i> argument. This information is only available if the lease is in the bound state.Therefore, this routine will return ERROR if a BOOTP reply was accepted.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if in bound state and values available, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_NOT_BOUND, <br> S_dhcpcLib_OPTION_NOT_PRESENT, S_dhcpcLib_TIMER_ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcParamsGet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dhcpcParamsGet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dhcpcParamsGet</i>( )</strong> - retrieve current configuration parameters</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcParamsGet ( void * pCookie, /* identifier returned by dhcpcInit() */ struct dhcp_param * pParamList /* requested parameters */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies the current configuration parameters for the leasespecified by the <i>pCookie</i> argument to the user-supplied structure. That structure, defined in <b>dhcp/dhcpc.h</b>, should contain non-NULL pointers to indicate the parameters of interest. All other values within the structure must be set to 0 before calling the routine. The requested information is only retrieved if the specified lease is in the bound state and knows that its parameters are good.<p>Many of the parameters within the user-supplied structure use one of the following secondary data types: struct in_addrs, struct u_shorts, and struct vendor_list. Each of those structures accepts a length designation and a data pointer. For the first two data types, the <b>num</b> member indicates the size of the buffer in terms of the number of underlying elements. For example, the <b>STATIC_ROUTE</b> option returns one or more IP address pairs. So, setting the <b>num</b> member to 2 in the static_route entry would indicate that the corresponding buffer contained 16 bytes. By contrast, the <b>len</b> member in the struct <b>vendor_list</b> data type consists of the buffer size, in bytes.See RFC 1533 for specific details on the types of data for each option. <p>On return, each of the length designators are set to indicate the amount ofdata returned. For instance, the <b>num</b> member in the static_route entry couldbe set to 1 to indicate that only one IP address pair of 8 bytes was available.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if in bound state, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>S_dhcpcLib_BAD_COOKIE, S_dhcpcLib_NOT_INITIALIZED, S_dhcpcLib_NOT_BOUND</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -