Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 87b89b73c41f4440bb86afd421c7548f > files > 147

libnl-devel-1.1-14.fc14.x86_64.rpm

<!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: Neighbours</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&#160;<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&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<h1>Neighbours</h1>  </div>
<div class="ingroups"><a class="el" href="group__rtnl.html">Routing Netlink</a></div></div>
<div class="contents">

<p>The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link.  
<a href="#_details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Object Allocation/Freeage</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7601938662f70d0b0dbf4d26728cbc2a"></a><!-- doxytag: member="neigh::rtnl_neigh_alloc" ref="ga7601938662f70d0b0dbf4d26728cbc2a" args="(void)" -->
struct rtnl_neigh *&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_alloc</b> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4eddb24336fb45b9c32cbe0ea1aff61a"></a><!-- doxytag: member="neigh::rtnl_neigh_put" ref="ga4eddb24336fb45b9c32cbe0ea1aff61a" args="(struct rtnl_neigh *neigh)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_put</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Cache Managament</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct nl_cache *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gad37ec03be6acd25ae30ab803c6e1fd7a">rtnl_neigh_alloc_cache</a> (struct nl_handle *handle)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Build a neighbour cache including all neighbours currently configured in the kernel.  <a href="#gad37ec03be6acd25ae30ab803c6e1fd7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct rtnl_neigh *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gac0f72f54c8c5f5cacf0f1aae5807ae00">rtnl_neigh_get</a> (struct nl_cache *cache, int ifindex, struct nl_addr *dst)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Look up a neighbour by interface index and destination address.  <a href="#gac0f72f54c8c5f5cacf0f1aae5807ae00"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Addition</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct nl_msg *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gab07155b529558716c404c20e44cf8a02">rtnl_neigh_build_add_request</a> (struct rtnl_neigh *tmpl, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Build netlink request message to add a new neighbour.  <a href="#gab07155b529558716c404c20e44cf8a02"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#ga1611d01a97a92db4c458b6f95104712f">rtnl_neigh_add</a> (struct nl_handle *handle, struct rtnl_neigh *tmpl, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a new neighbour.  <a href="#ga1611d01a97a92db4c458b6f95104712f"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Deletion</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct nl_msg *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gaa254801cc344c81cc08dec128bc5cdbf">rtnl_neigh_build_delete_request</a> (struct rtnl_neigh *neigh, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Build a netlink request message to delete a neighbour.  <a href="#gaa254801cc344c81cc08dec128bc5cdbf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gabdd3b197117d4315e41bf54afbb11725">rtnl_neigh_delete</a> (struct nl_handle *handle, struct rtnl_neigh *neigh, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a neighbour.  <a href="#gabdd3b197117d4315e41bf54afbb11725"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Modification</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct nl_msg *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#gab4452b62dde528443781bb70929ba909">rtnl_neigh_build_change_request</a> (struct rtnl_neigh *neigh, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Build a netlink request message to change neighbour attributes.  <a href="#gab4452b62dde528443781bb70929ba909"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__neigh.html#ga32792f40676344c79998f3a97923f783">rtnl_neigh_change</a> (struct nl_handle *handle, struct rtnl_neigh *neigh, int flags)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Change neighbour attributes.  <a href="#ga32792f40676344c79998f3a97923f783"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour States Translations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1b0b93d3e5472ffc86d8c21e2fa0d1b9"></a><!-- doxytag: member="neigh::rtnl_neigh_state2str" ref="ga1b0b93d3e5472ffc86d8c21e2fa0d1b9" args="(int state, char *buf, size_t len)" -->
char *&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_state2str</b> (int state, char *buf, size_t len)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga65c789abe266041da81021a1c7979aa2"></a><!-- doxytag: member="neigh::rtnl_neigh_str2state" ref="ga65c789abe266041da81021a1c7979aa2" args="(const char *name)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_str2state</b> (const char *name)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Neighbour Flags Translations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac42fc58dd4af665ab9d2695790de73d4"></a><!-- doxytag: member="neigh::rtnl_neigh_flags2str" ref="gac42fc58dd4af665ab9d2695790de73d4" args="(int flags, char *buf, size_t len)" -->
char *&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_flags2str</b> (int flags, char *buf, size_t len)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9c0d649bbfac83bdfec7c0f35fb1dbee"></a><!-- doxytag: member="neigh::rtnl_neigh_str2flag" ref="ga9c0d649bbfac83bdfec7c0f35fb1dbee" args="(const char *name)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_str2flag</b> (const char *name)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga074945090142e5493b8e6cbb5c59a235"></a><!-- doxytag: member="neigh::rtnl_neigh_set_state" ref="ga074945090142e5493b8e6cbb5c59a235" args="(struct rtnl_neigh *neigh, int state)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_state</b> (struct rtnl_neigh *neigh, int state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga708b204e7d54c6cb27322a02e9ae964c"></a><!-- doxytag: member="neigh::rtnl_neigh_get_state" ref="ga708b204e7d54c6cb27322a02e9ae964c" args="(struct rtnl_neigh *neigh)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_state</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad0b11699e7ff34270384af614323e843"></a><!-- doxytag: member="neigh::rtnl_neigh_unset_state" ref="gad0b11699e7ff34270384af614323e843" args="(struct rtnl_neigh *neigh, int state)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_unset_state</b> (struct rtnl_neigh *neigh, int state)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab44c2acdb92fa24f04caf175916bbb80"></a><!-- doxytag: member="neigh::rtnl_neigh_set_flags" ref="gab44c2acdb92fa24f04caf175916bbb80" args="(struct rtnl_neigh *neigh, unsigned int flags)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_flags</b> (struct rtnl_neigh *neigh, unsigned int flags)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa501595609e7e4adb35af3c482c9ecb8"></a><!-- doxytag: member="neigh::rtnl_neigh_get_flags" ref="gaa501595609e7e4adb35af3c482c9ecb8" args="(struct rtnl_neigh *neigh)" -->
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_flags</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga00c844512fefd9de88a36ee5cf7dd957"></a><!-- doxytag: member="neigh::rtnl_neigh_unset_flags" ref="ga00c844512fefd9de88a36ee5cf7dd957" args="(struct rtnl_neigh *neigh, unsigned int flags)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_unset_flags</b> (struct rtnl_neigh *neigh, unsigned int flags)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7dd8383b96ab0b4224fde35f19303465"></a><!-- doxytag: member="neigh::rtnl_neigh_set_ifindex" ref="ga7dd8383b96ab0b4224fde35f19303465" args="(struct rtnl_neigh *neigh, int ifindex)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_ifindex</b> (struct rtnl_neigh *neigh, int ifindex)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2d324b42d88e281871778b9059c7c2f5"></a><!-- doxytag: member="neigh::rtnl_neigh_get_ifindex" ref="ga2d324b42d88e281871778b9059c7c2f5" args="(struct rtnl_neigh *neigh)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_ifindex</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga698f40cfadfcfa439f70e49fb2ddde84"></a><!-- doxytag: member="neigh::rtnl_neigh_set_lladdr" ref="ga698f40cfadfcfa439f70e49fb2ddde84" args="(struct rtnl_neigh *neigh, struct nl_addr *addr)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_lladdr</b> (struct rtnl_neigh *neigh, struct nl_addr *addr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5f491aa8a12aa3b7f2afa815b6599f50"></a><!-- doxytag: member="neigh::rtnl_neigh_get_lladdr" ref="ga5f491aa8a12aa3b7f2afa815b6599f50" args="(struct rtnl_neigh *neigh)" -->
struct nl_addr *&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_lladdr</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga23d70db3954550b49da9b92964bfa9a9"></a><!-- doxytag: member="neigh::rtnl_neigh_set_dst" ref="ga23d70db3954550b49da9b92964bfa9a9" args="(struct rtnl_neigh *neigh, struct nl_addr *addr)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_dst</b> (struct rtnl_neigh *neigh, struct nl_addr *addr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8e01f4f01847b2c39cf99783da61893a"></a><!-- doxytag: member="neigh::rtnl_neigh_get_dst" ref="ga8e01f4f01847b2c39cf99783da61893a" args="(struct rtnl_neigh *neigh)" -->
struct nl_addr *&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_dst</b> (struct rtnl_neigh *neigh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga12f5ac3ec0511eb8f8e3b68aec561445"></a><!-- doxytag: member="neigh::rtnl_neigh_set_family" ref="ga12f5ac3ec0511eb8f8e3b68aec561445" args="(struct rtnl_neigh *neigh, int family)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_family</b> (struct rtnl_neigh *neigh, int family)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae20087d57393a91a3e49031f792b0940"></a><!-- doxytag: member="neigh::rtnl_neigh_set_type" ref="gae20087d57393a91a3e49031f792b0940" args="(struct rtnl_neigh *neigh, int type)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_set_type</b> (struct rtnl_neigh *neigh, int type)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9883d5185f54c9730213d1c17222edeb"></a><!-- doxytag: member="neigh::rtnl_neigh_get_type" ref="ga9883d5185f54c9730213d1c17222edeb" args="(struct rtnl_neigh *neigh)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>rtnl_neigh_get_type</b> (struct rtnl_neigh *neigh)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This module allows you to access and manipulate the content of these tables.</p>
<dl class="user"><dt><b>Neighbour States</b></dt><dd><div class="fragment"><pre class="fragment"> NUD_INCOMPLETE
 NUD_REACHABLE
 NUD_STALE
 NUD_DELAY
 NUD_PROBE
 NUD_FAILED
 NUD_NOARP
 NUD_PERMANENT
</pre></div></dd></dl>
<dl class="user"><dt><b>Neighbour Flags</b></dt><dd><div class="fragment"><pre class="fragment"> NTF_PROXY
 NTF_ROUTER
</pre></div></dd></dl>
<dl class="user"><dt><b>Neighbour Identification</b></dt><dd>A neighbour is uniquely identified by the attributes listed below, whenever you refer to an existing neighbour all of the attributes must be set. Neighbours from caches automatically have all required attributes set.<ul>
<li>interface index (rtnl_neigh_set_ifindex())</li>
<li>destination address (rtnl_neigh_set_dst())</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>Changeable Attributes</b></dt><dd><a class="anchor" id="neigh_changeable"></a><ul>
<li>state (rtnl_neigh_set_state())</li>
<li>link layer address (rtnl_neigh_set_lladdr())</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>Required Caches for Dumping</b></dt><dd>In order to dump neighbour attributes you must provide the following caches via nl_cache_provide()<ul>
<li>link cache holding all links</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>TODO</b></dt><dd><ul>
<li>Document proxy settings</li>
<li>Document states and their influence</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>1) Retrieving information about configured neighbours</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="comment">// The first step is to retrieve a list of all available neighbour within</span>
 <span class="comment">// the kernel and put them into a cache.</span>
 <span class="keyword">struct </span>nl_cache *cache = <a class="code" href="group__neigh.html#gad37ec03be6acd25ae30ab803c6e1fd7a" title="Build a neighbour cache including all neighbours currently configured in the kernel.">rtnl_neigh_alloc_cache</a>(handle);

 <span class="comment">// Neighbours can then be looked up by the interface and destination</span>
 <span class="comment">// address:</span>
 <span class="keyword">struct </span>rtnl_neigh *neigh = <a class="code" href="group__neigh.html#gac0f72f54c8c5f5cacf0f1aae5807ae00" title="Look up a neighbour by interface index and destination address.">rtnl_neigh_get</a>(cache, ifindex, dst_addr);
 
 <span class="comment">// After successful usage, the object must be given back to the cache</span>
 rtnl_neigh_put(neigh);
</pre></div></dd></dl>
<dl class="user"><dt><b>2) Adding new neighbours</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="comment">// Allocate an empty neighbour handle to be filled out with the attributes</span>
 <span class="comment">// of the new neighbour.</span>
 <span class="keyword">struct </span>rtnl_neigh *neigh = rtnl_neigh_alloc();

 <span class="comment">// Fill out the attributes of the new neighbour</span>
 rtnl_neigh_set_ifindex(neigh, ifindex);
 rtnl_neigh_set_dst(neigh, dst_addr);
 rtnl_neigh_set_state(neigh, rtnl_neigh_str2state(<span class="stringliteral">&quot;permanent&quot;</span>));

 <span class="comment">// Build the netlink message and send it to the kernel, the operation will</span>
 <span class="comment">// block until the operation has been completed. Alternatively the required</span>
 <span class="comment">// netlink message can be built using rtnl_neigh_build_add_request()</span>
 <span class="comment">// to be sent out using nl_send_auto_complete().</span>
 <a class="code" href="group__neigh.html#ga1611d01a97a92db4c458b6f95104712f" title="Add a new neighbour.">rtnl_neigh_add</a>(nl_handle, neigh, <a class="code" href="group__msg.html#ga508feb1b826c0b8f6b2487c682ddb734" title="Replace existing matching config object with this request.">NLM_F_REPLACE</a>);

 <span class="comment">// Free the memory</span>
 rtnl_neigh_put(neigh);
</pre></div></dd></dl>
<dl class="user"><dt><b>3) Deleting an existing neighbour</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="comment">// Allocate an empty neighbour object to be filled out with the attributes</span>
 <span class="comment">// matching the neighbour to be deleted. Alternatively a fully equipped</span>
 <span class="comment">// neighbour object out of a cache can be used instead.</span>
 <span class="keyword">struct </span>rtnl_neigh *neigh = rtnl_neigh_alloc();

 <span class="comment">// Neighbours are uniquely identified by their interface index and</span>
 <span class="comment">// destination address, you may fill out other attributes but they</span>
 <span class="comment">// will have no influence.</span>
 rtnl_neigh_set_ifindex(neigh, ifindex);
 rtnl_neigh_set_dst(neigh, dst_addr);

 <span class="comment">// Build the netlink message and send it to the kernel, the operation will</span>
 <span class="comment">// block until the operation has been completed. Alternatively the required</span>
 <span class="comment">// netlink message can be built using rtnl_neigh_build_delete_request()</span>
 <span class="comment">// to be sent out using nl_send_auto_complete().</span>
 <a class="code" href="group__neigh.html#gabdd3b197117d4315e41bf54afbb11725" title="Delete a neighbour.">rtnl_neigh_delete</a>(handle, neigh, 0);

 <span class="comment">// Free the memory</span>
 rtnl_neigh_put(neigh);
</pre></div></dd></dl>
<dl class="user"><dt><b>4) Changing neighbour attributes</b></dt><dd><div class="fragment"><pre class="fragment"> <span class="comment">// Allocate an empty neighbour object to be filled out with the attributes</span>
 <span class="comment">// matching the neighbour to be changed and the new parameters. Alternatively</span>
 <span class="comment">// a fully equipped modified neighbour object out of a cache can be used.</span>
 <span class="keyword">struct </span>rtnl_neigh *neigh = rtnl_neigh_alloc();

 <span class="comment">// Identify the neighbour to be changed by its interface index and</span>
 <span class="comment">// destination address</span>
 rtnl_neigh_set_ifindex(neigh, ifindex);
 rtnl_neigh_set_dst(neigh, dst_addr);

 <span class="comment">// The link layer address may be modified, if so it is wise to change</span>
 <span class="comment">// its state to &quot;permanent&quot; in order to avoid having it overwritten.</span>
 rtnl_neigh_set_lladdr(neigh, lladdr);

 <span class="comment">// Secondly the state can be modified allowing normal neighbours to be</span>
 <span class="comment">// converted into permanent entries or to manually confirm a neighbour.</span>
 rtnl_neigh_set_state(neigh, state);

 <span class="comment">// Build the netlink message and send it to the kernel, the operation will</span>
 <span class="comment">// block until the operation has been completed. Alternatively the required</span>
 <span class="comment">// netlink message can be built using rtnl_neigh_build_change_request()</span>
 <span class="comment">// to be sent out using nl_send_auto_complete().</span>
 <a class="code" href="group__neigh.html#ga32792f40676344c79998f3a97923f783" title="Change neighbour attributes.">rtnl_neigh_change</a>(handle, neigh, 0);

 <span class="comment">// Free the memory</span>
 rtnl_neigh_put(neigh);
