From c4d279ab34078ff68fde5ac7b0f18a80803351ab Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 16 Jul 2010 15:30:09 -0700 Subject: [PATCH] Add pretty-printers for QoS related OpenFlow and ODP actions. --- lib/odp-util.c | 6 ++++++ lib/ofp-print.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/odp-util.c b/lib/odp-util.c index 67d1b3ee7..ccf05c6bd 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -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; diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 7c1ebd006..c7130607f 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -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)); -- 2.43.0