📄 dhcpclib.html
字号:
<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if release scheduled, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcInformGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcInformGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcInformGet( )</strong> - obtain additional configuration parameters with DHCP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcInformGet ( void * pCookie, /* identifier returned by dhcpcInit() */ char * pAddrString, /* known address assigned to client */ BOOL syncFlag /* synchronous or asynchronous execution? */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine uses DHCP to retrieve additional configuration parameters fora client with the externally configured network address given by the<i>pAddrString</i> parameter. It sends an INFORM message and waits for a replyfollowing the process described in RFC 2131. The <i>pCookie</i> argument containsthe return value of an earlier <b><a href="./dhcpcLib.html#dhcpcInit">dhcpcInit</a>( )</b> call and is used to access theresulting configuration. Unlike the <b><a href="./dhcpcLib.html#dhcpcBind">dhcpcBind</a>( )</b> call, this routine does notestablish a lease with a server.<p>The <i>syncFlag</i> parameter specifies whether the message exchange started by this routine will execute synchronously or asynchronously. An asynchronous execution will return after sending the initial message, but a synchronous execution will only return once the process completes.<p>When a server responds with an acknowledgement message, any event hookprovided will be called to process the configuration parameters. The hookis also called if the message exchange fails. The results of an asynchronousexecution are not available unless an event hook is installed.<p></blockquote><h4>NOTE</h4><blockquote><p>This routine is designed as an alternative to the <b><a href="./dhcpcLib.html#dhcpcBind">dhcpcBind</a>( )</b> routine.It should not be used for any <b><a href="./dhcpcLib.html#dhcpcInit">dhcpcInit</a>( )</b> identifer corresponding to anactive or pending lease.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if routine completes, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b>, <b>S_dhcpcLib_BAD_OPTION</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcShutdown( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcShutdown( )</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><a href="./dhcpcLib.html#dhcpcLibInit">dhcpcLibInit</a>( )</b> routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if shutdown scheduled, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_dhcpcLib_NOT_INITIALIZED</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcOptionGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcOptionGet( )</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 2132 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 a specified option from a leaseindicated by the <i>pCookie</i> parameter. The <i>option</i> parameter specifiesan option tag as defined in RFC 2132. See the <b>dhcp/dhcp.h</b> include filefor a listing of defined aliases for the available option tags. Thisroutine will not accept the following <i>option</i> values, which are eitherused by the server for control purposes or only supplied by the client:<p> <b>_DHCP_PAD_TAG</b><br> <b>_DHCP_REQUEST_IPADDR_TAG</b><br> <b>_DHCP_OPT_OVERLOAD_TAG</b><br> <b>_DHCP_MSGTYPE_TAG</b><br> <b>_DHCP_REQ_LIST_TAG</b><br> <b>_DHCP_MAXMSGSIZE_TAG</b><br> <b>_DHCP_CLASS_ID_TAG</b><br> <b>_DHCP_CLIENT_ID_TAG</b><br> <b>_DHCP_END_TAG</b><p>If the option is found, the data is stored in the provided buffer, up tothe limit specified in the <i>pLength</i> parameter. The option is not availableif the DHCP client is not in the bound state or if the server did notprovide it. After returning, the <i>pLength</i> parameter indicates the amountof data actually retrieved. The provided buffer may contain IP addressesstored in network byte order. All other numeric values are stored in hostbyte order. See RFC 2132 for specific details 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><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b>, <b>S_dhcpcLib_NOT_BOUND</b>,<br> <b>S_dhcpcLib_OPTION_NOT_PRESENT</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b>, <b><a href="./dhcpcCommonLib.html#dhcpcOptionSet">dhcpcOptionSet</a>( )</b><hr><a name="dhcpcServerGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcServerGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcServerGet( )</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><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b>, <b>S_dhcpcLib_NOT_BOUND</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcTimerGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcTimerGet( )</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><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b>, <b>S_dhcpcLib_NOT_BOUND</b>, <br> <b>S_dhcpcLib_OPTION_NOT_PRESENT</b>, <b>S_dhcpcLib_TIMER_ERROR</b></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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcParamsGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcParamsGet( )</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 and allocated <b>dhcp_param</b> structure referenced in <i>pParamList</i>. Within this structure, defined in <b>h/dhcp/dhcpc.h</b>, you should supply buffer pointers for the parameters that interest you. Set all other structure members to zero. When <b><a href="./dhcpcLib.html#dhcpcParamsGet">dhcpcParamsGet</a>( )</b> returns, the buffers you specified in the submitted <b>dhcpc_param</b> structure will contain the information you requested. This assumes that the specified lease is in the bound state and that DHCP knows that the lease parameters are good.<p></blockquote><h4>NOTE</h4><blockquote><p>The <b>temp_sname</b> and <b>temp_file</b> members of the <b>dhcp_param</b> structure are for internal use only. They reference temporary buffers for options that are passed using the <b>sname</b> and <b>file</b> members. Do not request either <b>temp_sname</b> or <b>temp_file</b>. Instead, request either <b>sname</b> or <b>file</b> if you want those parameters. <p>Many of the parameters within the user-supplied structure use one of the following secondary data types: <b>struct in_addrs</b>, <b>struct u_shorts</b>, and <b>struct vendor_list</b>. 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. Thus, setting the <b>num</b> member to 2 in the <b>static_route</b> 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 <b>static_route</b> 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><b>S_dhcpcLib_BAD_COOKIE</b>, <b>S_dhcpcLib_NOT_INITIALIZED</b>, <b>S_dhcpcLib_NOT_BOUND</b></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 + -