[ovs-dev] [ofp-print 12/15] ofp-print: Print fragment handling in OpenFlow switch config messages.

Justin Pettit jpettit at nicira.com
Wed Jan 12 08:08:24 UTC 2011


Looks good.

--Justin


On Dec 14, 2010, at 12:23 PM, Ben Pfaff wrote:

> ---
> lib/ofp-print.c  |   16 ++++++++++++++++
> tests/ofproto.at |    4 ++--
> 2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/ofp-print.c b/lib/ofp-print.c
> index 3691f79..44d313a 100644
> --- a/lib/ofp-print.c
> +++ b/lib/ofp-print.c
> @@ -655,6 +655,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 6b430e5..a7dda06 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
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list