]> git.proxmox.com Git - ovs.git/commitdiff
vport: Move 'extern' declarations of vports to header.
authorJesse Gross <jesse@nicira.com>
Thu, 10 Jun 2010 20:48:08 +0000 (13:48 -0700)
committerJesse Gross <jesse@nicira.com>
Thu, 10 Jun 2010 21:29:30 +0000 (14:29 -0700)
Since vport implementations have no header files they needed to be
declared as extern before being used.  They are currently declared
in vport.c but this isn't safe because the compiler will silently
accept it if the type is incorrect.  This moves those declarations
into vport.h, which is included by all implementations and will
cause errors about conflicting types if there is a mismatch.

datapath/vport-gre.c
datapath/vport-internal_dev.c
datapath/vport-netdev.c
datapath/vport-patch.c
datapath/vport.c
datapath/vport.h

index 237835ba9d443ae3a0d0bf4cebf2c91e644cd915..cd0f3e8dce46c1936cd0dd8a87f19deb7b2fcadc 100644 (file)
@@ -63,8 +63,6 @@ struct gre_vport {
        struct mutable_config *mutable;
 };
 
-struct vport_ops gre_vport_ops;
-
 /* Protected by RCU. */
 static struct tbl *port_table;
 
index d8e57fef85daa122ed9645219e3c8b0ef9fcf7a9..eb7ddf963f9cea29951a4a5d1f3d80fe20e27b75 100644 (file)
@@ -40,8 +40,6 @@ struct internal_dev {
        struct pcpu_lstats extra_stats;
 };
 
-struct vport_ops internal_vport_ops;
-
 static inline struct internal_dev *internal_dev_priv(struct net_device *netdev)
 {
        return netdev_priv(netdev);
index 50c51ac097c55616d1279356224d13002ffdacb6..8e7847efda923f26959238d9d44db20f9e72e67d 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "compat.h"
 
-struct vport_ops netdev_vport_ops;
-
 static void netdev_port_receive(struct net_bridge_port *, struct sk_buff *);
 
 /*
index 96e1a10f84dd7b556a011e563e629f2b8b8b4be6..ff94be00a5840ca569cb00a588e5daaf90677a75 100644 (file)
@@ -35,8 +35,6 @@ struct patch_vport {
        struct device_config *devconf;
 };
 
-struct vport_ops patch_vport_ops;
-
 /* Protected by RTNL lock. */
 static struct hlist_head *peer_table;
 #define PEER_HASH_BUCKETS 256
index 83b42d550f294eb10dab56b9833fe5a1999105bb..1bd42431bc5a4edd31dadfe6945a3826a753709c 100644 (file)
 #include "vport.h"
 #include "vport-internal_dev.h"
 
-extern struct vport_ops netdev_vport_ops;
-extern struct vport_ops internal_vport_ops;
-extern struct vport_ops patch_vport_ops;
-extern struct vport_ops gre_vport_ops;
-
+/* List of statically compiled vport implementations.  Don't forget to also
+ * add yours to the list at the bottom of vport.h. */
 static struct vport_ops *base_vport_ops_list[] = {
        &netdev_vport_ops,
        &internal_vport_ops,
index e84c4e3632fc78c31a97a44fdbcc0f2ba4173fc9..fc2c1761611e45cb50993bf85e2f8a40dc2db4da 100644 (file)
@@ -237,4 +237,11 @@ vport_from_priv(const void *priv)
 void vport_receive(struct vport *, struct sk_buff *);
 void vport_record_error(struct vport *, enum vport_err_type err_type);
 
+/* List of statically compiled vport implementations.  Don't forget to also
+ * add yours to the list at the top of vport.c. */
+extern struct vport_ops netdev_vport_ops;
+extern struct vport_ops internal_vport_ops;
+extern struct vport_ops patch_vport_ops;
+extern struct vport_ops gre_vport_ops;
+
 #endif /* vport.h */