Add pretty-printers for QoS related OpenFlow and ODP actions.
authorBen Pfaff <blp@nicira.com>
Fri, 16 Jul 2010 22:30:09 +0000 (15:30 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 20 Jul 2010 18:22:36 +0000 (11:22 -0700)
lib/odp-util.c
lib/ofp-print.c

index 67d1b3e..ccf05c6 100644 (file)
@@ -92,6 +92,12 @@ format_odp_action(struct ds *ds, const union odp_action *a)
     case ODPAT_SET_TP_DST:
         ds_put_format(ds, "set_tp_dst(%"PRIu16")", ntohs(a->tp_port.tp_port));
         break;
+    case ODPAT_SET_PRIORITY:
+        ds_put_format(ds, "set_priority(0x%"PRIx32")", a->priority.priority);
+        break;
+    case ODPAT_POP_PRIORITY:
+        ds_put_cstr(ds, "pop_priority");
+        break;
     default:
         ds_put_format(ds, "***bad action 0x%"PRIx16"***", a->type);
         break;
index 7c1ebd0..c713060 100644 (file)
@@ -313,6 +313,20 @@ ofp_print_action(struct ds *string, const struct ofp_action_header *ah,
         break;
     }
 
+    case OFPAT_ENQUEUE: {
+        struct ofp_action_enqueue *ea = (struct ofp_action_enqueue *)ah;
+        unsigned int port = ntohs(ea->port);
+        unsigned int queue_id = ntohl(ea->queue_id);
+        ds_put_format(string, "enqueue:");
+        if (port != OFPP_IN_PORT) {
+            ds_put_format(string, "%u", port);
+        } else {
+            ds_put_cstr(string, "IN_PORT");
+        }
+        ds_put_format(string, "q%u", queue_id);
+        break;
+    }
+
     case OFPAT_SET_VLAN_VID: {
         struct ofp_action_vlan_vid *va = (struct ofp_action_vlan_vid *)ah;
         ds_put_format(string, "mod_vlan_vid:%"PRIu16, ntohs(va->vlan_vid));