/* Statistics messages. */
OFPT_STATS_REQUEST, /* Controller/switch message */
- OFPT_STATS_REPLY /* Controller/switch message */
+ OFPT_STATS_REPLY, /* Controller/switch message */
+
+ /* Barrier messages. */
+ OFPT_BARRIER_REQUEST, /* Controller/switch message */
+ OFPT_BARRIER_REPLY /* Controller/switch message */
};
/* Header on all OpenFlow packets. */
sizeof (struct ofp_vendor_header),
NULL,
},
+ {
+ OFPT_BARRIER_REQUEST,
+ "barrier_request",
+ sizeof (struct ofp_header),
+ NULL,
+ },
+ {
+ OFPT_BARRIER_REPLY,
+ "barrier_reply",
+ sizeof (struct ofp_header),
+ NULL,
+ }
};
/* Composes and returns a string representing the OpenFlow packet of 'len'
return ofp_mkerr(OFPET_BAD_REQUEST, OFPBRC_BAD_SUBTYPE);
}
+static int
+handle_barrier_request(struct ofconn *ofconn, struct ofp_header *oh)
+{
+ struct ofp_header *ob;
+ struct ofpbuf *buf;
+
+ /* Currently, everything executes synchronously, so we can just
+ * immediately send the barrier reply. */
+ ob = make_openflow_xid(sizeof *ob, OFPT_BARRIER_REPLY, oh->xid, &buf);
+ queue_tx(buf, ofconn, ofconn->reply_counter);
+ return 0;
+}
+
static void
handle_openflow(struct ofconn *ofconn, struct ofproto *p,
struct ofpbuf *ofp_msg)
error = handle_vendor(p, ofconn, ofp_msg->data);
break;
+ case OFPT_BARRIER_REQUEST:
+ error = handle_barrier_request(ofconn, oh);
+ break;
+
default:
if (VLOG_IS_WARN_ENABLED()) {
char *s = ofp_to_string(oh, ntohs(oh->length), 2);