diff options
author | Thomas Graf <tgraf@suug.ch> | 2009-12-16 15:20:46 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2009-12-16 15:20:46 (GMT) |
commit | 8808743839b0f459394ecd00cb0f7c1896c0ab7a (patch) | |
tree | a3ab1da0c8bb02390662891bcb92e2130662b5d7 /src/nl-monitor.c | |
parent | ff76549013c31082d303b3feef755bbd35e13ec6 (diff) | |
download | libnl-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-monitor.c')
-rw-r--r-- | src/nl-monitor.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nl-monitor.c b/src/nl-monitor.c index 19117a2..fdf6497 100644 --- a/src/nl-monitor.c +++ b/src/nl-monitor.c @@ -6,12 +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/route/link.h> -#include <netlink/route/addr.h> +#include <netlink/cli/utils.h> +#include <netlink/cli/link.h> static void obj_input(struct nl_object *obj, void *arg) { @@ -61,7 +60,7 @@ int main(int argc, char *argv[]) { RTNLGRP_NONE, NULL } }; - sock = nlt_alloc_socket(); + sock = nl_cli_alloc_socket(); nl_socket_disable_seq_check(sock); nl_socket_modify_cb(sock, NL_CB_VALID, NL_CB_CUSTOM, event_input, NULL); @@ -75,14 +74,15 @@ int main(int argc, char *argv[]) return 2; } - nlt_connect(sock, NETLINK_ROUTE); + nl_cli_connect(sock, NETLINK_ROUTE); for (idx = 1; argc > idx; idx++) { for (i = 0; known_groups[i].gr_id != RTNLGRP_NONE; i++) { if (!strcmp(argv[idx], known_groups[i].gr_name)) { if ((err = nl_socket_add_membership(sock, known_groups[i].gr_id)) < 0) { - fatal(err, "%s: %s\n", argv[idx], nl_geterror(err)); + nl_cli_fatal(err, "%s: %s\n", argv[idx], + nl_geterror(err)); } break; @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Warning: Unknown group: %s\n", argv[idx]); } - link_cache = nlt_alloc_link_cache(sock); + link_cache = nl_cli_link_alloc_cache(sock); while (1) { fd_set rfds; |