2 * src/nl-neightbl-dump.c Dump neighbour tables
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
14 static void print_usage(void)
17 "Usage: nl-neightbl-dump <mode> [<filter>]\n"
18 " mode := { brief | detailed | stats | xml }\n"
23 int main(int argc, char *argv[])
26 struct nl_handle *nlh;
27 struct nl_cache *ntc, *lc;
28 struct nl_dump_params params = {
30 .dp_type = NL_DUMP_BRIEF,
36 if (nltool_init(argc, argv) < 0)
39 nlh = nltool_alloc_handle();
43 if (nltool_connect(nlh, NETLINK_ROUTE) < 0)
46 ntc = nltool_alloc_neightbl_cache(nlh);
50 lc = nltool_alloc_link_cache(nlh);
52 goto errout_ntbl_cache;
54 params.dp_type = nltool_parse_dumptype(argv[1]);
55 if (params.dp_type < 0)
56 goto errout_link_cache;
58 nl_cache_dump(ntc, ¶ms);
68 nl_handle_destroy(nlh);