Newer
Older
UbixOS / doc / html / d7 / d05 / group__pbuf.html
<!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: Packet buffers (PBUF)</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&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</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
   &#160;<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" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',false,false,'search.php','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&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d7/d05/group__pbuf.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Packet buffers (PBUF)</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaee1baa59bb2f85ba575b5a8619ac1ebf"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> { <br />
&#160;&#160;<a class="el" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa2ded3594a3977f8bf9cf09552be327b5">PBUF_TRANSPORT</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfafcc1e506061ba69dfa142eb6b3da5f13">PBUF_IP</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfab4de441e737330558b609a990cd17346">PBUF_LINK</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa0ff039585f05f9208bcb66c2d37783e2">PBUF_RAW_TX</a>, 
<br />
&#160;&#160;<a class="el" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba">PBUF_RAW</a>
<br />
 }</td></tr>
<tr class="separator:gaee1baa59bb2f85ba575b5a8619ac1ebf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab7e0e32fcc292c0d7107721766ed92fb"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> { <a class="el" href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbac5e9f28455bca98944a030d4b84ecfab">PBUF_RAM</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbac120b0fe39efe35bb682e4aa3b82e2c9">PBUF_ROM</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbac9b6ba960fdea6f2e8f35c8313b77e4e">PBUF_REF</a>, 
<a class="el" href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbae969347127387b9b59a23ccd24b76d21">PBUF_POOL</a>
 }</td></tr>
