Skip to content

Commit

Permalink
dpif: Add function to get the dpif type.
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Pettit <[email protected]>
  • Loading branch information
Justin Pettit committed Nov 2, 2012
1 parent 4afba28 commit c7a2621
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/dpif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/dpif.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);

Expand Down

0 comments on commit c7a2621

Please sign in to comment.