<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Procyon AVRlib: DHCP Protocol Library (dhcp.c)</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>DHCP Protocol Library (dhcp.c)<br>
<small>
[<a class="el" href="group__network.html">Network Library</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="dhcp_8h.html">net/dhcp.h</a>"</span>
</pre></div> <dl compact><dt><b>Description</b></dt><dd>This library provides a limited implementation of DHCP (Dynamic Host Configuration Protocol) as described in RFC2131. DHCP allows a network device to automatically obtain an IP address and other network configuration settings from a DHCP server.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This code is currently below version 1.0, and therefore is considered to be lacking in some functionality or documentation, or may not be fully tested. Nonetheless, you can expect most functions to work. </dd></dl>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structnetBootpHeader.html">netBootpHeader</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Bootp Header (DHCP is transported by BOOTP/UDP/IP). <a href="structnetBootpHeader.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structnetDhcpHeader.html">netDhcpHeader</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP Header. <a href="structnetDhcpHeader.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga9" doxytag="dhcp::BOOTP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga9">BOOTP_HEADER_LEN</a> 236</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">length of BOOTP header not including options <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga10" doxytag="dhcp::BOOTP_OP_BOOTREQUEST"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga10">BOOTP_OP_BOOTREQUEST</a> 1</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">BOOTP Request operation (message from client to server). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga11" doxytag="dhcp::BOOTP_OP_BOOTREPLY"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga11">BOOTP_OP_BOOTREPLY</a> 2</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">BOOTP Reply operation (message from server to client). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga12" doxytag="dhcp::BOOTP_HTYPE_ETHERNET"></a>
#define </td><td class="memItemRight" valign="bottom"><b>BOOTP_HTYPE_ETHERNET</b> 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga13" doxytag="dhcp::BOOTP_HLEN_ETHERNET"></a>
#define </td><td class="memItemRight" valign="bottom"><b>BOOTP_HLEN_ETHERNET</b> 6</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga14" doxytag="dhcp::DHCP_HEADER_LEN"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga14">DHCP_HEADER_LEN</a> 240</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">length of DHCP header not including options <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga15" doxytag="dhcp::DHCP_UDP_SERVER_PORT"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga15">DHCP_UDP_SERVER_PORT</a> 67</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">UDP port where DHCP requests should be sent. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga16" doxytag="dhcp::DHCP_UDP_CLIENT_PORT"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga16">DHCP_UDP_CLIENT_PORT</a> 68</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">UDP port clients will receive DHCP replies. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga17" doxytag="dhcp::DHCP_OPT_PAD"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga17">DHCP_OPT_PAD</a> 0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">token padding value (make be skipped) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga18" doxytag="dhcp::DHCP_OPT_NETMASK"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga18">DHCP_OPT_NETMASK</a> 1</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">subnet mask client should use (4 byte mask) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga19" doxytag="dhcp::DHCP_OPT_ROUTERS"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga19">DHCP_OPT_ROUTERS</a> 3</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">routers client should use (IP addr list) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga20" doxytag="dhcp::DHCP_OPT_TIMESERVERS"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga20">DHCP_OPT_TIMESERVERS</a> 4</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">time servers client should use (IP addr list) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga21" doxytag="dhcp::DHCP_OPT_NAMESERVERS"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga21">DHCP_OPT_NAMESERVERS</a> 5</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">name servers client should use (IP addr list) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga22" doxytag="dhcp::DHCP_OPT_DNSSERVERS"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga22">DHCP_OPT_DNSSERVERS</a> 6</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DNS servers client should use (IP addr list). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga23" doxytag="dhcp::DHCP_OPT_HOSTNAME"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga23">DHCP_OPT_HOSTNAME</a> 12</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">host name client should use (string) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga24" doxytag="dhcp::DHCP_OPT_DOMAINNAME"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga24">DHCP_OPT_DOMAINNAME</a> 15</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">domain name client should use (string) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga25" doxytag="dhcp::DHCP_OPT_REQUESTEDIP"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga25">DHCP_OPT_REQUESTEDIP</a> 50</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">IP address requested by client (IP address). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga26" doxytag="dhcp::DHCP_OPT_LEASETIME"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga26">DHCP_OPT_LEASETIME</a> 51</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP Lease Time (uint32 seconds). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga27" doxytag="dhcp::DHCP_OPT_DHCPMSGTYPE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga27">DHCP_OPT_DHCPMSGTYPE</a> 53</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP message type (1 byte). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga28" doxytag="dhcp::DHCP_OPT_SERVERID"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga28">DHCP_OPT_SERVERID</a> 54</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Server Identifier (IP address). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga29" doxytag="dhcp::DHCP_OPT_PARAMREQLIST"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga29">DHCP_OPT_PARAMREQLIST</a> 55</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Paramerter Request List (n OPT codes). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga30" doxytag="dhcp::DHCP_OPT_RENEWALTIME"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga30">DHCP_OPT_RENEWALTIME</a> 58</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP Lease Renewal Time (uint32 seconds). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga31" doxytag="dhcp::DHCP_OPT_REBINDTIME"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga31">DHCP_OPT_REBINDTIME</a> 59</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP Lease Rebinding Time (uint32 seconds). <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga32" doxytag="dhcp::DHCP_OPT_END"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga32">DHCP_OPT_END</a> 255</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">token end value (marks end of options list) <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga33" doxytag="dhcp::DHCP_MSG_DHCPDISCOVER"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga33">DHCP_MSG_DHCPDISCOVER</a> 1</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DISCOVER is broadcast by client to solicit OFFER from any/all DHCP servers. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga34" doxytag="dhcp::DHCP_MSG_DHCPOFFER"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga34">DHCP_MSG_DHCPOFFER</a> 2</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">OFFER(s) are made to client by server to offer IP address and config info. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga35" doxytag="dhcp::DHCP_MSG_DHCPREQUEST"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga35">DHCP_MSG_DHCPREQUEST</a> 3</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">REQUEST is made my client in response to best/favorite OFFER message. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga36" doxytag="dhcp::DHCP_MSG_DHCPDECLINE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga36">DHCP_MSG_DHCPDECLINE</a> 4</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DECLINE may be sent by client to server to indicate IP already in use. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga37" doxytag="dhcp::DHCP_MSG_DHCPACK"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga37">DHCP_MSG_DHCPACK</a> 5</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">ACK is sent to client by server in confirmation of REQUEST, contains config and IP. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga38" doxytag="dhcp::DHCP_MSG_DHCPNAK"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga38">DHCP_MSG_DHCPNAK</a> 6</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">NAK is sent to client by server to indicate problem with REQUEST. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga39" doxytag="dhcp::DHCP_MSG_DHCPRELEASE"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga39">DHCP_MSG_DHCPRELEASE</a> 7</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">RELEASE is sent by client to server to relinquish DHCP lease on IP address, etc. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga40" doxytag="dhcp::DHCP_MSG_DHCPINFORM"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga40">DHCP_MSG_DHCPINFORM</a> 8</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">INFORM is sent by client to server to request config info, IP address configured locally. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga41" doxytag="dhcp::GNUC_PACKED"></a>
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga41">GNUC_PACKED</a> __attribute__((packed))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">DHCP Header. <br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga1">dhcpInit</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga2">dhcpIn</a> (unsigned int len, struct <a class="el" href="structnetDhcpHeader.html">netDhcpHeader</a> *packet)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga3">dhcpRequest</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga4">dhcpRelease</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga5">dhcpTimer</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga6">dhcpGetOption</a> (uint8_t *options, uint8_t optcode, uint8_t optlen, void *optvalptr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga7">dhcpSetOption</a> (uint8_t *options, uint8_t optcode, uint8_t optlen, void *optvalptr)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga8">dhcpPrintHeader</a> (struct <a class="el" href="structnetDhcpHeader.html">netDhcpHeader</a> *packet)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga0" doxytag="dhcp::GNUC_PACKED"></a>
<a class="el" href="structnetBootpHeader.html">netBootpHeader</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dhcp.html#ga0">GNUC_PACKED</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Bootp Header (DHCP is transported by BOOTP/UDP/IP). <br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga6" doxytag="dhcp.h::dhcpGetOption"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">uint8_t dhcpGetOption </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">uint8_t * </td>
<td class="mdname" nowrap> <em>options</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>uint8_t </td>
<td class="mdname" nowrap> <em>optcode</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>uint8_t </td>
<td class="mdname" nowrap> <em>optlen</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>optvalptr</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Get a DHCP option from the option list. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>options</em> </td><td>is a pointer to the options field of a DHCP packet. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optcode</em> </td><td>is the desired option number to retrieve. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optlen</em> </td><td>is the maximum data length that should be retrieved (less data will be retrieved if option is shorter). </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optvalptr</em> </td><td>is a pointer to where the option value will be stored. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>actual length of the option data, as stored in the options list. </dd></dl>
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00212">212</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="dhcp.h::dhcpIn"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpIn </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">unsigned int </td>
<td class="mdname" nowrap> <em>len</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>struct <a class="el" href="structnetDhcpHeader.html">netDhcpHeader</a> * </td>
<td class="mdname" nowrap> <em>packet</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Processes incoming DHCP packets from UDP port 68. This function is to be called by the stack when a DHCP packet arrives over the network. The DHCP packet will be parsed, handled, and a response will be generated and sent if needed. When the DHCP process completes, the IP addressing will be automatically updated.
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00042">42</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="dhcp.h::dhcpInit"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpInit </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Initialize DHCP system. Prepares DHCP for use and initializes lease time to zero.
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00030">30</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="dhcp.h::dhcpPrintHeader"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpPrintHeader </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">struct <a class="el" href="structnetDhcpHeader.html">netDhcpHeader</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>packet</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Print diagnotic information about BOOTP/DHCP packet. </td>
</tr>
</table>
<a class="anchor" name="ga4" doxytag="dhcp.h::dhcpRelease"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpRelease </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Release DHCP lease and assigned network parameters. This function releases the DHCP assigned address and allows the DHCP server to reallocate it.
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00158">158</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="dhcp.h::dhcpRequest"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpRequest </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Request DHCP assigned network parameters. This function begins the DHCP process. The remainder of operations are handled in <a class="el" href="group__dhcp.html#ga2">dhcpIn()</a>.
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00123">123</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="dhcp.h::dhcpSetOption"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">uint8_t* dhcpSetOption </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">uint8_t * </td>
<td class="mdname" nowrap> <em>options</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>uint8_t </td>
<td class="mdname" nowrap> <em>optcode</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>uint8_t </td>
<td class="mdname" nowrap> <em>optlen</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>optvalptr</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Set a DHCP option in the option list. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>options</em> </td><td>is a pointer to the options field of a DHCP packet. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optcode</em> </td><td>is the option number to write. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optlen</em> </td><td>is the data length of the option value. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>optvalptr</em> </td><td>is a pointer to the option data to be read. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>pointer to write location of the next option. </dd></dl>
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00253">253</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<a class="anchor" name="ga5" doxytag="dhcp.h::dhcpTimer"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void dhcpTimer </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Periodic DHCP maintenance. This function is to be called once per second and will expire the DHCP lease.
<p>
Definition at line <a class="el" href="dhcp_8c-source.html#l00203">203</a> of file <a class="el" href="dhcp_8c-source.html">dhcp.c</a>. </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:09 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>
|