From c7a262159e22cc84b802031982052fdece555e64 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Thu, 1 Nov 2012 16:04:06 -0700 Subject: [PATCH] dpif: Add function to get the dpif type. Signed-off-by: Justin Pettit --- lib/dpif.c | 7 +++++++ lib/dpif.h | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/dpif.c b/lib/dpif.c index 952a502d..0093f614 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -372,6 +372,13 @@ dpif_base_name(const struct dpif *dpif) return dpif->base_name; } +/* Returns the type of datapath 'dpif'. */ +const char * +dpif_type(const struct dpif *dpif) +{ + return dpif->dpif_class->type; +} + /* Returns the fully spelled out name for the given datapath 'type'. * * Normalized type string can be compared with strcmp(). Unnormalized type diff --git a/lib/dpif.h b/lib/dpif.h index bd6095ac..7d0881fa 100644 --- a/lib/dpif.h +++ b/lib/dpif.h @@ -57,6 +57,7 @@ void dpif_wait(struct dpif *); const char *dpif_name(const struct dpif *); const char *dpif_base_name(const struct dpif *); +const char *dpif_type(const struct dpif *); int dpif_delete(struct dpif *); -- 2.30.2