- for (p = processors; p < &processors[n_processors]; p++) {
- if (oh->type == p->type) {
- if (msg->size < p->min_size) {
- VLOG_WARN_RL(&rl, "%016llx: %s: too short (%zu bytes) for "
- "type %"PRIu8" (min %zu)", sw->datapath_id,
- rconn_get_name(rconn), msg->size, oh->type,
- p->min_size);
- return;
- }
- if (p->handler) {
- (p->handler)(sw, rconn, msg->data);
- }
- return;
+ ofputil_decode_msg_type(oh, &type);
+ switch (ofputil_msg_type_code(type)) {
+ case OFPUTIL_OFPT_ECHO_REQUEST:
+ process_echo_request(sw, rconn, msg->data);
+ break;
+
+ case OFPUTIL_OFPT_FEATURES_REPLY:
+ process_switch_features(sw, msg->data);
+ break;
+
+ case OFPUTIL_OFPT_PACKET_IN:
+ process_packet_in(sw, rconn, msg->data);
+ break;
+
+ case OFPUTIL_OFPT_FLOW_REMOVED:
+ /* Nothing to do. */
+ break;
+
+ case OFPUTIL_INVALID:
+ case OFPUTIL_OFPT_HELLO:
+ case OFPUTIL_OFPT_ERROR:
+ case OFPUTIL_OFPT_ECHO_REPLY:
+ case OFPUTIL_OFPT_FEATURES_REQUEST:
+ case OFPUTIL_OFPT_GET_CONFIG_REQUEST:
+ case OFPUTIL_OFPT_GET_CONFIG_REPLY:
+ case OFPUTIL_OFPT_SET_CONFIG:
+ case OFPUTIL_OFPT_PORT_STATUS:
+ case OFPUTIL_OFPT_PACKET_OUT:
+ case OFPUTIL_OFPT_FLOW_MOD:
+ case OFPUTIL_OFPT_PORT_MOD:
+ case OFPUTIL_OFPT_BARRIER_REQUEST:
+ case OFPUTIL_OFPT_BARRIER_REPLY:
+ case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REQUEST:
+ case OFPUTIL_OFPT_QUEUE_GET_CONFIG_REPLY:
+ case OFPUTIL_OFPST_DESC_REQUEST:
+ case OFPUTIL_OFPST_FLOW_REQUEST:
+ case OFPUTIL_OFPST_AGGREGATE_REQUEST:
+ case OFPUTIL_OFPST_TABLE_REQUEST:
+ case OFPUTIL_OFPST_PORT_REQUEST:
+ case OFPUTIL_OFPST_QUEUE_REQUEST:
+ case OFPUTIL_OFPST_DESC_REPLY:
+ case OFPUTIL_OFPST_FLOW_REPLY:
+ case OFPUTIL_OFPST_QUEUE_REPLY:
+ case OFPUTIL_OFPST_PORT_REPLY:
+ case OFPUTIL_OFPST_TABLE_REPLY:
+ case OFPUTIL_OFPST_AGGREGATE_REPLY:
+ case OFPUTIL_NXT_STATUS_REQUEST:
+ case OFPUTIL_NXT_STATUS_REPLY:
+ case OFPUTIL_NXT_TUN_ID_FROM_COOKIE:
+ case OFPUTIL_NXT_ROLE_REQUEST:
+ case OFPUTIL_NXT_ROLE_REPLY:
+ case OFPUTIL_NXT_SET_FLOW_FORMAT:
+ case OFPUTIL_NXT_FLOW_MOD:
+ case OFPUTIL_NXT_FLOW_REMOVED:
+ case OFPUTIL_NXST_FLOW_REQUEST:
+ case OFPUTIL_NXST_AGGREGATE_REQUEST:
+ case OFPUTIL_NXST_FLOW_REPLY:
+ case OFPUTIL_NXST_AGGREGATE_REPLY:
+ default:
+ if (VLOG_IS_DBG_ENABLED()) {
+ char *s = ofp_to_string(msg->data, msg->size, 2);
+ VLOG_DBG_RL(&rl, "%016llx: OpenFlow packet ignored: %s",
+ sw->datapath_id, s);
+ free(s);