From: Ben Pfaff Date: Sat, 17 May 2008 03:20:14 +0000 (-0700) Subject: Print more special ports by name in ofp-print.c. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c08c24913e4c6700a8aac4cc93bccbc0a4ba102;p=openvswitch Print more special ports by name in ofp-print.c. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index d3f5cb4a..8579cab5 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -180,15 +180,34 @@ ofp_packet_in(struct ds *string, const void *oh, size_t len, int verbosity) static void ofp_print_port_name(struct ds *string, uint16_t port) { - if (port == UINT16_MAX) { - ds_put_cstr(string, "none"); - } else if (port == OFPP_FLOOD) { - ds_put_cstr(string, "flood"); - } else if (port == OFPP_CONTROLLER) { - ds_put_cstr(string, "controller"); - } else { + const char *name; + switch (port) { + case OFPP_TABLE: + name = "TABLE"; + break; + case OFPP_NORMAL: + name = "NORMAL"; + break; + case OFPP_FLOOD: + name = "FLOOD"; + break; + case OFPP_ALL: + name = "ALL"; + break; + case OFPP_CONTROLLER: + name = "CONTROLLER"; + break; + case OFPP_LOCAL: + name = "LOCAL"; + break; + case OFPP_NONE: + name = "NONE"; + break; + default: ds_put_format(string, "%"PRIu16, port); + return; } + ds_put_cstr(string, name); } static void