From: Ben Pfaff Date: Tue, 20 May 2008 23:46:39 +0000 (-0700) Subject: Print special ports by name in ofp_packet_in messages. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf46e1e8a2f8e33c947f9b856f849f41ec86ae48;p=openvswitch Print special ports by name in ofp_packet_in messages. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index a1e4dc9d..4d47279e 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -48,6 +48,8 @@ #include "openflow.h" #include "packets.h" +static void ofp_print_port_name(struct ds *string, uint16_t port); + /* Returns a string that represents the contents of the Ethernet frame in the * 'len' bytes starting at 'data' to 'stream' as output by tcpdump. * 'total_len' specifies the full length of the Ethernet frame (of which 'len' @@ -149,8 +151,9 @@ ofp_packet_in(struct ds *string, const void *oh, size_t len, int verbosity) const struct ofp_packet_in *op = oh; size_t data_len; - ds_put_format(string, " total_len=%"PRIu16" in_port=%"PRIu8, - ntohs(op->total_len), ntohs(op->in_port)); + ds_put_format(string, " total_len=%"PRIu16" in_port=", + ntohs(op->total_len)); + ofp_print_port_name(string, ntohs(op->in_port)); if (op->reason == OFPR_ACTION) ds_put_cstr(string, " (via action)");