xenserver: Verify updates in ovs-xapi-sync.
[sliver-openvswitch.git] / lib / rconn.c
index 1b69b8f..f6d85a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -335,7 +335,7 @@ reconnect(struct rconn *rc)
         VLOG_INFO("%s: connecting...", rc->name);
     }
     rc->n_attempted_connections++;
-    retval = vconn_open(rc->target, OFP_VERSION, &rc->vconn);
+    retval = vconn_open(rc->target, OFP10_VERSION, &rc->vconn);
     if (!retval) {
         rc->remote_ip = vconn_get_remote_ip(rc->vconn);
         rc->local_ip = vconn_get_local_ip(rc->vconn);
@@ -731,6 +731,14 @@ rconn_get_local_port(const struct rconn *rconn)
     return rconn->vconn ? vconn_get_local_port(rconn->vconn) : 0;
 }
 
+/* Returns the OpenFlow version negotiated with the peer, or -1 if there is
+ * currently no connection or if version negotiation is not yet complete. */
+int
+rconn_get_version(const struct rconn *rconn)
+{
+    return rconn->vconn ? vconn_get_version(rconn->vconn) : -1;
+}
+
 /* Returns the total number of packets successfully received by the underlying
  * vconn.  */
 unsigned int