
Added initial support Xilinx Embedded Software. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
878 lines
42 KiB
HTML
Executable file
878 lines
42 KiB
HTML
Executable file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>2014.1_doc: U:/hsm_publish/HEAD/data/embeddedsw/ThirdParty/sw_services/lwip140_v2_0/src/lwip-1.4.0/src/core/pbuf.c File Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.5 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li id="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="dirs.html"><span>Directories</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="files.html"><span>File List</span></a></li>
|
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="dir_U_3A_2F.html">U:</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2F.html">hsm_publish</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2F.html">HEAD</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2F.html">data</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2F.html">embeddedsw</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2F.html">ThirdParty</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2F.html">sw_services</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2Flwip140_5Fv2_5F0_2F.html">lwip140_v2_0</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2Flwip140_5Fv2_5F0_2Fsrc_2F.html">src</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2Flwip140_5Fv2_5F0_2Fsrc_2Flwip_2D1_2E4_2E0_2F.html">lwip-1.4.0</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2Flwip140_5Fv2_5F0_2Fsrc_2Flwip_2D1_2E4_2E0_2Fsrc_2F.html">src</a> » <a class="el" href="dir_U_3A_2Fhsm_5Fpublish_2FHEAD_2Fdata_2Fembeddedsw_2FThirdParty_2Fsw_5Fservices_2Flwip140_5Fv2_5F0_2Fsrc_2Flwip_2D1_2E4_2E0_2Fsrc_2Fcore_2F.html">core</a></div>
|
|
<h1>pbuf.c File Reference</h1><code>#include "<a class="el" href="opt_8h.html">lwip/opt.h</a>"</code><br>
|
|
<code>#include "lwip/stats.h"</code><br>
|
|
<code>#include "lwip/def.h"</code><br>
|
|
<code>#include "lwip/mem.h"</code><br>
|
|
<code>#include "lwip/memp.h"</code><br>
|
|
<code>#include "lwip/pbuf.h"</code><br>
|
|
<code>#include "lwip/sys.h"</code><br>
|
|
<code>#include "arch/perf.h"</code><br>
|
|
<code>#include <string.h></code><br>
|
|
<table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">pbuf * </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#462f19a94b4d59b37481e7637ad06142">pbuf_alloc</a> (pbuf_layer layer, u16_t length, pbuf_type type)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#95d4e919a5206c6ebc3e79a2ccfd2a30">pbuf_realloc</a> (struct pbuf *p, u16_t new_len)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#1a1b373de37b714f344e1e6d3e7fdb35">pbuf_header</a> (struct pbuf *p, s16_t header_size_increment)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#95cc487c4910be01cee99494f8f965e0">pbuf_free</a> (struct pbuf *p)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#56a7db9f8a0a13b49c098ceab27e3703">pbuf_clen</a> (struct pbuf *p)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#26d08040c238947ee9fd8c473440d0c4">pbuf_ref</a> (struct pbuf *p)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#e0043192229bd974c0d65698d4a6a56a">pbuf_cat</a> (struct pbuf *h, struct pbuf *t)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#8b5e1fc716d9d0a7d8da52a4fea54c1e">pbuf_chain</a> (struct pbuf *h, struct pbuf *t)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">pbuf * </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#bf3a0be3ad39822bbcf0424e160f3af1">pbuf_dechain</a> (struct pbuf *p)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">err_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#e169a9766f792530b4476455133ae819">pbuf_copy</a> (struct pbuf *p_to, struct pbuf *p_from)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#97bde52c33afc2e4c5aa6353ea4255fa">pbuf_copy_partial</a> (struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">err_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#b7cf2698b7452e155c2891f8c64a8155">pbuf_take</a> (struct pbuf *buf, const void *dataptr, u16_t len)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">pbuf * </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#7451fac1349c1d83c672fd0d0ccdfc1a">pbuf_coalesce</a> (struct pbuf *p, pbuf_layer layer)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u8_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#d9276043a1464cf2f6b3077a22a7af69">pbuf_get_at</a> (struct pbuf *p, u16_t offset)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#60ca05b379d634f962f26fa7f9232230">pbuf_memcmp</a> (struct pbuf *p, u16_t offset, const void *s2, u16_t n)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#84acc57ae81ccc2056e56b86eec6487e">pbuf_memfind</a> (struct pbuf *p, const void *<a class="el" href="structmem.html">mem</a>, u16_t mem_len, u16_t start_offset)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">u16_t </td><td class="memItemRight" valign="bottom"><a class="el" href="pbuf_8c.html#5c37025406122c5ac374ad0dec0d5cea">pbuf_strstr</a> (struct pbuf *p, const char *substr)</td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Packet buffer management<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>
|
|
A packet may span over multiple pbufs, chained as a singly linked list. This is called a "pbuf chain".<p>
|
|
Multiple packets may be queued, also using this singly linked list. This is called a "packet queue".<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>
|
|
The differences between a pbuf chain and a packet queue are very precise but subtle.<p>
|
|
The last pbuf of a packet has a ->tot_len field that equals the ->len field. It can be found by traversing the list. If the last pbuf of a packet has a ->next field other than NULL, more packets are on the queue.<p>
|
|
Therefore, looping through a pbuf of a single packet, has an loop end condition (tot_len == p->len), NOT (next == NULL). <hr><h2>Function Documentation</h2>
|
|
<a class="anchor" name="462f19a94b4d59b37481e7637ad06142"></a><!-- doxytag: member="pbuf.c::pbuf_alloc" ref="462f19a94b4d59b37481e7637ad06142" args="(pbuf_layer layer, u16_t length, pbuf_type type)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">struct pbuf* pbuf_alloc </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">pbuf_layer </td>
|
|
<td class="mdname" nowrap> <em>layer</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>length</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>pbuf_type </td>
|
|
<td class="mdname" nowrap> <em>type</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Allocates a pbuf of the given type (possibly a chain for PBUF_POOL type).<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 compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>layer</em> </td><td>flag to define header size </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>length</em> </td><td>size of the pbuf's payload </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>type</em> </td><td>this parameter decides how and where the pbuf should be allocated as follows:</td></tr>
|
|
</table>
|
|
</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 pbuf_init().</li></ul>
|
|
<p>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>the allocated pbuf. If multiple pbufs where allocated, this is the first pbuf of a pbuf chain. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="e0043192229bd974c0d65698d4a6a56a"></a><!-- doxytag: member="pbuf.c::pbuf_cat" ref="e0043192229bd974c0d65698d4a6a56a" args="(struct pbuf *h, struct pbuf *t)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void pbuf_cat </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>t</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Concatenate two pbufs (each may be a pbuf chain) and take over the caller's reference of the tail pbuf.<p>
|
|
<dl compact><dt><b>Note:</b></dt><dd>The caller MAY NOT reference the tail pbuf afterwards. Use <a class="el" href="pbuf_8c.html#8b5e1fc716d9d0a7d8da52a4fea54c1e">pbuf_chain()</a> for that purpose.</dd></dl>
|
|
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="pbuf_8c.html#8b5e1fc716d9d0a7d8da52a4fea54c1e">pbuf_chain()</a> </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="8b5e1fc716d9d0a7d8da52a4fea54c1e"></a><!-- doxytag: member="pbuf.c::pbuf_chain" ref="8b5e1fc716d9d0a7d8da52a4fea54c1e" args="(struct pbuf *h, struct pbuf *t)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void pbuf_chain </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>h</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>t</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Chain two pbufs (or pbuf chains) together.<p>
|
|
The caller MUST call pbuf_free(t) once it has stopped using it. Use <a class="el" href="pbuf_8c.html#e0043192229bd974c0d65698d4a6a56a">pbuf_cat()</a> instead if you no longer use t.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>h</em> </td><td>head pbuf (chain) </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>t</em> </td><td>tail pbuf (chain) </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>The pbufs MUST belong to the same packet. <p>
|
|
MAY NOT be called on a packet queue.</dd></dl>
|
|
The ->tot_len fields of all pbufs of the head chain are adjusted. The ->next field of the last pbuf of the head chain is adjusted. The ->ref field of the first pbuf of the tail chain is adjusted. </td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="56a7db9f8a0a13b49c098ceab27e3703"></a><!-- doxytag: member="pbuf.c::pbuf_clen" ref="56a7db9f8a0a13b49c098ceab27e3703" args="(struct pbuf *p)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u8_t pbuf_clen </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>p</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Count number of pbufs in a chain<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>first pbuf of chain </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>the number of pbufs in a chain </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="7451fac1349c1d83c672fd0d0ccdfc1a"></a><!-- doxytag: member="pbuf.c::pbuf_coalesce" ref="7451fac1349c1d83c672fd0d0ccdfc1a" args="(struct pbuf *p, pbuf_layer layer)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">struct pbuf* pbuf_coalesce </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>pbuf_layer </td>
|
|
<td class="mdname" nowrap> <em>layer</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Creates a single pbuf out of a queue of pbufs.<p>
|
|
<dl compact><dt><b>Remarks:</b></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 compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>the source pbuf </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>layer</em> </td><td>pbuf_layer of the new pbuf</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>a new, single pbuf (p->next is NULL) or the old pbuf if allocation fails </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="e169a9766f792530b4476455133ae819"></a><!-- doxytag: member="pbuf.c::pbuf_copy" ref="e169a9766f792530b4476455133ae819" args="(struct pbuf *p_to, struct pbuf *p_from)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">err_t pbuf_copy </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p_to</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p_from</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Create PBUF_RAM copies of pbufs.<p>
|
|
Used to queue packets on behalf of the lwIP stack, such as ARP based queueing.<p>
|
|
<dl compact><dt><b>Note:</b></dt><dd>You MUST explicitly use p = pbuf_take(p);<p>
|
|
Only one packet is copied, no packet queue!</dd></dl>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p_to</em> </td><td>pbuf destination of the copy </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>p_from</em> </td><td>pbuf source of the copy</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></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>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="97bde52c33afc2e4c5aa6353ea4255fa"></a><!-- doxytag: member="pbuf.c::pbuf_copy_partial" ref="97bde52c33afc2e4c5aa6353ea4255fa" args="(struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u16_t pbuf_copy_partial </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>buf</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>void * </td>
|
|
<td class="mdname" nowrap> <em>dataptr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>len</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>offset</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Copy (part of) the contents of a packet buffer to an application supplied buffer.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>the pbuf from which to copy data </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>dataptr</em> </td><td>the application supplied buffer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of data to copy (dataptr must be big enough). No more than buf->tot_len will be copied, irrespective of len </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>offset into the packet buffer from where to begin copying len bytes </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>the number of bytes copied, or 0 on failure </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="bf3a0be3ad39822bbcf0424e160f3af1"></a><!-- doxytag: member="pbuf.c::pbuf_dechain" ref="bf3a0be3ad39822bbcf0424e160f3af1" args="(struct pbuf *p)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">struct pbuf* pbuf_dechain </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>p</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Dechains the first pbuf from its succeeding pbufs in the chain.<p>
|
|
Makes p->tot_len field equal to p->len. <dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to dechain </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>remainder of the pbuf chain, or NULL if it was de-allocated. </dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>May not be called on a packet queue. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="95cc487c4910be01cee99494f8f965e0"></a><!-- doxytag: member="pbuf.c::pbuf_free" ref="95cc487c4910be01cee99494f8f965e0" args="(struct pbuf *p)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u8_t pbuf_free </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>p</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Dereference a pbuf chain or queue and deallocate any no-longer-used pbufs at the head of this chain or queue.<p>
|
|
Decrements the pbuf reference count. If it reaches zero, the pbuf is deallocated.<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 compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>The pbuf (chain) to be dereferenced.</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>the number of pbufs that were de-allocated from the head of the chain.</dd></dl>
|
|
<dl compact><dt><b>Note:</b></dt><dd>MUST NOT be called on a packet queue (Not verified to work yet). <p>
|
|
the reference counter of a pbuf equals the number of pointers that refer to the pbuf (or into the pbuf). </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="d9276043a1464cf2f6b3077a22a7af69"></a><!-- doxytag: member="pbuf.c::pbuf_get_at" ref="d9276043a1464cf2f6b3077a22a7af69" args="(struct pbuf *p, u16_t offset)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u8_t pbuf_get_at </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>offset</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Get one byte from the specified position in a pbuf WARNING: returns zero for offset >= p->tot_len<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to parse </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>offset into p of the byte to return </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>byte at an offset into p OR ZERO IF 'offset' >= p->tot_len </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="1a1b373de37b714f344e1e6d3e7fdb35"></a><!-- doxytag: member="pbuf.c::pbuf_header" ref="1a1b373de37b714f344e1e6d3e7fdb35" args="(struct pbuf *p, s16_t header_size_increment)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u8_t pbuf_header </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>s16_t </td>
|
|
<td class="mdname" nowrap> <em>header_size_increment</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Adjusts the payload pointer to hide or reveal headers in the payload.<p>
|
|
Adjusts the ->payload pointer so that space for a header (dis)appears in the pbuf payload.<p>
|
|
The ->payload, ->tot_len and ->len fields are adjusted.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to change the header size. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>header_size_increment</em> </td><td>Number of bytes to increment header size which increases the size of the pbuf. New space is on the front. (Using a negative value decreases the header size.) If hdr_size_inc is 0, this function does nothing and returns succesful.</td></tr>
|
|
</table>
|
|
</dl>
|
|
PBUF_ROM and PBUF_REF type buffers cannot have their sizes increased, so the call will fail. A check is made that the increase in header size does not move the payload pointer in front of the start of the buffer. <dl compact><dt><b>Returns:</b></dt><dd>non-zero on failure, zero on success. </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="60ca05b379d634f962f26fa7f9232230"></a><!-- doxytag: member="pbuf.c::pbuf_memcmp" ref="60ca05b379d634f962f26fa7f9232230" args="(struct pbuf *p, u16_t offset, const void *s2, u16_t n)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u16_t pbuf_memcmp </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>offset</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>const void * </td>
|
|
<td class="mdname" nowrap> <em>s2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>n</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Compare pbuf contents at specified offset with memory s2, both of length n<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to compare </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>offset into p at wich to start comparing </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>s2</em> </td><td>buffer to compare </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>length of buffer to compare </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>zero if equal, nonzero otherwise (0xffff if p is too short, diffoffset+1 otherwise) </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="84acc57ae81ccc2056e56b86eec6487e"></a><!-- doxytag: member="pbuf.c::pbuf_memfind" ref="84acc57ae81ccc2056e56b86eec6487e" args="(struct pbuf *p, const void *mem, u16_t mem_len, u16_t start_offset)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u16_t pbuf_memfind </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>const void * </td>
|
|
<td class="mdname" nowrap> <em>mem</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>mem_len</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>start_offset</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Find occurrence of mem (with length mem_len) in pbuf p, starting at offset start_offset.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>mem</em> </td><td>search for the contents of this buffer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>mem_len</em> </td><td>length of 'mem' </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>start_offset</em> </td><td>offset into p at which to start searching </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>0xFFFF if substr was not found in p or the index where it was found </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="95d4e919a5206c6ebc3e79a2ccfd2a30"></a><!-- doxytag: member="pbuf.c::pbuf_realloc" ref="95d4e919a5206c6ebc3e79a2ccfd2a30" args="(struct pbuf *p, u16_t new_len)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void pbuf_realloc </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>new_len</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Shrink a pbuf chain to a desired length.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to shrink. </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>new_len</em> </td><td>desired new length of pbuf chain</td></tr>
|
|
</table>
|
|
</dl>
|
|
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 compact><dt><b>Note:</b></dt><dd>If the pbuf is ROM/REF, only the ->tot_len and ->len fields are adjusted. <p>
|
|
May not be called on a packet queue.<p>
|
|
Despite its name, pbuf_realloc cannot grow the size of a pbuf (chain). </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="26d08040c238947ee9fd8c473440d0c4"></a><!-- doxytag: member="pbuf.c::pbuf_ref" ref="26d08040c238947ee9fd8c473440d0c4" args="(struct pbuf *p)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">void pbuf_ref </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname1" valign="top" nowrap> <em>p</em> </td>
|
|
<td class="md" valign="top"> ) </td>
|
|
<td class="md" nowrap></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Increment the reference count of the pbuf.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to increase reference counter of </td></tr>
|
|
</table>
|
|
</dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="5c37025406122c5ac374ad0dec0d5cea"></a><!-- doxytag: member="pbuf.c::pbuf_strstr" ref="5c37025406122c5ac374ad0dec0d5cea" args="(struct pbuf *p, const char *substr)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">u16_t pbuf_strstr </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>p</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>const char * </td>
|
|
<td class="mdname" nowrap> <em>substr</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Find occurrence of substr with length substr_len in pbuf p, start at offset start_offset WARNING: in contrast to strstr(), this one does not stop at the first in the pbuf/source string!<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>pbuf to search, maximum length is 0xFFFE since 0xFFFF is used as return value 'not found' </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>substr</em> </td><td>string to search for in p, maximum length is 0xFFFE </td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>0xFFFF if substr was not found in p or the index where it was found </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<a class="anchor" name="b7cf2698b7452e155c2891f8c64a8155"></a><!-- doxytag: member="pbuf.c::pbuf_take" ref="b7cf2698b7452e155c2891f8c64a8155" args="(struct pbuf *buf, const void *dataptr, u16_t len)" --><p>
|
|
<table class="mdTable" cellpadding="2" cellspacing="0">
|
|
<tr>
|
|
<td class="mdRow">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md" nowrap valign="top">err_t pbuf_take </td>
|
|
<td class="md" valign="top">( </td>
|
|
<td class="md" nowrap valign="top">struct pbuf * </td>
|
|
<td class="mdname" nowrap> <em>buf</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>const void * </td>
|
|
<td class="mdname" nowrap> <em>dataptr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md" nowrap align="right"></td>
|
|
<td class="md"></td>
|
|
<td class="md" nowrap>u16_t </td>
|
|
<td class="mdname" nowrap> <em>len</em></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="md"></td>
|
|
<td class="md">) </td>
|
|
<td class="md" colspan="2"></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing="5" cellpadding="0" border="0">
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Copy application supplied data into a pbuf. This function can only be used to copy the equivalent of buf->tot_len data.<p>
|
|
<dl compact><dt><b>Parameters:</b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>pbuf to fill with data </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>dataptr</em> </td><td>application supplied data buffer </td></tr>
|
|
<tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>length of the application supplied data buffer</td></tr>
|
|
</table>
|
|
</dl>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>ERR_OK if successful, ERR_MEM if the pbuf is not big enough </dd></dl>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr size="1"><address style="align: right;"><small>Generated on Fri Feb 14 12:33:21 2014 for 2014.1_doc by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
|
|
</body>
|
|
</html>
|