⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dhcpcbootlib.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dhcpcBootLib.html - generated by refgen from dhcpcBootLib.c --> <title> dhcpcBootLib </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>dhcpcBootLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpcBootLib</strong> - DHCP boot-time client library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./dhcpcBootLib.html#dhcpcBootInit">dhcpcBootInit</a></i>(&nbsp;)</b>  -  set up the DHCP client parameters and data structures<br><b><i><a href="./dhcpcBootLib.html#dhcpcBootBind">dhcpcBootBind</a></i>(&nbsp;)</b>  -  initialize the network with DHCP at boot time<br><b><i><a href="./dhcpcBootLib.html#dhcpcBootOptionSet">dhcpcBootOptionSet</a></i>(&nbsp;)</b>  -  add an option to the option request list<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains the interface for the client side of the Dynamic HostConfiguration Protocol (DHCP) used during system boot. DHCP is an extensionof BOOTP, the bootstrap protocol.  Like BOOTP, the protocol allows automaticsystem startup by providing an IP address, boot file name, and boot host'sIP address over a network.  Additionally, DHCP provides the complete set ofconfiguration parameters defined in the Host Requirements RFCs and allowsautomatic reuse of network addresses by specifying a lease duration for aset of configuration parameters.  This library is linked into the boot ROM image automatically if <b>INCLUDE_DHCPC</b> is defined at the time that image is constructed.<p></blockquote><h4>HIGH-LEVEL INTERFACE</h4><blockquote><p>The VxWorks boot program uses this library to obtain configuration parameters with DHCP according to the client-server interaction detailed in RFC 1541 usingthe boot device specified in the boot parameters.  The boot device must be capable of sending broadcast messages.  Currently, only Ethernet devices and the shared-memory network drivers are supported.  To use DHCP, first build a boot ROM image with <b>INCLUDE_DHCPC</b> defined and set the appropriate flag in the boot parameters before initiating booting with the "@" command.  The DHCP client willattempt to retrieve entries for the boot file name, host IP address, and target IP address, as well as a subnet mask and broadcast address for the boot device.Any entries retrieved will only be used if the corresponding fields in theboot parameters are blank.<p></blockquote><h4>NOTE</h4><blockquote><p>After DHCP retrieves the boot parameters, the specified boot file is loadedand the system restarts. As a result, the boot-time DHCP client cannot renewthe lease associated with the assigned IP address.  To avoid potential IPaddress conflicts while loading the boot file, the <b>DHCPC_MIN_LEASE</b> value should be set to exceed the file transfer time.  In addition, the boot filemust also contain the DHCP client library so that the lease obtained beforethe restart can be renewed. Otherwise, the network initialization using theboot parameters will fail.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>dhcpcBootLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcBootLib.html#top">dhcpcBootLib</a></b>, <b><a href="./dhcpcLib.html#top">dhcpcLib</a></b>, RFC 1541, RFC 1533<hr><a name="dhcpcBootInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dhcpcBootInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dhcpcBootInit</i>(&nbsp;)</strong> - set up the DHCP client parameters and data structures</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcBootInit    (    struct ifnet * pIf /* network device used by client */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates any necessary data structures and sets the client's option request list to retrieve a subnet mask and broadcast address for the network interface indicated by <i>pIf</i>.  The routine is executed automatically by the boot program when <b>INCLUDE_DHCPC</b> is defined and the automatic configuration option is set in the boot flags.  The network interface specified by <i>pIf</i> is used to transmit and receive all DHCP messages during the lease negotiation.  That interface must be capable of sending broadcast messages.  Currently, only Ethernet devices and the shared-memory network drivers are supported.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if could not initialize.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcBootLib.html#top">dhcpcBootLib</a></b><hr><a name="dhcpcBootBind"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dhcpcBootBind</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dhcpcBootBind</i>(&nbsp;)</strong> - initialize the network with DHCP at boot time</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcBootBind (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine performs the client side of a DHCP negotiation according to RFC 1541.  The negotiation uses the network device specified with theinitialization call.  The addressing information retrieved is applied to that network device.  Because the boot image is replaced by the downloaded target image, the resulting lease cannot be renewed.  Therefore, the minimum lease length specified by <b>DHCPC_MIN_LEASE</b> must be set so that the target image has sufficient time to download and begin monitoring the lease.  This routine is called automatically by the boot program when <b>INCLUDE_DHCPC</b> is defined and the automatic configuration option is set in the boot flags.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if negotiation is successful, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcBootLib.html#top">dhcpcBootLib</a></b><hr><a name="dhcpcBootOptionSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>dhcpcBootOptionSet</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>dhcpcBootOptionSet</i>(&nbsp;)</strong> - add an option to the option request list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcBootOptionSet    (    int    option, /* RFC 1533 tag of desired option */    long   value,  /* numeric value for option */    long   length, /* length of data (if any) or 0 if unused */    char * pData   /* option data, or NULL if none */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets most client-to-server transmission options for a leaseestablished by the boot program.  The <i>option</i> parameter specifies an option tag as defined in RFC 1533 and the updates published in the Internet Draftof November 1996.  The boot program automatically sets all necessary options for target configuration.  This routine is only provided to support specialcircumstances in which additional options are necessary.  Any options requested with this routine may be retrieved after the runtime image hasstarted.  For a listing of defined aliases for the known option tags, see <b>dhcp/dhcp.h</b>.  This routine cannot set the options associated with the following tags: <p>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_PAD_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_OPT_OVERLOAD_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_MSGTYPE_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_SERVER_ID_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_REQ_LIST_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_MAXMSGSIZE_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_END_TAG</b><p>Most options only require specification of the appropriate tag in the <i>option</i> parameter.  In those cases, the <b><i><a href="./dhcpcBootLib.html#dhcpcBootOptionSet">dhcpcBootOptionSet</a></i>(&nbsp;)</b> call adds the specified option tag to the option request list, if possible.  However, some options require additional information.  The tags for these options are: <p>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_VENDOR_SPEC_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_REQUEST_IPADDR_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_LEASE_TIME_TAG</b>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_ERR_MSG_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_CLASS_ID_TAG</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>_DHCP_CLIENT_ID_TAG</b><p>The <b>_DHCP_LEASE_TIME_TAG</b> and <b>_DHCP_CLIENT_ID_TAG</b> options each require a<i>value</i> parameter.  For <b>_DHCP_LEASE_TIME_TAG</b>, <i>value</i> specifies the desired lease length.  For <b>_DHCP_CLIENT_ID_TAG</b>, <i>value</i> specifies the type for a type/value pair.  No other options use this parameter.<p>The <b>_DHCP_VENDOR_SPEC_TAG</b>, <b>_DHCP_CLASS_ID_TAG</b> and <b>_DHCP_CLIENT_ID_TAG</b>tags each require a value for the <i>length</i> parameter to specify the number of bytes of data provided.  No other options use this parameter.<p>Use the <i>data</i> parameter with the following option tags:<dl><dt><b>_DHCP_VENDOR_SPEC_TAG</b><dd>The <i>data</i> parameter points to a list of "length" bytes of options in the format specified by RFC 1533. <p><dt><b>_DHCP_REQUEST_IPADDR_TAG</b><dd>The <i>data</i> parameter points to the string representation of the desired Internet address for the client. <p><dt><b>_DHCP_ERRMSG_TAG</b><dd>The <i>data</i> parameter points to the error message to send to the server when releasing the current IP address.<p><dt><b>_DHCP_CLASS_ID_TAG</b><dd>The <i>data</i> parameter points to <i>length</i> bytes used as the value for the vendor class identifier.<p><dt><b>_DHCP_CLIENT_ID_TAG</b><dd>The <i>data</i> parameter points to <i>length</i>  bytes used as the value of a type/value pair.<p><dt>-<dd> The data parameter should be NULL for all other options.<p></dl></blockquote><h4>NOTE</h4><blockquote><p><p>&nbsp;With&nbsp;the&nbsp;exception&nbsp;of&nbsp;the&nbsp;<b>_DHCP_ERR_MSG_TAG</b>&nbsp;option,&nbsp;the&nbsp;DHCP&nbsp;specification forbids changing options after a lease has been established.  Therefore, this routine should not be used after the <b><i><a href="./dhcpcBootLib.html#dhcpcBootBind">dhcpcBootBind</a></i>(&nbsp;)</b> call.  Changing any option other than the error message atthat point could have unpredictable results.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if option set successfully, or ERROR if option is invalid or storage failed.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcBootLib.html#top">dhcpcBootLib</a></b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -