<?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="netifapi_8c" kind="file" language="C++">
    <compoundname>netifapi.c</compoundname>
    <includes local="yes">lwip/opt.h</includes>
    <incdepgraph>
      <node id="1">
        <label>C:/Dev/git/UbixOS/sys/net/api/netifapi.c</label>
        <link refid="netifapi_8c"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>lwip/opt.h</label>
      </node>
    </incdepgraph>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<para>Network Interface Sequential API module </para>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="14"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="15"><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="16"><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="17"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="18"><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="19"><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="20"><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="21"><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="22"><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="23"><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="24"><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="25"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="26"><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="27"><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="28"><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="29"><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="30"><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="31"><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="32"><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="33"><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="34"><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="35"><highlight class="comment"><sp/>*<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="36"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="37"><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="38"><highlight class="comment"><sp/>*</highlight></codeline>
<codeline lineno="39"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;lwip/opt.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_NETIF_API<sp/></highlight><highlight class="comment">/*<sp/>don&apos;t<sp/>build<sp/>if<sp/>not<sp/>configured<sp/>for<sp/>use<sp/>in<sp/>lwipopts.h<sp/>*/</highlight><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;lwip/netifapi.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;lwip/memp.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;lwip/priv/tcpip_priv.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>NETIFAPI_VAR_REF(name)<sp/><sp/><sp/><sp/><sp/><sp/>API_VAR_REF(name)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>NETIFAPI_VAR_DECLARE(name)<sp/><sp/>API_VAR_DECLARE(struct<sp/>netifapi_msg,<sp/>name)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="51"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>NETIFAPI_VAR_ALLOC(name)<sp/><sp/><sp/><sp/>API_VAR_ALLOC(struct<sp/>netifapi_msg,<sp/>MEMP_NETIFAPI_MSG,<sp/>name,<sp/>ERR_MEM)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="52"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>NETIFAPI_VAR_FREE(name)<sp/><sp/><sp/><sp/><sp/>API_VAR_FREE(MEMP_NETIFAPI_MSG,<sp/>name)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="58"><highlight class="normal">netifapi_do_netif_add(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structtcpip__api__call__data" kindref="compound">tcpip_api_call_data</ref><sp/>*m)</highlight></codeline>
<codeline lineno="59"><highlight class="normal">{</highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>cast<sp/>through<sp/>void*<sp/>to<sp/>silence<sp/>alignment<sp/>warnings.<sp/></highlight></codeline>
<codeline lineno="61"><highlight class="comment"><sp/><sp/><sp/>*<sp/>We<sp/>know<sp/>it<sp/>works<sp/>because<sp/>the<sp/>structs<sp/>have<sp/>been<sp/>instantiated<sp/>as<sp/>struct<sp/>netifapi_msg<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg<sp/>*msg<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg*)(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)m;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="64"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="group__netif_1ga66970b5877dd6b0cae906bfa78d0cb4c" kindref="member">netif_add</ref>(<sp/>msg-&gt;netif,</highlight></codeline>
<codeline lineno="65"><highlight class="normal">#</highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/><ref refid="lwipopts_8h_1a429e811a80ebb5157e14a854870c4410" kindref="member">LWIP_IPV4</ref></highlight></codeline>
<codeline lineno="66"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.ipaddr),</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.netmask),</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.gw),</highlight></codeline>
<codeline lineno="69"><highlight class="normal">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="70"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>msg-&gt;msg.add.state,</highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>msg-&gt;msg.add.init,</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>msg-&gt;msg.add.input))<sp/>{</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1ggae2e66c7d13afc90ffecd6151680fbadca7d61d90449ae6788575e8e46d5d3bbc6" kindref="member">ERR_IF</ref>;</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb" kindref="member">ERR_OK</ref>;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="77"><highlight class="normal">}</highlight></codeline>
<codeline lineno="78"><highlight class="normal"></highlight></codeline>
<codeline lineno="79"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="84"><highlight class="normal">netifapi_do_netif_set_addr(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structtcpip__api__call__data" kindref="compound">tcpip_api_call_data</ref><sp/>*m)</highlight></codeline>
<codeline lineno="85"><highlight class="normal">{</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>cast<sp/>through<sp/>void*<sp/>to<sp/>silence<sp/>alignment<sp/>warnings.<sp/></highlight></codeline>
<codeline lineno="87"><highlight class="comment"><sp/><sp/><sp/>*<sp/>We<sp/>know<sp/>it<sp/>works<sp/>because<sp/>the<sp/>structs<sp/>have<sp/>been<sp/>instantiated<sp/>as<sp/>struct<sp/>netifapi_msg<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg<sp/>*msg<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg*)(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)m;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"></highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/>netif_set_addr(<sp/>msg-&gt;netif,</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.ipaddr),</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.netmask),</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="tcpip__priv_8h_1a1f3c3ae0938b5510978cbd31560a5797" kindref="member">API_EXPR_REF</ref>(msg-&gt;msg.add.gw));</highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb" kindref="member">ERR_OK</ref>;</highlight></codeline>
<codeline lineno="95"><highlight class="normal">}</highlight></codeline>
<codeline lineno="96"><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="97"><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="103"><highlight class="normal">netifapi_do_netif_common(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structtcpip__api__call__data" kindref="compound">tcpip_api_call_data</ref><sp/>*m)</highlight></codeline>
<codeline lineno="104"><highlight class="normal">{</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>cast<sp/>through<sp/>void*<sp/>to<sp/>silence<sp/>alignment<sp/>warnings.<sp/></highlight></codeline>
<codeline lineno="106"><highlight class="comment"><sp/><sp/><sp/>*<sp/>We<sp/>know<sp/>it<sp/>works<sp/>because<sp/>the<sp/>structs<sp/>have<sp/>been<sp/>instantiated<sp/>as<sp/>struct<sp/>netifapi_msg<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg<sp/>*msg<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">netifapi_msg*)(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">*)m;</highlight></codeline>
<codeline lineno="108"><highlight class="normal"></highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(msg-&gt;msg.common.errtfunc<sp/>!=<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>msg-&gt;msg.common.errtfunc(msg-&gt;netif);</highlight></codeline>
<codeline lineno="111"><highlight class="normal"><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/>msg-&gt;msg.common.voidfunc(msg-&gt;netif);</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="group__infrastructure__errors_1ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb" kindref="member">ERR_OK</ref>;</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="115"><highlight class="normal">}</highlight></codeline>
<codeline lineno="116"><highlight class="normal"></highlight></codeline>
<codeline lineno="124"><highlight class="normal"><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="125"><highlight class="normal">netifapi_netif_add(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,</highlight></codeline>
<codeline lineno="126"><highlight class="normal">#</highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/><ref refid="lwipopts_8h_1a429e811a80ebb5157e14a854870c4410" kindref="member">LWIP_IPV4</ref></highlight></codeline>
<codeline lineno="127"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*ipaddr,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*netmask,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*gw,</highlight></codeline>
<codeline lineno="128"><highlight class="normal">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_IPV4<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*state,<sp/><ref refid="netif_8h_1a2b02a78a8769925ff8e4f83d34e5e1f5" kindref="member">netif_init_fn</ref><sp/>init,<sp/><ref refid="netif_8h_1ab2302b1b64ac7b95f24c6bab754a575e" kindref="member">netif_input_fn</ref><sp/>input)</highlight></codeline>
<codeline lineno="130"><highlight class="normal">{</highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref><sp/>err;</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_DECLARE(msg);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_ALLOC(msg);</highlight></codeline>
<codeline lineno="134"><highlight class="normal"></highlight></codeline>
<codeline lineno="135"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="136"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ipaddr<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="137"><highlight class="normal"><sp/><sp/><sp/><sp/>ipaddr<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="138"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="139"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(netmask<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/>netmask<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="141"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(gw<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/>gw<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="145"><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="146"><highlight class="normal"></highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).netif<sp/>=<sp/><ref refid="structnetif" kindref="compound">netif</ref>;</highlight></codeline>
<codeline lineno="148"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.ipaddr<sp/><sp/>=<sp/>NETIFAPI_VAR_REF(ipaddr);</highlight></codeline>
<codeline lineno="150"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.netmask<sp/>=<sp/>NETIFAPI_VAR_REF(netmask);</highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.gw<sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>NETIFAPI_VAR_REF(gw);</highlight></codeline>
<codeline lineno="152"><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="153"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.state<sp/><sp/><sp/>=<sp/>state;</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.init<sp/><sp/><sp/><sp/>=<sp/>init;</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.input<sp/><sp/><sp/>=<sp/>input;</highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/>err<sp/>=<sp/><ref refid="tcpip__priv_8h_1a3d42b0c46607f91aedcc7745ed466b08" kindref="member">tcpip_api_call</ref>(netifapi_do_netif_add,<sp/>&amp;<ref refid="tcpip__priv_8h_1a3518256af0d1a422755a899b13c2b563" kindref="member">API_VAR_REF</ref>(msg).call);</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_FREE(msg);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>err;</highlight></codeline>
<codeline lineno="159"><highlight class="normal">}</highlight></codeline>
<codeline lineno="160"><highlight class="normal"></highlight></codeline>
<codeline lineno="161"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>LWIP_IPV4</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="162"><highlight class="normal"></highlight></codeline>
<codeline lineno="169"><highlight class="normal"><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="170"><highlight class="normal">netifapi_netif_set_addr(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*ipaddr,</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*netmask,</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>ip4_addr_t<sp/>*gw)</highlight></codeline>
<codeline lineno="174"><highlight class="normal">{</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref><sp/>err;</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_DECLARE(msg);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_ALLOC(msg);</highlight></codeline>
<codeline lineno="178"><highlight class="normal"></highlight></codeline>
<codeline lineno="179"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ipaddr<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="180"><highlight class="normal"><sp/><sp/><sp/><sp/>ipaddr<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="181"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="182"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(netmask<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/>netmask<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(gw<sp/>==<sp/><ref refid="fat__string_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>)<sp/>{</highlight></codeline>
<codeline lineno="186"><highlight class="normal"><sp/><sp/><sp/><sp/>gw<sp/>=<sp/>IP4_ADDR_ANY4;</highlight></codeline>
<codeline lineno="187"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="188"><highlight class="normal"></highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).netif<sp/>=<sp/><ref refid="structnetif" kindref="compound">netif</ref>;</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.ipaddr<sp/><sp/>=<sp/>NETIFAPI_VAR_REF(ipaddr);</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.netmask<sp/>=<sp/>NETIFAPI_VAR_REF(netmask);</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.add.gw<sp/><sp/><sp/><sp/><sp/><sp/>=<sp/>NETIFAPI_VAR_REF(gw);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/>err<sp/>=<sp/><ref refid="tcpip__priv_8h_1a3d42b0c46607f91aedcc7745ed466b08" kindref="member">tcpip_api_call</ref>(netifapi_do_netif_set_addr,<sp/>&amp;<ref refid="tcpip__priv_8h_1a3518256af0d1a422755a899b13c2b563" kindref="member">API_VAR_REF</ref>(msg).call);</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_FREE(msg);</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>err;</highlight></codeline>
<codeline lineno="196"><highlight class="normal">}</highlight></codeline>
<codeline lineno="197"><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="198"><highlight class="normal"></highlight></codeline>
<codeline lineno="205"><highlight class="normal"><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref></highlight></codeline>
<codeline lineno="206"><highlight class="normal">netifapi_netif_common(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structnetif" kindref="compound">netif</ref><sp/>*<ref refid="structnetif" kindref="compound">netif</ref>,<sp/>netifapi_void_fn<sp/>voidfunc,</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>netifapi_errt_fn<sp/>errtfunc)</highlight></codeline>
<codeline lineno="208"><highlight class="normal">{</highlight></codeline>
<codeline lineno="209"><highlight class="normal"><sp/><sp/><ref refid="group__infrastructure__errors_1gaf02d9da80fd66b4f986d2c53d7231ddb" kindref="member">err_t</ref><sp/>err;</highlight></codeline>
<codeline lineno="210"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_DECLARE(msg);</highlight></codeline>
<codeline lineno="211"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_ALLOC(msg);</highlight></codeline>
<codeline lineno="212"><highlight class="normal"></highlight></codeline>
<codeline lineno="213"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).netif<sp/>=<sp/><ref refid="structnetif" kindref="compound">netif</ref>;</highlight></codeline>
<codeline lineno="214"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.common.voidfunc<sp/>=<sp/>voidfunc;</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_REF(msg).msg.common.errtfunc<sp/>=<sp/>errtfunc;</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/>err<sp/>=<sp/><ref refid="tcpip__priv_8h_1a3d42b0c46607f91aedcc7745ed466b08" kindref="member">tcpip_api_call</ref>(netifapi_do_netif_common,<sp/>&amp;<ref refid="tcpip__priv_8h_1a3518256af0d1a422755a899b13c2b563" kindref="member">API_VAR_REF</ref>(msg).call);</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/>NETIFAPI_VAR_FREE(msg);</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>err;</highlight></codeline>
<codeline lineno="219"><highlight class="normal">}</highlight></codeline>
<codeline lineno="220"><highlight class="normal"></highlight></codeline>
<codeline lineno="221"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/></highlight><highlight class="comment">/*<sp/>LWIP_NETIF_API<sp/>*/</highlight><highlight class="preprocessor"></highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/net/api/netifapi.c"/>
  </compounddef>
</doxygen>