<tr class="separator:gab7e0e32fcc292c0d7107721766ed92fb"><td class="memSeparator" colspan="2">&#160;</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:gacfcb0a2af918658ba0afe36499c65f47"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gacfcb0a2af918658ba0afe36499c65f47">pbuf_alloc</a> (<a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> layer, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> length, <a class="el" href="../../d7/d05/group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a> type)</td></tr>
<tr class="separator:gacfcb0a2af918658ba0afe36499c65f47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82429084fe29015509c9b4a072707cd4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga82429084fe29015509c9b4a072707cd4">pbuf_cat</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *h, struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *t)</td></tr>
<tr class="separator:ga82429084fe29015509c9b4a072707cd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga831c9a72bda1d3bd4c7b96f5a0e3b891"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga831c9a72bda1d3bd4c7b96f5a0e3b891">pbuf_chain</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *h, struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *t)</td></tr>
<tr class="separator:ga831c9a72bda1d3bd4c7b96f5a0e3b891"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54ac7b116c6f53c704cbf74f35a8b35c"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga54ac7b116c6f53c704cbf74f35a8b35c">pbuf_coalesce</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a> layer)</td></tr>
<tr class="separator:ga54ac7b116c6f53c704cbf74f35a8b35c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba88511dee3df4b631fde691f421320d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gaba88511dee3df4b631fde691f421320d">pbuf_copy</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p_to, <a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p_from)</td></tr>
<tr class="separator:gaba88511dee3df4b631fde691f421320d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac2f1f58fd36042e82af46f5015720899"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gac2f1f58fd36042e82af46f5015720899">pbuf_copy_partial</a> (<a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *<a class="el" href="../../d9/dd0/structbuf.html">buf</a>, void *dataptr, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> len, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset)</td></tr>
<tr class="separator:gac2f1f58fd36042e82af46f5015720899"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0dd696fb4b6bc65e548944584f1738b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:gab0dd696fb4b6bc65e548944584f1738b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d803d9945bffb7ad97743f2fa503da6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga6d803d9945bffb7ad97743f2fa503da6">pbuf_get_at</a> (<a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset)</td></tr>
<tr class="separator:ga6d803d9945bffb7ad97743f2fa503da6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2170ccbbb13238380dbb203ee1b85974"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga2170ccbbb13238380dbb203ee1b85974">pbuf_memcmp</a> (<a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset, <a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *s2, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> n)</td></tr>
<tr class="separator:ga2170ccbbb13238380dbb203ee1b85974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga18c164a6e4a24d89ea9eb7571a886448"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga18c164a6e4a24d89ea9eb7571a886448">pbuf_memfind</a> (<a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *<a class="el" href="../../d0/d0f/structmem.html">mem</a>, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> mem_len, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> start_offset)</td></tr>
<tr class="separator:ga18c164a6e4a24d89ea9eb7571a886448"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf76863707dc02993eae116574b1ea03f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gaf76863707dc02993eae116574b1ea03f">pbuf_put_at</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> data)</td></tr>
<tr class="separator:gaf76863707dc02993eae116574b1ea03f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50abfe830a33a1a47a562febee66015d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga50abfe830a33a1a47a562febee66015d">pbuf_realloc</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> new_len)</td></tr>
<tr class="separator:ga50abfe830a33a1a47a562febee66015d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77f6bbd69e45e542014d9c547c7da74e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga77f6bbd69e45e542014d9c547c7da74e">pbuf_ref</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p)</td></tr>
<tr class="separator:ga77f6bbd69e45e542014d9c547c7da74e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6a961522d81f0327aaf4d4ee6d96c583"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga6a961522d81f0327aaf4d4ee6d96c583">pbuf_skip</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *in, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> in_offset, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> *out_offset)</td></tr>
<tr class="separator:ga6a961522d81f0327aaf4d4ee6d96c583"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad1e31e370271335b197272af2724ca85"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gad1e31e370271335b197272af2724ca85">pbuf_take</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *<a class="el" href="../../d9/dd0/structbuf.html">buf</a>, <a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *dataptr, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> len)</td></tr>
<tr class="separator:gad1e31e370271335b197272af2724ca85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae1cf2bf7454ff87ff377b0b2262f9b44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#gae1cf2bf7454ff87ff377b0b2262f9b44">pbuf_take_at</a> (struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *<a class="el" href="../../d9/dd0/structbuf.html">buf</a>, <a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *dataptr, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> len, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset)</td></tr>
<tr class="separator:gae1cf2bf7454ff87ff377b0b2262f9b44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga839f342803b0cf89049744124c5a98ad"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d05/group__pbuf.html#ga839f342803b0cf89049744124c5a98ad">pbuf_try_get_at</a> (<a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *p, <a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> offset)</td></tr>
<tr class="separator:ga839f342803b0cf89049744124c5a98ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Packets are built from the pbuf data structure. It supports dynamic memory allocation for packet contents or can reference externally managed packet contents both in RAM and ROM. Quick allocation for incoming packets is provided through pools with fixed sized pbufs.</p>
<p>A packet may span over multiple pbufs, chained as a singly linked list. This is called a "pbuf chain".</p>
<p>Multiple packets may be queued, also using this singly linked list. This is called a "packet queue".</p>
<p>So, a packet queue consists of one or more pbuf chains, each of which consist of one or more pbufs. CURRENTLY, PACKET QUEUES ARE NOT SUPPORTED!!! Use helper structs to queue multiple packets.</p>
<p>The differences between a pbuf chain and a packet queue are very precise but subtle.</p>
<p>The last pbuf of a packet has a -&gt;tot_len field that equals the -&gt;len field. It can be found by traversing the list. If the last pbuf of a packet has a -&gt;next field other than NULL, more packets are on the queue.</p>
<p>Therefore, looping through a pbuf of a single packet, has an loop end condition (tot_len == p-&gt;len), NOT (next == NULL).</p>
<p>Example of custom pbuf usage for zero-copy RX: </p><div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>my_custom_pbuf</div>
<div class="line">{</div>
<div class="line">   <span class="keyword">struct </span>pbuf_custom p;</div>
<div class="line">   <span class="keywordtype">void</span>* dma_descriptor;</div>
<div class="line">} my_custom_pbuf_t;</div>
<div class="line"> </div>
<div class="line"><a class="code" href="../../dd/de2/group__mempool.html#ga5b1fb3ce7942432d87cc948b1c5ed6cb">LWIP_MEMPOOL_DECLARE</a>(RX_POOL, 10, <span class="keyword">sizeof</span>(my_custom_pbuf_t), <span class="stringliteral">&quot;Zero-copy RX PBUF pool&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> my_pbuf_free_custom(<span class="keywordtype">void</span>* p)</div>
<div class="line">{</div>
<div class="line">  my_custom_pbuf_t* my_puf = (my_custom_pbuf_t*)p;</div>
<div class="line"> </div>
<div class="line">  LOCK_INTERRUPTS();</div>
<div class="line">  free_rx_dma_descriptor(my_pbuf-&gt;dma_descriptor);</div>
<div class="line">  <a class="code" href="../../dd/de2/group__mempool.html#gaa43d114dd702fbd8f1db18474ea93a04">LWIP_MEMPOOL_FREE</a>(RX_POOL, my_pbuf);</div>
<div class="line">  UNLOCK_INTERRUPTS();</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> eth_rx_irq()</div>
<div class="line">{</div>
<div class="line">  dma_descriptor*   dma_desc = get_RX_DMA_descriptor_from_ethernet();</div>
<div class="line">  my_custom_pbuf_t* my_pbuf  = (my_custom_pbuf_t*)<a class="code" href="../../dd/de2/group__mempool.html#ga5e2498f6c17746c1fe7153de5f7f275a">LWIP_MEMPOOL_ALLOC</a>(RX_POOL);</div>
<div class="line"> </div>
<div class="line">  my_pbuf-&gt;p.custom_free_function = my_pbuf_free_custom;</div>
<div class="line">  my_pbuf-&gt;dma_descriptor         = dma_desc;</div>
<div class="line"> </div>
<div class="line">  invalidate_cpu_cache(dma_desc-&gt;rx_data, dma_desc-&gt;rx_length);</div>
<div class="line">  </div>
<div class="line">  <span class="keyword">struct </span><a class="code" href="../../d9/db8/structpbuf.html">pbuf</a>* p = pbuf_alloced_custom(<a class="code" href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba">PBUF_RAW</a>,</div>
<div class="line">     dma_desc-&gt;rx_length,</div>
<div class="line">     <a class="code" href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbac9b6ba960fdea6f2e8f35c8313b77e4e">PBUF_REF</a>,</div>
<div class="line">     &amp;my_pbuf-&gt;p,</div>
<div class="line">     dma_desc-&gt;rx_data,</div>
<div class="line">     dma_desc-&gt;max_buffer_size);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span>(<a class="code" href="../../d2/dd6/structnetif.html">netif</a>-&gt;<a class="code" href="../../d2/dd6/structnetif.html#a8fe4f1b7b0d710216287da9615164a5c">input</a>(p, <a class="code" href="../../d2/dd6/structnetif.html">netif</a>) != <a class="code" href="../../d2/de7/group__infrastructure__errors.html#ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb">ERR_OK</a>) {</div>
<div class="line">    <a class="code" href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a>(p);</div>
<div class="line">  }</div>
<div class="line">}</div>
</div><!-- fragment --> <h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gaee1baa59bb2f85ba575b5a8619ac1ebf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaee1baa59bb2f85ba575b5a8619ac1ebf">&#9670;&nbsp;</a></span>pbuf_layer</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enumeration of pbuf layers </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaee1baa59bb2f85ba575b5a8619ac1ebfa2ded3594a3977f8bf9cf09552be327b5"></a>PBUF_TRANSPORT&#160;</td><td class="fielddoc"><p>Includes spare room for transport layer header, e.g. UDP header. Use this if you intend to pass the pbuf to functions like udp_send(). </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaee1baa59bb2f85ba575b5a8619ac1ebfafcc1e506061ba69dfa142eb6b3da5f13"></a>PBUF_IP&#160;</td><td class="fielddoc"><p>Includes spare room for IP header. Use this if you intend to pass the pbuf to functions like raw_send(). </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaee1baa59bb2f85ba575b5a8619ac1ebfab4de441e737330558b609a990cd17346"></a>PBUF_LINK&#160;</td><td class="fielddoc"><p>Includes spare room for link layer header (ethernet header). Use this if you intend to pass the pbuf to functions like ethernet_output(). </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/da2/group__lwip__opts__pbuf.html#ga35998a3d56af9940e6a80bb372597685">PBUF_LINK_HLEN</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaee1baa59bb2f85ba575b5a8619ac1ebfa0ff039585f05f9208bcb66c2d37783e2"></a>PBUF_RAW_TX&#160;</td><td class="fielddoc"><p>Includes spare room for additional encapsulation header before ethernet headers (e.g. 802.11). Use this if you intend to pass the pbuf to functions like netif-&gt;linkoutput(). </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/da2/group__lwip__opts__pbuf.html#ga6e1ba1875ae5168a17b53d83597bc1de">PBUF_LINK_ENCAPSULATION_HLEN</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba"></a>PBUF_RAW&#160;</td><td class="fielddoc"><p>Use this for input packets in a netif driver when calling netif-&gt;input() in the most common case - ethernet-layer netif driver. </p>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00072">72</a> of file <a class="el" href="../../d0/d35/pbuf_8h_source.html">pbuf.h</a>.</p>

</div>
</div>
<a id="gab7e0e32fcc292c0d7107721766ed92fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab7e0e32fcc292c0d7107721766ed92fb">&#9670;&nbsp;</a></span>pbuf_type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d05/group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enumeration of pbuf types </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab7e0e32fcc292c0d7107721766ed92fbac5e9f28455bca98944a030d4b84ecfab"></a>PBUF_RAM&#160;</td><td class="fielddoc"><p>pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). <a class="el" href="../../d7/d05/group__pbuf.html#gacfcb0a2af918658ba0afe36499c65f47">pbuf_alloc()</a> allocates PBUF_RAM pbufs as unchained pbufs (although that might change in future versions). This should be used for all OUTGOING packets (TX). </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab7e0e32fcc292c0d7107721766ed92fbac120b0fe39efe35bb682e4aa3b82e2c9"></a>PBUF_ROM&#160;</td><td class="fielddoc"><p>pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in totally different memory areas. Since it points to ROM, payload does not have to be copied when queued for transmission. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab7e0e32fcc292c0d7107721766ed92fbac9b6ba960fdea6f2e8f35c8313b77e4e"></a>PBUF_REF&#160;</td><td class="fielddoc"><p>pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change so it has to be duplicated when queued before transmitting, depending on who has a 'ref' to it. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab7e0e32fcc292c0d7107721766ed92fbae969347127387b9b59a23ccd24b76d21"></a>PBUF_POOL&#160;</td><td class="fielddoc"><p>pbuf payload refers to RAM. This one comes from a pool and should be used for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct pbuf and its payload are allocated in one piece of contiguous memory (so the first payload byte can be calculated from struct pbuf). Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing, you are unable to receive TCP acks! </p>
</td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00101">101</a> of file <a class="el" href="../../d0/d35/pbuf_8h_source.html">pbuf.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gacfcb0a2af918658ba0afe36499c65f47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacfcb0a2af918658ba0afe36499c65f47">&#9670;&nbsp;</a></span>pbuf_alloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a>* pbuf_alloc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a>&#160;</td>
          <td class="paramname"><em>layer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d7/d05/group__pbuf.html#gab7e0e32fcc292c0d7107721766ed92fb">pbuf_type</a>&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).</p>
<p>The actual memory allocated for the pbuf is determined by the layer at which the pbuf is allocated and the requested size (from the size parameter).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">layer</td><td>flag to define header size </td></tr>
    <tr><td class="paramname">length</td><td>size of the pbuf's payload </td></tr>
    <tr><td class="paramname">type</td><td>this parameter decides how and where the pbuf should be allocated as follows:</td></tr>
  </table>
  </dd>
</dl>
<ul>
<li>PBUF_RAM: buffer memory for pbuf is allocated as one large chunk. This includes protocol headers as well.</li>
<li>PBUF_ROM: no buffer memory is allocated for the pbuf, even for protocol headers. Additional headers must be prepended by allocating another pbuf and chain in to the front of the ROM pbuf. It is assumed that the memory used is really similar to ROM in that it is immutable and will not be changed. Memory which is dynamic should generally not be attached to PBUF_ROM pbufs. Use PBUF_REF instead.</li>
<li>PBUF_REF: no buffer memory is allocated for the pbuf, even for protocol headers. It is assumed that the pbuf is only being used in a single thread. If the pbuf gets queued, then pbuf_take should be called to copy the buffer.</li>
<li>PBUF_POOL: the pbuf is allocated as a pbuf chain, with pbufs from the pbuf pool that is allocated during <a class="el" href="../../d0/d35/pbuf_8h.html#a0c9b6a35471ebe1628ffe74bbc67f0b4">pbuf_init()</a>.</li>
</ul>
<dl class="section return"><dt>Returns</dt><dd>the allocated pbuf. If multiple pbufs where allocated, this is the first pbuf of a pbuf chain. </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00248">248</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00165">flags</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00057">LWIP_DBG_LEVEL_SERIOUS</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00083">LWIP_DBG_TRACE</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="../../d2/d2d/arch_8h_source.html#l00236">LWIP_MEM_ALIGN</a>, <a class="el" href="../../d2/d2d/arch_8h_source.html#l00221">LWIP_MEM_ALIGN_SIZE</a>, <a class="el" href="../../d4/da4/def_8h_source.html#l00055">LWIP_MIN</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00054">MEM_ALIGNMENT</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00603">mem_malloc()</a>, <a class="el" href="../../d1/d70/memp_8c_source.html#l00385">memp_malloc()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00435">PBUF_DEBUG</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00715">pbuf_free()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00080">PBUF_IP</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00065">PBUF_IP_HLEN</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00085">PBUF_LINK</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00211">PBUF_LINK_ENCAPSULATION_HLEN</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00209">PBUF_LINK_HLEN</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00123">PBUF_POOL</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00132">PBUF_POOL_BUFSIZE_ALIGNED</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00135">PBUF_POOL_IS_EMPTY</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00108">PBUF_RAM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00094">PBUF_RAW</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00091">PBUF_RAW_TX</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00116">PBUF_REF</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00112">PBUF_ROM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00076">PBUF_TRANSPORT</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00061">PBUF_TRANSPORT_HLEN</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00172">ref</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00129">SIZEOF_STRUCT_PBUF</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00162">type</a>, and <a class="el" href="../../d2/d2d/arch_8h_source.html#l00148">U16_F</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d6/d94/arp_8c_source.html#l00273">arp_query()</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01230">pbuf_coalesce()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_gacfcb0a2af918658ba0afe36499c65f47_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_gacfcb0a2af918658ba0afe36499c65f47_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_gacfcb0a2af918658ba0afe36499c65f47_cgraph" id="d7/d05/group__pbuf_gacfcb0a2af918658ba0afe36499c65f47_cgraph">
<area shape="rect" title=" " alt="" coords="5,157,85,184"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a932aa40d85b14cb7331625e012d12335" title=" " alt="" coords="137,107,233,133"/>
<area shape="rect" href="../../df/dff/memp_8h.html#a2b00593d086313c267b54a976bf67aa5" title=" " alt="" coords="133,157,236,184"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b" title=" " alt="" coords="147,208,222,235"/>
<area shape="rect" href="../../d8/d3b/group__sys__mutex.html#ga4d4eb9afe5965fa2661dd54ff55d616a" title=" " alt="" coords="284,107,401,133"/>
<area shape="rect" href="../../dd/d1b/ubthread_8h.html#aa13bf141cd3e9bf0921fbf61ffc637d8" title=" " alt="" coords="449,107,596,133"/>
<area shape="rect" href="../../dc/d94/armv6_2kpanic_8c.html#adb9a182aa071791a306163d50d653deb" title="print panic message and halt system" alt="" coords="644,81,704,108"/>
<area shape="rect" href="../../da/d28/kprintf_8h.html#a20b56810edb62a6fe59917015c30848f" title=" " alt="" coords="645,132,703,159"/>
<area shape="rect" href="../../dd/d78/video_8h.html#a5429378b96a24fadfd2d1f8d777eb95a" title=" " alt="" coords="758,81,813,108"/>
<area shape="rect" href="../../df/d87/kprintf_8c.html#a3093cdac4668a4ccffdd7f77270888b7" title=" " alt="" coords="754,132,817,159"/>
<area shape="rect" href="../../da/d28/kprintf_8h.html#a3b4a66bf1f6583e65660f281b6014aa1" title=" " alt="" coords="752,183,819,209"/>
<area shape="rect" href="../../dc/dac/io_8h.html#a77b934268de1b3ecdcf3f275413b3108" title="input one byte from specified port" alt="" coords="871,5,952,32"/>
<area shape="rect" href="../../dc/dac/io_8h.html#a8acc1a06073db2e7b92ffbd00fbd0cf1" title="outputut one byte to specified port" alt="" coords="867,56,956,83"/>
<area shape="rect" href="../../dd/d71/tty_8h.html#a4f96ccac7e60296ef496008d8cbed0ff" title=" " alt="" coords="879,107,943,133"/>
<area shape="rect" href="../../dd/d71/tty_8h.html#ad96f57a7c113d3cfa76ee5fed6de33c0" title=" " alt="" coords="877,157,946,184"/>
<area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a71f03d2ba55111c715b6068254847a53" title=" " alt="" coords="1004,157,1079,184"/>
<area shape="rect" href="../../d3/d02/armv6_2sched_8c.html#a08933fe6d593a1c78b9080359f15a0b7" title=" " alt="" coords="1127,132,1218,159"/>
<area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a740766af5da58616f700fffab6768a78" title=" " alt="" coords="1127,183,1219,209"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a2fd7aa1adf6e394d3be7c7734e7df41a" title=" " alt="" coords="303,183,382,209"/>
<area shape="rect" href="../../df/dff/memp_8h.html#aecd94926b7c2a0e23ae195f4ae97581f" title=" " alt="" coords="299,233,386,260"/>
</map>
</div>

</div>
</div>
<a id="ga82429084fe29015509c9b4a072707cd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82429084fe29015509c9b4a072707cd4">&#9670;&nbsp;</a></span>pbuf_cat()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pbuf_cat </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf.</p>
<dl class="section note"><dt>Note</dt><dd>The caller MAY NOT reference the tail pbuf afterwards. Use <a class="el" href="../../d7/d05/group__pbuf.html#ga831c9a72bda1d3bd4c7b96f5a0e3b891">pbuf_chain()</a> for that purpose.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d7/d05/group__pbuf.html#ga831c9a72bda1d3bd4c7b96f5a0e3b891">pbuf_chain()</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00841">841</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00135">LWIP_ERROR</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00883">pbuf_chain()</a>.</p>

</div>
</div>
<a id="ga831c9a72bda1d3bd4c7b96f5a0e3b891"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga831c9a72bda1d3bd4c7b96f5a0e3b891">&#9670;&nbsp;</a></span>pbuf_chain()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pbuf_chain </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>h</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Chain two pbufs (or pbuf chains) together.</p>
<p>The caller MUST call pbuf_free(t) once it has stopped using it. Use <a class="el" href="../../d7/d05/group__pbuf.html#ga82429084fe29015509c9b4a072707cd4">pbuf_cat()</a> instead if you no longer use t.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">h</td><td>head pbuf (chain) </td></tr>
    <tr><td class="paramname">t</td><td>tail pbuf (chain) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The pbufs MUST belong to the same packet. </dd>
<dd>
MAY NOT be called on a packet queue.</dd></dl>
<p>The -&gt;tot_len fields of all pbufs of the head chain are adjusted. The -&gt;next field of the last pbuf of the head chain is adjusted. The -&gt;ref field of the first pbuf of the tail chain is adjusted. </p>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00883">883</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../db/d16/debug_8h_source.html#l00083">LWIP_DBG_TRACE</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00841">pbuf_cat()</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00435">PBUF_DEBUG</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00821">pbuf_ref()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga831c9a72bda1d3bd4c7b96f5a0e3b891_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga831c9a72bda1d3bd4c7b96f5a0e3b891_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga831c9a72bda1d3bd4c7b96f5a0e3b891_cgraph" id="d7/d05/group__pbuf_ga831c9a72bda1d3bd4c7b96f5a0e3b891_cgraph">
<area shape="rect" title=" " alt="" coords="5,31,89,57"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga82429084fe29015509c9b4a072707cd4" title=" " alt="" coords="137,5,208,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga77f6bbd69e45e542014d9c547c7da74e" title=" " alt="" coords="139,56,206,83"/>
</map>
</div>

</div>
</div>
<a id="ga54ac7b116c6f53c704cbf74f35a8b35c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54ac7b116c6f53c704cbf74f35a8b35c">&#9670;&nbsp;</a></span>pbuf_coalesce()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a>* pbuf_coalesce </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d7/d05/group__pbuf.html#gaee1baa59bb2f85ba575b5a8619ac1ebf">pbuf_layer</a>&#160;</td>
          <td class="paramname"><em>layer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a single pbuf out of a queue of pbufs.</p>
<dl class="section remark"><dt>Remarks</dt><dd>: Either the source pbuf 'p' is freed by this function or the original pbuf 'p' is returned, therefore the caller has to check the result!</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>the source pbuf </td></tr>
    <tr><td class="paramname">layer</td><td>pbuf_layer of the new pbuf</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a new, single pbuf (p-&gt;next is NULL) or the old pbuf if allocation fails </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01230">1230</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d6/d40/err_8h_source.html#l00063">ERR_OK</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../d2/d2d/arch_8h_source.html#l00315">LWIP_UNUSED_ARG</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00248">pbuf_alloc()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00949">pbuf_copy()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00715">pbuf_free()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00108">PBUF_RAM</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga54ac7b116c6f53c704cbf74f35a8b35c_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga54ac7b116c6f53c704cbf74f35a8b35c_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga54ac7b116c6f53c704cbf74f35a8b35c_cgraph" id="d7/d05/group__pbuf_ga54ac7b116c6f53c704cbf74f35a8b35c_cgraph">
<area shape="rect" title=" " alt="" coords="5,208,111,235"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gacfcb0a2af918658ba0afe36499c65f47" title=" " alt="" coords="159,157,239,184"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b" title=" " alt="" coords="302,208,377,235"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gaba88511dee3df4b631fde691f421320d" title=" " alt="" coords="159,259,240,285"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a932aa40d85b14cb7331625e012d12335" title=" " alt="" coords="291,107,387,133"/>
<area shape="rect" href="../../df/dff/memp_8h.html#a2b00593d086313c267b54a976bf67aa5" title=" " alt="" coords="288,157,391,184"/>
<area shape="rect" href="../../d8/d3b/group__sys__mutex.html#ga4d4eb9afe5965fa2661dd54ff55d616a" title=" " alt="" coords="439,107,556,133"/>
<area shape="rect" href="../../dd/d1b/ubthread_8h.html#aa13bf141cd3e9bf0921fbf61ffc637d8" title=" " alt="" coords="604,107,751,133"/>
<area shape="rect" href="../../dc/d94/armv6_2kpanic_8c.html#adb9a182aa071791a306163d50d653deb" title="print panic message and halt system" alt="" coords="799,81,859,108"/>
<area shape="rect" href="../../da/d28/kprintf_8h.html#a20b56810edb62a6fe59917015c30848f" title=" " alt="" coords="800,132,857,159"/>
<area shape="rect" href="../../dd/d78/video_8h.html#a5429378b96a24fadfd2d1f8d777eb95a" title=" " alt="" coords="913,81,967,108"/>
<area shape="rect" href="../../df/d87/kprintf_8c.html#a3093cdac4668a4ccffdd7f77270888b7" title=" " alt="" coords="909,132,971,159"/>
<area shape="rect" href="../../da/d28/kprintf_8h.html#a3b4a66bf1f6583e65660f281b6014aa1" title=" " alt="" coords="907,183,973,209"/>
<area shape="rect" href="../../dc/dac/io_8h.html#a77b934268de1b3ecdcf3f275413b3108" title="input one byte from specified port" alt="" coords="1025,5,1107,32"/>
<area shape="rect" href="../../dc/dac/io_8h.html#a8acc1a06073db2e7b92ffbd00fbd0cf1" title="outputut one byte to specified port" alt="" coords="1021,56,1111,83"/>
<area shape="rect" href="../../dd/d71/tty_8h.html#a4f96ccac7e60296ef496008d8cbed0ff" title=" " alt="" coords="1034,107,1098,133"/>
<area shape="rect" href="../../dd/d71/tty_8h.html#ad96f57a7c113d3cfa76ee5fed6de33c0" title=" " alt="" coords="1031,157,1101,184"/>
<area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a71f03d2ba55111c715b6068254847a53" title=" " alt="" coords="1159,157,1233,184"/>
<area shape="rect" href="../../d3/d02/armv6_2sched_8c.html#a08933fe6d593a1c78b9080359f15a0b7" title=" " alt="" coords="1282,132,1373,159"/>
<area shape="rect" href="../../dc/d88/armv6_2spinlock_8c.html#a740766af5da58616f700fffab6768a78" title=" " alt="" coords="1281,183,1373,209"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a2fd7aa1adf6e394d3be7c7734e7df41a" title=" " alt="" coords="458,183,537,209"/>
<area shape="rect" href="../../df/dff/memp_8h.html#aecd94926b7c2a0e23ae195f4ae97581f" title=" " alt="" coords="454,233,541,260"/>
</map>
</div>

</div>
</div>
<a id="gaba88511dee3df4b631fde691f421320d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaba88511dee3df4b631fde691f421320d">&#9670;&nbsp;</a></span>pbuf_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> pbuf_copy </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p_to</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p_from</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create PBUF_RAM copies of pbufs.</p>
<p>Used to queue packets on behalf of the lwIP stack, such as ARP based queueing.</p>
<dl class="section note"><dt>Note</dt><dd>You MUST explicitly use p = pbuf_take(p);</dd>
<dd>
Only one packet is copied, no packet queue!</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_to</td><td>pbuf destination of the copy </td></tr>
    <tr><td class="paramname">p_from</td><td>pbuf source of the copy</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if pbuf was copied ERR_ARG if one of the pbufs is NULL or p_to is not big enough to hold p_from </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00949">949</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d6/d40/err_8h_source.html#l00096">ERR_ARG</a>, <a class="el" href="../../d6/d40/err_8h_source.html#l00063">ERR_OK</a>, <a class="el" href="../../d6/d40/err_8h_source.html#l00075">ERR_VAL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00083">LWIP_DBG_TRACE</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00135">LWIP_ERROR</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00043">MEMCPY</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00435">PBUF_DEBUG</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01230">pbuf_coalesce()</a>.</p>

</div>
</div>
<a id="gac2f1f58fd36042e82af46f5015720899"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac2f1f58fd36042e82af46f5015720899">&#9670;&nbsp;</a></span>pbuf_copy_partial()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> pbuf_copy_partial </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dataptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy (part of) the contents of a packet buffer to an application supplied buffer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>the pbuf from which to copy data </td></tr>
    <tr><td class="paramname">dataptr</td><td>the application supplied buffer </td></tr>
    <tr><td class="paramname">len</td><td>length of data to copy (dataptr must be big enough). No more than buf-&gt;tot_len will be copied, irrespective of len </td></tr>
    <tr><td class="paramname">offset</td><td>offset into the packet buffer from where to begin copying len bytes </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of bytes copied, or 0 on failure </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01016">1016</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00135">LWIP_ERROR</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00043">MEMCPY</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>.</p>

</div>
</div>
<a id="gab0dd696fb4b6bc65e548944584f1738b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab0dd696fb4b6bc65e548944584f1738b">&#9670;&nbsp;</a></span>pbuf_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> pbuf_free </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain or queue.</p>
<p>Decrements the pbuf reference count. If it reaches zero, the pbuf is deallocated.</p>
<p>For a pbuf chain, this is repeated for each pbuf in the chain, up to the first pbuf which has a non-zero reference count after decrementing. So, when all reference counts are one, the whole chain is free'd.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>The pbuf (chain) to be dereferenced.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of pbufs that were de-allocated from the head of the chain.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>MUST NOT be called on a packet queue (Not verified to work yet). </dd>
<dd>
the reference counter of a pbuf equals the number of pointers that refer to the pbuf (or into the pbuf).</dd></dl>
<p>examples:</p>
<p>Assuming existing chains a-&gt;b-&gt;c with the following reference counts, calling pbuf_free(a) results in:</p>
<p>1-&gt;2-&gt;3 becomes ...1-&gt;3 3-&gt;3-&gt;3 becomes 2-&gt;3-&gt;3 1-&gt;1-&gt;2 becomes ......1 2-&gt;1-&gt;1 becomes 1-&gt;1-&gt;1 1-&gt;1-&gt;1 becomes ....... </p>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00715">715</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d3/d02/armv6_2sched_8c_source.html#l00050">_current</a>, <a class="el" href="../../d7/d00/sched_8h_source.html#l00063">taskStruct::id</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00057">LWIP_DBG_LEVEL_SERIOUS</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00083">LWIP_DBG_TRACE</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00164">LWIP_DEBUGF</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00419">mem_free()</a>, <a class="el" href="../../d1/d70/memp_8c_source.html#l00469">memp_free()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00435">PBUF_DEBUG</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00131">PBUF_FLAG_IS_CUSTOM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00123">PBUF_POOL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00108">PBUF_RAM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00116">PBUF_REF</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00112">PBUF_ROM</a>, <a class="el" href="../../d1/d3b/perf_8h_source.html#l00020">PERF_START</a>, <a class="el" href="../../d1/d3b/perf_8h_source.html#l00021">PERF_STOP</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00172">ref</a>, <a class="el" href="../../d9/d87/sys_8h_source.html#l00361">SYS_ARCH_DECL_PROTECT</a>, <a class="el" href="../../d9/d87/sys_8h_source.html#l00362">SYS_ARCH_PROTECT</a>, <a class="el" href="../../d9/d87/sys_8h_source.html#l00363">SYS_ARCH_UNPROTECT</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00162">type</a>, and <a class="el" href="../../d2/d2d/arch_8h_source.html#l00148">U16_F</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d6/d94/arp_8c_source.html#l00197">arp_arp_input()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00248">pbuf_alloc()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01230">pbuf_coalesce()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00900">pbuf_dechain()</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00493">pbuf_realloc()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_gab0dd696fb4b6bc65e548944584f1738b_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_gab0dd696fb4b6bc65e548944584f1738b_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_gab0dd696fb4b6bc65e548944584f1738b_cgraph" id="d7/d05/group__pbuf_gab0dd696fb4b6bc65e548944584f1738b_cgraph">
<area shape="rect" title=" " alt="" coords="5,31,80,57"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a2fd7aa1adf6e394d3be7c7734e7df41a" title=" " alt="" coords="132,5,211,32"/>
<area shape="rect" href="../../df/dff/memp_8h.html#aecd94926b7c2a0e23ae195f4ae97581f" title=" " alt="" coords="128,56,215,83"/>
</map>
</div>

</div>
</div>
<a id="ga6d803d9945bffb7ad97743f2fa503da6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6d803d9945bffb7ad97743f2fa503da6">&#9670;&nbsp;</a></span>pbuf_get_at()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a> pbuf_get_at </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get one byte from the specified position in a pbuf WARNING: returns zero for offset &gt;= p-&gt;tot_len</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to parse </td></tr>
    <tr><td class="paramname">offset</td><td>offset into p of the byte to return </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>byte at an offset into p OR ZERO IF 'offset' &gt;= p-&gt;tot_len </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01300">1300</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01318">pbuf_try_get_at()</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01363">pbuf_memcmp()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga6d803d9945bffb7ad97743f2fa503da6_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga6d803d9945bffb7ad97743f2fa503da6_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga6d803d9945bffb7ad97743f2fa503da6_cgraph" id="d7/d05/group__pbuf_ga6d803d9945bffb7ad97743f2fa503da6_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,95,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga839f342803b0cf89049744124c5a98ad" title=" " alt="" coords="143,5,253,32"/>
</map>
</div>

</div>
</div>
<a id="ga2170ccbbb13238380dbb203ee1b85974"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2170ccbbb13238380dbb203ee1b85974">&#9670;&nbsp;</a></span>pbuf_memcmp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> pbuf_memcmp </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *&#160;</td>
          <td class="paramname"><em>s2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Compare pbuf contents at specified offset with memory s2, both of length n</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to compare </td></tr>
    <tr><td class="paramname">offset</td><td>offset into p at which to start comparing </td></tr>
    <tr><td class="paramname">s2</td><td>buffer to compare </td></tr>
    <tr><td class="paramname">n</td><td>length of buffer to compare </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>zero if equal, nonzero otherwise (0xffff if p is too short, diffoffset+1 otherwise) </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01363">1363</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01300">pbuf_get_at()</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01405">pbuf_memfind()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga2170ccbbb13238380dbb203ee1b85974_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga2170ccbbb13238380dbb203ee1b85974_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga2170ccbbb13238380dbb203ee1b85974_cgraph" id="d7/d05/group__pbuf_ga2170ccbbb13238380dbb203ee1b85974_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,112,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga6d803d9945bffb7ad97743f2fa503da6" title=" " alt="" coords="160,5,249,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga839f342803b0cf89049744124c5a98ad" title=" " alt="" coords="297,5,408,32"/>
</map>
</div>

</div>
</div>
<a id="ga18c164a6e4a24d89ea9eb7571a886448"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga18c164a6e4a24d89ea9eb7571a886448">&#9670;&nbsp;</a></span>pbuf_memfind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> pbuf_memfind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *&#160;</td>
          <td class="paramname"><em>mem</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>mem_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>start_offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find occurrence of mem (with length mem_len) in pbuf p, starting at offset start_offset.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' </td></tr>
    <tr><td class="paramname">mem</td><td>search for the contents of this buffer </td></tr>
    <tr><td class="paramname">mem_len</td><td>length of 'mem' </td></tr>
    <tr><td class="paramname">start_offset</td><td>offset into p at which to start searching </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0xFFFF if substr was not found in p or the index where it was found </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01405">1405</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01363">pbuf_memcmp()</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01432">pbuf_strstr()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga18c164a6e4a24d89ea9eb7571a886448_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga18c164a6e4a24d89ea9eb7571a886448_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga18c164a6e4a24d89ea9eb7571a886448_cgraph" id="d7/d05/group__pbuf_ga18c164a6e4a24d89ea9eb7571a886448_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,108,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga2170ccbbb13238380dbb203ee1b85974" title=" " alt="" coords="156,5,263,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga6d803d9945bffb7ad97743f2fa503da6" title=" " alt="" coords="311,5,400,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga839f342803b0cf89049744124c5a98ad" title=" " alt="" coords="448,5,559,32"/>
</map>
</div>

</div>
</div>
<a id="gaf76863707dc02993eae116574b1ea03f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf76863707dc02993eae116574b1ea03f">&#9670;&nbsp;</a></span>pbuf_put_at()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pbuf_put_at </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga4caecabca98b43919dd11be1c0d4cd8e">u8_t</a>&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Put one byte to the specified position in a pbuf WARNING: silently ignores offset &gt;= p-&gt;tot_len</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to fill </td></tr>
    <tr><td class="paramname">offset</td><td>offset into p of the byte to write </td></tr>
    <tr><td class="paramname">data</td><td>byte to write at an offset into p </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01340">1340</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01132">pbuf_skip()</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_gaf76863707dc02993eae116574b1ea03f_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_gaf76863707dc02993eae116574b1ea03f_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_gaf76863707dc02993eae116574b1ea03f_cgraph" id="d7/d05/group__pbuf_gaf76863707dc02993eae116574b1ea03f_cgraph">
<area shape="rect" title=" " alt="" coords="5,5,95,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga6a961522d81f0327aaf4d4ee6d96c583" title=" " alt="" coords="143,5,220,32"/>
</map>
</div>

</div>
</div>
<a id="ga50abfe830a33a1a47a562febee66015d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50abfe830a33a1a47a562febee66015d">&#9670;&nbsp;</a></span>pbuf_realloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pbuf_realloc </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>new_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Shrink a pbuf chain to a desired length.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to shrink. </td></tr>
    <tr><td class="paramname">new_len</td><td>desired new length of pbuf chain</td></tr>
  </table>
  </dd>
</dl>
<p>Depending on the desired length, the first few pbufs in a chain might be skipped and left unchanged. The new last pbuf in the chain will be resized, and any remaining pbufs will be freed.</p>
<dl class="section note"><dt>Note</dt><dd>If the pbuf is ROM/REF, only the -&gt;tot_len and -&gt;len fields are adjusted. </dd>
<dd>
May not be called on a packet queue.</dd>
<dd>
Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain). </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00493">493</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00165">flags</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00055">LWIP_SUPPORT_CUSTOM_PBUF</a>, <a class="el" href="../../d3/d8f/mem_8c_source.html#l00478">mem_trim()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00131">PBUF_FLAG_IS_CUSTOM</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00715">pbuf_free()</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00123">PBUF_POOL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00108">PBUF_RAM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00116">PBUF_REF</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00112">PBUF_ROM</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00162">type</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_ga50abfe830a33a1a47a562febee66015d_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_ga50abfe830a33a1a47a562febee66015d_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_ga50abfe830a33a1a47a562febee66015d_cgraph" id="d7/d05/group__pbuf_ga50abfe830a33a1a47a562febee66015d_cgraph">
<area shape="rect" title=" " alt="" coords="5,31,96,57"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a5e39a108c44d8a72df0b30a117cb62e4" title=" " alt="" coords="144,5,224,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b" title=" " alt="" coords="147,56,221,83"/>
<area shape="rect" href="../../d9/d9a/mem_8h.html#a2fd7aa1adf6e394d3be7c7734e7df41a" title=" " alt="" coords="276,31,355,57"/>
<area shape="rect" href="../../df/dff/memp_8h.html#aecd94926b7c2a0e23ae195f4ae97581f" title=" " alt="" coords="272,81,359,108"/>
</map>
</div>

</div>
</div>
<a id="ga77f6bbd69e45e542014d9c547c7da74e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga77f6bbd69e45e542014d9c547c7da74e">&#9670;&nbsp;</a></span>pbuf_ref()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pbuf_ref </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Increment the reference count of the pbuf.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to increase reference counter of </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00821">821</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00172">ref</a>, and <a class="el" href="../../d9/d87/sys_8h_source.html#l00375">SYS_ARCH_INC</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l00883">pbuf_chain()</a>.</p>

</div>
</div>
<a id="ga6a961522d81f0327aaf4d4ee6d96c583"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6a961522d81f0327aaf4d4ee6d96c583">&#9670;&nbsp;</a></span>pbuf_skip()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a>* pbuf_skip </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>in_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a> *&#160;</td>
          <td class="paramname"><em>out_offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Skip a number of bytes at the start of a pbuf</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">in</td><td>input pbuf </td></tr>
    <tr><td class="paramname">in_offset</td><td>offset to skip </td></tr>
    <tr><td class="paramname">out_offset</td><td>resulting offset in the returned pbuf </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the pbuf in the queue where the offset is </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01132">1132</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01340">pbuf_put_at()</a>, and <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01194">pbuf_take_at()</a>.</p>

</div>
</div>
<a id="gad1e31e370271335b197272af2724ca85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad1e31e370271335b197272af2724ca85">&#9670;&nbsp;</a></span>pbuf_take()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> pbuf_take </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *&#160;</td>
          <td class="paramname"><em>dataptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy application supplied data into a pbuf. This function can only be used to copy the equivalent of buf-&gt;tot_len data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>pbuf to fill with data </td></tr>
    <tr><td class="paramname">dataptr</td><td>application supplied data buffer </td></tr>
    <tr><td class="paramname">len</td><td>length of the application supplied data buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_MEM if the pbuf is not big enough </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01150">1150</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d6/d40/err_8h_source.html#l00096">ERR_ARG</a>, <a class="el" href="../../d6/d40/err_8h_source.html#l00065">ERR_MEM</a>, <a class="el" href="../../d6/d40/err_8h_source.html#l00063">ERR_OK</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00116">LWIP_ASSERT</a>, <a class="el" href="../../db/d16/debug_8h_source.html#l00135">LWIP_ERROR</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00043">MEMCPY</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01194">pbuf_take_at()</a>.</p>

</div>
</div>
<a id="gae1cf2bf7454ff87ff377b0b2262f9b44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae1cf2bf7454ff87ff377b0b2262f9b44">&#9670;&nbsp;</a></span>pbuf_take_at()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d2/de7/group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> pbuf_take_at </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> void *&#160;</td>
          <td class="paramname"><em>dataptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Same as <a class="el" href="../../d7/d05/group__pbuf.html#gad1e31e370271335b197272af2724ca85">pbuf_take()</a> but puts data at an offset</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>pbuf to fill with data </td></tr>
    <tr><td class="paramname">dataptr</td><td>application supplied data buffer </td></tr>
    <tr><td class="paramname">len</td><td>length of the application supplied data buffer </td></tr>
    <tr><td class="paramname">offset</td><td>offset in pbuf where to copy dataptr to</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if successful, ERR_MEM if the pbuf is not big enough </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01194">1194</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">References <a class="el" href="../../d6/d40/err_8h_source.html#l00065">ERR_MEM</a>, <a class="el" href="../../d6/d40/err_8h_source.html#l00063">ERR_OK</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00159">len</a>, <a class="el" href="../../d4/da4/def_8h_source.html#l00055">LWIP_MIN</a>, <a class="el" href="../../d2/d78/lwipopts_8h_source.html#l00043">MEMCPY</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00144">next</a>, <a class="el" href="../../d6/d8a/fat__string_8h_source.html#l00017">NULL</a>, <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00147">payload</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01132">pbuf_skip()</a>, <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01150">pbuf_take()</a>, and <a class="el" href="../../d0/d35/pbuf_8h_source.html#l00156">tot_len</a>.</p>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="../../d7/d05/group__pbuf_gae1cf2bf7454ff87ff377b0b2262f9b44_cgraph.png" border="0" usemap="#d7/d05/group__pbuf_gae1cf2bf7454ff87ff377b0b2262f9b44_cgraph" alt=""/></div>
<map name="d7/d05/group__pbuf_gae1cf2bf7454ff87ff377b0b2262f9b44_cgraph" id="d7/d05/group__pbuf_gae1cf2bf7454ff87ff377b0b2262f9b44_cgraph">
<area shape="rect" title=" " alt="" coords="5,31,101,57"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#ga6a961522d81f0327aaf4d4ee6d96c583" title=" " alt="" coords="150,5,227,32"/>
<area shape="rect" href="../../d7/d05/group__pbuf.html#gad1e31e370271335b197272af2724ca85" title=" " alt="" coords="149,56,228,83"/>
</map>
</div>

</div>
</div>
<a id="ga839f342803b0cf89049744124c5a98ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga839f342803b0cf89049744124c5a98ad">&#9670;&nbsp;</a></span>pbuf_try_get_at()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pbuf_try_get_at </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d6/d92/cdefs_8h.html#a2c212835823e3c54a8ab6d95c652660e">const</a> struct <a class="el" href="../../d9/db8/structpbuf.html">pbuf</a> *&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../de/d8c/group__compiler__abstraction.html#ga77570ac4fcab86864fa1916e55676da2">u16_t</a>&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get one byte from the specified position in a pbuf</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>pbuf to parse </td></tr>
    <tr><td class="paramname">offset</td><td>offset into p of the byte to return </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>byte at an offset into p [0..0xFF] OR negative if 'offset' &gt;= p-&gt;tot_len </dd></dl>

<p class="definition">Definition at line <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01318">1318</a> of file <a class="el" href="../../d8/df0/pbuf_8c_source.html">pbuf.c</a>.</p>

<p class="reference">Referenced by <a class="el" href="../../d8/df0/pbuf_8c_source.html#l01300">pbuf_get_at()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="agroup__pbuf_html_ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba"><div class="ttname"><a href="../../d7/d05/group__pbuf.html#ggaee1baa59bb2f85ba575b5a8619ac1ebfa21116654fbab6d5a4dfeb87a1bb8f0ba">PBUF_RAW</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d0/d35/pbuf_8h_source.html#l00094">pbuf.h:94</a></div></div>
<div class="ttc" id="astructnetif_html_a8fe4f1b7b0d710216287da9615164a5c"><div class="ttname"><a href="../../d2/dd6/structnetif.html#a8fe4f1b7b0d710216287da9615164a5c">netif::input</a></div><div class="ttdeci">netif_input_fn input</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d69/netif_8h_source.html#l00252">netif.h:252</a></div></div>
<div class="ttc" id="agroup__pbuf_html_gab0dd696fb4b6bc65e548944584f1738b"><div class="ttname"><a href="../../d7/d05/group__pbuf.html#gab0dd696fb4b6bc65e548944584f1738b">pbuf_free</a></div><div class="ttdeci">u8_t pbuf_free(struct pbuf *p)</div><div class="ttdef"><b>Definition:</b> <a href="../../d8/df0/pbuf_8c_source.html#l00715">pbuf.c:715</a></div></div>
<div class="ttc" id="astructnetif_html"><div class="ttname"><a href="../../d2/dd6/structnetif.html">netif</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d69/netif_8h_source.html#l00233">netif.h:233</a></div></div>
<div class="ttc" id="agroup__mempool_html_gaa43d114dd702fbd8f1db18474ea93a04"><div class="ttname"><a href="../../dd/de2/group__mempool.html#gaa43d114dd702fbd8f1db18474ea93a04">LWIP_MEMPOOL_FREE</a></div><div class="ttdeci">#define LWIP_MEMPOOL_FREE(name, x)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dff/memp_8h_source.html#l00127">memp.h:127</a></div></div>
<div class="ttc" id="agroup__infrastructure__errors_html_ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb"><div class="ttname"><a href="../../d2/de7/group__infrastructure__errors.html#ggae2e66c7d13afc90ffecd6151680fbadcaa26c163b80b1f6786ca81dadc14b00fb">ERR_OK</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d6/d40/err_8h_source.html#l00063">err.h:63</a></div></div>
<div class="ttc" id="agroup__mempool_html_ga5b1fb3ce7942432d87cc948b1c5ed6cb"><div class="ttname"><a href="../../dd/de2/group__mempool.html#ga5b1fb3ce7942432d87cc948b1c5ed6cb">LWIP_MEMPOOL_DECLARE</a></div><div class="ttdeci">#define LWIP_MEMPOOL_DECLARE(name, num, size, desc)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dff/memp_8h_source.html#l00095">memp.h:95</a></div></div>
<div class="ttc" id="astructpbuf_html"><div class="ttname"><a href="../../d9/db8/structpbuf.html">pbuf</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d0/d35/pbuf_8h_source.html#l00142">pbuf.h:142</a></div></div>
<div class="ttc" id="agroup__mempool_html_ga5e2498f6c17746c1fe7153de5f7f275a"><div class="ttname"><a href="../../dd/de2/group__mempool.html#ga5e2498f6c17746c1fe7153de5f7f275a">LWIP_MEMPOOL_ALLOC</a></div><div class="ttdeci">#define LWIP_MEMPOOL_ALLOC(name)</div><div class="ttdef"><b>Definition:</b> <a href="../../df/dff/memp_8h_source.html#l00122">memp.h:122</a></div></div>
<div class="ttc" id="agroup__pbuf_html_ggab7e0e32fcc292c0d7107721766ed92fbac9b6ba960fdea6f2e8f35c8313b77e4e"><div class="ttname"><a href="../../d7/d05/group__pbuf.html#ggab7e0e32fcc292c0d7107721766ed92fbac9b6ba960fdea6f2e8f35c8313b77e4e">PBUF_REF</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d0/d35/pbuf_8h_source.html#l00116">pbuf.h:116</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <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>