<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
  <compounddef id="inet__chksum_8c" kind="file" language="C++">
    <compoundname>inet_chksum.c</compoundname>
    <includes refid="opt_8h" local="yes">net/opt.h</includes>
    <includes refid="inet__chksum_8h" local="yes">net/inet_chksum.h</includes>
    <includes refid="def_8h" local="yes">net/def.h</includes>
    <includes refid="ip__addr_8h" local="yes">net/ip_addr.h</includes>
    <includes refid="string_8h" local="no">string.h</includes>
    <incdepgraph>
      <node id="17">
        <label>stdarg.h</label>
        <link refid="stdarg_8h"/>
      </node>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c</label>
        <link refid="inet__chksum_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="19" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
        <childnode refid="22" relation="include">
        </childnode>
        <childnode refid="26" relation="include">
        </childnode>
      </node>
      <node id="18">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="15">
        <label>sys/io.h</label>
        <link refid="io_8h"/>
      </node>
      <node id="20">
        <label>net/pbuf.h</label>
        <link refid="pbuf_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="21" relation="include">
        </childnode>
      </node>
      <node id="27">
        <label>strings.h</label>
        <link refid="strings_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>sys/select.h</label>
        <link refid="select_8h"/>
        <childnode refid="9" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
      </node>
      <node id="13">
        <label>net/arch/cc.h</label>
        <link refid="cc_8h"/>
        <childnode refid="14" relation="include">
        </childnode>
      </node>
      <node id="12">
        <label>sys/_sigset.h</label>
        <link refid="__sigset_8h"/>
        <childnode refid="7" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>net/lwipopts.h</label>
        <link refid="lwipopts_8h"/>
      </node>
      <node id="26">
        <label>string.h</label>
        <link refid="string_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="27" relation="include">
        </childnode>
      </node>
      <node id="6">
        <label>sys/types.h</label>
        <link refid="include_2sys_2types_8h"/>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
      </node>
      <node id="23">
        <label>net/def.h</label>
        <link refid="def_8h"/>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>net/arch.h</label>
        <link refid="arch_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="16" relation="include">
        </childnode>
        <childnode refid="18" relation="include">
        </childnode>
      </node>
      <node id="25">
        <label>net/ip6_addr.h</label>
        <link refid="ip6__addr_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>net/opt.h</label>
        <link refid="opt_8h"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
      </node>
      <node id="16">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="17" relation="include">
        </childnode>
      </node>
      <node id="4">
        <label>net/debug.h</label>
        <link refid="debug_8h"/>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="24">
        <label>net/ip4_addr.h</label>
        <link refid="ip4__addr_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
      </node>
      <node id="22">
        <label>net/ip_addr.h</label>
        <link refid="ip__addr_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="23" relation="include">
        </childnode>
        <childnode refid="24" relation="include">
        </childnode>
        <childnode refid="25" relation="include">
        </childnode>
      </node>
      <node id="9">
        <label>sys/cdefs.h</label>
        <link refid="cdefs_8h"/>
      </node>
      <node id="14">
        <label>ubixos/time.h</label>
        <link refid="time_8h"/>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
        <childnode refid="15" relation="include">
        </childnode>
      </node>
      <node id="7">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="21">
        <label>net/err.h</label>
        <link refid="err_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="10">
        <label>sys/_timespec.h</label>
        <link refid="__timespec_8h"/>
        <childnode refid="7" relation="include">
        </childnode>
      </node>
      <node id="19">
        <label>net/inet_chksum.h</label>
        <link refid="inet__chksum_8h"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="20" relation="include">
        </childnode>
        <childnode refid="22" relation="include">
        </childnode>
      </node>
      <node id="11">
        <label>sys/_timeval.h</label>
        <link refid="__timeval_8h"/>
        <childnode refid="7" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" prot="public" static="no">
        <name>LWIP_CHKSUM</name>
        <initializer><ref refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" kindref="member">lwip_standard_chksum</ref></initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="57" column="10" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="57" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="inet__chksum_8c_1aa0865f14286191bd72fc1a9d9cbe25d4" prot="public" static="no">
        <name>LWIP_CHKSUM_ALGORITHM</name>
        <initializer>2</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="59" column="11" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="59" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="inet__chksum_8c_1a34f1aa1587562a09e11b704b51bab043" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>u16_t inet_chksum</definition>
        <argsstring>(const void *dataptr, u16_t len)</argsstring>
        <name>inet_chksum</name>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> void *</type>
          <declname>dataptr</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>len</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="555" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="555" bodyend="558"/>
        <references refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" compoundref="pbuf_8h" startline="159">pbuf::len</references>
        <references refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" compoundref="inet__chksum_8c" startline="57">LWIP_CHKSUM</references>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1ab35967a50418358e194e8f80fdc3c865" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>u16_t inet_chksum_pbuf</definition>
        <argsstring>(struct pbuf *p)</argsstring>
        <name>inet_chksum_pbuf</name>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Calculate a checksum over a chain of pbufs (without pseudo-header, much like inet_chksum only pbufs are used).</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>p</parametername>
