From: Justin Pettit Date: Tue, 23 Sep 2008 00:59:50 +0000 (-0700) Subject: First cut of pretty printer of ofp_port_mod messages. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=77c8eed5b4db899610a130764242e8b25efcae7b;p=sliver-openvswitch.git First cut of pretty printer of ofp_port_mod messages. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 07ae4a452..bacd37ccd 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -674,6 +674,23 @@ ofp_print_flow_expired(struct ds *string, const void *oh, size_t len, ntohll(ofe->byte_count)); } +static void +ofp_print_port_mod(struct ds *string, const void *oh, size_t len, + int verbosity) +{ + const struct ofp_port_mod *opm = oh; + + ds_put_format(string, "port: %d: addr:"ETH_ADDR_FMT", config: %#x, mask:%#x\n", + ntohs(opm->port_no), ETH_ADDR_ARGS(opm->hw_addr), + ntohl(opm->config), ntohl(opm->mask)); + ds_put_format(string, " advertised: "); + if (opm->advertise) { + ofp_print_port_features(string, ntohl(opm->advertise)); + } else { + ds_put_format(string, "Unchanged\n"); + } +} + struct error_type { int type; int code; @@ -1186,7 +1203,7 @@ static const struct openflow_packet packets[] = { OFPT_PORT_MOD, "port_mod", sizeof (struct ofp_port_mod), - NULL, + ofp_print_port_mod, }, { OFPT_PORT_STATUS,