/* ofproto supports two kinds of OpenFlow connections:
*
- * - "Controller connections": Connections to ordinary OpenFlow controllers.
- * ofproto maintains persistent connections to these controllers and by
- * default sends them asynchronous messages such as packet-ins.
+ * - "Primary" connections to ordinary OpenFlow controllers. ofproto
+ * maintains persistent connections to these controllers and by default
+ * sends them asynchronous messages such as packet-ins.
*
- * - "Transient connections", e.g. from ovs-ofctl. When these connections
+ * - "Service" connections, e.g. from ovs-ofctl. When these connections
* drop, it is the other side's responsibility to reconnect them if
* necessary. ofproto does not send them asynchronous messages by default.
*/
enum ofconn_type {
- OFCONN_CONTROLLER, /* An OpenFlow controller. */
- OFCONN_TRANSIENT /* A transient connection. */
+ OFCONN_PRIMARY, /* An ordinary OpenFlow controller. */
+ OFCONN_SERVICE /* A service connection, e.g. "ovs-ofctl". */
};
/* An OpenFlow connection. */
#define OFCONN_REPLY_MAX 100
struct rconn_packet_counter *reply_counter;
- /* type == OFCONN_CONTROLLER only. */
+ /* type == OFCONN_PRIMARY only. */
enum nx_role role; /* Role. */
struct hmap_node hmap_node; /* In struct ofproto's "controllers" map. */
struct discovery *discovery; /* Controller discovery object, if enabled. */
discovery = NULL;
}
- ofconn = ofconn_create(ofproto, rconn_create(5, 8), OFCONN_CONTROLLER);
+ ofconn = ofconn_create(ofproto, rconn_create(5, 8), OFCONN_PRIMARY);
ofconn->pktbuf = pktbuf_create();
ofconn->miss_send_len = OFP_DEFAULT_MISS_SEND_LEN;
if (discovery) {
/* Pick a controller for monitoring. */
best = NULL;
LIST_FOR_EACH (ofconn, struct ofconn, node, &ofproto->all_conns) {
- if (ofconn->type == OFCONN_CONTROLLER
+ if (ofconn->type == OFCONN_PRIMARY
&& (!best || snoop_preference(ofconn) > snoop_preference(best))) {
best = ofconn;
}
rconn_connect_unreliably(rconn, vconn, name);
free(name);
- ofconn_create(p, rconn, OFCONN_TRANSIENT);
+ ofconn_create(p, rconn, OFCONN_SERVICE);
} else if (retval != EAGAIN) {
VLOG_WARN_RL(&rl, "accept failed (%s)", strerror(retval));
}
static void
ofconn_destroy(struct ofconn *ofconn)
{
- if (ofconn->type == OFCONN_CONTROLLER) {
+ if (ofconn->type == OFCONN_PRIMARY) {
hmap_remove(&ofconn->ofproto->controllers, &ofconn->hmap_node);
}
discovery_destroy(ofconn->discovery);
static bool
ofconn_receives_async_msgs(const struct ofconn *ofconn)
{
- if (ofconn->type == OFCONN_CONTROLLER) {
- /* Ordinary controllers always get asynchronous messages unless they
+ if (ofconn->type == OFCONN_PRIMARY) {
+ /* Primary controllers always get asynchronous messages unless they
* have configured themselves as "slaves". */
return ofconn->role != NX_ROLE_SLAVE;
} else {
- /* Transient connections don't get asynchronous messages unless they
- * have explicitly asked for them by setting a nonzero miss send
- * length. */
+ /* Service connections don't get asynchronous messages unless they have
+ * explicitly asked for them by setting a nonzero miss send length. */
return ofconn->miss_send_len > 0;
}
}
}
flags = ntohs(osc->flags);
- if (ofconn->type == OFCONN_CONTROLLER && ofconn->role != NX_ROLE_SLAVE) {
+ if (ofconn->type == OFCONN_PRIMARY && ofconn->role != NX_ROLE_SLAVE) {
switch (flags & OFPC_FRAG_MASK) {
case OFPC_FRAG_NORMAL:
dpif_set_drop_frags(p->dpif, false);
static int
reject_slave_controller(struct ofconn *ofconn, const struct ofp_header *oh)
{
- if (ofconn->type == OFCONN_CONTROLLER && ofconn->role == NX_ROLE_SLAVE) {
+ if (ofconn->type == OFCONN_PRIMARY && ofconn->role == NX_ROLE_SLAVE) {
static struct vlog_rate_limit perm_rl = VLOG_RATE_LIMIT_INIT(1, 5);
char *type_name;
}
nrr = (struct nx_role_request *) msg;
- if (ofconn->type != OFCONN_CONTROLLER) {
+ if (ofconn->type != OFCONN_PRIMARY) {
VLOG_WARN_RL(&rl, "ignoring role request on non-controller "
"connection");
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_EPERM);