📄 dhcp_8h-source.html
字号:
<a name="l00078"></a><a class="code" href="group__dhcp.html#ga16">00078</a> <span class="comment"></span>#define DHCP_UDP_CLIENT_PORT 68 <span class="comment">///< UDP port clients will receive DHCP replies</span>00079 <span class="comment"></span>00080 <a name="l00081"></a><a class="code" href="group__dhcp.html#ga17">00081</a> <span class="preprocessor">#define DHCP_OPT_PAD 0 </span><span class="comment">///< token padding value (make be skipped)</span><a name="l00082"></a><a class="code" href="group__dhcp.html#ga18">00082</a> <span class="comment"></span>#define DHCP_OPT_NETMASK 1 <span class="comment">///< subnet mask client should use (4 byte mask)</span><a name="l00083"></a><a class="code" href="group__dhcp.html#ga19">00083</a> <span class="comment"></span>#define DHCP_OPT_ROUTERS 3 <span class="comment">///< routers client should use (IP addr list)</span><a name="l00084"></a><a class="code" href="group__dhcp.html#ga20">00084</a> <span class="comment"></span>#define DHCP_OPT_TIMESERVERS 4 <span class="comment">///< time servers client should use (IP addr list)</span><a name="l00085"></a><a class="code" href="group__dhcp.html#ga21">00085</a> <span class="comment"></span>#define DHCP_OPT_NAMESERVERS 5 <span class="comment">///< name servers client should use (IP addr list)</span><a name="l00086"></a><a class="code" href="group__dhcp.html#ga22">00086</a> <span class="comment"></span>#define DHCP_OPT_DNSSERVERS 6 <span class="comment">///< DNS servers client should use (IP addr list)</span><a name="l00087"></a><a class="code" href="group__dhcp.html#ga23">00087</a> <span class="comment"></span>#define DHCP_OPT_HOSTNAME 12 <span class="comment">///< host name client should use (string)</span><a name="l00088"></a><a class="code" href="group__dhcp.html#ga24">00088</a> <span class="comment"></span>#define DHCP_OPT_DOMAINNAME 15 <span class="comment">///< domain name client should use (string)</span><a name="l00089"></a><a class="code" href="group__dhcp.html#ga25">00089</a> <span class="comment"></span>#define DHCP_OPT_REQUESTEDIP 50 <span class="comment">///< IP address requested by client (IP address)</span><a name="l00090"></a><a class="code" href="group__dhcp.html#ga26">00090</a> <span class="comment"></span>#define DHCP_OPT_LEASETIME 51 <span class="comment">///< DHCP Lease Time (uint32 seconds)</span><a name="l00091"></a><a class="code" href="group__dhcp.html#ga27">00091</a> <span class="comment"></span>#define DHCP_OPT_DHCPMSGTYPE 53 <span class="comment">///< DHCP message type (1 byte)</span><a name="l00092"></a><a class="code" href="group__dhcp.html#ga28">00092</a> <span class="comment"></span>#define DHCP_OPT_SERVERID 54 <span class="comment">///< Server Identifier (IP address)</span><a name="l00093"></a><a class="code" href="group__dhcp.html#ga29">00093</a> <span class="comment"></span>#define DHCP_OPT_PARAMREQLIST 55 <span class="comment">///< Paramerter Request List (n OPT codes)</span><a name="l00094"></a><a class="code" href="group__dhcp.html#ga30">00094</a> <span class="comment"></span>#define DHCP_OPT_RENEWALTIME 58 <span class="comment">///< DHCP Lease Renewal Time (uint32 seconds)</span><a name="l00095"></a><a class="code" href="group__dhcp.html#ga31">00095</a> <span class="comment"></span>#define DHCP_OPT_REBINDTIME 59 <span class="comment">///< DHCP Lease Rebinding Time (uint32 seconds)</span><a name="l00096"></a><a class="code" href="group__dhcp.html#ga32">00096</a> <span class="comment"></span>#define DHCP_OPT_END 255 <span class="comment">///< token end value (marks end of options list)</span>00097 <span class="comment"></span><a name="l00098"></a><a class="code" href="group__dhcp.html#ga33">00098</a> <span class="preprocessor">#define DHCP_MSG_DHCPDISCOVER 1 </span><span class="comment">///< DISCOVER is broadcast by client to solicit OFFER from any/all DHCP servers.</span><a name="l00099"></a><a class="code" href="group__dhcp.html#ga34">00099</a> <span class="comment"></span>#define DHCP_MSG_DHCPOFFER 2 <span class="comment">///< OFFER(s) are made to client by server to offer IP address and config info.</span><a name="l00100"></a><a class="code" href="group__dhcp.html#ga35">00100</a> <span class="comment"></span>#define DHCP_MSG_DHCPREQUEST 3 <span class="comment">///< REQUEST is made my client in response to best/favorite OFFER message.</span><a name="l00101"></a><a class="code" href="group__dhcp.html#ga36">00101</a> <span class="comment"></span>#define DHCP_MSG_DHCPDECLINE 4 <span class="comment">///< DECLINE may be sent by client to server to indicate IP already in use.</span><a name="l00102"></a><a class="code" href="group__dhcp.html#ga37">00102</a> <span class="comment"></span>#define DHCP_MSG_DHCPACK 5 <span class="comment">///< ACK is sent to client by server in confirmation of REQUEST, contains config and IP.</span><a name="l00103"></a><a class="code" href="group__dhcp.html#ga38">00103</a> <span class="comment"></span>#define DHCP_MSG_DHCPNAK 6 <span class="comment">///< NAK is sent to client by server to indicate problem with REQUEST.</span><a name="l00104"></a><a class="code" href="group__dhcp.html#ga39">00104</a> <span class="comment"></span>#define DHCP_MSG_DHCPRELEASE 7 <span class="comment">///< RELEASE is sent by client to server to relinquish DHCP lease on IP address, etc.</span><a name="l00105"></a><a class="code" href="group__dhcp.html#ga40">00105</a> <span class="comment"></span>#define DHCP_MSG_DHCPINFORM 8 <span class="comment">///< INFORM is sent by client to server to request config info, IP address configured locally.</span>00106 <span class="comment"></span>00107 <span class="comment"></span>00108 <span class="comment">/*! Initialize DHCP system.</span>00109 <span class="comment"> Prepares DHCP for use and initializes lease time to zero. */</span>00110 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga1">dhcpInit</a>(<span class="keywordtype">void</span>);00111 <span class="comment"></span>00112 <span class="comment">/*! Processes incoming DHCP packets from UDP port 68.</span>00113 <span class="comment"> This function is to be called by the stack when a DHCP packet</span>00114 <span class="comment"> arrives over the network. The DHCP packet will be parsed, handled,</span>00115 <span class="comment"> and a response will be generated and sent if needed. When the DHCP</span>00116 <span class="comment"> process completes, the IP addressing will be automatically updated. */</span>00117 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga2">dhcpIn</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> len, <span class="keyword">struct</span> <a class="code" href="structnetDhcpHeader.html">netDhcpHeader</a>* packet);00118 <span class="comment"></span>00119 <span class="comment">/*! Request DHCP assigned network parameters.</span>00120 <span class="comment"> This function begins the DHCP process. The remainder of operations</span>00121 <span class="comment"> are handled in dhcpIn(). */</span>00122 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga3">dhcpRequest</a>(<span class="keywordtype">void</span>);00123 <span class="comment"></span>00124 <span class="comment">/*! Release DHCP lease and assigned network parameters.</span>00125 <span class="comment"> This function releases the DHCP assigned address and allows the</span>00126 <span class="comment"> DHCP server to reallocate it. */</span>00127 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga4">dhcpRelease</a>(<span class="keywordtype">void</span>);00128 <span class="comment"></span>00129 <span class="comment">/*! Periodic DHCP maintenance.</span>00130 <span class="comment"> This function is to be called once per second and will </span>00131 <span class="comment"> expire the DHCP lease. */</span>00132 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga5">dhcpTimer</a>(<span class="keywordtype">void</span>);00133 <span class="comment"></span>00134 <span class="comment">/*! Get a DHCP option from the option list.</span>00135 <span class="comment"> \param options is a pointer to the options field of a DHCP packet.</span>00136 <span class="comment"> \param optcode is the desired option number to retrieve.</span>00137 <span class="comment"> \param optlen is the maximum data length that should be retrieved (less data will be retrieved if option is shorter).</span>00138 <span class="comment"> \param optvalptr is a pointer to where the option value will be stored.</span>00139 <span class="comment"> \return actual length of the option data, as stored in the options list. */</span>00140 uint8_t <a class="code" href="group__dhcp.html#ga6">dhcpGetOption</a>(uint8_t* options, uint8_t optcode, uint8_t optlen, <span class="keywordtype">void</span>* optvalptr);00141 <span class="comment"></span>00142 <span class="comment">/*! Set a DHCP option in the option list.</span>00143 <span class="comment"> \param options is a pointer to the options field of a DHCP packet.</span>00144 <span class="comment"> \param optcode is the option number to write.</span>00145 <span class="comment"> \param optlen is the data length of the option value.</span>00146 <span class="comment"> \param optvalptr is a pointer to the option data to be read.</span>00147 <span class="comment"> \return pointer to write location of the next option. */</span>00148 uint8_t* <a class="code" href="group__dhcp.html#ga7">dhcpSetOption</a>(uint8_t* options, uint8_t optcode, uint8_t optlen, <span class="keywordtype">void</span>* optvalptr);00149 <span class="comment"></span>00150 <span class="comment">/*! Print diagnotic information about BOOTP/DHCP packet.</span>00151 <span class="comment">*/</span>00152 <span class="keywordtype">void</span> <a class="code" href="group__dhcp.html#ga8">dhcpPrintHeader</a>(<span class="keyword">struct</span> <a class="code" href="structnetDhcpHeader.html">netDhcpHeader</a>* packet);00153 00154 <span class="preprocessor">#endif</span>00155 <span class="preprocessor"></span><span class="comment">//@}</span>00156 <span class="comment"></span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:07 2006 for Procyon AVRlib by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -