On Oct 26, 2011, at 10:09 AM, Ben Pfaff wrote:
> +static enum ovs_key_attr
> +ovs_key_attr_from_string(const char *s, size_t len)
> +{
> + enum ovs_key_attr attr;
> +
> + for (attr = 0; attr <= OVS_KEY_ATTR_MAX; attr++) {
> + const char *attr_name = ovs_key_attr_to_string(attr);
> + if (strlen(attr_name) == len && !memcmp(s, attr_name, len)) {
> + return attr;
> + }
> + }
> +
> + return OVS_KEY_ATTR_UNSPEC;
Do you think it's worth distinguishing between unspecified and unknown? The
ovs_key_attr_to_string() handles them differently, but it's probably not
important for the one current caller here.
--Justin
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev