summaryrefslogtreecommitdiffstats
path: root/src/nl-neightbl-list.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2009-12-16 15:20:46 (GMT)
committerThomas Graf <tgraf@suug.ch>2009-12-16 15:20:46 (GMT)
commit8808743839b0f459394ecd00cb0f7c1896c0ab7a (patch)
treea3ab1da0c8bb02390662891bcb92e2130662b5d7 /src/nl-neightbl-list.c
parentff76549013c31082d303b3feef755bbd35e13ec6 (diff)
downloadlibnl-8808743839b0f459394ecd00cb0f7c1896c0ab7a.zip
libnl-8808743839b0f459394ecd00cb0f7c1896c0ab7a.tar.gz
libnl-8808743839b0f459394ecd00cb0f7c1896c0ab7a.tar.bz2
CLI - Command Line Interface Library
Moved common code in src/ used by CLI tools to src/lib/ for possible use by other CLI tools. Just link to libnl-cli.{so|la}
Diffstat (limited to 'src/nl-neightbl-list.c')
-rw-r--r--src/nl-neightbl-list.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nl-neightbl-list.c b/src/nl-neightbl-list.c
index 8a7a83f..5010b92 100644
--- a/src/nl-neightbl-list.c
+++ b/src/nl-neightbl-list.c
@@ -6,10 +6,11 @@
* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch>
*/
-#include "utils.h"
+#include <netlink/cli/utils.h>
+#include <netlink/cli/link.h>
static void print_usage(void)
{
@@ -33,10 +34,11 @@ int main(int argc, char *argv[])
.dp_fd = stdout,
};
- sock = nlt_alloc_socket();
- nlt_connect(sock, NETLINK_ROUTE);
- link_cache = nlt_alloc_link_cache(sock);
- neightbl_cache = nlt_alloc_neightbl_cache(sock);
+ sock = nl_cli_alloc_socket();
+ nl_cli_connect(sock, NETLINK_ROUTE);
+ link_cache = nl_cli_link_alloc_cache(sock);
+ neightbl_cache = nl_cli_alloc_cache(sock, "neighbour table",
+ rtnl_neightbl_alloc_cache);
for (;;) {
int c, optidx = 0;
@@ -52,9 +54,9 @@ int main(int argc, char *argv[])
break;
switch (c) {
- case 'f': params.dp_type = nlt_parse_dumptype(optarg); break;
+ case 'f': params.dp_type = nl_cli_parse_dumptype(optarg); break;
case 'h': print_usage(); break;
- case 'v': nlt_print_version(); break;
+ case 'v': nl_cli_print_version(); break;
}
}