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

📄 dhcpslib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
The storage routine is installed by a call to the <b><a href="./dhcpsLib.html#dhcpsLeaseHookAdd">dhcpsLeaseHookAdd</a>(&nbsp;)</b> routineThe manual pages for <b><a href="./dhcpsLib.html#dhcpsLeaseHookAdd">dhcpsLeaseHookAdd</a>(&nbsp;)</b> describe the parameters and required operation of the storage routine.<p></blockquote><h4>SECONDARY INTERFACE</h4><blockquote><p>In addition to the hard-coded entries, address entries may be added after the server has started by calling the following routine:<pre>    STATUS dhcpsLeaseEntryAdd (char *name, char *start, char *end, char *config);</pre>The parameters specify an entry name, starting and ending values for a block of IP addresses, and additional configuration information in the same format as shown above for the hard-coded entries.  Each parameter must be formatted as a NULL-terminated string. <p>The <b>DHCPS_ADDRESS_HOOK</b> constant specifies the name of a storage routine, used to preserve address entries added after startup, which has the following prototype:<pre>    STATUS dhcpsAddressStorageHook (int op,                                    char *name, char *start, char *end,                                     char *params);</pre>The storage routine is installed with the <b><a href="./dhcpsLib.html#dhcpsAddressHookAdd">dhcpsAddressHookAdd</a>(&nbsp;)</b> routine, and is fully described in the manual pages for that function.<p></blockquote><h4>OPTIONAL INTERFACE</h4><blockquote><p>The DHCP server can also receive messages forwarded from different subnetsby a relay agent.  To provide addresses to clients on different subnets, theappropriate relay agents must be listed in the provided table in <b>usrNetwork.c</b>. A sample configuration is:<pre>    DHCPS_RELAY_DESC dhcpsRelayTbl [] =        {        {"90.11.46.75", "90.11.46.0"}        };</pre>Each entry in the table specifies the address of a relay agent that will transmit the request and the corresponding subnet number.  To issue leasessuccessfully, the address pool must also contain IP addresses for the monitored subnets.<p>The following table allows a DHCP server to act as a relay agent in addition to its default function of processing messages.  It consists of a list of IP addresses.<pre>    DHCP_TARGET_DESC dhcpTargetTbl [] =         {         {"90.11.43.2"},         {"90.11.44.1"}         };</pre>Each IP address in this list receives a copy of any client messagesgenerated on the subnets monitored by the server.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>dhcpsLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p>RFC 1541, RFC 1533<hr><a name="dhcpsInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>dhcpsInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpsInit(&nbsp;)</strong> - set up the DHCP server parameters and data structures</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpsInit    (    DHCPS_CFG_PARAMS * pDhcpsCfg /* configuration parameters */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates the necessary data structures, builds theserver address pool, retrieves any lease or address information from permanent storage through the user-provided hooks, and initializes the network interfaces for monitoring.  It is called at system startup if <b>INCLUDE_DHCPS</b> is defined at the time the VxWorks image is built.<p>The <i>maxSize</i> parameter specifies the maximum length supported for anyDHCP message, including the UDP and IP headers and the largest linklevel header for all supported devices. The smallest valid value is576 bytes, corresponding to the minimum IP datagram a host must accept.Larger values will allow the server to handle longer DHCP messages.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if could not initialize.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpsLib.html#top">dhcpsLib</a></b><hr><a name="dhcpsLeaseEntryAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>dhcpsLeaseEntryAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpsLeaseEntryAdd(&nbsp;)</strong> - add another entry to the address pool</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpsLeaseEntryAdd    (    char * pName,             /* name of lease entry */    char * pStartIp,          /* first IP address to assign */    char * pEndIp,            /* last IP address in assignment range */    char * pParams            /* formatted string of lease parameters */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allows the user to add new entries to the address pool withoutrebuilding the VxWorks image.  The routine requires a unique entry name of upto eight characters, starting and ending IP addresses, and a colon-separated list of parameters.  Possible values for the parameters are listed in the reference entry for <b><a href="./dhcpsLib.html#top">dhcpsLib</a></b>.  The parameters also determine the type of lease, which the server uses to determine priority when assigning lease addresses.  For examples of the possible lease types, see the reference entry for <b><a href="./dhcpsLib.html#top">dhcpsLib</a></b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK if entry read successfully, or ERROR otherwise.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpsLib.html#top">dhcpsLib</a></b><hr><a name="dhcpsLeaseHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>dhcpsLeaseHookAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpsLeaseHookAdd(&nbsp;)</strong> - assign a permanent lease storage hook for the server</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpsLeaseHookAdd    (    FUNCPTR pCacheHookRtn     /* routine to store/retrieve lease records */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allows the server to access some form of permanent storagethat it can use to store current lease information across restarts.  The only argument to <b><a href="./dhcpsLib.html#dhcpsLeaseHookAdd">dhcpsLeaseHookAdd</a>(&nbsp;)</b> is a pointer to a storage routine with the following interface: <pre>    STATUS dhcpsStorageHook (int op, char *buffer, int datalen);</pre>The first parameter of the storage routine specifies one of the following operations: <p>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_START</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_READ</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_WRITE</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_STOP</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_CLEAR</b><p>In response to START, the storage routine should prepare to return data or overwrite data provided by earlier WRITEs.  For a WRITE the storage routine must save the contents of the buffer to permanent storage.  For a READ, the storage routine should copy data previously stored into the provided buffer as a NULL-terminated string in FIFO order.  For a CLEAR, the storage routine should discard currently stored data.  After a CLEAR, the READ operationmust return ERROR until additional data is stored.  For a STOP, the storage routine must handle cleanup.  After a STOP, READ and WRITE operations mustreturn error until a START is received.  Each of these operations must return OK if successful, or ERROR otherwise.<p>Before the server is initialized, VxWorks automatically calls <b><a href="./dhcpsLib.html#dhcpsLeaseHookAdd">dhcpsLeaseHookAdd</a>(&nbsp;)</b>, passing in the routine name defined by <b>DHCPS_LEASE_HOOK</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if routine is NULL.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpsLib.html#top">dhcpsLib</a></b><hr><a name="dhcpsAddressHookAdd"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>dhcpsAddressHookAdd(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>dhcpsAddressHookAdd(&nbsp;)</strong> - assign a permanent address storage hook for the server</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dhcpsAddressHookAdd    (    FUNCPTR pCacheHookRtn     /* routine to store/retrieve lease entries */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allows the server to access some form of permanent storageto preserve additional address entries across restarts.  This routine isnot required, but leases using unsaved addresses are not renewed.  The only argument provided is the name of a function with the following interface:<pre>    STATUS dhcpsAddressStorageHook (int op,                                    char *name, char *start, char *end,                                     char *params);</pre>The first parameter of this storage routine specifies one of the following operations: <p>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_START</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_READ</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_WRITE</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>DHCPS_STORAGE_STOP</b>&nbsp;<p>In response to a START, the storage routine should prepare to returndata or overwrite data provided by earlier WRITE operations.  For a WRITE, the storage routine must save the contents of the four buffers to permanent storage.  Those buffers contain the NULL-terminated strings received by the <b><a href="./dhcpsLib.html#dhcpsLeaseEntryAdd">dhcpsLeaseEntryAdd</a>(&nbsp;)</b> routine.  For a READ, thestorage routine should copy previously stored data (as NULL-terminated strings) into the provided buffers in the order received by earlier WRITEoperations.  For a STOP, the storage routine should do any necessary cleanup. After a STOP, the storage routine should return an ERROR for all operations except START.  However, the STOP operation does not normally occur sincethe server only deliberately exits following an unrecoverable error.  Thisstorage routine must not rely on that operation to handle READ, WRITE, ornew START attempts.<p>The storage routine should return OK if successful, ERROR otherwise.<p>Note that, unlike the lease storage routine, there is no CLEAR operation.<p>Before the server is initialized, VxWorks calls this routine automatically passing in the function named in <b>DHCPS_ADDRESS_HOOK</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if function pointer is NULL.<p></blockquote><h4>ERRNO</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dhcpsLib.html#top">dhcpsLib</a></b></body></html>

⌨️ 快捷键说明

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