</pre></div> </dd></dl>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gad37ec03be6acd25ae30ab803c6e1fd7a"></a><!-- doxytag: member="neigh.c::rtnl_neigh_alloc_cache" ref="gad37ec03be6acd25ae30ab803c6e1fd7a" args="(struct nl_handle *handle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct nl_cache* rtnl_neigh_alloc_cache </td>
          <td>(</td>
          <td class="paramtype">struct nl_handle *&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>netlink handle</td></tr>
  </table>
  </dd>
</dl>
<p>Allocates a new neighbour cache, initializes it properly and updates it to include all neighbours currently configured in the kernel.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The caller is responsible for destroying and freeing the cache after using it. </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The new cache or NULL if an error occured. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00534">534</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="cache_8c_source.html#l00173">nl_cache_alloc()</a>, <a class="el" href="cache_8c_source.html#l00265">nl_cache_free()</a>, and <a class="el" href="cache_8c_source.html#l00662">nl_cache_refill()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span>nl_cache *cache;

        cache = <a class="code" href="group__cache.html#ga9520ae0f2158db3c081f34c851d92252" title="Allocate an empty cache.">nl_cache_alloc</a>(&amp;rtnl_neigh_ops);
        <span class="keywordflow">if</span> (cache == NULL)
                <span class="keywordflow">return</span> NULL;

        <span class="keywordflow">if</span> (handle &amp;&amp; <a class="code" href="group__cache.html#gaf5bd584017847e6ef69ec36739a6aaf0" title="(Re)fill a cache with the contents in the kernel.">nl_cache_refill</a>(handle, cache) &lt; 0) {
                <a class="code" href="group__cache.html#ga530c896db26d72001d011114b1e6cfaa" title="Free a cache.">nl_cache_free</a>(cache);
                <span class="keywordflow">return</span> NULL;
        }

        NL_DBG(2, <span class="stringliteral">&quot;Returning new cache %p\n&quot;</span>, cache);

        <span class="keywordflow">return</span> cache;
}
</pre></div>
</div>
</div>
<a class="anchor" id="gac0f72f54c8c5f5cacf0f1aae5807ae00"></a><!-- doxytag: member="neigh.c::rtnl_neigh_get" ref="gac0f72f54c8c5f5cacf0f1aae5807ae00" args="(struct nl_cache *cache, int ifindex, struct nl_addr *dst)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct rtnl_neigh* rtnl_neigh_get </td>
          <td>(</td>
          <td class="paramtype">struct nl_cache *&#160;</td>
          <td class="paramname"><em>cache</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ifindex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct nl_addr *&#160;</td>
          <td class="paramname"><em>dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cache</td><td>neighbour cache </td></tr>
    <tr><td class="paramname">ifindex</td><td>interface index the neighbour is on </td></tr>
    <tr><td class="paramname">dst</td><td>destination address of the neighbour </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>neighbour handle or NULL if no match was found. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00559">559</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="addr_8c_source.html#l00489">nl_addr_cmp()</a>, and <a class="el" href="object_8c_source.html#l00162">nl_object_get()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keyword">struct </span>rtnl_neigh *neigh;

        nl_list_for_each_entry(neigh, &amp;cache-&gt;c_items, ce_list) {
                <span class="keywordflow">if</span> (neigh-&gt;n_ifindex == ifindex &amp;&amp;
                    !<a class="code" href="group__addr.html#ga3b85d180a4f6d2df86be1dc8798a7d9a" title="Compares two abstract address objects.">nl_addr_cmp</a>(neigh-&gt;n_dst, dst)) {
                        <a class="code" href="group__object.html#gabd5767ac47ec6f09d1ac643f44eb8bfd" title="Acquire a reference on a object.">nl_object_get</a>((<span class="keyword">struct</span> nl_object *) neigh);
                        <span class="keywordflow">return</span> neigh;
                }
        }

        <span class="keywordflow">return</span> NULL;
}
</pre></div>
</div>
</div>
<a class="anchor" id="gab07155b529558716c404c20e44cf8a02"></a><!-- doxytag: member="neigh.c::rtnl_neigh_build_add_request" ref="gab07155b529558716c404c20e44cf8a02" args="(struct rtnl_neigh *tmpl, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct nl_msg* rtnl_neigh_build_add_request </td>
          <td>(</td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>tmpl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">tmpl</td><td>template with data of new neighbour </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a new netlink message requesting a addition of a new neighbour. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via <a class="el" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp; extend header values as needed.">nl_send_auto_complete()</a> or supplemented as needed. <em>tmpl</em> must contain the attributes of the new neighbour set via <code>rtnl_neigh_set_*</code> functions.</p>
<p>The following attributes must be set in the template:</p>
<ul>
<li>Interface index (rtnl_neigh_set_ifindex())</li>
<li>State (rtnl_neigh_set_state())</li>
<li>Destination address (rtnl_neigh_set_dst())</li>
<li>Link layer address (rtnl_neigh_set_lladdr())</li>
</ul>
<dl class="return"><dt><b>Returns:</b></dt><dd>The netlink message </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00633">633</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="netlink-kernel_8h_source.html#l00134">NLM_F_CREATE</a>.</p>

<p>Referenced by <a class="el" href="neigh_8c_source.html#l00656">rtnl_neigh_add()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordflow">return</span> build_neigh_msg(tmpl, RTM_NEWNEIGH, <a class="code" href="group__msg.html#ga20a00ae52e4c150f54649d7346d23a7a" title="Create config object if it doesn&amp;#39;t already exist.">NLM_F_CREATE</a> | flags);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga1611d01a97a92db4c458b6f95104712f"></a><!-- doxytag: member="neigh.c::rtnl_neigh_add" ref="ga1611d01a97a92db4c458b6f95104712f" args="(struct nl_handle *handle, struct rtnl_neigh *tmpl, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int rtnl_neigh_add </td>
          <td>(</td>
          <td class="paramtype">struct nl_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>tmpl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</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">handle</td><td>netlink handle </td></tr>
    <tr><td class="paramname">tmpl</td><td>template with requested changes </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a netlink message by calling <a class="el" href="group__neigh.html#gab07155b529558716c404c20e44cf8a02" title="Build netlink request message to add a new neighbour.">rtnl_neigh_build_add_request()</a>, sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.</p>
<p>The following attributes must be set in the template:</p>
<ul>
<li>Interface index (rtnl_neigh_set_ifindex())</li>
<li>State (rtnl_neigh_set_state())</li>
<li>Destination address (rtnl_neigh_set_dst())</li>
<li>Link layer address (rtnl_neigh_set_lladdr())</li>
</ul>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on sucess or a negative error if an error occured. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00656">656</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="nl_8c_source.html#l00373">nl_send_auto_complete()</a>, <a class="el" href="nl_8c_source.html#l00800">nl_wait_for_ack()</a>, <a class="el" href="msg_8c_source.html#l00656">nlmsg_free()</a>, and <a class="el" href="neigh_8c_source.html#l00633">rtnl_neigh_build_add_request()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordtype">int</span> err;
        <span class="keyword">struct </span>nl_msg *msg;
        
        msg = <a class="code" href="group__neigh.html#gab07155b529558716c404c20e44cf8a02" title="Build netlink request message to add a new neighbour.">rtnl_neigh_build_add_request</a>(tmpl, flags);
        <span class="keywordflow">if</span> (!msg)
                <span class="keywordflow">return</span> nl_errno(ENOMEM);

        err = <a class="code" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp;amp; extend header values as needed.">nl_send_auto_complete</a>(handle, msg);
        <span class="keywordflow">if</span> (err &lt; 0)
                <span class="keywordflow">return</span> err;

        <a class="code" href="group__msg.html#ga138ba9bee70553f9fbe7143deacad48c" title="Free a netlink message.">nlmsg_free</a>(msg);
        <span class="keywordflow">return</span> <a class="code" href="group__nl.html#gaa65fec588e0a0a2de1881fb8366ccd79" title="Wait for ACK.">nl_wait_for_ack</a>(handle);
}
</pre></div>
</div>
</div>
<a class="anchor" id="gaa254801cc344c81cc08dec128bc5cdbf"></a><!-- doxytag: member="neigh.c::rtnl_neigh_build_delete_request" ref="gaa254801cc344c81cc08dec128bc5cdbf" args="(struct rtnl_neigh *neigh, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct nl_msg* rtnl_neigh_build_delete_request </td>
          <td>(</td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>neigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">neigh</td><td>neighbour to delete </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a new netlink message requesting a deletion of a neighbour. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via <a class="el" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp; extend header values as needed.">nl_send_auto_complete()</a> or supplemented as needed. <em>neigh</em> must point to an existing neighbour.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The netlink message </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00693">693</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>Referenced by <a class="el" href="neigh_8c_source.html#l00711">rtnl_neigh_delete()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordflow">return</span> build_neigh_msg(neigh, RTM_DELNEIGH, flags);
}
</pre></div>
</div>
</div>
<a class="anchor" id="gabdd3b197117d4315e41bf54afbb11725"></a><!-- doxytag: member="neigh.c::rtnl_neigh_delete" ref="gabdd3b197117d4315e41bf54afbb11725" args="(struct nl_handle *handle, struct rtnl_neigh *neigh, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int rtnl_neigh_delete </td>
          <td>(</td>
          <td class="paramtype">struct nl_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>neigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</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">handle</td><td>netlink handle </td></tr>
    <tr><td class="paramname">neigh</td><td>neighbour to delete </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a netlink message by calling <a class="el" href="group__neigh.html#gaa254801cc344c81cc08dec128bc5cdbf" title="Build a netlink request message to delete a neighbour.">rtnl_neigh_build_delete_request()</a>, sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on sucess or a negative error if an error occured. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00711">711</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="nl_8c_source.html#l00373">nl_send_auto_complete()</a>, <a class="el" href="nl_8c_source.html#l00800">nl_wait_for_ack()</a>, <a class="el" href="msg_8c_source.html#l00656">nlmsg_free()</a>, and <a class="el" href="neigh_8c_source.html#l00693">rtnl_neigh_build_delete_request()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordtype">int</span> err;
        <span class="keyword">struct </span>nl_msg *msg;
        
        msg = <a class="code" href="group__neigh.html#gaa254801cc344c81cc08dec128bc5cdbf" title="Build a netlink request message to delete a neighbour.">rtnl_neigh_build_delete_request</a>(neigh, flags);
        <span class="keywordflow">if</span> (!msg)
                <span class="keywordflow">return</span> nl_errno(ENOMEM);

        err = <a class="code" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp;amp; extend header values as needed.">nl_send_auto_complete</a>(handle, msg);
        <span class="keywordflow">if</span> (err &lt; 0)
                <span class="keywordflow">return</span> err;

        <a class="code" href="group__msg.html#ga138ba9bee70553f9fbe7143deacad48c" title="Free a netlink message.">nlmsg_free</a>(msg);
        <span class="keywordflow">return</span> <a class="code" href="group__nl.html#gaa65fec588e0a0a2de1881fb8366ccd79" title="Wait for ACK.">nl_wait_for_ack</a>(handle);
}
</pre></div>
</div>
</div>
<a class="anchor" id="gab4452b62dde528443781bb70929ba909"></a><!-- doxytag: member="neigh.c::rtnl_neigh_build_change_request" ref="gab4452b62dde528443781bb70929ba909" args="(struct rtnl_neigh *neigh, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct nl_msg* rtnl_neigh_build_change_request </td>
          <td>(</td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>neigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">neigh</td><td>the neighbour to change </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a new netlink message requesting a change of a neigh attributes. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via <a class="el" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp; extend header values as needed.">nl_send_auto_complete()</a> or supplemented as needed.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The netlink message </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>Not all attributes can be changed, see <a class="el" href="group__neigh.html#neigh_changeable">Changeable Attributes</a> for a list. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00750">750</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="netlink-kernel_8h_source.html#l00124">NLM_F_REPLACE</a>.</p>

<p>Referenced by <a class="el" href="neigh_8c_source.html#l00770">rtnl_neigh_change()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordflow">return</span> build_neigh_msg(neigh, RTM_NEWNEIGH, <a class="code" href="group__msg.html#ga508feb1b826c0b8f6b2487c682ddb734" title="Replace existing matching config object with this request.">NLM_F_REPLACE</a> | flags);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga32792f40676344c79998f3a97923f783"></a><!-- doxytag: member="neigh.c::rtnl_neigh_change" ref="ga32792f40676344c79998f3a97923f783" args="(struct nl_handle *handle, struct rtnl_neigh *neigh, int flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int rtnl_neigh_change </td>
          <td>(</td>
          <td class="paramtype">struct nl_handle *&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct rtnl_neigh *&#160;</td>
          <td class="paramname"><em>neigh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</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">handle</td><td>netlink handle </td></tr>
    <tr><td class="paramname">neigh</td><td>neighbour to be changed </td></tr>
    <tr><td class="paramname">flags</td><td>additional netlink message flags</td></tr>
  </table>
  </dd>
</dl>
<p>Builds a netlink message by calling <a class="el" href="group__neigh.html#gab4452b62dde528443781bb70929ba909" title="Build a netlink request message to change neighbour attributes.">rtnl_neigh_build_change_request()</a>, sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on sucess or a negative error if an error occured. </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>Not all attributes can be changed, see <a class="el" href="group__neigh.html#neigh_changeable">Changeable Attributes</a> for a list. </dd></dl>

<p>Definition at line <a class="el" href="neigh_8c_source.html#l00770">770</a> of file <a class="el" href="neigh_8c_source.html">neigh.c</a>.</p>

<p>References <a class="el" href="nl_8c_source.html#l00373">nl_send_auto_complete()</a>, <a class="el" href="nl_8c_source.html#l00800">nl_wait_for_ack()</a>, <a class="el" href="msg_8c_source.html#l00656">nlmsg_free()</a>, and <a class="el" href="neigh_8c_source.html#l00750">rtnl_neigh_build_change_request()</a>.</p>
<div class="fragment"><pre class="fragment">{
        <span class="keywordtype">int</span> err;
        <span class="keyword">struct </span>nl_msg *msg;
        
        msg = <a class="code" href="group__neigh.html#gab4452b62dde528443781bb70929ba909" title="Build a netlink request message to change neighbour attributes.">rtnl_neigh_build_change_request</a>(neigh, flags);
        <span class="keywordflow">if</span> (!msg)
                <span class="keywordflow">return</span> nl_errno(ENOMEM);

        err = <a class="code" href="group__nl.html#ga01a2aad82350f867e704d5c696438b60" title="Send netlink message and check &amp;amp; extend header values as needed.">nl_send_auto_complete</a>(handle, msg);
        <span class="keywordflow">if</span> (err &lt; 0)
                <span class="keywordflow">return</span> err;

        <a class="code" href="group__msg.html#ga138ba9bee70553f9fbe7143deacad48c" title="Free a netlink message.">nlmsg_free</a>(msg);
        <span class="keywordflow">return</span> <a class="code" href="group__nl.html#gaa65fec588e0a0a2de1881fb8366ccd79" title="Wait for ACK.">nl_wait_for_ack</a>(handle);
}
</pre></div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Mar 21 2011 for libnl by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>