12 #include <netlink/cli/utils.h>
13 #include <netlink/openvswitch/openvswitch.h>
15 static void print_usage(
void)
18 "Usage: nlovs-dp-list [OPTIONS]... \n"
21 " --stats Show statistics, implies --details\n"
22 " -h, --help Show this help text.\n"
23 " -v, --version Show versioning information.\n"
25 " -n, --name=NAME Name of datapath\n"
30 int main(
int argc,
char *argv[])
33 struct nl_cache *dp_cache;
40 sock = nl_cli_alloc_socket();
41 nl_cli_connect(sock, NETLINK_GENERIC);
50 static struct option long_opts[] = {
51 {
"stats", 0, 0, ARG_STATS },
52 {
"help", 0, 0,
'h' },
53 {
"version", 0, 0,
'v' },
54 {
"name", 1, 0,
'n' },
58 c = getopt_long(argc, argv,
"hvn:", long_opts, &optidx);
64 case 'h': print_usage();
break;
65 case 'v': nl_cli_print_version();
break;
71 nl_perror(err,
"Unable to allocate dp cache");