"use --help for help");
}
- rconn = rconn_new(argv[0], 5, 5);
+ rconn = rconn_create(5, 5);
+ rconn_connect(rconn, argv[0]);
die_if_already_running();
daemonize();
static bool is_connected_state(enum state);
static bool is_admitted_msg(const struct ofpbuf *);
-/* Creates a new rconn, connects it (reliably) to 'name', and returns it. */
-struct rconn *
-rconn_new(const char *name, int inactivity_probe_interval, int max_backoff)
-{
- struct rconn *rc = rconn_create(inactivity_probe_interval, max_backoff);
- rconn_connect(rc, name);
- return rc;
-}
-
-/* Creates a new rconn, connects it (unreliably) to 'vconn', and returns it. */
-struct rconn *
-rconn_new_from_vconn(struct vconn *vconn)
-{
- struct rconn *rc = rconn_create(60, 0);
- rconn_connect_unreliably(rc, vconn);
- return rc;
-}
-
/* Creates and returns a new rconn.
*
* 'probe_interval' is a number of seconds. If the interval passes once
* 'max_backoff' is the maximum number of seconds between attempts to connect
* to the peer. The actual interval starts at 1 second and doubles on each
* failure until it reaches 'max_backoff'. If 0 is specified, the default of
- * 8 seconds is used. */
+ * 8 seconds is used.
+ *
+ * The new rconn is initially unconnected. Use rconn_connect() or
+ * rconn_connect_unreliably() to connect it. */
struct rconn *
rconn_create(int probe_interval, int max_backoff)
{
struct vconn;
struct rconn_packet_counter;
-struct rconn *rconn_new(const char *name,
- int inactivity_probe_interval, int max_backoff);
-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);
retval = pvconn_accept(p->listeners[i], OFP_VERSION, &vconn);
if (!retval) {
- ofconn_create(p, rconn_new_from_vconn(vconn), OFCONN_TRANSIENT);
+ struct rconn *rconn;
+
+ rconn = rconn_create(60, 0);
+ rconn_connect_unreliably(rconn, vconn);
+ ofconn_create(p, rconn, OFCONN_TRANSIENT);
} else if (retval != EAGAIN) {
VLOG_WARN_RL(&rl, "accept failed (%s)", strerror(retval));
}
static void
new_switch(struct switch_ *sw, struct vconn *vconn)
{
- sw->rconn = rconn_new_from_vconn(vconn);
+ sw->rconn = rconn_create(60, 0);
+ rconn_connect_unreliably(sw->rconn, vconn);
sw->lswitch = lswitch_create(sw->rconn, learn_macs, exact_flows,
set_up_flows ? max_idle : -1,
action_normal);