<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.16"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>UbixOS V2: C:/Dev/git/UbixOS/sys/net/netif/ethernetif.c File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtreedata.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(initResizable); /* @license-end */</script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">UbixOS V2  <span id="projectnumber">2.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.16 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function(){initNavTree('ethernetif_8c.html','');}); /* @license-end */ </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#nested-classes">Data Structures</a> | <a href="#define-members">Macros</a> | <a href="#func-members">Functions</a> | <a href="#var-members">Variables</a> </div> <div class="headertitle"> <div class="title">ethernetif.c File Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include <<a class="el" href="lnc_8h_source.html">pci/lnc.h</a>></code><br /> <code>#include "<a class="el" href="opt_8h_source.html">net/opt.h</a>"</code><br /> <code>#include <<a class="el" href="tcpip_8h_source.html">net/tcpip.h</a>></code><br /> <code>#include "<a class="el" href="def_8h_source.html">net/def.h</a>"</code><br /> <code>#include "<a class="el" href="mem_8h_source.html">net/mem.h</a>"</code><br /> <code>#include "<a class="el" href="pbuf_8h_source.html">net/pbuf.h</a>"</code><br /> <code>#include "<a class="el" href="stats_8h_source.html">net/stats.h</a>"</code><br /> <code>#include "<a class="el" href="snmp_8h_source.html">net/snmp.h</a>"</code><br /> <code>#include "<a class="el" href="ethip6_8h_source.html">net/ethip6.h</a>"</code><br /> <code>#include "<a class="el" href="etharp_8h_source.html">net/etharp.h</a>"</code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for ethernetif.c:</div> <div class="dyncontent"> <div class="center"><img src="ethernetif_8c__incl.png" border="0" usemap="#C_1_2Dev_2git_2UbixOS_2sys_2net_2netif_2ethernetif_8c" alt=""/></div> </div> </div> <p><a href="ethernetif_8c_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Data Structures</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structethernetif.html">ethernetif</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:acd9e3df20507d5f895e80477aef74555"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ethernetif_8c.html#acd9e3df20507d5f895e80477aef74555">IFNAME0</a>   'e'</td></tr> <tr class="separator:acd9e3df20507d5f895e80477aef74555"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a43b130296861cb255f1ad5b8c3787fd1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ethernetif_8c.html#a43b130296861cb255f1ad5b8c3787fd1">IFNAME1</a>   'n'</td></tr> <tr class="separator:a43b130296861cb255f1ad5b8c3787fd1"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a7ce979d0ec31575ecf17998b7bd9abb2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="ethernetif_8c.html#a7ce979d0ec31575ecf17998b7bd9abb2">ethernetif_init</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr> <tr class="separator:a7ce979d0ec31575ecf17998b7bd9abb2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6b594ba7163978faa6f67288054079ac"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="ethernetif_8c.html#a6b594ba7163978faa6f67288054079ac">ethernetif_input</a> (struct <a class="el" href="structnetif.html">netif</a> *<a class="el" href="structnetif.html">netif</a>)</td></tr> <tr class="separator:a6b594ba7163978faa6f67288054079ac"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> Variables</h2></td></tr> <tr class="memitem:a4a11421d92a3c6d8d9fae9db3bb9f299"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structnicBuffer.html">nicBuffer</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="ethernetif_8c.html#a4a11421d92a3c6d8d9fae9db3bb9f299">tmpBuf</a> = 0x0</td></tr> <tr class="separator:a4a11421d92a3c6d8d9fae9db3bb9f299"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Ethernet Interface Skeleton </p> <p class="definition">Definition in file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> </div><h2 class="groupheader">Macro Definition Documentation</h2> <a id="acd9e3df20507d5f895e80477aef74555"></a> <h2 class="memtitle"><span class="permalink"><a href="#acd9e3df20507d5f895e80477aef74555">◆ </a></span>IFNAME0</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IFNAME0   'e'</td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="ethernetif_8c_source.html#l00060">60</a> of file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> </div> </div> <a id="a43b130296861cb255f1ad5b8c3787fd1"></a> <h2 class="memtitle"><span class="permalink"><a href="#a43b130296861cb255f1ad5b8c3787fd1">◆ </a></span>IFNAME1</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define IFNAME1   'n'</td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="ethernetif_8c_source.html#l00061">61</a> of file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a id="a7ce979d0ec31575ecf17998b7bd9abb2"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7ce979d0ec31575ecf17998b7bd9abb2">◆ </a></span>ethernetif_init()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> ethernetif_init </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> * </td> <td class="paramname"><em>netif</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Should be called at the beginning of the program to set up the network interface. It calls the function low_level_init() to do the actual setup of the hardware.</p> <p>This function should be passed as a parameter to <a class="el" href="group__netif.html#ga66970b5877dd6b0cae906bfa78d0cb4c">netif_add()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">netif</td><td>the lwip network interface structure for this ethernetif </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>ERR_OK if the loopif is initialized ERR_MEM if private data couldn't be allocated any other err_t on error </dd></dl> <p class="definition">Definition at line <a class="el" href="ethernetif_8c_source.html#l00302">302</a> of file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> <p class="reference">References <a class="el" href="err_8h_source.html#l00065">ERR_MEM</a>, <a class="el" href="ethernetif_8c_source.html#l00060">IFNAME0</a>, <a class="el" href="ethernetif_8c_source.html#l00061">IFNAME1</a>, <a class="el" href="netif_8h_source.html#l00263">netif::linkoutput</a>, <a class="el" href="debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="mem_8c_source.html#l00603">mem_malloc()</a>, <a class="el" href="netif_8h_source.html#l00315">netif::name</a>, <a class="el" href="lwipopts_8h_source.html#l00433">NETIF_DEBUG</a>, <a class="el" href="fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="netif_8h_source.html#l00287">netif::state</a>.</p> <p class="reference">Referenced by <a class="el" href="net_2init_8c_source.html#l00052">net_init()</a>.</p> <div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="ethernetif_8c_a7ce979d0ec31575ecf17998b7bd9abb2_cgraph.png" border="0" usemap="#ethernetif_8c_a7ce979d0ec31575ecf17998b7bd9abb2_cgraph" alt=""/></div> </div> </div> </div> <a id="a6b594ba7163978faa6f67288054079ac"></a> <h2 class="memtitle"><span class="permalink"><a href="#a6b594ba7163978faa6f67288054079ac">◆ </a></span>ethernetif_input()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ethernetif_input </td> <td>(</td> <td class="paramtype">struct <a class="el" href="structnetif.html">netif</a> * </td> <td class="paramname"><em>netif</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function should be called when a packet is ready to be read from the interface. It uses the function low_level_input() that should handle the actual reception of bytes from the network interface. Then the type of the received packet is determined and the appropriate input function is called.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">netif</td><td>the lwip network interface structure for this ethernetif </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="ethernetif_8c_source.html#l00270">270</a> of file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> <p class="reference">References <a class="el" href="netif_8h_source.html#l00287">netif::state</a>.</p> <p class="reference">Referenced by <a class="el" href="lnc_8c_source.html#l00278">lnc_thread()</a>.</p> </div> </div> <h2 class="groupheader">Variable Documentation</h2> <a id="a4a11421d92a3c6d8d9fae9db3bb9f299"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4a11421d92a3c6d8d9fae9db3bb9f299">◆ </a></span>tmpBuf</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct <a class="el" href="structnicBuffer.html">nicBuffer</a>* tmpBuf = 0x0</td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="ethernetif_8c_source.html#l00063">63</a> of file <a class="el" href="ethernetif_8c_source.html">ethernetif.c</a>.</p> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="dir_e6bb53534ac0e427887cf7a94c0c004e.html">C:</a></li><li class="navelem"><a class="el" href="dir_d99d5d4662bf24521eef49da6a8cd34d.html">Dev</a></li><li class="navelem"><a class="el" href="dir_474a4b306371cf7e7f6fa12cb0b77df6.html">git</a></li><li class="navelem"><a class="el" href="dir_849109bbd106d461b128d63e5babcedf.html">UbixOS</a></li><li class="navelem"><a class="el" href="dir_6ec99f6d7d5182ba8913209ab70c9f18.html">sys</a></li><li class="navelem"><a class="el" href="dir_6ed706464e1919433e32bb89560817da.html">net</a></li><li class="navelem"><a class="el" href="dir_674cfa2aa5c4f20e1e28b60514329d0f.html">netif</a></li><li class="navelem"><a class="el" href="ethernetif_8c.html">ethernetif.c</a></li> <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li> </ul> </div> </body> </html>