[ovs-dev] [PATCH] vconn: Move struct definitions back to provider interface.

Ben Pfaff blp at nicira.com
Tue Jan 20 12:35:39 UTC 2015


Commit 4a1f523f2d760 (lib: Move vconn.h to <openvswitch/vconn.h>) moved
the definitions of struct vconn and struct pvconn into the public vconn.h
header.  This is unnecessary because the size and content of these structs
is not part of the ABI.  This commit moves them back.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 include/openvswitch/vconn.h | 30 +++++-------------------------
 lib/vconn-provider.h        | 23 ++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/include/openvswitch/vconn.h b/include/openvswitch/vconn.h
index 99933b8..3b157e1 100644
--- a/include/openvswitch/vconn.h
+++ b/include/openvswitch/vconn.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 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.
@@ -27,23 +27,10 @@ extern "C" {
 #endif
 
 struct ofpbuf;
-struct vconn_class;
+struct pvconn;
 struct pvconn_class;
-
-/* This structure should be treated as opaque by vconn implementations. */
-struct vconn {
-    const struct vconn_class *vclass;
-    int state;
-    int error;
-
-    /* OpenFlow versions. */
-    uint32_t allowed_versions;  /* Bitmap of versions we will accept. */
-    uint32_t peer_versions;     /* Peer's bitmap of versions it will accept. */
-    enum ofp_version version;   /* Negotiated version (or 0). */
-    bool recv_any_version;      /* True to receive a message of any version. */
-
-    char *name;
-};
+struct vconn;
+struct vconn_class;
 
 void vconn_usage(bool active, bool passive, bool bootstrap);
 
@@ -90,14 +77,7 @@ void vconn_connect_wait(struct vconn *);
 void vconn_recv_wait(struct vconn *);
 void vconn_send_wait(struct vconn *);
 
-/* Passive vconns: virtual listeners for incoming OpenFlow connections.
- *
- * This structure should be treated as opaque by vconn implementations. */
-struct pvconn {
-    const struct pvconn_class *pvclass;
-    char *name;
-    uint32_t allowed_versions;
-};
+/* Passive vconns: virtual listeners for incoming OpenFlow connections. */
 int pvconn_verify_name(const char *name);
 int pvconn_open(const char *name, uint32_t allowed_versions, uint8_t dscp,
                 struct pvconn **pvconnp);
diff --git a/lib/vconn-provider.h b/lib/vconn-provider.h
index 48ca660..523f26f 100644
--- a/lib/vconn-provider.h
+++ b/lib/vconn-provider.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2012, 2013, 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.
@@ -26,6 +26,21 @@
 
 /* Active virtual connection to an OpenFlow device. */
 
+/* This structure should be treated as opaque by vconn implementations. */
+struct vconn {
+    const struct vconn_class *vclass;
+    int state;
+    int error;
+
+    /* OpenFlow versions. */
+    uint32_t allowed_versions;  /* Bitmap of versions we will accept. */
+    uint32_t peer_versions;     /* Peer's bitmap of versions it will accept. */
+    enum ofp_version version;   /* Negotiated version (or 0). */
+    bool recv_any_version;      /* True to receive a message of any version. */
+
+    char *name;
+};
+
 void vconn_init(struct vconn *, const struct vconn_class *, int connect_status,
                 const char *name, uint32_t allowed_versions);
 void vconn_free_data(struct vconn *vconn);
@@ -115,6 +130,12 @@ struct vconn_class {
 
 /* Passive virtual connection to an OpenFlow device. */
 
+/* This structure should be treated as opaque by vconn implementations. */
+struct pvconn {
+    const struct pvconn_class *pvclass;
+    char *name;
+    uint32_t allowed_versions;
+};
 void pvconn_init(struct pvconn *pvconn, const struct pvconn_class *pvclass,
                  const char *name, uint32_t allowed_versions);
 static inline void pvconn_assert_class(const struct pvconn *pvconn,
-- 
2.1.3




More information about the dev mailing list