connmgr: Parameterize ofservice_create() over allowed OpenFlow versions
authorSimon Horman <horms@verge.net.au>
Fri, 26 Oct 2012 02:35:52 +0000 (11:35 +0900)
committerBen Pfaff <blp@nicira.com>
Mon, 5 Nov 2012 06:11:40 +0000 (22:11 -0800)
This is in preparation for allowing configuration of the
allowed OpenFlow versions.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/connmgr.c

index 5a0b0d3dd750224b3fe0166a11f4a8e537e9eda2..7897bb7fea6843b24fd14b1a0a8784440ad19aa3 100644 (file)
@@ -137,7 +137,8 @@ struct ofservice {
 
 static void ofservice_reconfigure(struct ofservice *,
                                   const struct ofproto_controller *);
-static int ofservice_create(struct connmgr *, const char *target, uint8_t dscp);
+static int ofservice_create(struct connmgr *mgr, const char *target,
+                            uint32_t allowed_versions, uint8_t dscp);
 static void ofservice_destroy(struct connmgr *, struct ofservice *);
 static struct ofservice *ofservice_lookup(struct connmgr *,
                                           const char *target);
@@ -513,7 +514,7 @@ connmgr_set_controllers(struct connmgr *mgr,
             if (!ofservice_lookup(mgr, c->target)) {
                 VLOG_INFO("%s: added service controller \"%s\"",
                           mgr->name, c->target);
-                ofservice_create(mgr, c->target, c->dscp);
+                ofservice_create(mgr, c->target, 0, c->dscp);
             }
         } else {
             VLOG_WARN_RL(&rl, "%s: unsupported controller \"%s\"",
@@ -1618,13 +1619,14 @@ connmgr_flushed(struct connmgr *mgr)
  * ofservice_reconfigure() must be called to fully configure the new
  * ofservice. */
 static int
-ofservice_create(struct connmgr *mgr, const char *target, uint8_t dscp)
+ofservice_create(struct connmgr *mgr, const char *target,
+                 uint32_t allowed_versions, uint8_t dscp)
 {
     struct ofservice *ofservice;
     struct pvconn *pvconn;
     int error;
 
-    error = pvconn_open(target, 0, &pvconn, dscp);
+    error = pvconn_open(target, allowed_versions, &pvconn, dscp);
     if (error) {
         return error;
     }