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

📄 dhcpslib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/dhcpsLib.html - generated by refgen from dhcpsLib.c --> <title> dhcpsLib </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>dhcpsLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpsLib</strong> - Dynamic Host Configuration Protocol (DHCP) server library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./dhcpsLib.html#dhcpsInit">dhcpsInit</a>(&nbsp;)</b>  -  set up the DHCP server parameters and data structures<br><b><a href="./dhcpsLib.html#dhcpsLeaseEntryAdd">dhcpsLeaseEntryAdd</a>(&nbsp;)</b>  -  add another entry to the address pool<br><b><a href="./dhcpsLib.html#dhcpsLeaseHookAdd">dhcpsLeaseHookAdd</a>(&nbsp;)</b>  -  assign a permanent lease storage hook for the server<br><b><a href="./dhcpsLib.html#dhcpsAddressHookAdd">dhcpsAddressHookAdd</a>(&nbsp;)</b>  -  assign a permanent address storage hook for the server<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library implements the server side of the Dynamic Host ConfigurationProtocol (DHCP).  DHCP is an extension of BOOTP.  Like BOOTP, it allows atarget to configure itself dynamically by using the network to get its IP address, a boot file name, and the DHCP server's address.  Additionally,DHCP provides for automatic reuse of network addresses by specifyingindividual leases as well as many additional options.  The compatiblemessage format allows DHCP participants to interoperate with BOOTPparticipants.  The <b><a href="./dhcpsLib.html#dhcpsInit">dhcpsInit</a>(&nbsp;)</b> routine links this library into the VxWorks image.  This happens automatically if <b>INCLUDE_DHCPS</b> is defined when the image is built.<p></blockquote><h4>PRIMARY INTERFACE</h4><blockquote><p>The <b><a href="./dhcpsLib.html#dhcpsInit">dhcpsInit</a>(&nbsp;)</b> routine initializes the server.  It reads the hard-coded server configuration data that is stored in three separate tables.The first table contains entries as follows:<pre>DHCPS_LEASE_DESC dhcpsLeaseTbl [] =    {    {"sample1", "90.11.42.24", "90.11.42.24", "clid=\"1:0x08003D21FE90\""},    {"sample2", "90.11.42.25", "90.11.42.28", "maxl=90:dfll=60"},    {"sample3", "90.11.42.29", "90.11.42.34", "maxl=0xffffffff:file=/vxWorks"},    {"sample4", "90.11.42.24", "90.11.42.24", "albp=true:file=/vxWorks"}    };</pre>Each entry contains a name of up to eight characters, the starting and ending IP addresses of a range, and the parameters associated with the lease.  Thefour samples shown demonstrate the four types of leases. <p>Manual leases contain a specific client ID, and are issued only to that client, with an infinite duration.  The example shown specifies a MAC address, which is the identifier type used by the VxWorks DHCP client.<p>Dynamic leases specify a finite maximum length, and can be issued to anyrequesting client.  These leases allow later re-use of the assigned IP address.If not explicitly specified in the parameters field, these leases use the values of <b>DHCPS_MAX_LEASE</b> and <b>DHCPS_DFLT_LEASE</b> to determine the lease length.<p>Automatic leases are implied by the infinite maximum length.  Their IP addressesare assigned permanently to any requesting client.<p>The last sample demonstrates a lease that is also available to BOOTP clients.The infinite maximum length is implied, and any timing-related parameters areignored. <p>The DHCP server supplies leases to DHCP clients according to the lease type inthe order shown above.  Manual leases have the highest priority and leases available to BOOTP clients the lowest.<p>Entries in the parameters field may be one of these types:<p><dl><dt><b>bool</b><dd>Takes values of "true" or "false", for example, ipfd=true.  Unrecognized values default to false. <dt><b>str</b><dd>Takes a character string as a value, for example, hstn="clapton".If the string includes a delimiter character, such as a colon, it should be enclosed in quotation marks.<dt><b>octet</b><dd>Takes an 8-bit integer in decimal, octal, or hexadecimal, for example,8, 070, 0xff.<dt><b>short</b><dd>Takes a 16-bit integer.<dt><b>long</b><dd>Takes a 32-bit integer.<dt><b>ip</b><dd>Takes a string that is interpreted as a 32-bit IP address.  One of the following formats isexpected: a.b.c.d, <b>a.b.c</b> or a.b.  In the secondformat, c is interpreted as a 16-bit value.  Inthe third format, b is interpreted as a 24-bitvalue, for example siad=90.11.42.1.  <dt><b>iplist</b><dd>Takes a list of IP addresses, separated bywhite space, for example, rout=133.4.31.1 133.4.31.2 133.4.31.3.<dt><b>ippairs</b><dd>Takes a list of IP address pairs.  Each IPaddress is separated by white space and groupedin pairs, for example, strt=133.4.27.0  133.4.31.1133.4.36.0 133.4.31.1.<dt><b>mtpt</b><dd>Takes a list of 16 bit integers,separated by white space, for example, mtpt=1 2 3 4 6 8.<dt><b>clid</b><dd>Takes a client identifier as a value.Client identifiers are represented by the quotedstring "<i>type</i>:<i>data</i>", where <i>type</i> is aninteger from 0 to 255, as defined by the IANA,and <i>data</i> is a sequence of 8-bit values in hexadecimal.The client ID is usually a MAC address, for example, clid="1:0x08004600e5d5".</dl>The following table lists the option specifiers and descriptions forevery possible entry in the parameter list.  When available, the optioncode from RFC 2132 is included.<table><tr valign=top><th align=left>Name </th><th align=left> Code </th><th align=left> Type    </th><th align=left> Description</tr><tr><td colspan="4"><hr></tr><tr valign=top><td align=left>snam </td><td align=left> -    </td><td align=left> str     </td><td align=left> Optional server name.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>file </td><td align=left> -    </td><td align=left> str     </td><td align=left> Name of file containing the boot image.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>siad </td><td align=left> -    </td><td align=left> ip      </td><td align=left> Address of server that offers the boot image.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>albp </td><td align=left> -    </td><td align=left> bool    </td><td align=left> If true, this entry is also available</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> to BOOTP clients.  For entries using</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> static allocation, this value becomes</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> true by default and <i>maxl</i> becomes</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> infinity.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>maxl </td><td align=left> -    </td><td align=left> long    </td><td align=left> Maximum lease duration in seconds. </tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>dfll </td><td align=left> -    </td><td align=left> long    </td><td align=left> Default lease duration in seconds.  If a</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> client does not request a specific lease</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> duration, the server uses this value.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>clid </td><td align=left> -    </td><td align=left> clid    </td><td align=left> This specifies a client identifier for</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> manual leases.  The VxWorks client uses</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> a MAC address as the client identifier.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>pmid </td><td align=left> -    </td><td align=left> clid    </td><td align=left> This specifies a client identifier for</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> client-specific parameters to be included</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> in a lease.  It should be present in separate</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> entries without IP addresses.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>clas </td><td align=left> -    </td><td align=left> str     </td><td align=left> This specifies a class identifier for</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> class-specific parameters to be included in </tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> a lease.  It should be present in separate entries</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> without IP addresses.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>snmk </td><td align=left> 1    </td><td align=left> ip      </td><td align=left> Subnet mask of the IP address to be</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> allocated.  The default is a natural mask</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> corresponding to the IP address.  The</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> server will not issue IP addresses to </tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> clients on different subnets.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>tmof </td><td align=left> 2    </td><td align=left> long    </td><td align=left> Time offset from UTC in seconds.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>rout </td><td align=left> 3    </td><td align=left> iplist  </td><td align=left> A list of routers on the same subnet as</tr><tr valign=top><td align=left>     </td><td align=left>      </td><td align=left>         </td><td align=left> the client.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>tmsv </td><td align=left>  4   </td><td align=left> iplist  </td><td align=left> A list of time servers (RFC 868).</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>nmsv </td><td align=left>  5   </td><td align=left> iplist  </td><td align=left> A list of name servers (IEN 116).</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>dnsv </td><td align=left>  6   </td><td align=left> iplist  </td><td align=left> A list of DNS servers (RFC 1035).</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>lgsv </td><td align=left>  7   </td><td align=left> iplist  </td><td align=left> A list of MIT-LCS UDP log servers.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>cksv </td><td align=left>  8   </td><td align=left> iplist  </td><td align=left> A list of Cookie servers (RFC 865).</tr><tr valign=top><td align=left></tr>

⌨️ 快捷键说明

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