• Adrian Moreno's avatar
    selftests: openvswitch: support key masks · 9f1179fb
    Adrian Moreno authored
    The default value for the mask actually depends on the value (e.g: if
    the value is non-null, the default is full-mask), so change the convert
    functions to accept the full, possibly masked string and let them figure
    out how to parse the different values.
    
    Also, implement size-aware int parsing.
    
    With this patch we can now express flows such as the following:
    "eth(src=0a:ca:fe:ca:fe:0a/ff:ff:00:00:ff:00)"
    "eth(src=0a:ca:fe:ca:fe:0a)" -> mask = ff:ff:ff:ff:ff:ff
    "ipv4(src=192.168.1.1)" -> mask = 255.255.255.255
    "ipv4(src=192.168.1.1/24)"
    "ipv4(src=192.168.1.1/255.255.255.0)"
    "tcp(src=8080)" -> mask = 0xffff
    "tcp(src=8080/0xf0f0)"
    Signed-off-by: default avatarAdrian Moreno <amorenoz@redhat.com>
    Acked-by: default avatarAaron Conole <aconole@redhat.com>
    Reviewed-by: default avatarSimon Horman <horms@kernel.org>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    9f1179fb
ovs-dpctl.py 61.4 KB