</parameternamelist>
<parameterdescription>
<para>pbuf chain over that the checksum should be calculated </para>
</parameterdescription>
</parameteritem>
</parameterlist>
<simplesect kind="return"><para>checksum (as u16_t) to be saved directly in the protocol header </para>
</simplesect>
</para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="568" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="568" bodyend="589"/>
        <references refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" compoundref="inet__chksum_8h" startline="52">FOLD_U32T</references>
        <references refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" compoundref="pbuf_8h" startline="159">pbuf::len</references>
        <references refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" compoundref="inet__chksum_8c" startline="57">LWIP_CHKSUM</references>
        <references refid="structpbuf_1a5e5763c94fd18d78937b0b58ce7df341" compoundref="pbuf_8h" startline="144">pbuf::next</references>
        <references refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="fat__string_8h" startline="17">NULL</references>
        <references refid="structpbuf_1a8d32dc3e964369d4eec638fc37fbc460" compoundref="pbuf_8h" startline="147">pbuf::payload</references>
        <references refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" compoundref="inet__chksum_8h" startline="47">SWAP_BYTES_IN_WORD</references>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1ae98139a7aae3f434c2055ae5bbea5a9a" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>static u16_t inet_cksum_pseudo_base</definition>
        <argsstring>(struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc)</argsstring>
        <name>inet_cksum_pseudo_base</name>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref></type>
          <declname>proto</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>proto_len</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref></type>
          <declname>acc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Parts of the pseudo checksum which are common to IPv4 and IPv6 </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="260" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="260" bodyend="294"/>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1adda177c94eaa1958cdba18fe280b51a6" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>static u16_t inet_cksum_pseudo_partial_base</definition>
        <argsstring>(struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, u32_t acc)</argsstring>
        <name>inet_cksum_pseudo_partial_base</name>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref></type>
          <declname>proto</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>proto_len</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>chksum_len</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref></type>
          <declname>acc</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Parts of the pseudo checksum which are common to IPv4 and IPv6 </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="399" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="399" bodyend="440"/>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1aa13cda42e7c262f5dee243ff6c28422f" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>u16_t ip_chksum_pseudo</definition>
        <argsstring>(struct pbuf *p, u8_t proto, u16_t proto_len, const ip_addr_t *src, const ip_addr_t *dest)</argsstring>
        <name>ip_chksum_pseudo</name>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref></type>
          <declname>proto</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>proto_len</declname>
        </param>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref> *</type>
          <declname>src</declname>
        </param>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref> *</type>
          <declname>dest</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="379" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="379" bodyend="395"/>
        <references refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" compoundref="ip__addr_8h" startline="301">ip_2_ip6</references>
        <references refid="ip__addr_8h_1a9bac7e938757f1d24df2404e8b57cb7d" compoundref="ip__addr_8h" startline="296">IP_IS_V6</references>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1acfe7ab6c63ef998210c66bb4822b03b2" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>u16_t ip_chksum_pseudo_partial</definition>
        <argsstring>(struct pbuf *p, u8_t proto, u16_t proto_len, u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest)</argsstring>
        <name>ip_chksum_pseudo_partial</name>
        <param>
          <type>struct <ref refid="structpbuf" kindref="compound">pbuf</ref> *</type>
          <declname>p</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref></type>
          <declname>proto</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>proto_len</declname>
        </param>
        <param>
          <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
          <declname>chksum_len</declname>
        </param>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref> *</type>
          <declname>src</declname>
        </param>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref> *</type>
          <declname>dest</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="526" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="526" bodyend="542"/>
        <references refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" compoundref="ip__addr_8h" startline="301">ip_2_ip6</references>
        <references refid="ip__addr_8h_1a9bac7e938757f1d24df2404e8b57cb7d" compoundref="ip__addr_8h" startline="296">IP_IS_V6</references>
      </memberdef>
      <memberdef kind="function" id="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></type>
        <definition>u16_t lwip_standard_chksum</definition>
        <argsstring>(const void *dataptr, int len)</argsstring>
        <name>lwip_standard_chksum</name>
        <param>
          <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> void *</type>
          <declname>dataptr</declname>
        </param>
        <param>
          <type>int</type>
          <declname>len</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" line="133" column="1" bodyfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" bodystart="133" bodyend="173" declfile="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c" declline="61" declcolumn="7"/>
        <references refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" compoundref="inet__chksum_8h" startline="52">FOLD_U32T</references>
        <references refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" compoundref="inet__chksum_8h" startline="47">SWAP_BYTES_IN_WORD</references>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<para>Incluse internet checksum functions.<linebreak/>
 These are some reference implementations of the checksum algorithm, with the aim of being simple, correct and fully portable. Checksumming is the first thing you would want to optimize for your platform. If you create your own version, link it in and in your <ref refid="cc_8h" kindref="compound">cc.h</ref> put:</para>
