📄 dhcpcbootlib.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.htm"><i>VxWorks API Reference : OS 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><a href="./dhcpcBootLib.html#dhcpcBootInit">dhcpcBootInit</a>( )</b> - set up the DHCP client parameters and data structures<br><b><a href="./dhcpcBootLib.html#dhcpcBootBind">dhcpcBootBind</a>( )</b> - initialize the network with DHCP at boot time<br><b><a href="./dhcpcBootLib.html#dhcpcBootInformGet">dhcpcBootInformGet</a>( )</b> - obtain additional configuration parameters with DHCP<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 2131 usingthe boot device specified in the boot parameters. The DHCP client supportsdevices attached to the IP protocol with the MUX/END interface. It alsosupports BSD Ethernet devices attached to the IP protocol.<p>To use DHCP, first build a boot ROM image with <b>INCLUDE_DHCPC</b> defined and set<br> the appropriate flag in the boot parameters before initiating booting withthe "@" command. The DHCP client will attempt to retrieve entries for theboot file name, and host IP address, as well as a subnet mask and broadcastaddress for the boot device. If a target IP address is not available, theclient will retrieve those parameters in the context of a lease. Otherwise,it will search for permanent assignments using a simpler message exchange.Any entries retrieved with either method will only be used if the correspondingfields in the boot 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 renewany lease which may be associated with the assigned IP address. To avoidpotential IP address 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 bootfile must also contain the DHCP client library so that the lease obtainedbefore the restart can be renewed. Otherwise, the network initialization usingthe boot parameters will fail. These restrictions do not apply if the targetIP address is entered manually since the boot parameters do not involve alease in that case.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>dhcpcBootLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpcLib.html#top">dhcpcLib</a></b>, RFC 1541, RFC 1533<hr><a name="dhcpcBootInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcBootInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcBootInit( )</strong> - set up the DHCP client parameters and data structures</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void * dhcpcBootInit ( struct ifnet * pIf, /* network device used by client */ int serverPort, /* port used by DHCP servers (default 67) */ int clientPort, /* port used by DHCP clients (default 68) */ int maxSize, /* largest DHCP message supported, in bytes */ int offerTimeout, /* interval to get additional DHCP offers */ int defaultLease, /* default value for requested lease length */ int minLease /* minimum accepted lease length */ )</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. The DHCP client supports interfaces attached to theIP protocol using the MUX/END interface and BSD Ethernet devices attachedto that protocol. The interface must be capable of sending broadcastmessages. The <i>maxSize</i> parameter specifies the maximum length supported forany DHCP message, including the UDP and IP headers and the link level header.The maximum length of the DHCP options field is based on this value or theMTU size for the given interface, whichever is less. The smallest valid valuefor the <i>maxSize</i> parameter is 576 bytes, corresponding to the minimum IPdatagram a host must accept. The MTU size of the network interface must belarge enough to handle those datagrams.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A<p></blockquote><h4>RETURNS</h4><blockquote><p>Lease handle for later use, or NULL if lease startup fails.</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.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcBootBind( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcBootBind( )</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 2131. 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 and no targetaddress is present.<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="dhcpcBootInformGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>dhcpcBootInformGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>dhcpcBootInformGet( )</strong> - obtain additional configuration parameters with DHCP</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpcBootInformGet ( char * pAddrString /* known address assigned to client */ )</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 message exchange usesthe network device specified with the initialization call. Any interfaceinformation retrieved is applied to that network device. Since this processdoes not establish a lease, the target address will not contain anytimestamp information so that the runtime image will not attempt to verify the configuration parameters. This routine is called automatically by theboot program when <b>INCLUDE_DHCPC</b> is defined and the automatic configurationoption is set in the boot flags if a target address is already present.<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></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -