#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
+#include <net/if.h>
#include <netinet/in.h>
#include <signal.h>
#include <stdarg.h>
dpif_close(&dpif);
}
+static void
+do_get_name(const struct settings *s UNUSED, int argc UNUSED, char *argv[])
+{
+ struct dpif dpif;
+ char name[IF_NAMESIZE + 1];
+
+ run(dpif_open(argv[1], &dpif), "opening datapath");
+ run(dpif_get_name(&dpif, name, sizeof name), "getting datapath name");
+ puts(name);
+ dpif_close(&dpif);
+}
+
static void
do_add_dp(const struct settings *s UNUSED, int argc UNUSED, char *argv[])
{
{ "addif", 2, INT_MAX, do_add_port },
{ "delif", 2, INT_MAX, do_del_port },
{ "get-idx", 1, 1, do_get_idx },
+ { "get-name", 1, 1, do_get_name },
{ "showdp", 0, INT_MAX, do_show_dp },
#endif