From: Justin Pettit Date: Thu, 1 Nov 2012 23:04:06 +0000 (-0700) Subject: dpif: Add function to get the dpif type. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7a262159e22cc84b802031982052fdece555e64;p=openvswitch dpif: Add function to get the dpif type. Signed-off-by: Justin Pettit --- 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 *);