diff mbox

[ovs-dev,PATCH_v5,26/26] Move lib/ofp-print.h to include/openvswitch directory

Message ID 153b702f985677190f4186fd8ed79765b1d6c746.1458939733.git.ben@skyportsystems.com
State Deferred
Headers show

Commit Message

ben@skyportsystems.com March 25, 2016, 9:10 p.m. UTC
From: Ben Warren <ben@skyportsystems.com>

Signed-off-by: Ben Warren <ben@skyportsystems.com>
---
 include/openvswitch/automake.mk |  1 +
 include/openvswitch/ofp-print.h | 58 +++++++++++++++++++++++++++++++++++++++++
 lib/automake.mk                 |  1 -
 lib/dpif-netdev.c               | 11 ++++----
 lib/dpif.c                      |  2 +-
 lib/learning-switch.c           |  2 +-
 lib/netdev-dpdk.c               |  6 ++---
 lib/netdev-dummy.c              |  8 +++---
 lib/ofp-print.c                 |  6 ++---
 lib/ofp-print.h                 | 58 -----------------------------------------
 lib/ofp-util.c                  |  4 +--
 lib/stream.c                    |  8 +++---
 lib/vconn.c                     |  2 +-
 ofproto/ofproto-dpif.c          |  2 +-
 ofproto/ofproto.c               |  2 +-
 ovn/controller/ofctrl.c         |  2 +-
 ovn/controller/pinctrl.c        |  2 +-
 tests/test-flows.c              |  8 +++---
 third-party/ofp-tcpdump.patch   |  2 +-
 utilities/ovs-ofctl.c           |  2 +-
 vswitchd/bridge.c               | 22 ++++++++--------
 21 files changed, 104 insertions(+), 105 deletions(-)
 create mode 100644 include/openvswitch/ofp-print.h
 delete mode 100644 lib/ofp-print.h
diff mbox

Patch

diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index b366d03..3d0362d 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -13,6 +13,7 @@  openvswitchinclude_HEADERS = \
 	include/openvswitch/ofp-errors.h \
 	include/openvswitch/ofp-msgs.h \
 	include/openvswitch/ofp-parse.h \
+	include/openvswitch/ofp-print.h \
 	include/openvswitch/ofp-prop.h \
 	include/openvswitch/ofp-util.h \
 	include/openvswitch/packets.h \
diff --git a/include/openvswitch/ofp-print.h b/include/openvswitch/ofp-print.h
new file mode 100644
index 0000000..bbac18b
--- /dev/null
+++ b/include/openvswitch/ofp-print.h
@@ -0,0 +1,58 @@ 
+/*
+ * Copyright (c) 2008, 2009, 2011, 2012, 2015 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* OpenFlow protocol pretty-printer. */
+
+#ifndef OFP_PRINT_H
+#define OFP_PRINT_H 1
+
+#include <stdint.h>
+#include <stdio.h>
+
+struct ds;
+struct ofp10_match;
+struct ofp_flow_mod;
+struct ofp_header;
+struct ofputil_flow_stats;
+struct ofputil_table_features;
+struct ofputil_table_stats;
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+void ofp_print(FILE *, const void *, size_t, int verbosity);
+void ofp_print_packet(FILE *stream, const void *data, size_t len);
+
+void ofp10_match_print(struct ds *, const struct ofp10_match *, int verbosity);
+
+char *ofp_to_string(const void *, size_t, int verbosity);
+char *ofp10_match_to_string(const struct ofp10_match *, int verbosity);
+char *ofp_packet_to_string(const void *data, size_t len);
+
+void ofp_print_flow_stats(struct ds *, struct ofputil_flow_stats *);
+void ofp_print_version(const struct ofp_header *, struct ds *);
+void ofp_print_table_features(
+    struct ds *, const struct ofputil_table_features *features,
+    const struct ofputil_table_features *prev_features,
+    const struct ofputil_table_stats *stats,
+    const struct ofputil_table_stats *prev_stats);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* ofp-print.h */
diff --git a/lib/automake.mk b/lib/automake.mk
index bb6d489..1ec2115 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -142,7 +142,6 @@  lib_libopenvswitch_la_SOURCES = \
 	lib/ofp-msgs.c \
 	lib/ofp-parse.c \
 	lib/ofp-print.c \