<para>#define LWIP_CHKSUM your_checksum_routine</para>
<para>Or you can select from the implementations below by defining LWIP_CHKSUM_ALGORITHM to 1, 2 or 3. </para>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="16"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>*<sp/>Copyright<sp/>(c)<sp/>2001-2004<sp/>Swedish<sp/>Institute<sp/>of<sp/>Computer<sp/>Science.</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>*<sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="20"><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/>modification,</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>*<sp/>are<sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="23"><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/>notice,</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>this<sp/>list<sp/>of<sp/>conditions<sp/>and<sp/>the<sp/>following<sp/>disclaimer.</highlight></codeline>
<codeline lineno="25"><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/>notice,</highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>this<sp/>list<sp/>of<sp/>conditions<sp/>and<sp/>the<sp/>following<sp/>disclaimer<sp/>in<sp/>the<sp/>documentation</highlight></codeline>
<codeline lineno="27"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>and/or<sp/>other<sp/>materials<sp/>provided<sp/>with<sp/>the<sp/>distribution.</highlight></codeline>
<codeline lineno="28"><highlight class="comment"><sp/>*<sp/>3.<sp/>The<sp/>name<sp/>of<sp/>the<sp/>author<sp/>may<sp/>not<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products</highlight></codeline>
<codeline lineno="29"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>derived<sp/>from<sp/>this<sp/>software<sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.</highlight></codeline>
<codeline lineno="30"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="31"><highlight class="comment"><sp/>*<sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>AUTHOR<sp/>``AS<sp/>IS&apos;&apos;<sp/>AND<sp/>ANY<sp/>EXPRESS<sp/>OR<sp/>IMPLIED</highlight></codeline>
<codeline lineno="32"><highlight class="comment"><sp/>*<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF</highlight></codeline>
<codeline lineno="33"><highlight class="comment"><sp/>*<sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT</highlight></codeline>
<codeline lineno="34"><highlight class="comment"><sp/>*<sp/>SHALL<sp/>THE<sp/>AUTHOR<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,<sp/>SPECIAL,</highlight></codeline>
<codeline lineno="35"><highlight class="comment"><sp/>*<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT</highlight></codeline>
<codeline lineno="36"><highlight class="comment"><sp/>*<sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS</highlight></codeline>
<codeline lineno="37"><highlight class="comment"><sp/>*<sp/>INTERRUPTION)<sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN</highlight></codeline>
<codeline lineno="38"><highlight class="comment"><sp/>*<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR<sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING</highlight></codeline>
<codeline lineno="39"><highlight class="comment"><sp/>*<sp/>IN<sp/>ANY<sp/>WAY<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</highlight></codeline>
<codeline lineno="40"><highlight class="comment"><sp/>*<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="41"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="42"><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="43"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="44"><highlight class="comment"><sp/>*<sp/>Author:<sp/>Adam<sp/>Dunkels<sp/>&lt;adam@sics.se&gt;</highlight></codeline>
<codeline lineno="45"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="46"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="opt_8h" kindref="compound">net/opt.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="inet__chksum_8h" kindref="compound">net/inet_chksum.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="def_8h" kindref="compound">net/def.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;<ref refid="ip__addr_8h" kindref="compound">net/ip_addr.h</ref>&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="string_8h" kindref="compound">string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight><highlight class="preprocessor">#ifndef<sp/>LWIP_CHKSUM</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57" refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#<sp/>define<sp/>LWIP_CHKSUM<sp/>lwip_standard_chksum</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"></highlight><highlight class="preprocessor">#<sp/>ifndef<sp/>LWIP_CHKSUM_ALGORITHM</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59" refid="inet__chksum_8c_1aa0865f14286191bd72fc1a9d9cbe25d4" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#<sp/><sp/>define<sp/>LWIP_CHKSUM_ALGORITHM<sp/>2</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight><highlight class="preprocessor">#<sp/>endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/><ref refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" kindref="member">lwip_standard_chksum</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dataptr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len);</highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>If<sp/>none<sp/>set:<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"></highlight><highlight class="preprocessor">#ifndef<sp/>LWIP_CHKSUM_ALGORITHM</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight><highlight class="preprocessor">#<sp/>define<sp/>LWIP_CHKSUM_ALGORITHM<sp/>0</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="66"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>(LWIP_CHKSUM_ALGORITHM<sp/>==<sp/>1)<sp/></highlight><highlight class="comment">/*<sp/>Version<sp/>#1<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="69"><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="80"><highlight class="normal"><ref refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" kindref="member">lwip_standard_chksum</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dataptr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len)</highlight></codeline>
<codeline lineno="81"><highlight class="normal">{</highlight></codeline>
<codeline lineno="82"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>src;</highlight></codeline>
<codeline lineno="84"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*octetptr;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"></highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>dataptr<sp/>may<sp/>be<sp/>at<sp/>odd<sp/>or<sp/>even<sp/>addresses<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/>octetptr<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref>*)dataptr;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>declare<sp/>first<sp/>octet<sp/>as<sp/>most<sp/>significant</highlight></codeline>
<codeline lineno="91"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>thus<sp/>assume<sp/>network<sp/>order,<sp/>ignoring<sp/>host<sp/>order<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/>src<sp/>=<sp/>(*octetptr)<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/>octetptr++;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>declare<sp/>second<sp/>octet<sp/>as<sp/>least<sp/>significant<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"><sp/><sp/><sp/><sp/>src<sp/>|=<sp/>(*octetptr);</highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/>octetptr++;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>src;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/>len<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="99"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>accumulate<sp/>remaining<sp/>octet<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/>src<sp/>=<sp/>(*octetptr)<sp/>&lt;&lt;<sp/>8;</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>src;</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>add<sp/>deferred<sp/>carry<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="106"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/>(acc<sp/>&gt;&gt;<sp/>16)<sp/>+<sp/>(acc<sp/>&amp;<sp/>0x0000ffffUL);</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((acc<sp/>&amp;<sp/>0xffff0000UL)<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="108"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/>(acc<sp/>&gt;&gt;<sp/>16)<sp/>+<sp/>(acc<sp/>&amp;<sp/>0x0000ffffUL);</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>This<sp/>maybe<sp/>a<sp/>little<sp/>confusing:<sp/>reorder<sp/>sum<sp/>using<sp/>lwip_htons()</highlight></codeline>
<codeline lineno="111"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>instead<sp/>of<sp/>lwip_ntohs()<sp/>since<sp/>it<sp/>has<sp/>a<sp/>little<sp/>less<sp/>call<sp/>overhead.</highlight></codeline>
<codeline lineno="112"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>The<sp/>caller<sp/>must<sp/>invert<sp/>bits<sp/>for<sp/>Internet<sp/>sum<sp/>!<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="def_8c_1ad637280639de4066392e6b5614fa3e56" kindref="member">lwip_htons</ref>((<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)acc);</highlight></codeline>
<codeline lineno="114"><highlight class="normal">}</highlight></codeline>
<codeline lineno="115"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight></codeline>
<codeline lineno="117"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>(LWIP_CHKSUM_ALGORITHM<sp/>==<sp/>2)<sp/></highlight><highlight class="comment">/*<sp/>Alternative<sp/>version<sp/>#2<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="118"><highlight class="normal"></highlight><highlight class="comment">/*</highlight></codeline>
<codeline lineno="119"><highlight class="comment"><sp/>*<sp/>Curt<sp/>McDowell</highlight></codeline>
<codeline lineno="120"><highlight class="comment"><sp/>*<sp/>Broadcom<sp/>Corp.</highlight></codeline>
<codeline lineno="121"><highlight class="comment"><sp/>*<sp/>csm@broadcom.com</highlight></codeline>
<codeline lineno="122"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="123"><highlight class="comment"><sp/>*<sp/>IP<sp/>checksum<sp/>two<sp/>bytes<sp/>at<sp/>a<sp/>time<sp/>with<sp/>support<sp/>for</highlight></codeline>
<codeline lineno="124"><highlight class="comment"><sp/>*<sp/>unaligned<sp/>buffer.</highlight></codeline>
<codeline lineno="125"><highlight class="comment"><sp/>*<sp/>Works<sp/>for<sp/>len<sp/>up<sp/>to<sp/>and<sp/>including<sp/>0x20000.</highlight></codeline>
<codeline lineno="126"><highlight class="comment"><sp/>*<sp/>by<sp/>Curt<sp/>McDowell,<sp/>Broadcom<sp/>Corp.<sp/>12/08/2005</highlight></codeline>
<codeline lineno="127"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="128"><highlight class="comment"><sp/>*<sp/>@param<sp/>dataptr<sp/>points<sp/>to<sp/>start<sp/>of<sp/>data<sp/>to<sp/>be<sp/>summed<sp/>at<sp/>any<sp/>boundary</highlight></codeline>
<codeline lineno="129"><highlight class="comment"><sp/>*<sp/>@param<sp/>len<sp/>length<sp/>of<sp/>data<sp/>to<sp/>be<sp/>summed</highlight></codeline>
<codeline lineno="130"><highlight class="comment"><sp/>*<sp/>@return<sp/>host<sp/>order<sp/>(!)<sp/>lwip<sp/>checksum<sp/>(non-inverted<sp/>Internet<sp/>sum)</highlight></codeline>
<codeline lineno="131"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="132"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="133" refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" refkind="member"><highlight class="normal"><ref refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" kindref="member">lwip_standard_chksum</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dataptr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len)</highlight></codeline>
<codeline lineno="134"><highlight class="normal">{</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*pb<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)dataptr;</highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>*ps;</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>t<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>sum<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>odd<sp/>=<sp/>((<ref refid="group__compiler__abstraction_1gaf019cbb71af10dcfda7758b21e655307" kindref="member">mem_ptr_t</ref>)pb<sp/>&amp;<sp/>1);</highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Get<sp/>aligned<sp/>to<sp/>u16_t<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(odd<sp/>&amp;&amp;<sp/>len<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/>((<ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)&amp;t)[1]<sp/>=<sp/>*pb++;</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/>len--;</highlight></codeline>
<codeline lineno="145"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="146"><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Add<sp/>the<sp/>bulk<sp/>of<sp/>the<sp/>data<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/>ps<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>*)(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)pb;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>+=<sp/>*ps++;</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/>len<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="153"><highlight class="normal"></highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Consume<sp/>left-over<sp/>byte,<sp/>if<sp/>any<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/>((<ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)&amp;t)[0]<sp/>=<sp/>*(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)ps;</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="158"><highlight class="normal"></highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Add<sp/>end<sp/>bytes<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/>sum<sp/>+=<sp/>t;</highlight></codeline>
<codeline lineno="161"><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Fold<sp/>32-bit<sp/>sum<sp/>to<sp/>16<sp/>bits</highlight></codeline>
<codeline lineno="163"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>calling<sp/>this<sp/>twice<sp/>is<sp/>probably<sp/>faster<sp/>than<sp/>if<sp/>statements...<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(sum);</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(sum);</highlight></codeline>
<codeline lineno="166"><highlight class="normal"></highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Swap<sp/>if<sp/>alignment<sp/>was<sp/>odd<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(odd)<sp/>{</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(sum);</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="171"><highlight class="normal"></highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)sum;</highlight></codeline>
<codeline lineno="173"><highlight class="normal">}</highlight></codeline>
<codeline lineno="174"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="175"><highlight class="normal"></highlight></codeline>
<codeline lineno="176"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>(LWIP_CHKSUM_ALGORITHM<sp/>==<sp/>3)<sp/></highlight><highlight class="comment">/*<sp/>Alternative<sp/>version<sp/>#3<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="177"><highlight class="normal"></highlight></codeline>
<codeline lineno="188"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><ref refid="inet__chksum_8c_1a4c8d40559878aa9bf6bfce8d8ab8a72b" kindref="member">lwip_standard_chksum</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dataptr,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>len)</highlight></codeline>
<codeline lineno="190"><highlight class="normal">{</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*pb<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)dataptr;</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>*ps;</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>t<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>*pl;</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>sum<sp/>=<sp/>0,<sp/>tmp;</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>starts<sp/>at<sp/>odd<sp/>byte<sp/>address?<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>odd<sp/>=<sp/>((<ref refid="group__compiler__abstraction_1gaf019cbb71af10dcfda7758b21e655307" kindref="member">mem_ptr_t</ref>)pb<sp/>&amp;<sp/>1);</highlight></codeline>
<codeline lineno="198"><highlight class="normal"></highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(odd<sp/>&amp;&amp;<sp/>len<sp/>&gt;<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/>((<ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)&amp;t)[1]<sp/>=<sp/>*pb++;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/>len--;</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="203"><highlight class="normal"></highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/>ps<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>*)(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)pb;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"></highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(((<ref refid="group__compiler__abstraction_1gaf019cbb71af10dcfda7758b21e655307" kindref="member">mem_ptr_t</ref>)ps<sp/>&amp;<sp/>3)<sp/>&amp;&amp;<sp/>len<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>+=<sp/>*ps++;</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/>len<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/>pl<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>*)(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)ps;</highlight></codeline>
<codeline lineno="212"><highlight class="normal"></highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>7)<sp/><sp/>{</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/><sp/><sp/>tmp<sp/>=<sp/>sum<sp/>+<sp/>*pl++;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>ping<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(tmp<sp/>&lt;<sp/>sum)<sp/>{</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>tmp++;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>add<sp/>back<sp/>carry<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="218"><highlight class="normal"></highlight></codeline>
<codeline lineno="219"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>=<sp/>tmp<sp/>+<sp/>*pl++;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>pong<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(sum<sp/>&lt;<sp/>tmp)<sp/>{</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>sum++;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>add<sp/>back<sp/>carry<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="223"><highlight class="normal"></highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/>len<sp/>-=<sp/>8;</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="226"><highlight class="normal"></highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>make<sp/>room<sp/>in<sp/>upper<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(sum);</highlight></codeline>
<codeline lineno="229"><highlight class="normal"></highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/>ps<sp/>=<sp/>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>*)pl;</highlight></codeline>
<codeline lineno="231"><highlight class="normal"></highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>16-bit<sp/>aligned<sp/>word<sp/>remaining?<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>1)<sp/>{</highlight></codeline>
<codeline lineno="234"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>+=<sp/>*ps++;</highlight></codeline>
<codeline lineno="235"><highlight class="normal"><sp/><sp/><sp/><sp/>len<sp/>-=<sp/>2;</highlight></codeline>
<codeline lineno="236"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="237"><highlight class="normal"></highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>dangling<sp/>tail<sp/>byte<sp/>remaining?<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(len<sp/>&gt;<sp/>0)<sp/>{<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>include<sp/>odd<sp/>byte<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/>((<ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)&amp;t)[0]<sp/>=<sp/>*(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>*)ps;</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="242"><highlight class="normal"></highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/>sum<sp/>+=<sp/>t;<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>add<sp/>end<sp/>bytes<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="244"><highlight class="normal"></highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Fold<sp/>32-bit<sp/>sum<sp/>to<sp/>16<sp/>bits</highlight></codeline>
<codeline lineno="246"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>calling<sp/>this<sp/>twice<sp/>is<sp/>probably<sp/>faster<sp/>than<sp/>if<sp/>statements...<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(sum);</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(sum);</highlight></codeline>
<codeline lineno="249"><highlight class="normal"></highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(odd)<sp/>{</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/>sum<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(sum);</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="253"><highlight class="normal"></highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)sum;</highlight></codeline>
<codeline lineno="255"><highlight class="normal">}</highlight></codeline>
<codeline lineno="256"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="257"><highlight class="normal"></highlight></codeline>
<codeline lineno="259"><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="260"><highlight class="normal">inet_cksum_pseudo_base(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,<sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc)</highlight></codeline>
<codeline lineno="261"><highlight class="normal">{</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*q;</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>swapped<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="264"><highlight class="normal"></highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>iterate<sp/>through<sp/>all<sp/>pbuf<sp/>in<sp/>chain<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="266"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(q<sp/>=<sp/>p;<sp/>q<sp/>!=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;<sp/>q<sp/>=<sp/>q-&gt;<ref refid="structpbuf_1a5e5763c94fd18d78937b0b58ce7df341" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="267"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="debug_8h_1a63a04edf7ff63c951bd8706711956cdb" kindref="member">LWIP_DEBUGF</ref>(<ref refid="lwipopts_8h_1a78140cbe70258a65cb5c9e381843e4f3" kindref="member">INET_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;inet_chksum_pseudo():<sp/>checksumming<sp/>pbuf<sp/>%p<sp/>(has<sp/>next<sp/>%p)<sp/>\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)q,<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)q-&gt;next));</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/><ref refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" kindref="member">LWIP_CHKSUM</ref>(q-&gt;payload,<sp/>q-&gt;len);</highlight></codeline>
<codeline lineno="270"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*LWIP_DEBUGF(INET_DEBUG,<sp/>(&quot;inet_chksum_pseudo():<sp/>unwrapped<sp/>lwip_chksum()=%&quot;X32_F&quot;<sp/>\n&quot;,<sp/>acc));*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>just<sp/>executing<sp/>this<sp/>next<sp/>line<sp/>is<sp/>probably<sp/>faster<sp/>that<sp/>the<sp/>if<sp/>statement<sp/>needed</highlight></codeline>
<codeline lineno="272"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/><sp/>to<sp/>check<sp/>whether<sp/>we<sp/>really<sp/>need<sp/>to<sp/>execute<sp/>it,<sp/>and<sp/>does<sp/>no<sp/>harm<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(q-&gt;len<sp/>%<sp/>2<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>swapped<sp/>=<sp/>1<sp/>-<sp/>swapped;</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*LWIP_DEBUGF(INET_DEBUG,<sp/>(&quot;inet_chksum_pseudo():<sp/>wrapped<sp/>lwip_chksum()=%&quot;X32_F&quot;<sp/>\n&quot;,<sp/>acc));*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="280"><highlight class="normal"></highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(swapped)<sp/>{</highlight></codeline>
<codeline lineno="282"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="284"><highlight class="normal"></highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(<ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref>)<ref refid="def_8c_1ad637280639de4066392e6b5614fa3e56" kindref="member">lwip_htons</ref>((<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)proto);</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(<ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref>)<ref refid="def_8c_1ad637280639de4066392e6b5614fa3e56" kindref="member">lwip_htons</ref>(proto_len);</highlight></codeline>
<codeline lineno="287"><highlight class="normal"></highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Fold<sp/>32-bit<sp/>sum<sp/>to<sp/>16<sp/>bits</highlight></codeline>
<codeline lineno="289"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>calling<sp/>this<sp/>twice<sp/>is<sp/>probably<sp/>faster<sp/>than<sp/>if<sp/>statements...<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="290"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="291"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/><ref refid="debug_8h_1a63a04edf7ff63c951bd8706711956cdb" kindref="member">LWIP_DEBUGF</ref>(<ref refid="lwipopts_8h_1a78140cbe70258a65cb5c9e381843e4f3" kindref="member">INET_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;inet_chksum_pseudo():<sp/>pbuf<sp/>chain<sp/>lwip_chksum()=%&quot;</highlight><highlight class="normal"><ref refid="group__compiler__abstraction_1gac219830a93d05c5f18f64ce87a34be14" kindref="member">X32_F</ref></highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">,<sp/>acc));</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)~(acc<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="294"><highlight class="normal">}</highlight></codeline>
<codeline lineno="295"><highlight class="normal"></highlight></codeline>
<codeline lineno="296"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="297"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>inet_chksum_pseudo:</highlight></codeline>
<codeline lineno="298"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="299"><highlight class="comment"><sp/>*<sp/>Calculates<sp/>the<sp/>IPv4<sp/>pseudo<sp/>Internet<sp/>checksum<sp/>used<sp/>by<sp/>TCP<sp/>and<sp/>UDP<sp/>for<sp/>a<sp/>pbuf<sp/>chain.</highlight></codeline>
<codeline lineno="300"><highlight class="comment"><sp/>*<sp/>IP<sp/>addresses<sp/>are<sp/>expected<sp/>to<sp/>be<sp/>in<sp/>network<sp/>byte<sp/>order.</highlight></codeline>
<codeline lineno="301"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="302"><highlight class="comment"><sp/>*<sp/>@param<sp/>p<sp/>chain<sp/>of<sp/>pbufs<sp/>over<sp/>that<sp/>a<sp/>checksum<sp/>should<sp/>be<sp/>calculated<sp/>(ip<sp/>data<sp/>part)</highlight></codeline>
<codeline lineno="303"><highlight class="comment"><sp/>*<sp/>@param<sp/>src<sp/>source<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="304"><highlight class="comment"><sp/>*<sp/>@param<sp/>dst<sp/>destination<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="305"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto<sp/>ip<sp/>protocol<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="306"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto_len<sp/>length<sp/>of<sp/>the<sp/>ip<sp/>data<sp/>part<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="307"><highlight class="comment"><sp/>*<sp/>@return<sp/>checksum<sp/>(as<sp/>u16_t)<sp/>to<sp/>be<sp/>saved<sp/>directly<sp/>in<sp/>the<sp/>protocol<sp/>header</highlight></codeline>
<codeline lineno="308"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="309"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="310"><highlight class="normal">inet_chksum_pseudo(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*dest)</highlight></codeline>
<codeline lineno="312"><highlight class="normal">{</highlight></codeline>
<codeline lineno="313"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc;</highlight></codeline>
<codeline lineno="314"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>addr;</highlight></codeline>
<codeline lineno="315"><highlight class="normal"></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/>addr<sp/>=<sp/>ip4_addr_get_u32(src);</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/>addr<sp/>=<sp/>ip4_addr_get_u32(dest);</highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>fold<sp/>down<sp/>to<sp/>16<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="325"><highlight class="normal"></highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_cksum_pseudo_base(p,<sp/>proto,<sp/>proto_len,<sp/>acc);</highlight></codeline>
<codeline lineno="327"><highlight class="normal">}</highlight></codeline>
<codeline lineno="328"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="329"><highlight class="normal"></highlight></codeline>
<codeline lineno="330"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="331"><highlight class="normal"></highlight></codeline>
<codeline lineno="342"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="343"><highlight class="normal">ip6_chksum_pseudo(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="344"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip6_addr_t<sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip6_addr_t<sp/>*dest)</highlight></codeline>
<codeline lineno="345"><highlight class="normal">{</highlight></codeline>
<codeline lineno="346"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="347"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>addr;</highlight></codeline>
<codeline lineno="348"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>addr_part;</highlight></codeline>
<codeline lineno="349"><highlight class="normal"></highlight></codeline>
<codeline lineno="350"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(addr_part<sp/>=<sp/>0;<sp/>addr_part<sp/>&lt;<sp/>4;<sp/>addr_part++)<sp/>{</highlight></codeline>
<codeline lineno="351"><highlight class="normal"><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>src-&gt;addr[addr_part];</highlight></codeline>
<codeline lineno="352"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="353"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="354"><highlight class="normal"><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>dest-&gt;addr[addr_part];</highlight></codeline>
<codeline lineno="355"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="356"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="357"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="358"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>fold<sp/>down<sp/>to<sp/>16<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="359"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="360"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="361"><highlight class="normal"></highlight></codeline>
<codeline lineno="362"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_cksum_pseudo_base(p,<sp/>proto,<sp/>proto_len,<sp/>acc);</highlight></codeline>
<codeline lineno="363"><highlight class="normal">}</highlight></codeline>
<codeline lineno="364"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="365"><highlight class="normal"></highlight></codeline>
<codeline lineno="366"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>ip_chksum_pseudo:</highlight></codeline>
<codeline lineno="367"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="368"><highlight class="comment"><sp/>*<sp/>Calculates<sp/>the<sp/>IPv4<sp/>or<sp/>IPv6<sp/>pseudo<sp/>Internet<sp/>checksum<sp/>used<sp/>by<sp/>TCP<sp/>and<sp/>UDP<sp/>for<sp/>a<sp/>pbuf<sp/>chain.</highlight></codeline>
<codeline lineno="369"><highlight class="comment"><sp/>*<sp/>IP<sp/>addresses<sp/>are<sp/>expected<sp/>to<sp/>be<sp/>in<sp/>network<sp/>byte<sp/>order.</highlight></codeline>
<codeline lineno="370"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="371"><highlight class="comment"><sp/>*<sp/>@param<sp/>p<sp/>chain<sp/>of<sp/>pbufs<sp/>over<sp/>that<sp/>a<sp/>checksum<sp/>should<sp/>be<sp/>calculated<sp/>(ip<sp/>data<sp/>part)</highlight></codeline>
<codeline lineno="372"><highlight class="comment"><sp/>*<sp/>@param<sp/>src<sp/>source<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="373"><highlight class="comment"><sp/>*<sp/>@param<sp/>dst<sp/>destination<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="374"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto<sp/>ip<sp/>protocol<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="375"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto_len<sp/>length<sp/>of<sp/>the<sp/>ip<sp/>data<sp/>part<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="376"><highlight class="comment"><sp/>*<sp/>@return<sp/>checksum<sp/>(as<sp/>u16_t)<sp/>to<sp/>be<sp/>saved<sp/>directly<sp/>in<sp/>the<sp/>protocol<sp/>header</highlight></codeline>
<codeline lineno="377"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="378"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="379" refid="inet__chksum_8c_1aa13cda42e7c262f5dee243ff6c28422f" refkind="member"><highlight class="normal"><ref refid="inet__chksum_8c_1aa13cda42e7c262f5dee243ff6c28422f" kindref="member">ip_chksum_pseudo</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="380"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref><sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref><sp/>*dest)</highlight></codeline>
<codeline lineno="381"><highlight class="normal">{</highlight></codeline>
<codeline lineno="382"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="383"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ip__addr_8h_1a9bac7e938757f1d24df2404e8b57cb7d" kindref="member">IP_IS_V6</ref>(dest))<sp/>{</highlight></codeline>
<codeline lineno="384"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ip6_chksum_pseudo(p,<sp/>proto,<sp/>proto_len,<sp/><ref refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" kindref="member">ip_2_ip6</ref>(src),<sp/><ref refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" kindref="member">ip_2_ip6</ref>(dest));</highlight></codeline>
<codeline lineno="385"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="386"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="387"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4<sp/>&amp;&amp;<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="388"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="389"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>&amp;&amp;<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="390"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="391"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="392"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_chksum_pseudo(p,<sp/>proto,<sp/>proto_len,<sp/>ip_2_ip4(src),<sp/>ip_2_ip4(dest));</highlight></codeline>
<codeline lineno="393"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="394"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="395"><highlight class="normal">}</highlight></codeline>
<codeline lineno="396"><highlight class="normal"></highlight></codeline>
<codeline lineno="398"><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="399"><highlight class="normal">inet_cksum_pseudo_partial_base(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="400"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>chksum_len,<sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc)</highlight></codeline>
<codeline lineno="401"><highlight class="normal">{</highlight></codeline>
<codeline lineno="402"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*q;</highlight></codeline>
<codeline lineno="403"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>swapped<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="404"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>chklen;</highlight></codeline>
<codeline lineno="405"><highlight class="normal"></highlight></codeline>
<codeline lineno="406"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>iterate<sp/>through<sp/>all<sp/>pbuf<sp/>in<sp/>chain<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="407"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(q<sp/>=<sp/>p;<sp/>(q<sp/>!=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>&amp;&amp;<sp/>(chksum_len<sp/>&gt;<sp/>0);<sp/>q<sp/>=<sp/>q-&gt;<ref refid="structpbuf_1a5e5763c94fd18d78937b0b58ce7df341" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="408"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="debug_8h_1a63a04edf7ff63c951bd8706711956cdb" kindref="member">LWIP_DEBUGF</ref>(<ref refid="lwipopts_8h_1a78140cbe70258a65cb5c9e381843e4f3" kindref="member">INET_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;inet_chksum_pseudo():<sp/>checksumming<sp/>pbuf<sp/>%p<sp/>(has<sp/>next<sp/>%p)<sp/>\n&quot;</highlight><highlight class="normal">,</highlight></codeline>
<codeline lineno="409"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)q,<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)q-&gt;next));</highlight></codeline>
<codeline lineno="410"><highlight class="normal"><sp/><sp/><sp/><sp/>chklen<sp/>=<sp/>q-&gt;len;</highlight></codeline>
<codeline lineno="411"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(chklen<sp/>&gt;<sp/>chksum_len)<sp/>{</highlight></codeline>
<codeline lineno="412"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>chklen<sp/>=<sp/>chksum_len;</highlight></codeline>
<codeline lineno="413"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="414"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/><ref refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" kindref="member">LWIP_CHKSUM</ref>(q-&gt;payload,<sp/>chklen);</highlight></codeline>
<codeline lineno="415"><highlight class="normal"><sp/><sp/><sp/><sp/>chksum_len<sp/>-=<sp/>chklen;</highlight></codeline>
<codeline lineno="416"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="debug_8h_1a94ad086267808462beae2b38f91996ed" kindref="member">LWIP_ASSERT</ref>(</highlight><highlight class="stringliteral">&quot;delete<sp/>me&quot;</highlight><highlight class="normal">,<sp/>chksum_len<sp/>&lt;<sp/>0x7fff);</highlight></codeline>
<codeline lineno="417"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*LWIP_DEBUGF(INET_DEBUG,<sp/>(&quot;inet_chksum_pseudo():<sp/>unwrapped<sp/>lwip_chksum()=%&quot;X32_F&quot;<sp/>\n&quot;,<sp/>acc));*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="418"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>fold<sp/>the<sp/>upper<sp/>bit<sp/>down<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="419"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="420"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(q-&gt;len<sp/>%<sp/>2<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="421"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>swapped<sp/>=<sp/>1<sp/>-<sp/>swapped;</highlight></codeline>
<codeline lineno="422"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="423"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="424"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*LWIP_DEBUGF(INET_DEBUG,<sp/>(&quot;inet_chksum_pseudo():<sp/>wrapped<sp/>lwip_chksum()=%&quot;X32_F&quot;<sp/>\n&quot;,<sp/>acc));*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="425"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="426"><highlight class="normal"></highlight></codeline>
<codeline lineno="427"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(swapped)<sp/>{</highlight></codeline>
<codeline lineno="428"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="429"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="430"><highlight class="normal"></highlight></codeline>
<codeline lineno="431"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(<ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref>)<ref refid="def_8c_1ad637280639de4066392e6b5614fa3e56" kindref="member">lwip_htons</ref>((<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)proto);</highlight></codeline>
<codeline lineno="432"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(<ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref>)<ref refid="def_8c_1ad637280639de4066392e6b5614fa3e56" kindref="member">lwip_htons</ref>(proto_len);</highlight></codeline>
<codeline lineno="433"><highlight class="normal"></highlight></codeline>
<codeline lineno="434"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Fold<sp/>32-bit<sp/>sum<sp/>to<sp/>16<sp/>bits</highlight></codeline>
<codeline lineno="435"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/>calling<sp/>this<sp/>twice<sp/>is<sp/>probably<sp/>faster<sp/>than<sp/>if<sp/>statements...<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="436"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="437"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="438"><highlight class="normal"><sp/><sp/><ref refid="debug_8h_1a63a04edf7ff63c951bd8706711956cdb" kindref="member">LWIP_DEBUGF</ref>(<ref refid="lwipopts_8h_1a78140cbe70258a65cb5c9e381843e4f3" kindref="member">INET_DEBUG</ref>,<sp/>(</highlight><highlight class="stringliteral">&quot;inet_chksum_pseudo():<sp/>pbuf<sp/>chain<sp/>lwip_chksum()=%&quot;</highlight><highlight class="normal"><ref refid="group__compiler__abstraction_1gac219830a93d05c5f18f64ce87a34be14" kindref="member">X32_F</ref></highlight><highlight class="stringliteral">&quot;\n&quot;</highlight><highlight class="normal">,<sp/>acc));</highlight></codeline>
<codeline lineno="439"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)~(acc<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="440"><highlight class="normal">}</highlight></codeline>
<codeline lineno="441"><highlight class="normal"></highlight></codeline>
<codeline lineno="442"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="443"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>inet_chksum_pseudo_partial:</highlight></codeline>
<codeline lineno="444"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="445"><highlight class="comment"><sp/>*<sp/>Calculates<sp/>the<sp/>IPv4<sp/>pseudo<sp/>Internet<sp/>checksum<sp/>used<sp/>by<sp/>TCP<sp/>and<sp/>UDP<sp/>for<sp/>a<sp/>pbuf<sp/>chain.</highlight></codeline>
<codeline lineno="446"><highlight class="comment"><sp/>*<sp/>IP<sp/>addresses<sp/>are<sp/>expected<sp/>to<sp/>be<sp/>in<sp/>network<sp/>byte<sp/>order.</highlight></codeline>
<codeline lineno="447"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="448"><highlight class="comment"><sp/>*<sp/>@param<sp/>p<sp/>chain<sp/>of<sp/>pbufs<sp/>over<sp/>that<sp/>a<sp/>checksum<sp/>should<sp/>be<sp/>calculated<sp/>(ip<sp/>data<sp/>part)</highlight></codeline>
<codeline lineno="449"><highlight class="comment"><sp/>*<sp/>@param<sp/>src<sp/>source<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="450"><highlight class="comment"><sp/>*<sp/>@param<sp/>dst<sp/>destination<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="451"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto<sp/>ip<sp/>protocol<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="452"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto_len<sp/>length<sp/>of<sp/>the<sp/>ip<sp/>data<sp/>part<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="453"><highlight class="comment"><sp/>*<sp/>@return<sp/>checksum<sp/>(as<sp/>u16_t)<sp/>to<sp/>be<sp/>saved<sp/>directly<sp/>in<sp/>the<sp/>protocol<sp/>header</highlight></codeline>
<codeline lineno="454"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="455"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="456"><highlight class="normal">inet_chksum_pseudo_partial(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="457"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>chksum_len,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*dest)</highlight></codeline>
<codeline lineno="458"><highlight class="normal">{</highlight></codeline>
<codeline lineno="459"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc;</highlight></codeline>
<codeline lineno="460"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>addr;</highlight></codeline>
<codeline lineno="461"><highlight class="normal"></highlight></codeline>
<codeline lineno="462"><highlight class="normal"><sp/><sp/>addr<sp/>=<sp/>ip4_addr_get_u32(src);</highlight></codeline>
<codeline lineno="463"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="464"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="465"><highlight class="normal"><sp/><sp/>addr<sp/>=<sp/>ip4_addr_get_u32(dest);</highlight></codeline>
<codeline lineno="466"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="467"><highlight class="normal"><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="468"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>fold<sp/>down<sp/>to<sp/>16<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="469"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="470"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="471"><highlight class="normal"></highlight></codeline>
<codeline lineno="472"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_cksum_pseudo_partial_base(p,<sp/>proto,<sp/>proto_len,<sp/>chksum_len,<sp/>acc);</highlight></codeline>
<codeline lineno="473"><highlight class="normal">}</highlight></codeline>
<codeline lineno="474"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="475"><highlight class="normal"></highlight></codeline>
<codeline lineno="476"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="477"><highlight class="normal"></highlight></codeline>
<codeline lineno="490"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="491"><highlight class="normal">ip6_chksum_pseudo_partial(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="492"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>chksum_len,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip6_addr_t<sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip6_addr_t<sp/>*dest)</highlight></codeline>
<codeline lineno="493"><highlight class="normal">{</highlight></codeline>
<codeline lineno="494"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="495"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>addr;</highlight></codeline>
<codeline lineno="496"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>addr_part;</highlight></codeline>
<codeline lineno="497"><highlight class="normal"></highlight></codeline>
<codeline lineno="498"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(addr_part<sp/>=<sp/>0;<sp/>addr_part<sp/>&lt;<sp/>4;<sp/>addr_part++)<sp/>{</highlight></codeline>
<codeline lineno="499"><highlight class="normal"><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>src-&gt;addr[addr_part];</highlight></codeline>
<codeline lineno="500"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="501"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="502"><highlight class="normal"><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>dest-&gt;addr[addr_part];</highlight></codeline>
<codeline lineno="503"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>(addr<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="504"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/>((addr<sp/>&gt;&gt;<sp/>16)<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="505"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="506"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>fold<sp/>down<sp/>to<sp/>16<sp/>bits<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="507"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="508"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="509"><highlight class="normal"></highlight></codeline>
<codeline lineno="510"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_cksum_pseudo_partial_base(p,<sp/>proto,<sp/>proto_len,<sp/>chksum_len,<sp/>acc);</highlight></codeline>
<codeline lineno="511"><highlight class="normal">}</highlight></codeline>
<codeline lineno="512"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="513"><highlight class="normal"></highlight></codeline>
<codeline lineno="514"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>ip_chksum_pseudo_partial:</highlight></codeline>
<codeline lineno="515"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="516"><highlight class="comment"><sp/>*<sp/>Calculates<sp/>the<sp/>IPv4<sp/>or<sp/>IPv6<sp/>pseudo<sp/>Internet<sp/>checksum<sp/>used<sp/>by<sp/>TCP<sp/>and<sp/>UDP<sp/>for<sp/>a<sp/>pbuf<sp/>chain.</highlight></codeline>
<codeline lineno="517"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="518"><highlight class="comment"><sp/>*<sp/>@param<sp/>p<sp/>chain<sp/>of<sp/>pbufs<sp/>over<sp/>that<sp/>a<sp/>checksum<sp/>should<sp/>be<sp/>calculated<sp/>(ip<sp/>data<sp/>part)</highlight></codeline>
<codeline lineno="519"><highlight class="comment"><sp/>*<sp/>@param<sp/>src<sp/>source<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="520"><highlight class="comment"><sp/>*<sp/>@param<sp/>dst<sp/>destination<sp/>ip<sp/>address<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="521"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto<sp/>ip<sp/>protocol<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="522"><highlight class="comment"><sp/>*<sp/>@param<sp/>proto_len<sp/>length<sp/>of<sp/>the<sp/>ip<sp/>data<sp/>part<sp/>(used<sp/>for<sp/>checksum<sp/>of<sp/>pseudo<sp/>header)</highlight></codeline>
<codeline lineno="523"><highlight class="comment"><sp/>*<sp/>@return<sp/>checksum<sp/>(as<sp/>u16_t)<sp/>to<sp/>be<sp/>saved<sp/>directly<sp/>in<sp/>the<sp/>protocol<sp/>header</highlight></codeline>
<codeline lineno="524"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="525"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="526" refid="inet__chksum_8c_1acfe7ab6c63ef998210c66bb4822b03b2" refkind="member"><highlight class="normal"><ref refid="inet__chksum_8c_1acfe7ab6c63ef998210c66bb4822b03b2" kindref="member">ip_chksum_pseudo_partial</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p,<sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>proto,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>proto_len,</highlight></codeline>
<codeline lineno="527"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/>chksum_len,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref><sp/>*src,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="ip__addr_8h_1a88b43639738c4de2d3cd22e3a1fd7696" kindref="member">ip_addr_t</ref><sp/>*dest)</highlight></codeline>
<codeline lineno="528"><highlight class="normal">{</highlight></codeline>
<codeline lineno="529"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="530"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ip__addr_8h_1a9bac7e938757f1d24df2404e8b57cb7d" kindref="member">IP_IS_V6</ref>(dest))<sp/>{</highlight></codeline>
<codeline lineno="531"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>ip6_chksum_pseudo_partial(p,<sp/>proto,<sp/>proto_len,<sp/>chksum_len,<sp/><ref refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" kindref="member">ip_2_ip6</ref>(src),<sp/><ref refid="ip__addr_8h_1a06e75bcd198012b5ba39480c233608bd" kindref="member">ip_2_ip6</ref>(dest));</highlight></codeline>
<codeline lineno="532"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="533"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="534"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4<sp/>&amp;&amp;<sp/>LWIP_IPV6</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="535"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="536"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>&amp;&amp;<sp/>LWIP_IPV6<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="537"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="538"><highlight class="normal"><sp/><sp/>{</highlight></codeline>
<codeline lineno="539"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>inet_chksum_pseudo_partial(p,<sp/>proto,<sp/>proto_len,<sp/>chksum_len,<sp/>ip_2_ip4(src),<sp/>ip_2_ip4(dest));</highlight></codeline>
<codeline lineno="540"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="541"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="542"><highlight class="normal">}</highlight></codeline>
<codeline lineno="543"><highlight class="normal"></highlight></codeline>
<codeline lineno="544"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>inet_chksum:</highlight></codeline>
<codeline lineno="545"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="546"><highlight class="comment"><sp/>*<sp/>Calculates<sp/>the<sp/>Internet<sp/>checksum<sp/>over<sp/>a<sp/>portion<sp/>of<sp/>memory.<sp/>Used<sp/>primarily<sp/>for<sp/>IP</highlight></codeline>
<codeline lineno="547"><highlight class="comment"><sp/>*<sp/>and<sp/>ICMP.</highlight></codeline>
<codeline lineno="548"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="549"><highlight class="comment"><sp/>*<sp/>@param<sp/>dataptr<sp/>start<sp/>of<sp/>the<sp/>buffer<sp/>to<sp/>calculate<sp/>the<sp/>checksum<sp/>(no<sp/>alignment<sp/>needed)</highlight></codeline>
<codeline lineno="550"><highlight class="comment"><sp/>*<sp/>@param<sp/>len<sp/>length<sp/>of<sp/>the<sp/>buffer<sp/>to<sp/>calculate<sp/>the<sp/>checksum</highlight></codeline>
<codeline lineno="551"><highlight class="comment"><sp/>*<sp/>@return<sp/>checksum<sp/>(as<sp/>u16_t)<sp/>to<sp/>be<sp/>saved<sp/>directly<sp/>in<sp/>the<sp/>protocol<sp/>header</highlight></codeline>
<codeline lineno="552"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="553"><highlight class="normal"></highlight></codeline>
<codeline lineno="554"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="555" refid="inet__chksum_8c_1a34f1aa1587562a09e11b704b51bab043" refkind="member"><highlight class="normal"><ref refid="inet__chksum_8c_1a34f1aa1587562a09e11b704b51bab043" kindref="member">inet_chksum</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dataptr,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/><ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>)</highlight></codeline>
<codeline lineno="556"><highlight class="normal">{</highlight></codeline>
<codeline lineno="557"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)~(</highlight><highlight class="keywordtype">unsigned</highlight><highlight class="normal"><sp/>int)<ref refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" kindref="member">LWIP_CHKSUM</ref>(dataptr,<sp/><ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>);</highlight></codeline>
<codeline lineno="558"><highlight class="normal">}</highlight></codeline>
<codeline lineno="559"><highlight class="normal"></highlight></codeline>
<codeline lineno="567"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="568" refid="inet__chksum_8c_1ab35967a50418358e194e8f80fdc3c865" refkind="member"><highlight class="normal"><ref refid="inet__chksum_8c_1ab35967a50418358e194e8f80fdc3c865" kindref="member">inet_chksum_pbuf</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*p)</highlight></codeline>
<codeline lineno="569"><highlight class="normal">{</highlight></codeline>
<codeline lineno="570"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4c14294869aceba3ef9d4c0c302d0f33" kindref="member">u32_t</ref><sp/>acc;</highlight></codeline>
<codeline lineno="571"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structpbuf" kindref="compound">pbuf</ref><sp/>*q;</highlight></codeline>
<codeline lineno="572"><highlight class="normal"><sp/><sp/><ref refid="group__compiler__abstraction_1ga4caecabca98b43919dd11be1c0d4cd8e" kindref="member">u8_t</ref><sp/>swapped;</highlight></codeline>
<codeline lineno="573"><highlight class="normal"></highlight></codeline>
<codeline lineno="574"><highlight class="normal"><sp/><sp/>acc<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="575"><highlight class="normal"><sp/><sp/>swapped<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="576"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(q<sp/>=<sp/>p;<sp/>q<sp/>!=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>;<sp/>q<sp/>=<sp/>q-&gt;<ref refid="structpbuf_1a5e5763c94fd18d78937b0b58ce7df341" kindref="member">next</ref>)<sp/>{</highlight></codeline>
<codeline lineno="577"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>+=<sp/><ref refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" kindref="member">LWIP_CHKSUM</ref>(q-&gt;<ref refid="structpbuf_1a8d32dc3e964369d4eec638fc37fbc460" kindref="member">payload</ref>,<sp/>q-&gt;<ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>);</highlight></codeline>
<codeline lineno="578"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a6ffe83b4bdd1784a0671ee4778966a01" kindref="member">FOLD_U32T</ref>(acc);</highlight></codeline>
<codeline lineno="579"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(q-&gt;<ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref><sp/>%<sp/>2<sp/>!=<sp/>0)<sp/>{</highlight></codeline>
<codeline lineno="580"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>swapped<sp/>=<sp/>1<sp/>-<sp/>swapped;</highlight></codeline>
<codeline lineno="581"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="582"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="583"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="584"><highlight class="normal"></highlight></codeline>
<codeline lineno="585"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(swapped)<sp/>{</highlight></codeline>
<codeline lineno="586"><highlight class="normal"><sp/><sp/><sp/><sp/>acc<sp/>=<sp/><ref refid="inet__chksum_8h_1a0196bd603262882d16b5264b52eafe18" kindref="member">SWAP_BYTES_IN_WORD</ref>(acc);</highlight></codeline>
<codeline lineno="587"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="588"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref>)~(acc<sp/>&amp;<sp/>0xffffUL);</highlight></codeline>
<codeline lineno="589"><highlight class="normal">}</highlight></codeline>
<codeline lineno="590"><highlight class="normal"></highlight></codeline>
<codeline lineno="591"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>These<sp/>are<sp/>some<sp/>implementations<sp/>for<sp/>LWIP_CHKSUM_COPY,<sp/>which<sp/>copies<sp/>data</highlight></codeline>
<codeline lineno="592"><highlight class="comment"><sp/>*<sp/>like<sp/>MEMCPY<sp/>but<sp/>generates<sp/>a<sp/>checksum<sp/>at<sp/>the<sp/>same<sp/>time.<sp/>Since<sp/>this<sp/>is<sp/>a</highlight></codeline>
<codeline lineno="593"><highlight class="comment"><sp/>*<sp/>performance-sensitive<sp/>function,<sp/>you<sp/>might<sp/>want<sp/>to<sp/>create<sp/>your<sp/>own<sp/>version</highlight></codeline>
<codeline lineno="594"><highlight class="comment"><sp/>*<sp/>in<sp/>assembly<sp/>targeted<sp/>at<sp/>your<sp/>hardware<sp/>by<sp/>defining<sp/>it<sp/>in<sp/>lwipopts.h:</highlight></codeline>
<codeline lineno="595"><highlight class="comment"><sp/>*<sp/><sp/><sp/>#define<sp/>LWIP_CHKSUM_COPY(dst,<sp/>src,<sp/>len)<sp/>your_chksum_copy(dst,<sp/>src,<sp/>len)</highlight></codeline>
<codeline lineno="596"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="597"><highlight class="normal"></highlight></codeline>
<codeline lineno="598"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>(LWIP_CHKSUM_COPY_ALGORITHM<sp/>==<sp/>1)<sp/></highlight><highlight class="comment">/*<sp/>Version<sp/>#1<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="599"><highlight class="normal"></highlight></codeline>
<codeline lineno="603"><highlight class="normal"><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref></highlight></codeline>
<codeline lineno="604"><highlight class="normal">lwip_chksum_copy(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*dst,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*src,<sp/><ref refid="group__compiler__abstraction_1ga77570ac4fcab86864fa1916e55676da2" kindref="member">u16_t</ref><sp/><ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>)</highlight></codeline>
<codeline lineno="605"><highlight class="normal">{</highlight></codeline>
<codeline lineno="606"><highlight class="normal"><sp/><sp/><ref refid="lwipopts_8h_1aa1dd57a66b6de8c0593e9e3e8d1411f6" kindref="member">MEMCPY</ref>(dst,<sp/>src,<sp/><ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>);</highlight></codeline>
<codeline lineno="607"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="inet__chksum_8c_1adaaa51e3290b80f8f8f8b1d080f54c1e" kindref="member">LWIP_CHKSUM</ref>(dst,<sp/><ref refid="structpbuf_1a6f82449625e36e294f5d210268c0703f" kindref="member">len</ref>);</highlight></codeline>
<codeline lineno="608"><highlight class="normal">}</highlight></codeline>
<codeline lineno="609"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>(LWIP_CHKSUM_COPY_ALGORITHM<sp/>==<sp/>1)<sp/>*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/net/core/inet_chksum.c"/>
  </compounddef>
</doxygen>
