From: Justin Pettit Date: Thu, 1 Nov 2012 23:04:06 +0000 (-0700) Subject: dpif: Add function to get the dpif type. X-Git-Tag: sliver-openvswitch-1.9.90-3~10^2~242 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c7a262159e22cc84b802031982052fdece555e64;p=sliver-openvswitch.git dpif: Add function to get the dpif type. Signed-off-by: Justin Pettit --- diff --git a/lib/dpif.c b/lib/dpif.c index 952a502d6..0093f6142 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 bd6095acf..7d0881fab 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 *);