[ovs-dev] [of1.2 errors 4/4] Add error codes for Open Flow v1.2

Reid Price reid at nicira.com
Mon Mar 26 21:46:19 UTC 2012


Glanced at python.  One note inline, rest seemed correct

On Mon, Mar 26, 2012 at 1:59 PM, Ben Pfaff <blp at nicira.com> wrote:

> From: Simon Horman <horms at verge.net.au>
>

<snip>


>
> @@ -254,12 +304,17 @@ static enum ofperr
>  %s_decode(uint16_t type, uint16_t code)
>  {
>     switch ((type << 16) | code) {""" % name
> +        found = []
>

found = set() might be more appropriate here, won't matter.


>          for enum in names:
>             if enum not in map:
>                 continue
>             type_, code = map[enum]
>             if code is None:
>                 continue
> +            value = (type_ << 16) | code
> +            if value in found:
> +                continue
> +            found.append(value)
>             print "    case (%d << 16) | %d:" % (type_, code)
>             print "        return OFPERR_%s;" % enum
>         print """\
>

<bigsnip>

  -Reid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20120326/2b1ff94a/attachment-0003.html>


More information about the dev mailing list