summaryrefslogtreecommitdiff
path: root/lib/shash.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2009-12-03 11:28:40 -0800
committerBen Pfaff <blp@nicira.com>2009-12-03 11:28:40 -0800
commit7634353824f1631c3008dc43a4a1cc0aebff3caa (patch)
treeb6579ad23e786f6dc83c79536e9dc4c3c725eb13 /lib/shash.c
parentba54bf4f658658b95be19e6d5a37276a5f37d0b3 (diff)
downloadopenvswitch-7634353824f1631c3008dc43a4a1cc0aebff3caa.tar.gz
vswitchd: Initial conversion to database-based configuration.
This has seen very little testing, so some features are almost certainly busted. Port mirroring is not yet converted, so it will definitely not work.
Diffstat (limited to 'lib/shash.c')
-rw-r--r--lib/shash.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/shash.c b/lib/shash.c
index e6cb6b0db..5257de12a 100644
--- a/lib/shash.c
+++ b/lib/shash.c
@@ -76,6 +76,17 @@ shash_add(struct shash *sh, const char *name, const void *data)
return node;
}
+bool
+shash_add_once(struct shash *sh, const char *name, const void *data)
+{
+ if (!shash_find(sh, name)) {
+ shash_add(sh, name, data);
+ return true;
+ } else {
+ return false;
+ }
+}
+
void
shash_delete(struct shash *sh, struct shash_node *node)
{