📄 arp_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>arp.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><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="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> <a class="qindex" href="examples.html">Examples</a> </center><hr><h1>/opentcp/include/inet/arp.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2> <dl compact><dt><b>Author: </b></dt><dd> <ul><li> Jari Lahti (<a href="mailto:jari.lahti@violasystems.com">jari.lahti@violasystems.com</a>) </ul></dl><dl compact><dt><b>Version: </b></dt><dd>1.0 </dl><dl compact><dt><b>Date: </b></dt><dd>10.7.2002</dl>OpenTCP ARP protocol function declarations, constants, etc.<p><p>Definition in file <a class="el" href="arp_8h-source.html">arp.h</a>.<p><a href="arp_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Data Structures</h2></td></tr><tr><td nowrap align=right valign=top>struct </td><td valign=bottom><a class="el" href="structarp__entry.html">arp_entry</a></td></tr><tr><td> </td><td><font size=-1><em>ARP packet header fields.</em> <a href="structarp__entry.html#_details">More...</a><em></em></font><br><br></td></tr><tr><td colspan=2><br><h2>Defines</h2></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a0">MAXHWALEN</a> 6</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a1">MAXPRALEN</a> 4</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__opentcp__config.html#a0">ARP_TSIZE</a> 10</td></tr><tr><td> </td><td><font size=-1><em>ARP cache size (number of entries).</em> <a href="group__opentcp__config.html#a0"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__opentcp__config.html#a1">ARP_TIMEOUT</a> 60</td></tr><tr><td> </td><td><font size=-1><em>ARP cache entry refresh period (in seconds).</em> <a href="group__opentcp__config.html#a1"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__opentcp__config.html#a2">ARP_RESEND</a> 2</td></tr><tr><td> </td><td><font size=-1><em>ARP Request resend period (in seconds).</em> <a href="group__opentcp__config.html#a2"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__opentcp__config.html#a3">ARP_MAXRETRY</a> 5</td></tr><tr><td> </td><td><font size=-1><em>Number of IP address resolving retires.</em> <a href="group__opentcp__config.html#a3"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a11">ARP_FREE</a> 0</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a12">ARP_RESERVED</a> 1</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a13">ARP_PENDING</a> 2</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a14">ARP_RESOLVED</a> 3</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a15">ARP_REFRESHING</a> 4</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a16">ARP_FIXED_IP</a> 0</td></tr><tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="arp_8h.html#a17">ARP_TEMP_IP</a> 1</td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="arp_8h.html#a18">arp_init</a> (void)</td></tr><tr><td> </td><td><font size=-1><em>Initialize data structures for ARP processing.</em> <a href="#a18"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>INT8 </td><td valign=bottom><a class="el" href="arp_8h.html#a20">arp_alloc</a> (UINT8)</td></tr><tr><td> </td><td><font size=-1><em>Allocate ARP entry in ARP cache table.</em> <a href="#a20"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="arp_8h.html#a21">arp_send_req</a> (UINT8)</td></tr><tr><td> </td><td><font size=-1><em>Send ARP request based on information in an ARP cache table.</em> <a href="#a21"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a class="el" href="structarp__entry.html">arp_entry</a> * </td><td valign=bottom><a class="el" href="arp_8h.html#a22">arp_find</a> (LWORD, struct <a class="el" href="structnetif.html">netif</a> *, UINT8)</td></tr><tr><td> </td><td><font size=-1><em>Find an ARP entry given a protocol address.</em> <a href="#a22"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="arp_8h.html#a23">arp_manage</a> (void)</td></tr><tr><td> </td><td><font size=-1><em>Manage ARP cache periodically.</em> <a href="#a23"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>BYTE </td><td valign=bottom><a class="el" href="arp_8h.html#a24">is_subnet</a> (LWORD, struct <a class="el" href="structnetif.html">netif</a> *)</td></tr><tr><td> </td><td><font size=-1><em>Checks if a given IP address belongs to the subnet of a given machine.</em> <a href="#a24"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>BYTE </td><td valign=bottom><a class="el" href="arp_8h.html#a25">process_arp</a> (struct <a class="el" href="structethernet__frame.html">ethernet_frame</a> *)</td></tr><tr><td> </td><td><font size=-1><em>Process and analyze the received ARP packet.</em> <a href="#a25"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="arp_8h.html#a26">arp_send_response</a> (void)</td></tr><tr><td> </td><td><font size=-1><em>Send response to an ARP request.</em> <a href="#a26"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="arp_8h.html#a27">arp_get_response</a> (void)</td></tr><tr><td> </td><td><font size=-1><em>Extract data from the received ARP packet.</em> <a href="#a27"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>INT8 </td><td valign=bottom><a class="el" href="arp_8h.html#a29">arp_add</a> (UINT32, UINT8 *, UINT8)</td></tr><tr><td> </td><td><font size=-1><em>Add given IP address and MAC address to ARP cache.</em> <a href="#a29"></a><em></em></font><br><br></td></tr></table><hr><h2>Define Documentation</h2><a name="a0" doxytag="arp.h::MAXHWALEN"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define MAXHWALEN 6 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Maximum HW address Length (6=Eth) <p>Definition at line <a class="el" href="arp_8h-source.html#l00074">74</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>, <a class="el" href="arp_8c-source.html#l00910">arp_init()</a>, <a class="el" href="arp_8c-source.html#l00390">arp_send_req()</a>, <a class="el" href="arp_8c-source.html#l00188">arp_send_response()</a>, <a class="el" href="arp_8c-source.html#l00116">process_arp()</a>, and <a class="el" href="ip_8c-source.html#l00300">process_ip_out()</a>. </td> </tr></table><a name="a1" doxytag="arp.h::MAXPRALEN"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define MAXPRALEN 4 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Maximum Protocol adr.len (4=IPv4) <p>Definition at line <a class="el" href="arp_8h-source.html#l00075">75</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>, <a class="el" href="arp_8c-source.html#l00390">arp_send_req()</a>, <a class="el" href="arp_8c-source.html#l00188">arp_send_response()</a>, and <a class="el" href="arp_8c-source.html#l00116">process_arp()</a>. </td> </tr></table><a name="a11" doxytag="arp.h::ARP_FREE"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_FREE 0 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Entry is Unused (initial value) <p>Definition at line <a class="el" href="arp_8h-source.html#l00185">185</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, <a class="el" href="arp_8c-source.html#l00466">arp_alloc()</a>, <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>, <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>, <a class="el" href="arp_8c-source.html#l00910">arp_init()</a>, and <a class="el" href="arp_8c-source.html#l00785">arp_manage()</a>. </td> </tr></table><a name="a12" doxytag="arp.h::ARP_RESERVED"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_RESERVED 1 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Entry is reserved (allocated) <p>Definition at line <a class="el" href="arp_8h-source.html#l00186">186</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00466">arp_alloc()</a>, and <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>. </td> </tr></table><a name="a13" doxytag="arp.h::ARP_PENDING"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_PENDING 2 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Entry is used but incomplete <p>Definition at line <a class="el" href="arp_8h-source.html#l00187">187</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>, and <a class="el" href="arp_8c-source.html#l00785">arp_manage()</a>. </td> </tr></table><a name="a14" doxytag="arp.h::ARP_RESOLVED"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_RESOLVED 3 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Entry has been resolved <p>Definition at line <a class="el" href="arp_8h-source.html#l00188">188</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>, <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>, <a class="el" href="arp_8c-source.html#l00910">arp_init()</a>, and <a class="el" href="arp_8c-source.html#l00785">arp_manage()</a>. </td> </tr></table><a name="a15" doxytag="arp.h::ARP_REFRESHING"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_REFRESHING 4 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Entry is being refreshed <p>Definition at line <a class="el" href="arp_8h-source.html#l00189">189</a> of file <a class="el" href="arp_8h-source.html">arp.h</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00785">arp_manage()</a>. </td> </tr></table><a name="a16" doxytag="arp.h::ARP_FIXED_IP"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define ARP_FIXED_IP 0 </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>For Fixed addresses like GW. Entry is refreshed after ttl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -