12 #include <netlink/cli/utils.h>
13 #include <netlink/cli/link.h>
15 static void print_usage(
void)
18 "Usage: nl-neightbl-list [OPTION]...\n"
21 " -f, --format=TYPE Output format { brief | details | stats }\n"
22 " -h, --help Show this help\n"
23 " -v, --version Show versioning information\n"
28 int main(
int argc,
char *argv[])
31 struct nl_cache *link_cache, *neightbl_cache;
37 sock = nl_cli_alloc_socket();
38 nl_cli_connect(sock, NETLINK_ROUTE);
39 link_cache = nl_cli_link_alloc_cache(sock);
40 neightbl_cache = nl_cli_alloc_cache(sock,
"neighbour table",
45 static struct option long_opts[] = {
46 {
"format", 1, 0,
'f' },
47 {
"help", 0, 0,
'h' },
48 {
"version", 0, 0,
'v' },
52 c = getopt_long(argc, argv,
"f:hv", long_opts, &optidx);
57 case 'f': params.
dp_type = nl_cli_parse_dumptype(optarg);
break;
58 case 'h': print_usage();
break;
59 case 'v': nl_cli_print_version();
break;