summaryrefslogtreecommitdiff
path: root/src/nl-neigh-list.c
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2009-12-16 16:20:46 +0100
committerThomas Graf <tgraf@suug.ch>2009-12-16 16:20:46 +0100
commit8808743839b0f459394ecd00cb0f7c1896c0ab7a (patch)
treea3ab1da0c8bb02390662891bcb92e2130662b5d7 /src/nl-neigh-list.c
parentff76549013c31082d303b3feef755bbd35e13ec6 (diff)
downloadlibnl-8808743839b0f459394ecd00cb0f7c1896c0ab7a.tar.gz
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-neigh-list.c')
-rw-r--r--src/nl-neigh-list.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/nl-neigh-list.c b/src/nl-neigh-list.c
index 4a74e27..ebf5486 100644
--- a/src/nl-neigh-list.c
+++ b/src/nl-neigh-list.c
@@ -6,10 +6,12 @@
* 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 "neigh-utils.h"
+#include <netlink/cli/utils.h>
+#include <netlink/cli/neigh.h>
+#include <netlink/cli/link.h>
static void print_usage(void)
{
@@ -41,11 +43,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);
- neigh_cache = nlt_alloc_neigh_cache(sock);
- neigh = nlt_alloc_neigh();
+ sock = nl_cli_alloc_socket();
+ nl_cli_connect(sock, NETLINK_ROUTE);
+ link_cache = nl_cli_link_alloc_cache(sock);
+ neigh_cache = nl_cli_neigh_alloc_cache(sock);
+ neigh = nl_cli_neigh_alloc();
for (;;) {
int c, optidx = 0;
@@ -70,14 +72,14 @@ 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 'a': parse_dst(neigh, optarg); break;
- case 'l': parse_lladdr(neigh, optarg); break;
- case 'd': parse_dev(neigh, link_cache, optarg); break;
- case ARG_FAMILY: parse_family(neigh, optarg); break;
- case ARG_STATE: parse_state(neigh, optarg); break;
+ case 'v': nl_cli_print_version(); break;
+ case 'a': nl_cli_neigh_parse_dst(neigh, optarg); break;
+ case 'l': nl_cli_neigh_parse_lladdr(neigh, optarg); break;
+ case 'd': nl_cli_neigh_parse_dev(neigh, link_cache, optarg); break;
+ case ARG_FAMILY: nl_cli_neigh_parse_family(neigh, optarg); break;
+ case ARG_STATE: nl_cli_neigh_parse_state(neigh, optarg); break;
}
}