Print special ports by name in ofp_packet_in messages.
authorBen Pfaff <blp@nicira.com>
Tue, 20 May 2008 23:46:39 +0000 (16:46 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 28 May 2008 16:58:23 +0000 (09:58 -0700)
lib/ofp-print.c

index a1e4dc9dc5f4abca63f115fa35bf913140005962..4d47279e8dbb762e8dd2c42cd9797527b802a3d0 100644 (file)
@@ -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)");