<!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"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>libnl: Routing</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="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="libnl.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 style="padding-left: 0.5em;"> <div id="projectname">libnl  <span id="projectnumber">3.2.21</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.1.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__route.html','');}); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#groups">Modules</a> | <a href="#define-members">Macros</a> </div> <div class="headertitle"> <div class="title">Routing</div> </div> <div class="ingroups"><a class="el" href="group__rtnl.html">Routing Library (libnl-route)</a></div></div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="groups"></a> Modules</h2></td></tr> <tr class="memitem:group__route__obj"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__route__obj.html">Route Object</a></td></tr> <tr class="memitem:group__route__utils"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__route__utils.html">Utilities</a></td></tr> <tr class="memdesc:group__route__utils"><td class="mdescLeft"> </td><td class="mdescRight">Routing Utility Functions. <br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga8c0973eb5ca8bdcc070e0a1706df7769"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8c0973eb5ca8bdcc070e0a1706df7769"></a> #define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__route.html#ga8c0973eb5ca8bdcc070e0a1706df7769">ROUTE_CACHE_CONTENT</a>   1</td></tr> <tr class="memdesc:ga8c0973eb5ca8bdcc070e0a1706df7769"><td class="mdescLeft"> </td><td class="mdescRight">When passed to <a class="el" href="group__route.html#ga21514a77b265b569ce0c64e928faae47" title="Build a route cache holding all routes currently configured in the kernel.">rtnl_route_alloc_cache()</a> the cache will correspond to the contents of the routing cache instead of the actual routes. <br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="member-group"></a> Cache Management</h2></td></tr> <tr class="memitem:ga21514a77b265b569ce0c64e928faae47"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__route.html#ga21514a77b265b569ce0c64e928faae47">rtnl_route_alloc_cache</a> (struct nl_sock *sk, int family, int flags, struct nl_cache **result)</td></tr> <tr class="memdesc:ga21514a77b265b569ce0c64e928faae47"><td class="mdescLeft"> </td><td class="mdescRight">Build a route cache holding all routes currently configured in the kernel. <a href="#ga21514a77b265b569ce0c64e928faae47"></a><br/></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2><a name="member-group"></a> Route Addition</h2></td></tr> <tr class="memitem:ga641e61e055707e72a197360e522d1103"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga641e61e055707e72a197360e522d1103"></a> int </td><td class="memItemRight" valign="bottom"><b>rtnl_route_build_add_request</b> (struct rtnl_route *tmpl, int flags, struct nl_msg **result)</td></tr> <tr class="memitem:ga1e0407a06489bd3327f4e6b826c308ac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1e0407a06489bd3327f4e6b826c308ac"></a> int </td><td class="memItemRight" valign="bottom"><b>rtnl_route_add</b> (struct nl_sock *sk, struct rtnl_route *route, int flags)</td></tr> <tr class="memitem:ga71b740f64d743cd4209b63fc9e3cf04d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga71b740f64d743cd4209b63fc9e3cf04d"></a> int </td><td class="memItemRight" valign="bottom"><b>rtnl_route_build_del_request</b> (struct rtnl_route *tmpl, int flags, struct nl_msg **result)</td></tr> <tr class="memitem:gac4588aab4e62c9ab9baa0a593aaf3339"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac4588aab4e62c9ab9baa0a593aaf3339"></a> int </td><td class="memItemRight" valign="bottom"><b>rtnl_route_delete</b> (struct nl_sock *sk, struct rtnl_route *route, int flags)</td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <hr/><h2>Function Documentation</h2> <a class="anchor" id="ga21514a77b265b569ce0c64e928faae47"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int rtnl_route_alloc_cache </td> <td>(</td> <td class="paramtype">struct nl_sock * </td> <td class="paramname"><em>sk</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>family</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>flags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">struct nl_cache ** </td> <td class="paramname"><em>result</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Build a route cache holding all routes currently configured in the kernel. </p> <dl class="params"><dt>Parameters:</dt><dd> <table class="params"> <tr><td class="paramname">sk</td><td>Netlink socket. </td></tr> <tr><td class="paramname">family</td><td>Address family of routes to cover or AF_UNSPEC </td></tr> <tr><td class="paramname">flags</td><td>Flags </td></tr> <tr><td class="paramname">result</td><td>Result pointer</td></tr> </table> </dd> </dl> <p>Allocates a new cache, initializes it properly and updates it to contain all routes currently configured in the kernel.</p> <p>Valid flags:</p> <ul> <li>ROUTE_CACHE_CONTENT - Cache will contain contents of routing cache instead of actual routes.</li> </ul> <dl class="section note"><dt>Note:</dt><dd>The caller is responsible for destroying and freeing the cache after using it. </dd></dl> <dl class="section return"><dt>Returns:</dt><dd>0 on success or a negative error code. </dd></dl> <p>Definition at line <a class="el" href="lib_2route_2route_8c_source.html#l00080">80</a> of file <a class="el" href="lib_2route_2route_8c_source.html">route.c</a>.</p> <p>References <a class="el" href="cache_8c_source.html#l00183">nl_cache_alloc()</a>, and <a class="el" href="cache_8c_source.html#l00937">nl_cache_refill()</a>.</p> <p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Here is the call graph for this function:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"><img src="group__route_ga21514a77b265b569ce0c64e928faae47_cgraph.png" border="0" usemap="#group__route_ga21514a77b265b569ce0c64e928faae47_cgraph" alt=""/></div> <map name="group__route_ga21514a77b265b569ce0c64e928faae47_cgraph" id="group__route_ga21514a77b265b569ce0c64e928faae47_cgraph"> <area shape="rect" id="node3" href="group__cache.html#ga9520ae0f2158db3c081f34c851d92252" title="Allocate new cache." alt="" coords="219,69,333,96"/><area shape="rect" id="node7" href="group__cache.html#ga10aacd9aef738dbf9e0e5967272999de" title="(Re)fill a cache with the contents in the kernel." alt="" coords="221,145,331,172"/><area shape="rect" id="node5" href="group__hashtable.html#ga385592984c127646229f450e68d54631" title="Allocate hashtable." alt="" coords="381,56,528,83"/><area shape="rect" id="node9" href="group__cache.html#gad22be4bd392afc8daca60a80f24a277b" title="Remove all objects of a cache." alt="" coords="397,107,513,133"/><area shape="rect" id="node25" href="group__cache.html#ga6259b43583b20927adf461300cabca12" title="Pickup a netlink dump response and put it into a cache." alt="" coords="391,157,518,184"/><area shape="rect" id="node27" href="group__cache.html#ga281b7042d76dbdc704dc0a47c7cd83f0" title="Set synchronization arg1 of cache." alt="" coords="384,208,525,235"/><area shape="rect" id="node11" href="group__cache.html#ga8d1f1d2c3b355a7f129d9cd6f7da2b52" title="Remove object from cache." alt="" coords="577,107,711,133"/><area shape="rect" id="node13" href="group__hashtable.html#ga6946a161136a7fb529e80a6d4baa7fab" title="Remove object from hashtable." alt="" coords="760,56,896,83"/><area shape="rect" id="node19" href="group__object.html#ga9905da094bf4c03cf4ac78aeaa86a12b" title="Release a reference from an object." alt="" coords="960,107,1067,133"/><area shape="rect" id="node15" href="group__object.html#gaab17e2f7a53ad9eb9cae3d0a60e41074" title="Check if the identifiers of two objects are identical." alt="" coords="944,5,1083,32"/><area shape="rect" id="node17" href="group__object.html#gafa9b3404ac70fd385d2837312fd38f6b" title="Generate object hash key." alt="" coords="947,56,1079,83"/><area shape="rect" id="node21" href="group__object.html#gabf3bc276bb9102f83fc96d299b6b03ce" title="Free a cacheable object." alt="" coords="1131,132,1242,159"/></map> </div> </p> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Thu Jan 24 2013 14:39:30 for libnl by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li> </ul> </div> </body> </html>