/* Creates a new rconn, connects it (unreliably) to 'vconn', and returns it. */
struct rconn *
-rconn_new_from_vconn(const char *name, struct vconn *vconn)
+rconn_new_from_vconn(struct vconn *vconn)
{
struct rconn *rc = rconn_create(60, 0);
- rconn_connect_unreliably(rc, name, vconn);
+ rconn_connect_unreliably(rc, vconn);
return rc;
}
}
void
-rconn_connect_unreliably(struct rconn *rc,
- const char *name, struct vconn *vconn)
+rconn_connect_unreliably(struct rconn *rc, struct vconn *vconn)
{
assert(vconn != NULL);
rconn_disconnect(rc);
- set_vconn_name(rc, name);
+ set_vconn_name(rc, vconn_get_name(vconn));
rc->reliable = false;
rc->vconn = vconn;
rc->last_connected = time_now();
struct rconn *rconn_new(const char *name,
int inactivity_probe_interval, int max_backoff);
-struct rconn *rconn_new_from_vconn(const char *name, struct vconn *);
+struct rconn *rconn_new_from_vconn(struct vconn *);
struct rconn *rconn_create(int inactivity_probe_interval, int max_backoff);
void rconn_set_max_backoff(struct rconn *, int max_backoff);
int rconn_get_probe_interval(const struct rconn *);
int rconn_connect(struct rconn *, const char *name);
-void rconn_connect_unreliably(struct rconn *,
- const char *name, struct vconn *vconn);
+void rconn_connect_unreliably(struct rconn *, struct vconn *vconn);
void rconn_reconnect(struct rconn *);
void rconn_disconnect(struct rconn *);
void rconn_destroy(struct rconn *);
retval = pvconn_accept(p->listeners[i], OFP_VERSION, &vconn);
if (!retval) {
- ofconn_create(p, rconn_new_from_vconn("passive", vconn),
- OFCONN_TRANSIENT);
+ ofconn_create(p, rconn_new_from_vconn(vconn), OFCONN_TRANSIENT);
} else if (retval != EAGAIN) {
VLOG_WARN_RL(&rl, "accept failed (%s)", strerror(retval));
}
static char *unixctl_path = NULL;
static int do_switching(struct switch_ *);
-static void new_switch(struct switch_ *, struct vconn *, const char *name);
+static void new_switch(struct switch_ *, struct vconn *);
static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
if (n_switches >= MAX_SWITCHES) {
ovs_fatal(0, "max %d switch connections", n_switches);
}
- new_switch(&switches[n_switches++], vconn, name);
+ new_switch(&switches[n_switches++], vconn);
continue;
} else if (retval == EAFNOSUPPORT) {
struct pvconn *pvconn;
retval = pvconn_accept(listeners[i], OFP_VERSION, &new_vconn);
if (!retval || retval == EAGAIN) {
if (!retval) {
- new_switch(&switches[n_switches++], new_vconn, "tcp");
+ new_switch(&switches[n_switches++], new_vconn);
}
i++;
} else {
}
static void
-new_switch(struct switch_ *sw, struct vconn *vconn, const char *name)
+new_switch(struct switch_ *sw, struct vconn *vconn)
{
- sw->rconn = rconn_new_from_vconn(name, vconn);
+ sw->rconn = rconn_new_from_vconn(vconn);
sw->lswitch = lswitch_create(sw->rconn, learn_macs, exact_flows,
set_up_flows ? max_idle : -1,
action_normal);