2 * src/genl-ctrl-dump.c Dump Generic Netlink Controller
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: genl-ctrl-dump <mode> [<filter>]\n"
18 " mode := { brief | detailed | stats }\n"
23 int main(int argc, char *argv[])
25 struct nl_handle *nlh;
26 struct nl_cache *family_cache;
27 struct nl_dump_params params = {
29 .dp_type = NL_DUMP_BRIEF
33 if (nltool_init(argc, argv) < 0)
36 if (argc < 2 || !strcmp(argv[1], "-h"))
39 nlh = nltool_alloc_handle();
43 if (genl_connect(nlh) < 0) {
44 fprintf(stderr, "Unable to connect generic netlink socket%s\n",
49 family_cache = nltool_alloc_genl_family_cache(nlh);
53 params.dp_type = nltool_parse_dumptype(argv[1]);
54 if (params.dp_type < 0)
57 //get_filter(link, argc, argv, 2, link_cache);
58 nl_cache_dump(family_cache, ¶ms);
59 nl_cache_free(family_cache);
63 nl_handle_destroy(nlh);