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

📄 arp_8c.html

📁 Freescale mcu OpenTCP-1.0.4.doc.html.zip 文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>&gt;=0 - pointer to allocated ARP entry (actaully index in the  ARP cache table)</dl>Allocate arp entry for given type. Chooses the unused entry if  one exists. Otherwice deletes entries in round-robin fashion. <p>Definition at line <a class="el" href="arp_8c-source.html#l00466">466</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="arp_8h-source.html#l00185">ARP_FREE</a>, <a class="el" href="arp_8h-source.html#l00186">ARP_RESERVED</a>, <a class="el" href="arp_8h-source.html#l00196">ARP_TEMP_IP</a>, <a class="el" href="arp_8h-source.html#l00157">arp_entry::state</a>, and <a class="el" href="arp_8h-source.html#l00167">arp_entry::type</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, and <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>.    </td>  </tr></table><a name="a7" doxytag="arp.c::arp_add"></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"> INT8 arp_add </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">UINT32&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>pra</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT8 *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>hwadr</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT8&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>type</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><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>Date: </b></dt><dd>10.07.2002 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pra</em>&nbsp;</td><td>- protocol address (assumed IPv4) </td></tr><tr><td valign=top><em>hwadr</em>&nbsp;</td><td>- pointer to Ethernet MAC address (6 bytes) </td></tr><tr><td valign=top><em>type</em>&nbsp;</td><td>- type of address allocated if not found. Can be one of the following: <ul><li> <a class="el" href="arp_8h.html#a16">ARP_FIXED_IP</a> <li> <a class="el" href="arp_8h.html#a17">ARP_TEMP_IP</a> </ul></td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> 0 - Address already in cache. Refreshed. <li> 1 - New entry in ARP cache created</ul></dl>New IP address is added to ARP cache based on the information supplied to function as parameters. <p>Definition at line <a class="el" href="arp_8c-source.html#l00552">552</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="arp_8c-source.html#l00466">arp_alloc()</a>, <a class="el" href="arp_8h-source.html#l00195">ARP_FIXED_IP</a>, <a class="el" href="arp_8h-source.html#l00185">ARP_FREE</a>, <a class="el" href="arp_8h-source.html#l00126">ARP_MAXRETRY</a>, <a class="el" href="arp_8h-source.html#l00188">ARP_RESOLVED</a>, <a class="el" href="arp_8h-source.html#l00102">ARP_TIMEOUT</a>, <a class="el" href="system_8h-source.html#l00079">FALSE</a>, <a class="el" href="arp_8h-source.html#l00175">arp_entry::hwadr</a>, <a class="el" href="arp_8c-source.html#l00960">is_subnet()</a>, <a class="el" href="arp_8h-source.html#l00074">MAXHWALEN</a>, <a class="el" href="arp_8h-source.html#l00179">arp_entry::pradr</a>, <a class="el" href="arp_8h-source.html#l00168">arp_entry::retries</a>, <a class="el" href="arp_8h-source.html#l00157">arp_entry::state</a>, and <a class="el" href="arp_8h-source.html#l00172">arp_entry::ttl</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00188">arp_send_response()</a>, and <a class="el" href="ip_8c-source.html#l00115">process_ip_in()</a>.    </td>  </tr></table><a name="a8" doxytag="arp.c::arp_find"></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"> struct <a class="el" href="structarp__entry.html">arp_entry</a>* arp_find </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">LWORD&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>pra</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>struct <a class="el" href="structnetif.html">netif</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>machine</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>UINT8&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>type</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><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>Date: </b></dt><dd>01.11.2001 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pra</em>&nbsp;</td><td>- Protocol address (IPv4) </td></tr><tr><td valign=top><em>machine</em>&nbsp;</td><td>- Pointer to configuration of network interface used </td></tr><tr><td valign=top><em>type</em>&nbsp;</td><td>- Type of address allocated if not found. Can be one of the following: <ul><li> <a class="el" href="arp_8h.html#a16">ARP_FIXED_IP</a> <li> <a class="el" href="arp_8h.html#a17">ARP_TEMP_IP</a> </ul></td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> 0 - ARP entry not found or not ready yet (waiting for ARP response) <li> struct <a class="el" href="structarp__entry.html">arp_entry</a>* - pointer to solved entry of ARP cache table</ul></dl>This function tries to resolve IPv4 address by checking the ARP cache table and sending ARP requested if needed. <p>Definition at line <a class="el" href="arp_8c-source.html#l00639">639</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="arp_8c-source.html#l00466">arp_alloc()</a>, <a class="el" href="arp_8h-source.html#l00195">ARP_FIXED_IP</a>, <a class="el" href="arp_8h-source.html#l00185">ARP_FREE</a>, <a class="el" href="arp_8h-source.html#l00126">ARP_MAXRETRY</a>, <a class="el" href="arp_8h-source.html#l00187">ARP_PENDING</a>, <a class="el" href="arp_8h-source.html#l00117">ARP_RESEND</a>, <a class="el" href="arp_8h-source.html#l00188">ARP_RESOLVED</a>, <a class="el" href="arp_8c-source.html#l00390">arp_send_req()</a>, <a class="el" href="arp_8h-source.html#l00175">arp_entry::hwadr</a>, <a class="el" href="arp_8c-source.html#l00960">is_subnet()</a>, <a class="el" href="arp_8h-source.html#l00179">arp_entry::pradr</a>, <a class="el" href="arp_8h-source.html#l00168">arp_entry::retries</a>, <a class="el" href="arp_8h-source.html#l00157">arp_entry::state</a>, and <a class="el" href="arp_8h-source.html#l00172">arp_entry::ttl</a>.<p>Referenced by <a class="el" href="ip_8c-source.html#l00300">process_ip_out()</a>.    </td>  </tr></table><a name="a11" doxytag="arp.c::is_subnet"></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"> BYTE is_subnet </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">LWORD&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>ipadr</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>struct <a class="el" href="structnetif.html">netif</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>machine</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p><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>Date: </b></dt><dd>05.11.2001 </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ipadr</em>&nbsp;</td><td>- IP address under check </td></tr><tr><td valign=top><em>machine</em>&nbsp;</td><td>- pointer to configuration of network parameters used </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd> <ul><li> <a class="el" href="system_8h.html#a1">TRUE</a> - ipadr belongs to subnet of given machine <li> <a class="el" href="system_8h.html#a2">FALSE</a> - ipadr is NOT a part of subnet of given machine</ul></dl>Based on information supplied in ipadr and machine parameters this function performs basic check if IP address is on the same subnet as the one defined for the machine. <p>Definition at line <a class="el" href="arp_8c-source.html#l00960">960</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="system_8h-source.html#l00119">netif::localip</a>, and <a class="el" href="system_8h-source.html#l00145">netif::netmask</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, and <a class="el" href="arp_8c-source.html#l00639">arp_find()</a>.    </td>  </tr></table><hr><h2>Variable Documentation</h2><a name="a0" doxytag="arp.c::arp_table"></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"> struct <a class="el" href="structarp__entry.html">arp_entry</a> arp_table[ARP_TSIZE]      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>ARP cache table is an array of <a class="el" href="structarp__entry.html">arp_entry</a> structures holding all of the necessary information about the state, timeouts and hardware/IP addresses of individual entries. By modifying the <a class="el" href="group__opentcp__config.html#a0">ARP_TSIZE</a>, cache size can be changed and thus RAM memory occupied by the ARP cache significantly reduced or increased. See <a class="el" href="structarp__entry.html">arp_entry</a> definition for more information about struct fields. <p>Definition at line <a class="el" href="arp_8c-source.html#l00086">86</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.    </td>  </tr></table><a name="a1" doxytag="arp.c::arp_timer"></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"> UINT8 arp_timer      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>ARP module uses this timer handle to detect that a certain period of time has expired (defined by the value of ARP_MANG_TOUT) and that cache entries should be examined to see what to do with them. <p>Definition at line <a class="el" href="arp_8c-source.html#l00094">94</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>Referenced by <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><hr><address style="align: right;"><small>Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

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