summaryrefslogtreecommitdiff
path: root/lib/meta-flow.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2019-12-04 15:06:07 -0800
committerWilliam Tu <u9012063@gmail.com>2019-12-12 10:16:05 -0800
commit95a5454c511057ae6f35c18f0adfce4d2dbe5410 (patch)
tree0e9936c03b8437694b9fc0bd7ec6f47d1ccac5c5 /lib/meta-flow.c
parent9802fafa962baff8f52aeea1f1139a68c027d1d2 (diff)
downloadopenvswitch-95a5454c511057ae6f35c18f0adfce4d2dbe5410.tar.gz
ofp-print: Abbreviate lists of fields in table features output.
This makes the output both shorter and easier to read. Signed-off-by: Ben Pfaff <blp@ovn.org> Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'lib/meta-flow.c')
-rw-r--r--lib/meta-flow.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index e3274b97f..8b62e6d96 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -3581,3 +3581,27 @@ mf_bitmap_is_superset(const struct mf_bitmap *super,
{
return bitmap_is_superset(super->bm, sub->bm, MFF_N_IDS);
}
+
+/* Returns the bitwise-and of 'a' and 'b'. */
+struct mf_bitmap
+mf_bitmap_and(struct mf_bitmap a, struct mf_bitmap b)
+{
+ bitmap_and(a.bm, b.bm, MFF_N_IDS);
+ return a;
+}
+
+/* Returns the bitwise-or of 'a' and 'b'. */
+struct mf_bitmap
+mf_bitmap_or(struct mf_bitmap a, struct mf_bitmap b)
+{
+ bitmap_or(a.bm, b.bm, MFF_N_IDS);
+ return a;
+}
+
+/* Returns the bitwise-not of 'x'. */
+struct mf_bitmap
+mf_bitmap_not(struct mf_bitmap x)
+{
+ bitmap_not(x.bm, MFF_N_IDS);
+ return x;
+}