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

📄 arp_8h.html

📁 Freescale mcu OpenTCP-1.0.4.doc.html.zip 文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p>References <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#l00187">ARP_PENDING</a>, <a class="el" href="arp_8h-source.html#l00189">ARP_REFRESHING</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#l00196">ARP_TEMP_IP</a>, <a class="el" href="arp_8h-source.html#l00102">ARP_TIMEOUT</a>, <a class="el" href="arp_8c-source.html#l00094">arp_timer</a>, <a class="el" href="timers_8c-source.html#l00233">check_timer()</a>, <a class="el" href="timers_8c-source.html#l00194">init_timer()</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>, <a class="el" href="timers_8h-source.html#l00086">TIMERTIC</a>, <a class="el" href="arp_8h-source.html#l00172">arp_entry::ttl</a>, and <a class="el" href="arp_8h-source.html#l00167">arp_entry::type</a>.    </td>  </tr></table><a name="a24" doxytag="arp.h::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><a name="a25" doxytag="arp.h::process_arp"></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 process_arp </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">struct <a class="el" href="structethernet__frame.html">ethernet_frame</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>frame</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></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>frame</em>&nbsp;</td><td>Pointer to <a class="el" href="structethernet__frame.html">ethernet_frame</a> structure containing information about the received frame </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>Return <a class="el" href="system_8h.html#a1">TRUE</a> if Ethernet frame processed held ARP packet, otherwise <a class="el" href="system_8h.html#a2">FALSE</a>.</dl>Invoke process_arp function whenever ARP packet is received  (see <a class="el" href="main__demo_8c.html">main_demo.c</a> for an example loop). This function will process the received packet, analyze it'c content briefly and perform on of the two possible actions: <ul><li> If the received packet is ARP request it will invoke arp_send_reply in order to send ARP reply back <li> If the received packet is ARP response it will iterate through the cache table and try to find ARP entry that is beeing resolved or refreshed </ul><p>Definition at line <a class="el" href="arp_8c-source.html#l00116">116</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="arp_8c-source.html#l00307">arp_get_response()</a>, <a class="el" href="arp_8c-source.html#l00188">arp_send_response()</a>, <a class="el" href="ethernet_8h-source.html#l00161">ethernet_frame::buf_index</a>, <a class="el" href="ethernet_8h-source.html#l00152">ethernet_frame::frame_size</a>, <a class="el" href="arp_8h-source.html#l00074">MAXHWALEN</a>, <a class="el" href="arp_8h-source.html#l00075">MAXPRALEN</a>, <a class="el" href="system_8h-source.html#l00270">NETWORK_RECEIVE_INITIALIZE</a>, <a class="el" href="ethernet_8h-source.html#l00155">ethernet_frame::protocol</a>, and <a class="el" href="system_8h-source.html#l00210">RECEIVE_NETWORK_B</a>.    </td>  </tr></table><a name="a26" doxytag="arp.h::arp_send_response"></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"> void arp_send_response </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></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>Warning: </b></dt><dd> <ul><li> This function starts reading data from Ethernet controller without initializing it for reading it first, so NIC must already be initialized for reading from correct address (it expects ar$sha field from ARP packet immediately)</ul></dl>This function is invoked from <a class="el" href="arp_8h.html#a25">process_arp()</a> function in order to send a reply to an ARP request. First, incoming packet is checked to see if it is intended for us or not. If not, function does not do anything. Otherwise, ARP reply packet is formed and sent. <p>Definition at line <a class="el" href="arp_8c-source.html#l00188">188</a> of file <a class="el" href="arp_8c-source.html">arp.c</a>.<p>References <a class="el" href="arp_8c-source.html#l00552">arp_add()</a>, <a class="el" href="ethernet_8h-source.html#l00125">ARP_BUFFER</a>, <a class="el" href="arp_8h-source.html#l00196">ARP_TEMP_IP</a>, <a class="el" href="arp_8h-source.html#l00074">MAXHWALEN</a>, <a class="el" href="arp_8h-source.html#l00075">MAXPRALEN</a>, <a class="el" href="system_8h-source.html#l00306">NETWORK_ADD_DATALINK</a>, <a class="el" href="system_8h-source.html#l00288">NETWORK_COMPLETE_SEND</a>, <a class="el" href="system_8h-source.html#l00296">NETWORK_SEND_INITIALIZE</a>, <a class="el" href="ethernet_8h-source.html#l00081">PROTOCOL_ARP</a>, <a class="el" href="system_8h-source.html#l00210">RECEIVE_NETWORK_B</a>, and <a class="el" href="system_8h-source.html#l00240">SEND_NETWORK_B</a>.<p>Referenced by <a class="el" href="arp_8c-source.html#l00116">process_arp()</a>.    </td>  </tr></table><a name="a27" doxytag="arp.h::arp_get_response"></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"> void arp_get_response </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></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>Warning: </b></dt><dd> <ul><li> This function starts reading data from Ethernet controller without initializing it for reading it first, so NIC must already be initialized for reading from correct address (it expects ar$sha field from ARP packet immediately)</ul></dl>This function is invoked from <a class="el" href="arp_8h.html#a25">process_arp()</a> function when ARP reply packet is detected. Basic checking is performed to see if the packet is intended for us, and if it is, ARP cache table is checked and  corresponding entry is refreshed (resolved). <p>Definition at line <a class="el" href="arp_8c-source.html#l00307">307</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#l00126">ARP_MAXRETRY</a>, <a class="el" href="arp_8h-source.html#l00186">ARP_RESERVED</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="arp_8h-source.html#l00175">arp_entry::hwadr</a>, <a class="el" href="arp_8h-source.html#l00074">MAXHWALEN</a>, <a class="el" href="arp_8h-source.html#l00075">MAXPRALEN</a>, <a class="el" href="arp_8h-source.html#l00179">arp_entry::pradr</a>, <a class="el" href="system_8h-source.html#l00210">RECEIVE_NETWORK_B</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#l00116">process_arp()</a>.    </td>  </tr></table><a name="a29" doxytag="arp.h::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><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 + -