📄 dhcpccommonlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dhcpcCommonLib.html - generated by refgen from dhcpcCommonLib.c --> <title> dhcpcCommonLib </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>dhcpcCommonLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcCommonLib</strong> - DHCP client interface shared code library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./dhcpcCommonLib.html#dhcpcOptionSet">dhcpcOptionSet</a>( )</b> - add an option to the option request list<br><b><a href="./dhcpcCommonLib.html#dhcpcOptionAdd">dhcpcOptionAdd</a>( )</b> - add an option to the client messages<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the shared functions used by the both the run-timeand boot-time portions of the DHCP client.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>dhcpcLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b><hr><a name="dhcpcOptionSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcOptionSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcOptionSet( )</strong> - add an option to the option request list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcOptionSet ( void * pCookie, /* identifier returned by dhcpcInit() */ int option /* RFC 2132 tag of desired option */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine specifies which options the lease indicated by the <i>pCookie</i>parameter will request from a server. The <i>option</i> parameter specifies an option tag as defined in RFC 2132. See the <b>dhcp/dhcp.h</b> include file for alisting of defined aliases for the available option tags. This routine willnot accept the following <i>option</i> values, which are either used by theserver 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_LEASE_TIME_TAG</b> <br> <b>_DHCP_OPT_OVERLOAD_TAG</b><br> <b>_DHCP_MSGTYPE_TAG</b><br> <b>_DHCP_SERVER_ID_TAG</b><br> <b>_DHCP_REQ_LIST_TAG</b> <br> <b>_DHCP_ERRMSG_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>This routine also will not accept <i>option</i> values 62 or 63, which are notcurrently defined.<p>The maximum length of the option field in a DHCP message depends on theMTU size of the associated interface and the maximum DHCP message size setduring the DHCP library initialization. Both the option request list andthe options sent by the client through the <b><a href="./dhcpcCommonLib.html#dhcpcOptionAdd">dhcpcOptionAdd</a>( )</b> routine sharethat field. Options which exceed the limit will not be stored.<p></blockquote><h4>NOTE</h4><blockquote><p>The boot program automatically requests all options necessary fordefault target configuration. This routine is only necessary to supportspecial circumstances in which additional options are required. Anyoptions requested in that case may be retrieved after the runtime imagehas started.<p></blockquote><h4>NOTE</h4><blockquote><p>The DHCP specification forbids changing the option request list aftera lease has been established. Therefore, this routine must not be usedafter the <b><a href="./dhcpcLib.html#dhcpcBind">dhcpcBind</a>( )</b> call (in a runtime image) or the <b><a href="./dhcpcBootLib.html#dhcpcBootBind">dhcpcBootBind</a>( )</b> call(for a boot image). Changing the request list at that point could haveunpredictable results.<p></blockquote><h4>NOTE</h4><blockquote><p>Options are added directly to outgoing DHCP messages, and numericoptions (e.g. lease duration time) are expected to be provided in networkbyte order. Care must be taken on little-endian hosts to insure thatnumeric arguments are properly byte-swapped before being passed to thisroutine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if the option was set successfully, or ERROR if the optionis invalid or storage failed.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_dhcpcLib_BAD_OPTION</b>, <b>S_dhcpcLib_OPTION_NOT_STORED</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcCommonLib.html#top">dhcpcCommonLib</a></b><hr><a name="dhcpcOptionAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcOptionAdd( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcOptionAdd( )</strong> - add an option to the client messages</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcOptionAdd ( void * pCookie, /* identifier returned by dhcpcInit() */ UCHAR option, /* RFC 2132 tag of desired option */ int length, /* length of option data */ UCHAR * pData /* option data */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine inserts option tags and associated values into the body ofall outgoing messages for the lease indicated by the <i>pCookie</i> parameter.Each lease can accept option data up to the MTU size of the underlyinginterface, minus the link-level header size and the additional 283 bytesrequired for a minimum DHCP message (including mandatory options).<p>The <i>option</i> parameter specifies an option tag defined in RFC 2132. Seethe <b>dhcp/dhcp.h</b> include file for a listing of defined aliases for theavailable option tags. This routine will not accept the following <i>option</i>values, which are used for control purposes and cannot be includedarbitrarily:<p> <b>_DHCP_PAD_TAG</b><br> <b>_DHCP_OPT_OVERLOAD_TAG</b><br> <b>_DHCP_MSGTYPE_TAG</b><br> <b>_DHCP_SERVER_ID_TAG</b><br> <b>_DHCP_MAXMSGSIZE_TAG</b><br> <b>_DHCP_END_TAG</b><p>This routine also will not accept <i>option</i> values 62 or 63, which are notcurrently defined.<p>The <i>length</i> parameter indicates the number of bytes in the option bodyprovided by the <i>pData</i> parameter. <p>The maximum length of the option field in a DHCP message depends on theMTU size of the associated interface and the maximum DHCP message size setduring the DHCP library initialization. These option settings share thatfield with any option request list created through the <b><a href="./dhcpcCommonLib.html#dhcpcOptionSet">dhcpcOptionSet</a>( )</b>routine. Options which exceed the limit will not be stored.<p>Each call to this routine with the same <i>option</i> value usually replacesthe value of the existing option, if any. However, the routine will appendthe new data for the <i>option</i> values which contain variable length lists,corresponding to tags 3-11, 21, 25, 33, 41-45, 48-49, 55, 65, and 68-76.<p></blockquote><h4>WARNING</h4><blockquote><p>The <b>_DHCP_REQ_LIST_TAG</b> <i>option</i> value (55) will replaceany existing list created with the <b><a href="./dhcpcCommonLib.html#dhcpcOptionSet">dhcpcOptionSet</a>( )</b> routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if the option was inserted successfully, or ERROR if the optionis invalid or storage failed.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_dhcpcLib_BAD_OPTION</b>, <b>S_dhcpcLib_OPTION_NOT_STORED</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcCommonLib.html#top">dhcpcCommonLib</a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -