Newer
Older
UbixOS / doc / xml / arp_8c.xml
<?xml version='1.0' encoding='iso-8859-1' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.4.7">
  <compounddef id="arp_8c" kind="file">
    <compoundname>arp.c</compoundname>
    <includes refid="types_8h" local="no">ubixos/types.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="debug_8h" local="yes">net/debug.h</includes>
    <includes refid="ipv4_2inet_8h" local="yes">net/ipv4/inet.h</includes>
    <includes refid="arp_8h" local="yes">netif/arp.h</includes>
    <includes refid="ipv4_2ip_8h" local="yes">net/ipv4/ip.h</includes>
    <incdepgraph>
      <node id="4135">
        <label>net/ipv4/ip.h</label>
        <link refid="ipv4_2ip_8h"/>
        <childnode refid="4125" relation="include">
        </childnode>
        <childnode refid="4136" relation="include">
        </childnode>
        <childnode refid="4130" relation="include">
        </childnode>
        <childnode refid="4131" relation="include">
        </childnode>
        <childnode refid="4133" relation="include">
        </childnode>
        <childnode refid="4134" relation="include">
        </childnode>
      </node>
      <node id="4137">
        <label>arch/lib.h</label>
        <link refid="lib_8h"/>
      </node>
      <node id="4133">
        <label>net/netif.h</label>
        <link refid="netif_8h"/>
        <childnode refid="4128" relation="include">
        </childnode>
        <childnode refid="4134" relation="include">
        </childnode>
        <childnode refid="4131" relation="include">
        </childnode>
        <childnode refid="4124" relation="include">
        </childnode>
        <childnode refid="4130" relation="include">
        </childnode>
      </node>
      <node id="4126">
        <label>arch/cpu.h</label>
        <link refid="cpu_8h"/>
      </node>
      <node id="4132">
        <label>netif/arp.h</label>
        <link refid="arp_8h"/>
        <childnode refid="4130" relation="include">
        </childnode>
        <childnode refid="4131" relation="include">
        </childnode>
        <childnode refid="4133" relation="include">
        </childnode>
      </node>
      <node id="4120">
        <label>ubixos/types.h</label>
        <link refid="types_8h"/>
        <childnode refid="4121" relation="include">
        </childnode>
      </node>
      <node id="4121">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="4125">
        <label>net/arch.h</label>
        <link refid="arch_8h"/>
        <childnode refid="4126" relation="include">
        </childnode>
        <childnode refid="4127" relation="include">
        </childnode>
      </node>
      <node id="4119">
        <label>src/sys/net/netif/arp.c</label>
        <link refid="arp.c"/>
        <childnode refid="4120" relation="include">
        </childnode>
        <childnode refid="4122" relation="include">
        </childnode>
        <childnode refid="4123" relation="include">
        </childnode>
        <childnode refid="4124" relation="include">
        </childnode>
        <childnode refid="4132" relation="include">
        </childnode>
        <childnode refid="4135" relation="include">
        </childnode>
      </node>
      <node id="4129">
        <label>net/lwipopts.h</label>
        <link refid="lwipopts_8h"/>
      </node>
      <node id="4136">
        <label>net/def.h</label>
        <link refid="def_8h"/>
        <childnode refid="4137" relation="include">
        </childnode>
      </node>
      <node id="4122">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="4120" relation="include">
        </childnode>
      </node>
      <node id="4131">
        <label>net/ipv4/ip_addr.h</label>
        <link refid="ipv4_2ip__addr_8h"/>
        <childnode refid="4125" relation="include">
        </childnode>
      </node>
      <node id="4134">
        <label>net/err.h</label>
        <link refid="err_8h"/>
        <childnode refid="4120" relation="include">
        </childnode>
        <childnode refid="4123" relation="include">
        </childnode>
        <childnode refid="4127" relation="include">
        </childnode>
      </node>
      <node id="4128">
        <label>net/opt.h</label>
        <link refid="opt_8h"/>
        <childnode refid="4129" relation="include">
        </childnode>
      </node>
      <node id="4130">
        <label>net/pbuf.h</label>
        <link refid="pbuf_8h"/>
        <childnode refid="4123" relation="include">
        </childnode>
        <childnode refid="4125" relation="include">
        </childnode>
      </node>
      <node id="4123">
        <label>net/debug.h</label>
        <link refid="debug_8h"/>
      </node>
      <node id="4124">
        <label>net/ipv4/inet.h</label>
        <link refid="ipv4_2inet_8h"/>
        <childnode refid="4125" relation="include">
        </childnode>
        <childnode refid="4128" relation="include">
        </childnode>
        <childnode refid="4130" relation="include">
        </childnode>
        <childnode refid="4131" relation="include">
        </childnode>
      </node>
      <node id="4127">
        <label>arch/cc.h</label>
        <link refid="cc_8h"/>
      </node>
    </incdepgraph>
    <innerclass refid="structarp__entry" prot="public">arp_entry</innerclass>
    <innerclass refid="structarp__hdr" prot="public">arp_hdr</innerclass>
    <innerclass refid="structethip__hdr" prot="public">ethip_hdr</innerclass>
      <sectiondef kind="define">
      <memberdef kind="define" id="arp_8c_1741a0710dc126ed3ae9e305472df3432" prot="public" static="no">
        <name>ARP_MAXAGE</name>
        <initializer>2</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="46" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="46" bodyend="-1"/>
        <referencedby refid="arp_8c_12cc298ed4c68289160da1376faf20938" compoundref="arp_8c" startline="104" endline="117">arp_tmr</referencedby>
      </memberdef>
      <memberdef kind="define" id="arp_8c_106ba7b414e718081998f2814090debf1" prot="public" static="no">
        <name>ARP_REPLY</name>
        <initializer>2</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="51" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="51" bodyend="-1"/>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
      </memberdef>
      <memberdef kind="define" id="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" prot="public" static="no">
        <name>ARP_REQUEST</name>
        <initializer>1</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="50" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="50" bodyend="-1"/>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
        <referencedby refid="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" compoundref="arp_8c" startline="266" endline="302">arp_query</referencedby>
      </memberdef>
      <memberdef kind="define" id="arp_8c_106faf2eae13476a702524b13ea6ecd7f" prot="public" static="no">
        <name>ARPH_HWLEN</name>
        <param><defname>hdr</defname></param>
        <initializer>(NTOHS((hdr)-&gt;_hwlen_protolen) &gt;&gt; 8)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="68" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="68" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" prot="public" static="no">
        <name>ARPH_HWLEN_SET</name>
        <param><defname>hdr</defname></param>
        <param><defname>len</defname></param>
        <initializer>(hdr)-&gt;_hwlen_protolen = HTONS(ARPH_PROTOLEN(hdr) | ((len) &lt;&lt; 8))</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="72" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="72" bodyend="-1"/>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
        <referencedby refid="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" compoundref="arp_8c" startline="266" endline="302">arp_query</referencedby>
      </memberdef>
      <memberdef kind="define" id="arp_8c_18c416438814934662a28d7e3c891a175" prot="public" static="no">
        <name>ARPH_PROTOLEN</name>
        <param><defname>hdr</defname></param>
        <initializer>(NTOHS((hdr)-&gt;_hwlen_protolen) &amp; 0xff)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="69" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="69" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="arp_8c_1edb2ded9225b09da0358754f859d72d6" prot="public" static="no">
        <name>ARPH_PROTOLEN_SET</name>
        <param><defname>hdr</defname></param>
        <param><defname>len</defname></param>
        <initializer>(hdr)-&gt;_hwlen_protolen = HTONS((len) | (ARPH_HWLEN(hdr) &lt;&lt; 8))</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="73" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="73" bodyend="-1"/>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
        <referencedby refid="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" compoundref="arp_8c" startline="266" endline="302">arp_query</referencedby>
      </memberdef>
      <memberdef kind="define" id="arp_8c_128a28d3e575df3e75985e2313cc2d51a" prot="public" static="no">
        <name>HWTYPE_ETHERNET</name>
        <initializer>1</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="48" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="48" bodyend="-1"/>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
        <referencedby refid="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" compoundref="arp_8c" startline="266" endline="302">arp_query</referencedby>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>static void add_arp_entry</definition>
        <argsstring>(struct ip_addr *ipaddr, struct eth_addr *ethaddr)</argsstring>
        <name>add_arp_entry</name>
        <param>
          <type>struct <ref refid="structip__addr" kindref="compound">ip_addr</ref> *</type>
          <declname>ipaddr</declname>
        </param>
        <param>
          <type>struct <ref refid="structeth__addr" kindref="compound">eth_addr</ref> *</type>
          <declname>ethaddr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="121" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="120" bodyend="178"/>
        <references refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" compoundref="arp_8c" startline="88">arp_table</references>
        <references refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" compoundref="lwipopts_8h" startline="128">ARP_TABLE_SIZE</references>
        <references refid="arp_8c_19b78800fdadcc20482aacd10da639621" compoundref="arp_8c" startline="89">ctime</references>
        <references refid="structarp__entry_149945e8299d4bf7241c0fd2b5e4d84df" compoundref="arp_8c" startline="85">arp_entry::ctime</references>
        <references refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" compoundref="arp_8c" startline="84">arp_entry::ethaddr</references>
        <references refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" compoundref="ipv4_2ip__addr_8h" startline="62">ip_addr_cmp</references>
        <references refid="ipv4_2ip__addr_8h_10d51c2bb5f2af51392540af1c5df511a" compoundref="ipv4_2ip__addr_8h" startline="64">ip_addr_isany</references>
        <references refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" compoundref="ipv4_2ip__addr_8h" startline="55">ip_addr_set</references>
        <references refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" compoundref="arp_8c" startline="83">arp_entry::ipaddr</references>
        <referencedby refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" compoundref="arp_8c" startline="197" endline="250">arp_arp_input</referencedby>
        <referencedby refid="arp_8c_1916d08dbb8f4a38e1e904a8a018b000c" compoundref="arp_8c" startline="181" endline="194">arp_ip_input</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
        <definition>struct pbuf* arp_arp_input</definition>
        <argsstring>(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p)</argsstring>
        <name>arp_arp_input</name>
        <param>
          <type>struct <ref refid="structnetif" kindref="compound">netif</ref> *</type>
          <declname>netif</declname>
        </param>
        <param>
          <type>struct <ref refid="structeth__addr" kindref="compound">eth_addr</ref> *</type>
          <declname>ethaddr</declname>
        </param>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="198" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="197" bodyend="250"/>
        <references refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" compoundref="arp_8c" startline="120" endline="178">add_arp_entry</references>
        <references refid="arp_8c_106ba7b414e718081998f2814090debf1" compoundref="arp_8c" startline="51">ARP_REPLY</references>
        <references refid="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" compoundref="arp_8c" startline="50">ARP_REQUEST</references>
        <references refid="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" compoundref="arp_8c" startline="72">ARPH_HWLEN_SET</references>
        <references refid="arp_8c_1edb2ded9225b09da0358754f859d72d6" compoundref="arp_8c" startline="73">ARPH_PROTOLEN_SET</references>
        <references refid="arp_8h_1dbc208bed02b2900ca2639a25d3f6198" compoundref="arp_8h" startline="60">ETHTYPE_ARP</references>
        <references refid="arp_8h_1392234c1299a5f5c264e511d88a66e56" compoundref="arp_8h" startline="61">ETHTYPE_IP</references>
        <references refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" compoundref="ipv4_2inet_8h" startline="66">htons</references>
        <references refid="arp_8c_128a28d3e575df3e75985e2313cc2d51a" compoundref="arp_8c" startline="48">HWTYPE_ETHERNET</references>
        <references refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" compoundref="netif_8h" startline="51">netif::ip_addr</references>
        <references refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" compoundref="ipv4_2ip__addr_8h" startline="62">ip_addr_cmp</references>
        <references refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" compoundref="ipv4_2ip__addr_8h" startline="55">ip_addr_set</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="def_8h" startline="41">NULL</references>
        <references refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" compoundref="pbuf_8h" startline="71">pbuf::payload</references>
        <references refid="pbuf_8h_1334112aa2ac402c254d604c0dbbbb746">pbuf_free</references>
        <references refid="structpbuf_13b42932c0b26c9ff2b8fe88bd25fb127" compoundref="pbuf_8h" startline="74">pbuf::tot_len</references>
        <referencedby refid="ethernetif_8c_1687c1030eeb3939b9aa8e1a0811c301a" compoundref="ethernetif_8c" startline="275" endline="306">ethernetif_input</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_1c8ad5a32790d172fcec2eac97a87ee9f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void arp_init</definition>
        <argsstring>(void)</argsstring>
        <name>arp_init</name>
        <param>
          <type>void</type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="94" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="93" bodyend="101"/>
        <references refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" compoundref="arp_8c" startline="88">arp_table</references>
        <references refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" compoundref="lwipopts_8h" startline="128">ARP_TABLE_SIZE</references>
        <references refid="ipv4_2ip__addr_8h_13e5e67b7292b156034560fef2202776c" compoundref="ipv4_2ip__addr_8h" startline="40">IP_ADDR_ANY</references>
        <references refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" compoundref="ipv4_2ip__addr_8h" startline="55">ip_addr_set</references>
        <references refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" compoundref="arp_8c" startline="83">arp_entry::ipaddr</references>
        <referencedby refid="ethernetif_8c_164753cb7324510825069062660f10926" compoundref="ethernetif_8c" startline="325" endline="341">ethernetif_init</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_1916d08dbb8f4a38e1e904a8a018b000c" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void arp_ip_input</definition>
        <argsstring>(struct netif *netif, struct pbuf *p)</argsstring>
        <name>arp_ip_input</name>
        <param>
          <type>struct <ref refid="structnetif" kindref="compound">netif</ref> *</type>
          <declname>netif</declname>
        </param>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="182" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="181" bodyend="194"/>
        <references refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" compoundref="arp_8c" startline="120" endline="178">add_arp_entry</references>
        <references refid="debug_8h_17fa8be0d28d77b4ab4f44d924d4d69e2" compoundref="debug_8h" startline="97">ARP_DEBUG</references>
        <references refid="debug_8h_18b52c1fca5671ffbfe068c8d50ca0065" compoundref="debug_8h" startline="92">DEBUGF</references>
        <references refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" compoundref="netif_8h" startline="51">netif::ip_addr</references>
        <references refid="ipv4_2ip__addr_8h_1f656f30425e386d96d0e1a1b2dcb3952" compoundref="ipv4_2ip__addr_8h" startline="58">ip_addr_maskcmp</references>
        <references refid="structnetif_1c4b9556c67758bde9a2b29f57f3e8cf2" compoundref="netif_8h" startline="52">netif::netmask</references>
        <references refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" compoundref="pbuf_8h" startline="71">pbuf::payload</references>
        <referencedby refid="ethernetif_8c_1687c1030eeb3939b9aa8e1a0811c301a" compoundref="ethernetif_8c" startline="275" endline="306">ethernetif_input</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_1eec8fff4f036cca2ac1b5635fa46d21b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structeth__addr" kindref="compound">eth_addr</ref> *</type>
        <definition>struct eth_addr* arp_lookup</definition>
        <argsstring>(struct ip_addr *ipaddr)</argsstring>
        <name>arp_lookup</name>
        <param>
          <type>struct <ref refid="structip__addr" kindref="compound">ip_addr</ref> *</type>
          <declname>ipaddr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="254" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="253" bodyend="263"/>
        <references refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" compoundref="arp_8c" startline="88">arp_table</references>
        <references refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" compoundref="lwipopts_8h" startline="128">ARP_TABLE_SIZE</references>
        <references refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" compoundref="ipv4_2ip__addr_8h" startline="62">ip_addr_cmp</references>
        <references refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="def_8h" startline="41">NULL</references>
        <referencedby refid="ethernetif_8c_1eb49a49ab62789d8e32fddf180d52ebf" compoundref="ethernetif_8c" startline="186" endline="263">ethernetif_output</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
        <definition>struct pbuf* arp_query</definition>
        <argsstring>(struct netif *netif, struct eth_addr *ethaddr, struct ip_addr *ipaddr)</argsstring>
        <name>arp_query</name>
        <param>
          <type>struct <ref refid="structnetif" kindref="compound">netif</ref> *</type>
          <declname>netif</declname>
        </param>
        <param>
          <type>struct <ref refid="structeth__addr" kindref="compound">eth_addr</ref> *</type>
          <declname>ethaddr</declname>
        </param>
        <param>
          <type>struct <ref refid="structip__addr" kindref="compound">ip_addr</ref> *</type>
          <declname>ipaddr</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="267" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="266" bodyend="302"/>
        <references refid="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" compoundref="arp_8c" startline="50">ARP_REQUEST</references>
        <references refid="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" compoundref="arp_8c" startline="72">ARPH_HWLEN_SET</references>
        <references refid="arp_8c_1edb2ded9225b09da0358754f859d72d6" compoundref="arp_8c" startline="73">ARPH_PROTOLEN_SET</references>
        <references refid="arp_8h_1dbc208bed02b2900ca2639a25d3f6198" compoundref="arp_8h" startline="60">ETHTYPE_ARP</references>
        <references refid="arp_8h_1392234c1299a5f5c264e511d88a66e56" compoundref="arp_8h" startline="61">ETHTYPE_IP</references>
        <references refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" compoundref="ipv4_2inet_8h" startline="66">htons</references>
        <references refid="arp_8c_128a28d3e575df3e75985e2313cc2d51a" compoundref="arp_8c" startline="48">HWTYPE_ETHERNET</references>
        <references refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" compoundref="netif_8h" startline="51">netif::ip_addr</references>
        <references refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" compoundref="ipv4_2ip__addr_8h" startline="55">ip_addr_set</references>
        <references refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="def_8h" startline="41">NULL</references>
        <references refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" compoundref="pbuf_8h" startline="71">pbuf::payload</references>
        <references refid="pbuf_8h_1bb6c8efa7f7739e71cb286c6dd4a47ef">pbuf_alloc</references>
        <references refid="pbuf_8h_1ee1baa59bb2f85ba575b5a8619ac1ebfb4de441e737330558b609a990cd17346">PBUF_LINK</references>
        <references refid="pbuf_8h_1b3c589840cc5a202e7278f41463f97e7c5e9f28455bca98944a030d4b84ecfab">PBUF_RAM</references>
        <referencedby refid="ethernetif_8c_1eb49a49ab62789d8e32fddf180d52ebf" compoundref="ethernetif_8c" startline="186" endline="263">ethernetif_output</referencedby>
      </memberdef>
      <memberdef kind="function" id="arp_8c_12cc298ed4c68289160da1376faf20938" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>void</type>
        <definition>void arp_tmr</definition>
        <argsstring>(void)</argsstring>
        <name>arp_tmr</name>
        <param>
          <type>void</type>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="105" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="104" bodyend="117"/>
        <references refid="debug_8h_17fa8be0d28d77b4ab4f44d924d4d69e2" compoundref="debug_8h" startline="97">ARP_DEBUG</references>
        <references refid="arp_8c_1741a0710dc126ed3ae9e305472df3432" compoundref="arp_8c" startline="46">ARP_MAXAGE</references>
        <references refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" compoundref="arp_8c" startline="88">arp_table</references>
        <references refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" compoundref="lwipopts_8h" startline="128">ARP_TABLE_SIZE</references>
        <references refid="arp_8c_19b78800fdadcc20482aacd10da639621" compoundref="arp_8c" startline="89">ctime</references>
        <references refid="debug_8h_18b52c1fca5671ffbfe068c8d50ca0065" compoundref="debug_8h" startline="92">DEBUGF</references>
        <references refid="ipv4_2ip__addr_8h_13e5e67b7292b156034560fef2202776c" compoundref="ipv4_2ip__addr_8h" startline="40">IP_ADDR_ANY</references>
        <references refid="ipv4_2ip__addr_8h_10d51c2bb5f2af51392540af1c5df511a" compoundref="ipv4_2ip__addr_8h" startline="64">ip_addr_isany</references>
        <references refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" compoundref="ipv4_2ip__addr_8h" startline="55">ip_addr_set</references>
        <references refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" compoundref="arp_8c" startline="83">arp_entry::ipaddr</references>
        <referencedby refid="ethernetif_8c_1c94d6bae5aaeab8f812a6809ba4a6367" compoundref="ethernetif_8c" startline="309" endline="313">arp_timer</referencedby>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" prot="public" static="yes" mutable="no">
        <type>struct <ref refid="structarp__entry" kindref="compound">arp_entry</ref></type>
        <definition>struct arp_entry arp_table[ARP_TABLE_SIZE]</definition>
        <argsstring>[ARP_TABLE_SIZE]</argsstring>
        <name>arp_table</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="88" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="88" bodyend="-1"/>
        <referencedby refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" compoundref="arp_8c" startline="120" endline="178">add_arp_entry</referencedby>
        <referencedby refid="arp_8c_1c8ad5a32790d172fcec2eac97a87ee9f" compoundref="arp_8c" startline="93" endline="101">arp_init</referencedby>
        <referencedby refid="arp_8c_1eec8fff4f036cca2ac1b5635fa46d21b" compoundref="arp_8c" startline="253" endline="263">arp_lookup</referencedby>
        <referencedby refid="arp_8c_12cc298ed4c68289160da1376faf20938" compoundref="arp_8c" startline="104" endline="117">arp_tmr</referencedby>
      </memberdef>
      <memberdef kind="variable" id="arp_8c_19b78800fdadcc20482aacd10da639621" prot="public" static="yes" mutable="no">
        <type><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref></type>
        <definition>uInt8 ctime</definition>
        <argsstring></argsstring>
        <name>ctime</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="89" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" bodystart="89" bodyend="-1"/>
        <referencedby refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" compoundref="arp_8c" startline="120" endline="178">add_arp_entry</referencedby>
        <referencedby refid="arp_8c_12cc298ed4c68289160da1376faf20938" compoundref="arp_8c" startline="104" endline="117">arp_tmr</referencedby>
      </memberdef>
      <memberdef kind="variable" id="arp_8c_1b335643ec08d519342c9d3834091d6e0" prot="public" static="no" mutable="no">
        <type>PACK_STRUCT_BEGIN struct <ref refid="structarp__hdr" kindref="compound">arp_hdr</ref></type>
        <definition>PACK_STRUCT_BEGIN struct arp_hdr  PACK_STRUCT_STRUCT</definition>
        <argsstring></argsstring>
        <name>PACK_STRUCT_STRUCT</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c" line="65"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>*<sp/>Copyright<sp/>(c)<sp/>2001,<sp/>Swedish<sp/>Institute<sp/>of<sp/>Computer<sp/>Science.</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>*<sp/>All<sp/>rights<sp/>reserved.<sp/></highlight></codeline>
<codeline lineno="4"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>*<sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/></highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>*<sp/>modification,<sp/>are<sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/></highlight></codeline>
<codeline lineno="7"><highlight class="comment"><sp/>*<sp/>are<sp/>met:<sp/></highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>*<sp/>1.<sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/></highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions<sp/>and<sp/>the<sp/>following<sp/>disclaimer.<sp/></highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>*<sp/>2.<sp/>Redistributions<sp/>in<sp/>binary<sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/></highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions<sp/>and<sp/>the<sp/>following<sp/>disclaimer<sp/>in<sp/>the<sp/></highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>documentation<sp/>and/or<sp/>other<sp/>materials<sp/>provided<sp/>with<sp/>the<sp/>distribution.<sp/></highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>*<sp/>3.<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>Institute<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its<sp/>contributors<sp/></highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>may<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software<sp/></highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.<sp/></highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>INSTITUTE<sp/>AND<sp/>CONTRIBUTORS<sp/>``AS<sp/>IS&apos;&apos;<sp/>AND<sp/></highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*<sp/>ANY<sp/>EXPRESS<sp/>OR<sp/>IMPLIED<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/></highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF<sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/></highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>*<sp/>ARE<sp/>DISCLAIMED.<sp/><sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>INSTITUTE<sp/>OR<sp/>CONTRIBUTORS<sp/>BE<sp/>LIABLE<sp/></highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,<sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/></highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT<sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/></highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>*<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)<sp/></highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>*<sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>CONTRACT,<sp/>STRICT<sp/></highlight></codeline>
<codeline lineno="25"><highlight class="comment"><sp/>*<sp/>LIABILITY,<sp/>OR<sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/></highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>*<sp/>OUT<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS<sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/></highlight></codeline>
<codeline lineno="27"><highlight class="comment"><sp/>*<sp/>SUCH<sp/>DAMAGE.<sp/></highlight></codeline>
<codeline lineno="28"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="29"><highlight class="comment"><sp/>*<sp/>This<sp/>file<sp/>is<sp/>part<sp/>of<sp/>the<sp/>lwIP<sp/>TCP/IP<sp/>stack.</highlight></codeline>
<codeline lineno="30"><highlight class="comment"><sp/>*<sp/></highlight></codeline>
<codeline lineno="31"><highlight class="comment"><sp/>*<sp/>Author:<sp/>Adam<sp/>Dunkels<sp/>&lt;adam@sics.se&gt;</highlight></codeline>
<codeline lineno="32"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="33"><highlight class="comment"><sp/>*<sp/>$Id: arp_8c.xml 88 2016-01-12 00:11:29Z reddawg $</highlight></codeline>
<codeline lineno="34"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="35"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="types_8h" kindref="compound">ubixos/types.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="debug_8h" kindref="compound">net/debug.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ipv4_2inet_8h" kindref="compound">net/ipv4/inet.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="arp_8h" kindref="compound">netif/arp.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ipv4_2ip_8h" kindref="compound">net/ipv4/ip.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46" refid="arp_8c_1741a0710dc126ed3ae9e305472df3432" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ARP_MAXAGE<sp/>2<sp/><sp/></highlight><highlight class="comment">/*<sp/>120<sp/>*<sp/>10<sp/>seconds<sp/>=<sp/>20<sp/>minutes.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="48" refid="arp_8c_128a28d3e575df3e75985e2313cc2d51a" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>HWTYPE_ETHERNET<sp/>1</highlight></codeline>
<codeline lineno="49"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50" refid="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ARP_REQUEST<sp/>1</highlight></codeline>
<codeline lineno="51" refid="arp_8c_106ba7b414e718081998f2814090debf1" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>ARP_REPLY<sp/>2</highlight></codeline>
<codeline lineno="52"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>MUST<sp/>be<sp/>compiled<sp/>with<sp/>&quot;pack<sp/>structs&quot;<sp/>or<sp/>equivalent!<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><ref refid="cc_8h_173199061891adf1b912d20835c7d5e96" kindref="member">PACK_STRUCT_BEGIN</ref></highlight></codeline>
<codeline lineno="55" refid="structarp__hdr" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structarp__hdr" kindref="compound">arp_hdr</ref><sp/>{</highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__hdr" kindref="compound">eth_hdr</ref><sp/>ethhdr);</highlight></codeline>
<codeline lineno="57"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>hwtype);</highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>proto);</highlight></codeline>
<codeline lineno="59"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>_hwlen_protolen);</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(<ref refid="types_8h_13b65128d2644e9b80cec9a69bfa7e094" kindref="member">uInt16</ref><sp/>opcode);</highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>shwaddr);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/>sipaddr);</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>dhwaddr);</highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/><ref refid="structarp__hdr_1bf562b78f962f27cb93c538f42c6fe79" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/>dipaddr);</highlight></codeline>
<codeline lineno="65"><highlight class="normal">}<sp/><ref refid="cc_8h_133623da05bb55497534c3dc26ebebeb2" kindref="member">PACK_STRUCT_STRUCT</ref>;</highlight></codeline>
<codeline lineno="66"><highlight class="normal"><ref refid="cc_8h_1465fef70f294e21cbf4ea51fc342f20e" kindref="member">PACK_STRUCT_END</ref></highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68" refid="arp_8c_106faf2eae13476a702524b13ea6ecd7f" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ARPH_HWLEN(hdr)<sp/>(NTOHS((hdr)-&gt;_hwlen_protolen)<sp/>&gt;&gt;<sp/>8)</highlight></codeline>
<codeline lineno="69" refid="arp_8c_18c416438814934662a28d7e3c891a175" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>ARPH_PROTOLEN(hdr)<sp/>(NTOHS((hdr)-&gt;_hwlen_protolen)<sp/>&amp;<sp/>0xff)</highlight></codeline>
<codeline lineno="70"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"></highlight></codeline>
<codeline lineno="72" refid="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>ARPH_HWLEN_SET(hdr,<sp/>len)<sp/>(hdr)-&gt;_hwlen_protolen<sp/>=<sp/>HTONS(ARPH_PROTOLEN(hdr)<sp/>|<sp/>((len)<sp/>&lt;&lt;<sp/>8))</highlight></codeline>
<codeline lineno="73" refid="arp_8c_1edb2ded9225b09da0358754f859d72d6" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>ARPH_PROTOLEN_SET(hdr,<sp/>len)<sp/>(hdr)-&gt;_hwlen_protolen<sp/>=<sp/>HTONS((len)<sp/>|<sp/>(ARPH_HWLEN(hdr)<sp/>&lt;&lt;<sp/>8))</highlight></codeline>
<codeline lineno="74"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="75"><highlight class="normal"><ref refid="cc_8h_173199061891adf1b912d20835c7d5e96" kindref="member">PACK_STRUCT_BEGIN</ref></highlight></codeline>
<codeline lineno="76" refid="structethip__hdr" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structethip__hdr" kindref="compound">ethip_hdr</ref><sp/>{</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/><sp/><ref refid="structethip__hdr_1eaff5bdb00c5618ea94cc70081ba27d9" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__hdr" kindref="compound">eth_hdr</ref><sp/>eth);</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/><sp/><ref refid="structethip__hdr_1eaff5bdb00c5618ea94cc70081ba27d9" kindref="member">PACK_STRUCT_FIELD</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__hdr" kindref="compound">ip_hdr</ref><sp/>ip);</highlight></codeline>
<codeline lineno="79"><highlight class="normal">};</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><ref refid="cc_8h_1465fef70f294e21cbf4ea51fc342f20e" kindref="member">PACK_STRUCT_END</ref></highlight></codeline>
<codeline lineno="81"><highlight class="normal"></highlight></codeline>
<codeline lineno="82" refid="structarp__entry" refkind="compound"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structarp__entry" kindref="compound">arp_entry</ref><sp/>{</highlight></codeline>
<codeline lineno="83" refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/><ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>;</highlight></codeline>
<codeline lineno="84" refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" refkind="member"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/><ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>;</highlight></codeline>
<codeline lineno="85" refid="structarp__entry_149945e8299d4bf7241c0fd2b5e4d84df" refkind="member"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/><ref refid="structarp__entry_149945e8299d4bf7241c0fd2b5e4d84df" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="86"><highlight class="normal">};</highlight></codeline>
<codeline lineno="87"><highlight class="normal"></highlight></codeline>
<codeline lineno="88" refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structarp__entry" kindref="compound">arp_entry</ref><sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[<ref refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" kindref="member">ARP_TABLE_SIZE</ref>];</highlight></codeline>
<codeline lineno="89" refid="arp_8c_19b78800fdadcc20482aacd10da639621" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/><ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="90"><highlight class="normal"></highlight></codeline>
<codeline lineno="91"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="93" refid="arp_8c_1c8ad5a32790d172fcec2eac97a87ee9f" refkind="member"><highlight class="normal"><ref refid="arp_8h_1c8ad5a32790d172fcec2eac97a87ee9f" kindref="member">arp_init</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="94"><highlight class="normal">{</highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i;</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" kindref="member">ARP_TABLE_SIZE</ref>;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>),</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_13e5e67b7292b156034560fef2202776c" kindref="member">IP_ADDR_ANY</ref>);</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="101"><highlight class="normal">}</highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="103"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="104" refid="arp_8c_12cc298ed4c68289160da1376faf20938" refkind="member"><highlight class="normal"><ref refid="arp_8h_12cc298ed4c68289160da1376faf20938" kindref="member">arp_tmr</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="105"><highlight class="normal">{</highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i;</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/>++<ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" kindref="member">ARP_TABLE_SIZE</ref>;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(!<ref refid="ipv4_2ip__addr_8h_10d51c2bb5f2af51392540af1c5df511a" kindref="member">ip_addr_isany</ref>(&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>)<sp/>&amp;&amp;<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref><sp/>-<sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref><sp/>&gt;=<sp/><ref refid="arp_8c_1741a0710dc126ed3ae9e305472df3432" kindref="member">ARP_MAXAGE</ref>)<sp/>{</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="debug_8h_18b52c1fca5671ffbfe068c8d50ca0065" kindref="member">DEBUGF</ref>(<ref refid="debug_8h_17fa8be0d28d77b4ab4f44d924d4d69e2" kindref="member">ARP_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;arp_timer:<sp/>expired<sp/>entry<sp/>%d.\n&quot;</highlight><highlight class="normal">,<sp/>i));</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].ipaddr),</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_13e5e67b7292b156034560fef2202776c" kindref="member">IP_ADDR_ANY</ref>);</highlight></codeline>
<codeline lineno="115"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/>}<sp/><sp/></highlight></codeline>
<codeline lineno="117"><highlight class="normal">}</highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="119"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="120" refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" refkind="member"><highlight class="normal"><ref refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" kindref="member">add_arp_entry</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/>*<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>*<ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>)</highlight></codeline>
<codeline lineno="121"><highlight class="normal">{</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i,<sp/>j,<sp/>k;</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>maxtime;</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Walk<sp/>through<sp/>the<sp/>ARP<sp/>mapping<sp/>table<sp/>and<sp/>try<sp/>to<sp/>find<sp/>an<sp/>entry<sp/>to</highlight></codeline>
<codeline lineno="126"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>update.<sp/>If<sp/>none<sp/>is<sp/>found,<sp/>the<sp/>IP<sp/>-&gt;<sp/>MAC<sp/>address<sp/>mapping<sp/>is</highlight></codeline>
<codeline lineno="127"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>inserted<sp/>in<sp/>the<sp/>ARP<sp/>table.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" kindref="member">ARP_TABLE_SIZE</ref>;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="130"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Only<sp/>check<sp/>those<sp/>entries<sp/>that<sp/>are<sp/>actually<sp/>in<sp/>use.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(!<ref refid="ipv4_2ip__addr_8h_10d51c2bb5f2af51392540af1c5df511a" kindref="member">ip_addr_isany</ref>(&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>))<sp/>{</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>Check<sp/>if<sp/>the<sp/>source<sp/>IP<sp/>address<sp/>of<sp/>the<sp/>incoming<sp/>packet<sp/>matches</highlight></codeline>
<codeline lineno="133"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>the<sp/>IP<sp/>address<sp/>in<sp/>this<sp/>ARP<sp/>table<sp/>entry.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" kindref="member">ip_addr_cmp</ref>(ipaddr,<sp/>&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].ipaddr))<sp/>{</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>An<sp/>old<sp/>entry<sp/>found,<sp/>update<sp/>this<sp/>and<sp/>return.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(k<sp/>=<sp/>0;<sp/>k<sp/>&lt;<sp/>6;<sp/>++k)<sp/>{</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>.addr[k]<sp/>=<sp/><ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>-&gt;addr[k];</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_149945e8299d4bf7241c0fd2b5e4d84df" kindref="member">ctime</ref><sp/>=<sp/><ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="144"><highlight class="normal"></highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>If<sp/>we<sp/>get<sp/>here,<sp/>no<sp/>existing<sp/>ARP<sp/>table<sp/>entry<sp/>was<sp/>found,<sp/>so<sp/>we</highlight></codeline>
<codeline lineno="146"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>create<sp/>one.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>First,<sp/>we<sp/>try<sp/>to<sp/>find<sp/>an<sp/>unused<sp/>entry<sp/>in<sp/>the<sp/>ARP<sp/>table.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>ARP_TABLE_SIZE;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="ipv4_2ip__addr_8h_10d51c2bb5f2af51392540af1c5df511a" kindref="member">ip_addr_isany</ref>(&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>))<sp/>{</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="154"><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>If<sp/>no<sp/>unused<sp/>entry<sp/>is<sp/>found,<sp/>we<sp/>try<sp/>to<sp/>find<sp/>the<sp/>oldest<sp/>entry<sp/>and</highlight></codeline>
<codeline lineno="156"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>throw<sp/>it<sp/>away.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(i<sp/>==<sp/>ARP_TABLE_SIZE)<sp/>{</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/>maxtime<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/>j<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>ARP_TABLE_SIZE;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref><sp/>-<sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref><sp/>&gt;<sp/>maxtime)<sp/>{</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>maxtime<sp/>=<sp/><ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref><sp/>-<sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>j<sp/>=<sp/>i;</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/>i<sp/>=<sp/>j;</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="168"><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Now,<sp/>i<sp/>is<sp/>the<sp/>ARP<sp/>table<sp/>entry<sp/>which<sp/>we<sp/>will<sp/>fill<sp/>with<sp/>the<sp/>new</highlight></codeline>
<codeline lineno="170"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>information.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_1b9ee1643a380bd563aac0dea83973459" kindref="member">ipaddr</ref>,<sp/>ipaddr);</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(k<sp/>=<sp/>0;<sp/>k<sp/>&lt;<sp/>6;<sp/>++k)<sp/>{</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>.addr[k]<sp/>=<sp/><ref refid="structarp__entry_14cd78dd42071f584f2b8a5ead9f70eaf" kindref="member">ethaddr</ref>-&gt;addr[k];</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].<ref refid="structarp__entry_149945e8299d4bf7241c0fd2b5e4d84df" kindref="member">ctime</ref><sp/>=<sp/><ref refid="arp_8c_19b78800fdadcc20482aacd10da639621" kindref="member">ctime</ref>;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="177"><highlight class="normal"></highlight></codeline>
<codeline lineno="178"><highlight class="normal">}</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="180"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="181" refid="arp_8c_1916d08dbb8f4a38e1e904a8a018b000c" refkind="member"><highlight class="normal"><ref refid="arp_8h_1916d08dbb8f4a38e1e904a8a018b000c" kindref="member">arp_ip_input</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p)</highlight></codeline>
<codeline lineno="182"><highlight class="normal">{</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structethip__hdr" kindref="compound">ethip_hdr</ref><sp/>*hdr;</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/>hdr<sp/>=<sp/>p-&gt;<ref refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" kindref="member">payload</ref>;</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Only<sp/>insert/update<sp/>an<sp/>entry<sp/>if<sp/>the<sp/>source<sp/>IP<sp/>address<sp/>of<sp/>the</highlight></codeline>
<codeline lineno="188"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>incoming<sp/>IP<sp/>packet<sp/>comes<sp/>from<sp/>a<sp/>host<sp/>on<sp/>the<sp/>local<sp/>network.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(!<ref refid="ipv4_2ip__addr_8h_1f656f30425e386d96d0e1a1b2dcb3952" kindref="member">ip_addr_maskcmp</ref>(&amp;(hdr-&gt;ip.src),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" kindref="member">ip_addr</ref>),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1c4b9556c67758bde9a2b29f57f3e8cf2" kindref="member">netmask</ref>)))<sp/>{</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><ref refid="debug_8h_18b52c1fca5671ffbfe068c8d50ca0065" kindref="member">DEBUGF</ref>(<ref refid="debug_8h_17fa8be0d28d77b4ab4f44d924d4d69e2" kindref="member">ARP_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;arp_ip_input:<sp/>updating<sp/>ARP<sp/>table.\n&quot;</highlight><highlight class="normal">));</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><ref refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" kindref="member">add_arp_entry</ref>(&amp;(hdr-&gt;ip.src),<sp/>&amp;(hdr-&gt;eth.src));</highlight></codeline>
<codeline lineno="194"><highlight class="normal">}</highlight></codeline>
<codeline lineno="195"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="196"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*</highlight></codeline>
<codeline lineno="197" refid="arp_8c_157a25dd51cf73f048ad5364ecc2f040b" refkind="member"><highlight class="normal"><ref refid="arp_8h_157a25dd51cf73f048ad5364ecc2f040b" kindref="member">arp_arp_input</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>*ethaddr,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p)</highlight></codeline>
<codeline lineno="198"><highlight class="normal">{</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structarp__hdr" kindref="compound">arp_hdr</ref><sp/>*hdr;</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(p-&gt;<ref refid="structpbuf_13b42932c0b26c9ff2b8fe88bd25fb127" kindref="member">tot_len</ref><sp/>&lt;<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structarp__hdr" kindref="compound">arp_hdr</ref>))<sp/>{</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;arp_arp_input:<sp/>packet<sp/>too<sp/>short<sp/>(%d/%d)\n&quot;</highlight><highlight class="normal">,<sp/>p-&gt;<ref refid="structpbuf_13b42932c0b26c9ff2b8fe88bd25fb127" kindref="member">tot_len</ref>,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>arp_hdr));</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="pbuf_8h_1334112aa2ac402c254d604c0dbbbb746" kindref="member">pbuf_free</ref>(p);</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="207"><highlight class="normal"></highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/>hdr<sp/>=<sp/>p-&gt;<ref refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" kindref="member">payload</ref>;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">switch</highlight><highlight class="normal">(<ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(hdr-&gt;opcode))<sp/>{</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" kindref="member">ARP_REQUEST</ref>:</highlight></codeline>
<codeline lineno="212"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>ARP<sp/>request.<sp/>If<sp/>it<sp/>asked<sp/>for<sp/>our<sp/>address,<sp/>we<sp/>send<sp/>out<sp/>a</highlight></codeline>
<codeline lineno="213"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>reply.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" kindref="member">ip_addr_cmp</ref>(&amp;(hdr-&gt;dipaddr),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" kindref="member">ip_addr</ref>)))<sp/>{</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;opcode<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8c_106ba7b414e718081998f2814090debf1" kindref="member">ARP_REPLY</ref>);</highlight></codeline>
<codeline lineno="216"><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(hdr-&gt;dipaddr),<sp/>&amp;(hdr-&gt;sipaddr));</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(hdr-&gt;sipaddr),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" kindref="member">ip_addr</ref>));</highlight></codeline>
<codeline lineno="219"><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>6;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;dhwaddr.addr[i]<sp/>=<sp/>hdr-&gt;shwaddr.addr[i];</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;shwaddr.addr[i]<sp/>=<sp/>ethaddr-&gt;addr[i];</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;ethhdr.dest.addr[i]<sp/>=<sp/>hdr-&gt;dhwaddr.addr[i];</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;ethhdr.src.addr[i]<sp/>=<sp/>ethaddr-&gt;addr[i];</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="226"><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;hwtype<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8c_128a28d3e575df3e75985e2313cc2d51a" kindref="member">HWTYPE_ETHERNET</ref>);</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" kindref="member">ARPH_HWLEN_SET</ref>(hdr,<sp/>6);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;proto<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8h_1392234c1299a5f5c264e511d88a66e56" kindref="member">ETHTYPE_IP</ref>);</highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_1edb2ded9225b09da0358754f859d72d6" kindref="member">ARPH_PROTOLEN_SET</ref>(hdr,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref>));<sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>hdr-&gt;ethhdr.type<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8h_1dbc208bed02b2900ca2639a25d3f6198" kindref="member">ETHTYPE_ARP</ref>);<sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>p;</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">case</highlight><highlight class="normal"><sp/><ref refid="arp_8c_106ba7b414e718081998f2814090debf1" kindref="member">ARP_REPLY</ref>:<sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>ARP<sp/>reply.<sp/>We<sp/>insert<sp/>or<sp/>update<sp/>the<sp/>ARP<sp/>table.<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" kindref="member">ip_addr_cmp</ref>(&amp;(hdr-&gt;dipaddr),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" kindref="member">ip_addr</ref>)))<sp/>{</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="arp_8c_1038bb8fc3bcc993d8b7724632e43ed0f" kindref="member">add_arp_entry</ref>(&amp;(hdr-&gt;sipaddr),<sp/>&amp;(hdr-&gt;shwaddr));</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="242"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">default</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;arp_arp_input:<sp/>unknown<sp/>type<sp/>%d\n&quot;</highlight><highlight class="normal">,<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(hdr-&gt;opcode));</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="247"><highlight class="normal"></highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><ref refid="pbuf_8h_1334112aa2ac402c254d604c0dbbbb746" kindref="member">pbuf_free</ref>(p);</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;</highlight></codeline>
<codeline lineno="250"><highlight class="normal">}</highlight></codeline>
<codeline lineno="251"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="252"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>*</highlight></codeline>
<codeline lineno="253" refid="arp_8c_1eec8fff4f036cca2ac1b5635fa46d21b" refkind="member"><highlight class="normal"><ref refid="arp_8h_1eec8fff4f036cca2ac1b5635fa46d21b" kindref="member">arp_lookup</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/>*ipaddr)</highlight></codeline>
<codeline lineno="254"><highlight class="normal">{</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i;</highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/><ref refid="lwipopts_8h_1924936a814564dbdb0bc950d255a83b9" kindref="member">ARP_TABLE_SIZE</ref>;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(<ref refid="ipv4_2ip__addr_8h_1008c9c92d770cc030ea054e6b259835a" kindref="member">ip_addr_cmp</ref>(ipaddr,<sp/>&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].ipaddr))<sp/>{</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>&amp;<ref refid="arp_8c_1f695765e961406ffcbd5a25a4dca7a55" kindref="member">arp_table</ref>[i].ethaddr;</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;<sp/><sp/></highlight></codeline>
<codeline lineno="263"><highlight class="normal">}</highlight></codeline>
<codeline lineno="264"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="265"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*</highlight></codeline>
<codeline lineno="266" refid="arp_8c_19d1287b9a80c370797b2ac5c63f70e2e" refkind="member"><highlight class="normal"><ref refid="arp_8h_19d1287b9a80c370797b2ac5c63f70e2e" kindref="member">arp_query</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structeth__addr" kindref="compound">eth_addr</ref><sp/>*ethaddr,<sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref><sp/>*ipaddr)</highlight></codeline>
<codeline lineno="267"><highlight class="normal">{</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structarp__hdr" kindref="compound">arp_hdr</ref><sp/>*hdr;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p;</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><ref refid="types_8h_1a4e0f27a9aca905e340c06d2dcae843c" kindref="member">uInt8</ref><sp/>i;</highlight></codeline>
<codeline lineno="271"><highlight class="normal"></highlight></codeline>
<codeline lineno="272"><highlight class="normal"><sp/><sp/>p<sp/>=<sp/><ref refid="pbuf_8h_1bb6c8efa7f7739e71cb286c6dd4a47ef" kindref="member">pbuf_alloc</ref>(<ref refid="pbuf_8h_1ee1baa59bb2f85ba575b5a8619ac1ebfb4de441e737330558b609a990cd17346" kindref="member">PBUF_LINK</ref>,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structarp__hdr" kindref="compound">arp_hdr</ref>),<sp/><ref refid="pbuf_8h_1b3c589840cc5a202e7278f41463f97e7c5e9f28455bca98944a030d4b84ecfab" kindref="member">PBUF_RAM</ref>);</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(p<sp/>==<sp/><ref refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="def_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="276"><highlight class="normal"></highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/>hdr<sp/>=<sp/>p-&gt;<ref refid="structpbuf_18d32dc3e964369d4eec638fc37fbc460" kindref="member">payload</ref>;</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/>hdr-&gt;opcode<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8c_17a7c46ffaba30477b8c9e3e61bd2e106" kindref="member">ARP_REQUEST</ref>);</highlight></codeline>
<codeline lineno="280"><highlight class="normal"></highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>6;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/>hdr-&gt;dhwaddr.addr[i]<sp/>=<sp/>0x00;</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/><sp/><sp/>hdr-&gt;shwaddr.addr[i]<sp/>=<sp/>ethaddr-&gt;addr[i];</highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(hdr-&gt;dipaddr),<sp/>ipaddr);</highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/><ref refid="ipv4_2ip__addr_8h_140db7feae2b92f7a7a01d65a85b06e18" kindref="member">ip_addr_set</ref>(&amp;(hdr-&gt;sipaddr),<sp/>&amp;(netif-&gt;<ref refid="structnetif_1d666097c02e7d7e82ea838b0c721470d" kindref="member">ip_addr</ref>));</highlight></codeline>
<codeline lineno="288"><highlight class="normal"></highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/>hdr-&gt;hwtype<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8c_128a28d3e575df3e75985e2313cc2d51a" kindref="member">HWTYPE_ETHERNET</ref>);</highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/><ref refid="arp_8c_1f463dc7a7aaf3ea0b6bc472b261380ac" kindref="member">ARPH_HWLEN_SET</ref>(hdr,<sp/>6);</highlight></codeline>
<codeline lineno="291"><highlight class="normal"></highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/>hdr-&gt;proto<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8h_1392234c1299a5f5c264e511d88a66e56" kindref="member">ETHTYPE_IP</ref>);</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/><ref refid="arp_8c_1edb2ded9225b09da0358754f859d72d6" kindref="member">ARPH_PROTOLEN_SET</ref>(hdr,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structip__addr" kindref="compound">ip_addr</ref>));</highlight></codeline>
<codeline lineno="294"><highlight class="normal"></highlight></codeline>
<codeline lineno="295"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>6;<sp/>++i)<sp/>{</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><sp/><sp/>hdr-&gt;ethhdr.dest.addr[i]<sp/>=<sp/>0xff;</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/><sp/><sp/>hdr-&gt;ethhdr.src.addr[i]<sp/>=<sp/>ethaddr-&gt;addr[i];</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="299"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="300"><highlight class="normal"><sp/><sp/>hdr-&gt;ethhdr.type<sp/>=<sp/><ref refid="ipv4_2inet_8h_1b7fffd06ef1d1a7d34f99eedbb9f44dd" kindref="member">htons</ref>(<ref refid="arp_8h_1dbc208bed02b2900ca2639a25d3f6198" kindref="member">ETHTYPE_ARP</ref>);<sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="301"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>p;</highlight></codeline>
<codeline lineno="302"><highlight class="normal">}</highlight></codeline>
<codeline lineno="303"><highlight class="normal"></highlight><highlight class="comment">/*-----------------------------------------------------------------------------------*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="304"><highlight class="normal"></highlight></codeline>
<codeline lineno="305"><highlight class="normal"></highlight></codeline>
<codeline lineno="306"><highlight class="normal"></highlight></codeline>
<codeline lineno="307"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/usr/home/reddawg/source/ubix2/src/sys/net/netif/arp.c"/>
  </compounddef>
</doxygen>