[ovs-discuss] [ACLv2 14/19] flow: Add more detailed printing for ARP flows.

Ben Pfaff blp at nicira.com
Tue Aug 25 19:58:01 UTC 2009


Jesse Gross <jesse at nicira.com> writes:

> @@ -399,7 +399,19 @@ flow_wildcard_to_string(flow_t *flow, uint32_t wildcards, int verbosity)
>                  ds_put_cstr(&f, "ip,");
>              }
>          } else if (flow->dl_type == htons(ETH_TYPE_ARP)) {
> -            ds_put_cstr(&f, "arp,");
> +            if (!(wildcards & OFPFW_NW_PROTO)) {
> +                skip_proto = true;
> +                if (flow->nw_proto == ARP_OP_REQUEST) {
> +                    ds_put_cstr(&f, "arp request,");
> +                } else if (flow->nw_proto == ARP_OP_REPLY) {
> +                    ds_put_cstr(&f, "arp reply,");

The design here is supposed to match the keywords parsed by
parse_protocol() in ovs-ofctl.c.  Those keywords can't include
spaces (see str_to_flow()).  For the moment that code doesn't
care, since OpenFlow doesn't support ARP, but someday it might
and then it'd be nice to have keywords that can be easily added.
So I would add a hyphen: "arp-request", "arp-reply".

> +                } else {
> +                    ds_put_cstr(&f, "arp,");
> +                    skip_proto = false;
> +                }
> +            } else {
> +                ds_put_cstr(&f, "arp,");
> +            }
>          } else {
>              skip_type = false;
>          }




More information about the discuss mailing list