-	lib/ofp-print.h \
 	lib/ofp-prop.c \
 	lib/ofp-util.c \
 	lib/ofp-version-opt.h \
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index a3c9b08..51ebd79 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -39,21 +39,22 @@ 
 #include "dpif.h"
 #include "dpif-provider.h"
 #include "dummy.h"
-#include "openvswitch/dynamic-string.h"
 #include "fat-rwlock.h"
 #include "flow.h"
 #include "hmapx.h"
 #include "latch.h"
-#include "openvswitch/list.h"
-#include "openvswitch/match.h"
 #include "netdev.h"
 #include "netdev-dpdk.h"
 #include "netdev-vport.h"
 #include "netlink.h"
 #include "odp-execute.h"
 #include "odp-util.h"
-#include "ofp-print.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/list.h"
+#include "openvswitch/match.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
 #include "ovs-numa.h"
 #include "ovs-rcu.h"
 #include "packets.h"
@@ -69,8 +70,6 @@ 
 #include "unixctl.h"
 #include "util.h"
 
-#include "openvswitch/vlog.h"
-
 VLOG_DEFINE_THIS_MODULE(dpif_netdev);
 
 #define FLOW_DUMP_MAX_BATCH 50
diff --git a/lib/dpif.c b/lib/dpif.c
index 1cf894c..2c64d9e 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -33,7 +33,7 @@ 
 #include "netlink.h"
 #include "odp-execute.h"
 #include "odp-util.h"
-#include "ofp-print.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "packets.h"
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index afc1f76..c69ca4c 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -29,11 +29,11 @@ 
 #include "flow.h"
 #include "hmap.h"
 #include "mac-learning.h"
-#include "ofp-print.h"
 #include "openflow/openflow.h"
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofp-parse.h"
 #include "openvswitch/ofpbuf.h"
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index f8342ea..02be8bc 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -34,12 +34,13 @@ 
 #include "dp-packet.h"
 #include "dpif-netdev.h"
 #include "fatal-signal.h"
-#include "openvswitch/list.h"
 #include "netdev-dpdk.h"
 #include "netdev-provider.h"
 #include "netdev-vport.h"
 #include "odp-util.h"
-#include "ofp-print.h"
+#include "openvswitch/list.h"
+#include "openvswitch/ofp-print.h"
+#include "openvswitch/vlog.h"
 #include "ovs-numa.h"
 #include "ovs-thread.h"
 #include "ovs-rcu.h"
@@ -50,7 +51,6 @@ 
 #include "unaligned.h"
 #include "timeval.h"
 #include "unixctl.h"
-#include "openvswitch/vlog.h"
 
 #include "rte_config.h"
 #include "rte_mbuf.h"
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index edc86fa..1794363 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -22,14 +22,15 @@ 
 
 #include "dp-packet.h"
 #include "dpif-netdev.h"
-#include "openvswitch/dynamic-string.h"
 #include "flow.h"
-#include "openvswitch/list.h"
 #include "netdev-provider.h"
 #include "netdev-vport.h"
 #include "odp-util.h"
-#include "ofp-print.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/list.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
 #include "ovs-atomic.h"
 #include "packets.h"
 #include "pcap-file.h"
@@ -41,7 +42,6 @@ 
 #include "timeval.h"
 #include "unixctl.h"
 #include "reconnect.h"
-#include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(netdev_dummy);
 
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index eb98ee5..24464a1 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -15,7 +15,6 @@ 
  */
 
 #include <config.h>
-#include "ofp-print.h"
 
 #include <errno.h>
 #include <inttypes.h>
@@ -30,11 +29,13 @@ 
 #include "byte-order.h"
 #include "colors.h"
 #include "compiler.h"
+#include "dp-packet.h"
 #include "flow.h"
 #include "learn.h"
 #include "multipath.h"
 #include "netdev.h"
 #include "nx-match.h"
+#include "odp-util.h"
 #include "openflow/nicira-ext.h"
 #include "openflow/openflow.h"
 #include "openvswitch/dynamic-string.h"
@@ -42,13 +43,12 @@ 
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/type-props.h"
 #include "packets.h"
