2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
Adrian Moreno
b16270e69b sset: add SHORT version of SAFE loop macros.
Add SHORT version of SAFE loop macros and overload the current macro
name to keep backwards compatibility.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2022-03-30 16:59:03 +02:00
Ben Pfaff
3ae9a07ae7 sset: New function sset_join().
This will acquire its first user in an upcoming commit.

This function follows the pattern set by svec_join().

Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-09-18 08:42:30 -07:00
Terry Wilson
ee89ea7b47 json: Move from lib to include/openvswitch.
To easily allow both in- and out-of-tree building of the Python
wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to
include/openvswitch. This also requires moving lib/{hmap,shash}.h.

Both hmap.h and shash.h were #include-ing "util.h" even though the
headers themselves did not use anything from there, but rather from
include/openvswitch/util.h. Fixing that required including util.h
in several C files mostly due to OVS_NOT_REACHED and things like
xmalloc.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2016-07-22 17:09:17 -07:00
Ben Pfaff
63a10e1e4c sset: New function sset_from_delimited_string().
This simplifies code in a couple of places.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-By: Ryan Moats <rmoats@us.ibm.com>
2016-07-13 13:43:37 -07:00
Daniele Di Proietto
bfbcebc272 hmap: Use struct for hmap_at_position().
The interface will be more similar to the cmap.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Tested-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
2016-05-23 10:10:23 -07:00
Ben Pfaff
05e43c5ddc sset: Make sset iteration check the type of the nodes it's iterating.
Without this additional check, SSET_FOR_EACH is happy to iterate over any
type that has a struct hmap member named 'map'.  We have a number of these:
hmapx, shash, simap, and smap, in addition to sset.

I guess another approach would be give each of these a unique member name,
but the short name 'map' is nice too.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
2016-02-08 22:45:37 -08:00
Ben Pfaff
a4686ba367 sset: New function sset_intersect().
This will acquire its first user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2015-08-26 16:39:30 -07:00
Mark D. Gray
842733c37c vswitch.ovsschema: Add datapath_types and port_types.
At startup enumerate datapath and port types and add this information to
the datapath_types and port_types columns in the ovsdb.

This allows an ovsdb client to query the datapath in order to determine
if certain datapath and port types exist. For example, by querying the
port_types column, an ovsdb client will be able to determine if this
instance of ovs-vswitchd was compiled with DPDK support.

Signed-off-by: Mark D. Gray <mark.d.gray@intel.com>
Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com>
[blp@nicira.com made several changes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-24 09:12:27 -07:00
Alex Wang
55d2690646 clang: Fix segfault in unit tests.
It seems that 'clang' compiler applies strict protection on pointer
dereference. And it causes unexpected execution in macro functions
like "HMAP_FOR_EACH()" and unit test failures. This commit fixes
this issue and pass all unit tests.

Co-authored-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-07-22 11:20:43 -07:00
Ben Pfaff
808311f6d9 sset: New function sset_sort().
This will have its first caller in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-04-10 18:10:58 -07:00
Justin Pettit
6822daf206 sset: Add sset_at_position() function.
This will be useful in a future commit.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-11-01 22:54:27 -07:00
Ben Pfaff
ebc56baa41 util: New macro CONST_CAST.
Casts are sometimes necessary.  One common reason that they are necessary
is for discarding a "const" qualifier.  However, this can impede
maintenance: if the type of the expression being cast changes, then the
presence of the cast can hide a necessary change in the code that does the
cast.  Using CONST_CAST, instead of a bare cast, makes these changes
visible.

Inspired by my own work elsewhere:
http://git.savannah.gnu.org/cgit/pspp.git/tree/src/libpspp/cast.h#n80

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-03 13:33:13 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Casey Barker
43d1478b16 lib: Adapt headers for use in C++.
This commit makes several library headers suitable for inclusion in C++.

It adds [extern "C"] guards and makes minor changes to fix casting and
keyword issues.
2011-08-04 16:20:04 -07:00
Ben Pfaff
f391294fde sset: New data type for a set of strings.
Many uses of "shash" or "svec" data structures really call for a "set of
strings" data type.  This commit introduces such a data structure.  Later
commits convert inappropriate uses of shash and svec to use sset instead.
2011-03-31 16:42:01 -07:00