summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-03-25 13:00:13 -0700
committerBen Pfaff <blp@nicira.com>2011-03-31 16:42:01 -0700
commitd0c23a1a57f5bd994d3af124673a218e21528dd3 (patch)
tree5419c3e5e1f8daf6d50df00656e8506b031f2526 /lib
parentb3c01ed3308e7899e98e981bf465f74be86f5f12 (diff)
downloadopenvswitch-d0c23a1a57f5bd994d3af124673a218e21528dd3.tar.gz
dpif: Use sset instead of svec in dpif interface.
Diffstat (limited to 'lib')
-rw-r--r--lib/dpif-linux.c5
-rw-r--r--lib/dpif-provider.h2
-rw-r--r--lib/dpif.c16
-rw-r--r--lib/dpif.h6
4 files changed, 14 insertions, 15 deletions
diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
index 3c22b5567..bdc770369 100644
--- a/lib/dpif-linux.c
+++ b/lib/dpif-linux.c
@@ -46,7 +46,6 @@
#include "rtnetlink-link.h"
#include "shash.h"
#include "sset.h"
-#include "svec.h"
#include "unaligned.h"
#include "util.h"
#include "vlog.h"
@@ -160,7 +159,7 @@ dpif_linux_cast(const struct dpif *dpif)
}
static int
-dpif_linux_enumerate(struct svec *all_dps)
+dpif_linux_enumerate(struct sset *all_dps)
{
struct nl_dump dump;
struct ofpbuf msg;
@@ -176,7 +175,7 @@ dpif_linux_enumerate(struct svec *all_dps)
struct dpif_linux_dp dp;
if (!dpif_linux_dp_from_ofpbuf(&dp, &msg)) {
- svec_add(all_dps, dp.name);
+ sset_add(all_dps, dp.name);
}
}
return nl_dump_done(&dump);
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
index 91074d507..4d367530e 100644
--- a/lib/dpif-provider.h
+++ b/lib/dpif-provider.h
@@ -86,7 +86,7 @@ struct dpif_class {
*
* Some kinds of datapaths might not be practically enumerable, in which
* case this function may be a null pointer. */
- int (*enumerate)(struct svec *all_dps);
+ int (*enumerate)(struct sset *all_dps);
/* Attempts to open an existing dpif called 'name', if 'create' is false,
* or to open an existing dpif or create a new one, if 'create' is true.
diff --git a/lib/dpif.c b/lib/dpif.c
index a754613a0..81e180fbb 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -36,7 +36,7 @@
#include "packets.h"
#include "poll-loop.h"
#include "shash.h"
-#include "svec.h"
+#include "sset.h"
#include "timeval.h"
#include "util.h"
#include "valgrind.h"
@@ -184,36 +184,36 @@ dp_unregister_provider(const char *type)
}
/* Clears 'types' and enumerates the types of all currently registered datapath
- * providers into it. The caller must first initialize the svec. */
+ * providers into it. The caller must first initialize the sset. */
void
-dp_enumerate_types(struct svec *types)
+dp_enumerate_types(struct sset *types)
{
struct shash_node *node;
dp_initialize();
- svec_clear(types);
+ sset_clear(types);
SHASH_FOR_EACH(node, &dpif_classes) {
const struct registered_dpif_class *registered_class = node->data;
- svec_add(types, registered_class->dpif_class->type);
+ sset_add(types, registered_class->dpif_class->type);
}
}
/* Clears 'names' and enumerates the names of all known created datapaths with
- * the given 'type'. The caller must first initialize the svec. Returns 0 if
+ * the given 'type'. The caller must first initialize the sset. Returns 0 if
* successful, otherwise a positive errno value.
*
* Some kinds of datapaths might not be practically enumerable. This is not
* considered an error. */
int
-dp_enumerate_names(const char *type, struct svec *names)
+dp_enumerate_names(const char *type, struct sset *names)
{
const struct registered_dpif_class *registered_class;
const struct dpif_class *dpif_class;
int error;
dp_initialize();
- svec_clear(names);
+ sset_clear(names);
registered_class = shash_find_data(&dpif_classes, type);
if (!registered_class) {
diff --git a/lib/dpif.h b/lib/dpif.h
index 8872a2ef7..0e0f407c3 100644
--- a/lib/dpif.h
+++ b/lib/dpif.h
@@ -34,7 +34,7 @@ struct ds;
struct netdev;
struct nlattr;
struct ofpbuf;
-struct svec;
+struct sset;
struct dpif_class;
void dp_run(void);
@@ -42,9 +42,9 @@ void dp_wait(void);
int dp_register_provider(const struct dpif_class *);
int dp_unregister_provider(const char *type);
-void dp_enumerate_types(struct svec *types);
+void dp_enumerate_types(struct sset *types);
-int dp_enumerate_names(const char *type, struct svec *names);
+int dp_enumerate_names(const char *type, struct sset *names);
void dp_parse_name(const char *datapath_name, char **name, char **type);
int dpif_open(const char *name, const char *type, struct dpif **);