From: Ben Pfaff Date: Tue, 14 Dec 2010 20:08:10 +0000 (-0800) Subject: ofp-print: Print fragment handling in OpenFlow switch config messages. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b62feba9839bc341770ac7540976e6afd7d905b;p=openvswitch ofp-print: Print fragment handling in OpenFlow switch config messages. --- diff --git a/lib/ofp-print.c b/lib/ofp-print.c index 9d1b3b0c..ac841ccd 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -663,6 +663,22 @@ ofp_print_switch_config(struct ds *string, const struct ofp_switch_config *osc) uint16_t flags; flags = ntohs(osc->flags); + + ds_put_cstr(string, " frags="); + switch (flags & OFPC_FRAG_MASK) { + case OFPC_FRAG_NORMAL: + ds_put_cstr(string, "normal"); + flags &= ~OFPC_FRAG_MASK; + break; + case OFPC_FRAG_DROP: + ds_put_cstr(string, "drop"); + flags &= ~OFPC_FRAG_MASK; + break; + case OFPC_FRAG_REASM: + ds_put_cstr(string, "reassemble"); + flags &= ~OFPC_FRAG_MASK; + break; + } if (flags) { ds_put_format(string, " ***unknown flags 0x%04"PRIx16"***", flags); } diff --git a/tests/ofproto.at b/tests/ofproto.at index 6b430e56..a7dda06f 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -31,7 +31,7 @@ OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210 n_tables:2, n_buffers:256 features: capabilities:0x87, actions:0xfff LOCAL(br0): addr:aa:55:aa:55:00:00, config: 0x1, state:0x1 -OFPT_GET_CONFIG_REPLY: miss_send_len=0 +OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) OFPROTO_STOP AT_CLEANUP @@ -53,7 +53,7 @@ OFPT_FEATURES_REPLY: ver:0x1, dpid:fedcba9876543210 n_tables:2, n_buffers:256 features: capabilities:0x87, actions:0xfff LOCAL(br0): addr:aa:55:aa:55:00:00, config: $config, state:$state -OFPT_GET_CONFIG_REPLY: miss_send_len=0 +OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) done OFPROTO_STOP