-#include "dp-packet.h"
 #include "unaligned.h"
-#include "odp-util.h"
 #include "util.h"
 #include "uuid.h"
 
diff --git a/lib/ofp-print.h b/lib/ofp-print.h
deleted file mode 100644
index bbac18b..0000000
--- a/lib/ofp-print.h
+++ /dev/null
@@ -1,58 +0,0 @@ 
-/*
- * Copyright (c) 2008, 2009, 2011, 2012, 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* OpenFlow protocol pretty-printer. */
-
-#ifndef OFP_PRINT_H
-#define OFP_PRINT_H 1
-
-#include <stdint.h>
-#include <stdio.h>
-
-struct ds;
-struct ofp10_match;
-struct ofp_flow_mod;
-struct ofp_header;
-struct ofputil_flow_stats;
-struct ofputil_table_features;
-struct ofputil_table_stats;
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-void ofp_print(FILE *, const void *, size_t, int verbosity);
-void ofp_print_packet(FILE *stream, const void *data, size_t len);
-
-void ofp10_match_print(struct ds *, const struct ofp10_match *, int verbosity);
-
-char *ofp_to_string(const void *, size_t, int verbosity);
-char *ofp10_match_to_string(const struct ofp10_match *, int verbosity);
-char *ofp_packet_to_string(const void *data, size_t len);
-
-void ofp_print_flow_stats(struct ds *, struct ofputil_flow_stats *);
-void ofp_print_version(const struct ofp_header *, struct ds *);
-void ofp_print_table_features(
-    struct ds *, const struct ofputil_table_features *features,
-    const struct ofputil_table_features *prev_features,
-    const struct ofputil_table_stats *stats,
-    const struct ofputil_table_stats *prev_stats);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* ofp-print.h */
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 83c0823..b200b93 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -15,7 +15,6 @@ 
  */
 
 #include <config.h>
-#include "ofp-print.h"
 #include <ctype.h>
 #include <errno.h>
 #include <inttypes.h>
@@ -23,6 +22,7 @@ 
 #include <netinet/in.h>
 #include <netinet/icmp6.h>
 #include <stdlib.h>
+#include "bitmap.h"
 #include "bundle.h"
 #include "byte-order.h"
 #include "classifier.h"
@@ -37,6 +37,7 @@ 
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-prop.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
@@ -47,7 +48,6 @@ 
 #include "random.h"
 #include "tun-metadata.h"
 #include "unaligned.h"
-#include "bitmap.h"
 #include "uuid.h"
 
 VLOG_DEFINE_THIS_MODULE(ofp_util);
diff --git a/lib/stream.c b/lib/stream.c
index 3fc69c1..f6ea849 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -23,21 +23,21 @@ 
 #include <stdlib.h>
 #include <string.h>
 #include "coverage.h"
-#include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "flow.h"
 #include "jsonrpc.h"
-#include "ofp-print.h"
-#include "openvswitch/ofpbuf.h"
 #include "openflow/nicira-ext.h"
 #include "openflow/openflow.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-print.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
 #include "ovs-thread.h"
 #include "packets.h"
 #include "poll-loop.h"
 #include "random.h"
 #include "socket-util.h"
 #include "util.h"
-#include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(stream);
 
diff --git a/lib/vconn.c b/lib/vconn.c
index 97d71da..50b4047 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -25,12 +25,12 @@ 
 #include "coverage.h"
 #include "fatal-signal.h"
 #include "flow.h"
-#include "ofp-print.h"
 #include "openflow/nicira-ext.h"
 #include "openflow/openflow.h"
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index d6456c9..734a301 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -40,7 +40,6 @@ 
 #include "nx-match.h"
 #include "odp-util.h"
 #include "odp-execute.h"
-#include "ofp-print.h"
 #include "ofproto/ofproto-dpif.h"
 #include "ofproto/ofproto-provider.h"
 #include "ofproto-dpif-ipfix.h"
@@ -54,6 +53,7 @@ 
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/meta-flow.h"
 #include "openvswitch/ofp-parse.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index fa766f6..ff6affd 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -34,7 +34,6 @@ 
 #include "hmap.h"
 #include "netdev.h"
 #include "nx-match.h"
