diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk index b64b6c15d..21b863801 100644 --- a/include/openvswitch/automake.mk +++ b/include/openvswitch/automake.mk @@ -7,6 +7,7 @@ openvswitchinclude_HEADERS = \ include/openvswitch/list.h \ include/openvswitch/netdev.h \ include/openvswitch/match.h \ + include/openvswitch/meta-flow.h \ include/openvswitch/ofpbuf.h \ include/openvswitch/ofp-errors.h \ include/openvswitch/ofp-parse.h \ diff --git a/lib/meta-flow.h b/include/openvswitch/meta-flow.h similarity index 99% rename from lib/meta-flow.h rename to include/openvswitch/meta-flow.h index c73a1afc6..c11f153e5 100644 --- a/lib/meta-flow.h +++ b/include/openvswitch/meta-flow.h @@ -14,17 +14,18 @@ * limitations under the License. */ -#ifndef META_FLOW_H -#define META_FLOW_H 1 +#ifndef OPENVSWITCH_META_FLOW_H +#define OPENVSWITCH_META_FLOW_H 1 +#include +#include #include #include #include -#include "bitmap.h" -#include "flow.h" +#include "openvswitch/flow.h" #include "openvswitch/ofp-errors.h" -#include "packets.h" -#include "util.h" +#include "openvswitch/packets.h" +#include "openvswitch/util.h" struct ds; struct match; diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h index cfafc3612..2230b2a0c 100644 --- a/include/openvswitch/util.h +++ b/include/openvswitch/util.h @@ -191,6 +191,10 @@ is_pow2(uintmax_t x) #define RDP2_4(X) (RDP2_5(X) | (RDP2_5(X) >> 2)) #define RDP2_5(X) ( (X) | ( (X) >> 1)) +/* Macros for sizing bitmaps */ +#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT) +#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS) + /* Given ATTR, and TYPE, cast the ATTR to TYPE by first casting ATTR to * (void *). This is to suppress the alignment warning issued by clang. */ #define ALIGNED_CAST(TYPE, ATTR) ((TYPE) (void *) (ATTR)) diff --git a/lib/automake.mk b/lib/automake.mk index b9e26e40d..015fc860f 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -120,7 +120,6 @@ lib_libopenvswitch_la_SOURCES = \ lib/memory.c \ lib/memory.h \ lib/meta-flow.c \ - lib/meta-flow.h \ lib/multipath.c \ lib/multipath.h \ lib/netdev-dummy.c \ @@ -471,10 +470,10 @@ lib/dirs.c: lib/dirs.c.in Makefile > lib/dirs.c.tmp && \ mv lib/dirs.c.tmp lib/dirs.c -lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h +lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/meta-flow.h $(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@ lib/meta-flow.lo: lib/meta-flow.inc -lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h +lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields include/openvswitch/meta-flow.h $(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@ lib/nx-match.lo: lib/nx-match.inc CLEANFILES += lib/meta-flow.inc lib/nx-match.inc diff --git a/lib/bitmap.h b/lib/bitmap.h index d541bab58..39b759719 100644 --- a/lib/bitmap.h +++ b/lib/bitmap.h @@ -21,8 +21,6 @@ #include #include "util.h" -#define BITMAP_ULONG_BITS (sizeof(unsigned long) * CHAR_BIT) - static inline unsigned long * bitmap_unit__(const unsigned long *bitmap, size_t offset) { @@ -35,8 +33,6 @@ bitmap_bit__(size_t offset) return 1UL << (offset % BITMAP_ULONG_BITS); } -#define BITMAP_N_LONGS(N_BITS) DIV_ROUND_UP(N_BITS, BITMAP_ULONG_BITS) - static inline size_t bitmap_n_longs(size_t n_bits) { diff --git a/lib/bundle.c b/lib/bundle.c index 4509d25c3..31c73c690 100644 --- a/lib/bundle.c +++ b/lib/bundle.c @@ -23,7 +23,7 @@ #include "colors.h" #include "openvswitch/dynamic-string.h" #include "multipath.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "nx-match.h" #include "openvswitch/ofpbuf.h" #include "ofp-actions.h" diff --git a/lib/classifier.h b/lib/classifier.h index 975a4f07e..d93b82d8e 100644 --- a/lib/classifier.h +++ b/lib/classifier.h @@ -300,7 +300,7 @@ #include "cmap.h" #include "openvswitch/match.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "pvector.h" #include "rculist.h" #include "type-props.h" diff --git a/lib/learn.c b/lib/learn.c index af8e1e86e..3aff2e6d1 100644 --- a/lib/learn.c +++ b/lib/learn.c @@ -22,7 +22,7 @@ #include "colors.h" #include "openvswitch/dynamic-string.h" #include "openvswitch/match.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "nx-match.h" #include "ofp-actions.h" #include "ofp-util.h" diff --git a/lib/meta-flow.c b/lib/meta-flow.c index 721152c40..cb96bf71a 100644 --- a/lib/meta-flow.c +++ b/lib/meta-flow.c @@ -16,7 +16,7 @@ #include -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include #include diff --git a/lib/nx-match.c b/lib/nx-match.c index 9f0f452dd..4732ea886 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -24,7 +24,7 @@ #include "colors.h" #include "openvswitch/dynamic-string.h" #include "hmap.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "ofp-actions.h" #include "ofp-util.h" #include "openvswitch/ofpbuf.h" diff --git a/lib/nx-match.h b/lib/nx-match.h index ce252f08e..51d64148a 100644 --- a/lib/nx-match.h +++ b/lib/nx-match.h @@ -22,7 +22,7 @@ #include #include "compiler.h" #include "flow.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "openvswitch/ofp-errors.h" #include "openvswitch/types.h" diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 106ebc84e..d8659e0d7 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -26,7 +26,7 @@ #include "openvswitch/dynamic-string.h" #include "hmap.h" #include "learn.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "multipath.h" #include "nx-match.h" #include "odp-netlink.h" diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 7aa87f19a..ebfc3d963 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -19,7 +19,7 @@ #include #include -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "ofp-util.h" #include "openflow/openflow.h" #include "openflow/nicira-ext.h" diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 13f6bd6be..015b7a58b 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -24,7 +24,7 @@ #include "byte-order.h" #include "openvswitch/dynamic-string.h" #include "learn.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "multipath.h" #include "netdev.h" #include "nx-match.h" diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 148edf25d..9cf6cda66 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -34,7 +34,7 @@ #include "flow.h" #include "learn.h" #include "multipath.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "netdev.h" #include "nx-match.h" #include "ofp-actions.h" diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 923a4298d..c47b985e9 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -28,7 +28,7 @@ #include "classifier.h" #include "openvswitch/dynamic-string.h" #include "learn.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "multipath.h" #include "netdev.h" #include "nx-match.h" diff --git a/lib/ofp-util.h b/lib/ofp-util.h index 0e5b440b6..ca36dc4df 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -22,10 +22,10 @@ #include #include "bitmap.h" #include "compiler.h" -#include "flow.h" +#include "openvswitch/flow.h" #include "openvswitch/list.h" #include "openvswitch/match.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "netdev.h" #include "openflow/netronome-ext.h" #include "openflow/nicira-ext.h" diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index a02dc24f6..a4fa09fb0 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -41,7 +41,7 @@ #include "ovs-lldp.h" #include "mac-learning.h" #include "mcast-snooping.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "multipath.h" #include "netdev-vport.h" #include "netlink.h" diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h index cf9932cf1..c4c23d5c3 100644 --- a/ofproto/ofproto-dpif-xlate.h +++ b/ofproto/ofproto-dpif-xlate.h @@ -17,7 +17,7 @@ #include "dp-packet.h" #include "flow.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "odp-util.h" #include "openvswitch/ofpbuf.h" #include "ofproto-dpif-mirror.h" diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 6be7b0aa7..23b417871 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -39,7 +39,7 @@ #include "learn.h" #include "mac-learning.h" #include "mcast-snooping.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "multipath.h" #include "netdev-vport.h" #include "netdev.h" diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 6e74e5efd..72b1d348a 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -31,7 +31,7 @@ #include "openvswitch/dynamic-string.h" #include "hash.h" #include "hmap.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "netdev.h" #include "nx-match.h" #include "ofp-actions.h" diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index 2d5a48148..2d241c96d 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -25,7 +25,7 @@ #include "cfm.h" #include "classifier.h" #include "flow.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "netflow.h" #include "rstp.h" #include "smap.h" diff --git a/ovn/controller/ofctrl.h b/ovn/controller/ofctrl.h index 93ef8eaa7..bc9cfbab1 100644 --- a/ovn/controller/ofctrl.h +++ b/ovn/controller/ofctrl.h @@ -19,7 +19,7 @@ #include -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" struct controller_ctx; struct hmap; diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 7c68c9d80..fc45d6439 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -44,6 +44,8 @@ #include "physical.h" #include "pinctrl.h" #include "poll-loop.h" +#include "lib/bitmap.h" +#include "lib/hash.h" #include "smap.h" #include "stream-ssl.h" #include "stream.h" diff --git a/ovn/controller/physical.h b/ovn/controller/physical.h index 9f405745e..2f8b58aec 100644 --- a/ovn/controller/physical.h +++ b/ovn/controller/physical.h @@ -25,7 +25,7 @@ * two pipelines. */ -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" struct controller_ctx; struct hmap; diff --git a/ovn/controller/pinctrl.h b/ovn/controller/pinctrl.h index 945e76bb2..2ad5ec22f 100644 --- a/ovn/controller/pinctrl.h +++ b/ovn/controller/pinctrl.h @@ -19,7 +19,7 @@ #include -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" struct lport_index; struct ovsrec_bridge; diff --git a/ovn/lib/expr.h b/ovn/lib/expr.h index 372577152..132778991 100644 --- a/ovn/lib/expr.h +++ b/ovn/lib/expr.h @@ -57,7 +57,7 @@ #include "hmap.h" #include "openvswitch/list.h" #include "openvswitch/match.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" struct ds; struct ofpbuf; diff --git a/ovn/lib/lex.h b/ovn/lib/lex.h index 20ede7a8c..578ef40d1 100644 --- a/ovn/lib/lex.h +++ b/ovn/lib/lex.h @@ -23,7 +23,7 @@ * This is a simple lexical analyzer (or tokenizer) for OVN match expressions * and ACLs. */ -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" struct ds; diff --git a/ovn/lib/logical-fields.h b/ovn/lib/logical-fields.h index 41d42a5a8..59f1ceea3 100644 --- a/ovn/lib/logical-fields.h +++ b/ovn/lib/logical-fields.h @@ -16,7 +16,7 @@ #ifndef OVN_LOGICAL_FIELDS_H #define OVN_LOGICAL_FIELDS_H 1 -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" /* Logical fields. * diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 302cc1de3..898a319bf 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -29,6 +29,7 @@ #include "ovn/lib/lex.h" #include "ovn/lib/ovn-nb-idl.h" #include "ovn/lib/ovn-sb-idl.h" +#include "packets.h" #include "poll-loop.h" #include "smap.h" #include "stream.h" diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 6fbf361f3..37432b1aa 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -63,7 +63,7 @@ #include "openvswitch/ofp-parse.h" #include "openvswitch/vconn.h" #include "openvswitch/vlog.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "sort.h" VLOG_DEFINE_THIS_MODULE(ofctl); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index cfe313b4a..b40ac8311 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -38,7 +38,7 @@ #include "ovs-lldp.h" #include "mac-learning.h" #include "mcast-snooping.h" -#include "meta-flow.h" +#include "openvswitch/meta-flow.h" #include "netdev.h" #include "nx-match.h" #include "ofp-print.h"