/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
static void
parse_options(int argc, char *argv[])
{
+ enum {
+ OPT_DUMMY = UCHAR_MAX + 1,
+ VLOG_OPTION_ENUMS
+ };
static struct option long_options[] = {
{"timeout", required_argument, 0, 't'},
- {"verbose", optional_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
+ VLOG_LONG_OPTIONS,
{0, 0, 0, 0},
};
char *short_options = long_options_to_short_options(long_options);
OVS_PRINT_VERSION(0, 0);
exit(EXIT_SUCCESS);
- case 'v':
- vlog_set_verbosity(optarg);
- break;
+ VLOG_OPTION_HANDLERS
case '?':
exit(EXIT_FAILURE);
}
static void
-do_add_dp(int argc UNUSED, char *argv[])
+do_add_dp(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
run(dpif_create(argv[1], &dpif), "add_dp");
}
static void
-do_del_dp(int argc UNUSED, char *argv[])
+do_del_dp(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
run(dpif_open(argv[1], &dpif), "opening datapath");
}
static void
-do_add_if(int argc UNUSED, char *argv[])
+do_add_if(int argc OVS_UNUSED, char *argv[])
{
bool failure = false;
struct dpif *dpif;
}
static void
-do_del_if(int argc UNUSED, char *argv[])
+do_del_if(int argc OVS_UNUSED, char *argv[])
{
bool failure = false;
struct dpif *dpif;
printf("\tports: cur:%"PRIu32", max:%"PRIu32"\n",
stats.n_ports, stats.max_ports);
printf("\tgroups: max:%"PRIu16"\n", stats.max_groups);
- printf("\tlookups: frags:%"PRIu64", hit:%"PRIu64", missed:%"PRIu64", "
- "lost:%"PRIu64"\n",
- stats.n_frags, stats.n_hit, stats.n_missed, stats.n_lost);
+ printf("\tlookups: frags:%llu, hit:%llu, missed:%llu, lost:%llu\n",
+ (unsigned long long int) stats.n_frags,
+ (unsigned long long int) stats.n_hit,
+ (unsigned long long int) stats.n_missed,
+ (unsigned long long int) stats.n_lost);
printf("\tqueues: max-miss:%"PRIu16", max-action:%"PRIu16"\n",
stats.max_miss_queue, stats.max_action_queue);
}
}
static void
-do_dump_dps(int argc UNUSED, char *argv[] UNUSED)
+do_dump_dps(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
struct svec all_dps;
unsigned int i;
}
static void
-do_dump_flows(int argc UNUSED, char *argv[])
+do_dump_flows(int argc OVS_UNUSED, char *argv[])
{
struct odp_flow *flows;
struct dpif *dpif;
}
static void
-do_del_flows(int argc UNUSED, char *argv[])
+do_del_flows(int argc OVS_UNUSED, char *argv[])
{
struct dpif *dpif;
}
static void
-do_dump_groups(int argc UNUSED, char *argv[])
+do_dump_groups(int argc OVS_UNUSED, char *argv[])
{
struct odp_stats stats;
struct dpif *dpif;
}
static void
-do_help(int argc UNUSED, char *argv[] UNUSED)
+do_help(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
{
usage();
}