-#include "ofp-print.h"
 #include "ofproto.h"
 #include "ofproto-provider.h"
 #include "openflow/nicira-ext.h"
@@ -44,6 +43,7 @@ 
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index edd6f2a..b9e2153 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -19,12 +19,12 @@ 
 #include "hash.h"
 #include "hmap.h"
 #include "ofctrl.h"
-#include "ofp-print.h"
 #include "openflow/openflow.h"
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/match.h"
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 9e9cd89..cbac50e 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -22,9 +22,9 @@ 
 #include "dp-packet.h"
 #include "flow.h"
 #include "lport.h"
-#include "ofp-print.h"
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/vlog.h"
 #include "ovn-controller.h"
diff --git a/tests/test-flows.c b/tests/test-flows.c
index 040953b..4a1b65e 100644
--- a/tests/test-flows.c
+++ b/tests/test-flows.c
@@ -22,16 +22,16 @@ 
 #include <stdlib.h>
 #include <string.h>
 #include "classifier.h"
-#include "openvswitch/ofpbuf.h"
-#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
 #include "openflow/openflow.h"
+#include "openvswitch/ofp-print.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
 #include "ovstest.h"
 #include "dp-packet.h"
 #include "pcap-file.h"
 #include "timeval.h"
 #include "util.h"
-#include "openvswitch/vlog.h"
 
 static void
 test_flows_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
diff --git a/third-party/ofp-tcpdump.patch b/third-party/ofp-tcpdump.patch
index 72d33b8..56b3571 100644
--- a/third-party/ofp-tcpdump.patch
+++ b/third-party/ofp-tcpdump.patch
@@ -93,7 +93,7 @@ 
 +
 +#include "interface.h"
 +#include "openflow/openflow.h"
-+#include "../../lib/ofp-print.h"
++#include "openvswitch/ofp-print.h"
 +
 +void
 +openflow_print(const u_char *sp, u_int length)
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 6edb30c..a8116d9 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -40,7 +40,6 @@ 
 #include "fatal-signal.h"
 #include "nx-match.h"
 #include "odp-util.h"
-#include "ofp-print.h"
 #include "ofp-version-opt.h"
 #include "ofproto/ofproto.h"
 #include "openflow/nicira-ext.h"
@@ -50,6 +49,7 @@ 
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-msgs.h"
+#include "openvswitch/ofp-print.h"
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofp-parse.h"
 #include "openvswitch/ofpbuf.h"
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 2c224f5..700f65c 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -28,28 +28,31 @@ 
 #include "daemon.h"
 #include "dirs.h"
 #include "dpif.h"
-#include "openvswitch/dynamic-string.h"
 #include "hash.h"
 #include "hmap.h"
 #include "hmapx.h"
+#include "if-notifier.h"
 #include "jsonrpc.h"
 #include "lacp.h"
-#include "openvswitch/list.h"
-#include "ovs-lldp.h"
 #include "mac-learning.h"
 #include "mcast-snooping.h"
-#include "openvswitch/meta-flow.h"
 #include "netdev.h"
 #include "nx-match.h"
-#include "ofp-print.h"
-#include "openvswitch/ofp-util.h"
-#include "openvswitch/ofpbuf.h"
 #include "ofproto/bond.h"
 #include "ofproto/ofproto.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/list.h"
+#include "openvswitch/meta-flow.h"
+#include "openvswitch/ofp-print.h"
+#include "openvswitch/ofp-util.h"
+#include "openvswitch/ofpbuf.h"
+#include "openvswitch/vlog.h"
+#include "ovs-lldp.h"
 #include "ovs-numa.h"
+#include "packets.h"
 #include "poll-loop.h"
-#include "if-notifier.h"
 #include "seq.h"
+#include "sflow_api.h"
 #include "sha1.h"
 #include "shash.h"
 #include "smap.h"
@@ -64,10 +67,7 @@ 
 #include "vlandev.h"
 #include "lib/vswitch-idl.h"
 #include "xenserver.h"
-#include "openvswitch/vlog.h"
-#include "sflow_api.h"
 #include "vlan-bitmap.h"
-#include "packets.h"
 
 VLOG_DEFINE_THIS_MODULE(bridge);