/*
- * 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.
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);
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