diff options
| author | Ben Pfaff <blp@nicira.com> | 2009-12-03 11:28:40 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2009-12-03 11:28:40 -0800 |
| commit | 7634353824f1631c3008dc43a4a1cc0aebff3caa (patch) | |
| tree | b6579ad23e786f6dc83c79536e9dc4c3c725eb13 /lib/shash.c | |
| parent | ba54bf4f658658b95be19e6d5a37276a5f37d0b3 (diff) | |
| download | openvswitch-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.c | 11 |
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) { |
