<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/> <title>libnl: Packet/Bytes FIFO (pfifo/bfifo)</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libnl <span id="projectnumber">1.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <h1>Packet/Bytes FIFO (pfifo/bfifo)</h1> </div> <div class="ingroups"><a class="el" href="group__qdisc__api.html">Queueing Discipline Modules</a></div></div> <div class="contents"> <p>The FIFO qdisc comes in two flavours: <a href="#_details">More...</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="member-group"></a> Attribute Modification</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fifo.html#gac3de03e9d829b5d884b52c668e972c1e">rtnl_qdisc_fifo_set_limit</a> (struct rtnl_qdisc *qdisc, int limit)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set limit of FIFO qdisc. <a href="#gac3de03e9d829b5d884b52c668e972c1e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__fifo.html#ga4cf9cc1e906d5459af88869e5cbbe06d">rtnl_qdisc_fifo_get_limit</a> (struct rtnl_qdisc *qdisc)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get limit of a FIFO qdisc. <a href="#ga4cf9cc1e906d5459af88869e5cbbe06d"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <dl class="user"><dt><b>bfifo (Byte FIFO)</b></dt><dd>Allows enqueuing until the currently queued volume in bytes exceeds the configured limit.backlog contains currently enqueued volume in bytes.</dd></dl> <dl class="user"><dt><b>pfifo (Packet FIFO)</b></dt><dd>Allows enquueing until the currently queued number of packets exceeds the configured limit.</dd></dl> <p>The configuration is exactly the same, the decision which of the two variations is going to be used is made based on the kind of the qdisc (rtnl_qdisc_set_kind()). </p> <hr/><h2>Function Documentation</h2> <a class="anchor" id="gac3de03e9d829b5d884b52c668e972c1e"></a><!-- doxytag: member="fifo.c::rtnl_qdisc_fifo_set_limit" ref="gac3de03e9d829b5d884b52c668e972c1e" args="(struct rtnl_qdisc *qdisc, int limit)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int rtnl_qdisc_fifo_set_limit </td> <td>(</td> <td class="paramtype">struct rtnl_qdisc * </td> <td class="paramname"><em>qdisc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>limit</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">qdisc</td><td>FIFO qdisc to be modified. </td></tr> <tr><td class="paramname">limit</td><td>New limit. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>0 on success or a negative error code. </dd></dl> <p>Definition at line <a class="el" href="fifo_8c_source.html#l00145">145</a> of file <a class="el" href="fifo_8c_source.html">fifo.c</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keyword">struct </span>rtnl_fifo *fifo; fifo = fifo_alloc(qdisc); <span class="keywordflow">if</span> (!fifo) <span class="keywordflow">return</span> nl_errno(ENOMEM); fifo->qf_limit = limit; fifo->qf_mask |= SCH_FIFO_ATTR_LIMIT; <span class="keywordflow">return</span> 0; } </pre></div> </div> </div> <a class="anchor" id="ga4cf9cc1e906d5459af88869e5cbbe06d"></a><!-- doxytag: member="fifo.c::rtnl_qdisc_fifo_get_limit" ref="ga4cf9cc1e906d5459af88869e5cbbe06d" args="(struct rtnl_qdisc *qdisc)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int rtnl_qdisc_fifo_get_limit </td> <td>(</td> <td class="paramtype">struct rtnl_qdisc * </td> <td class="paramname"><em>qdisc</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">qdisc</td><td>FIFO qdisc. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Numeric limit or a negative error code. </dd></dl> <p>Definition at line <a class="el" href="fifo_8c_source.html#l00164">164</a> of file <a class="el" href="fifo_8c_source.html">fifo.c</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keyword">struct </span>rtnl_fifo *fifo; fifo = fifo_qdisc(qdisc); <span class="keywordflow">if</span> (fifo && fifo->qf_mask & SCH_FIFO_ATTR_LIMIT) <span class="keywordflow">return</span> fifo->qf_limit; <span class="keywordflow">else</span> <span class="keywordflow">return</span> nl_errno(ENOMEM); } </pre></div> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated on Mon Mar 21 2011 for libnl by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>