Allow hexdump of packet data of PACKET_{IN, OUT} messages
authorSimon Horman <horms@verge.net.au>
Fri, 17 May 2013 05:14:14 +0000 (14:14 +0900)
committerBen Pfaff <blp@nicira.com>
Fri, 17 May 2013 05:49:21 +0000 (22:49 -0700)
commitb4ccee7576e5bbc36764b88ad50f5052ecea25be
tree7e4b5124507057238da88fcb780492d5cc9e109e
parent4b2d9d113f8eb7ee4e6bf703e81d4169377fc26b
Allow hexdump of packet data of PACKET_{IN, OUT} messages

If verbosity parameter of ofp_print_packet_{in,out}() is greater than 2
then when formatting packet data include a hex dump as well as the output
of ofp_packet_to_string(), which is already included if verbosity is
greater than 0.

This feature may be accesed in serveral ways including:

* Including the -m parameter in an invoocation of ovs-ofctl monitor.
* Including a verbosity greater than 2 in an invocation of
  ovs-ofctl ofp-print.

This patch includes tests to exercise this feature using ovs-ofctl ofp-print.

The motivation of this is to allow tests to be written that use ovs-ofctl
-m monitor to check packet data which is not output by
ofp_packet_to_string(). Specifically, as the protocol of the inner-packet
is not known by ofp_packet_to_string() it only decodes and stringifies an
MPLS packet up to and including the first MPLS label stack entry. However
it may be useful to create tests which verify the contents of the inner
packet.

One example may be verify the effect of dec_ttl in the following sequence
of actions applied to a packet with a single MPLS label stack entry.

pop_mpls(0x800),dec_ttl,push_mpls(0x8847)

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-print.c
tests/ofp-print.at