X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fodp-util.c;h=4084e55d626835a8c96bf158dd37a67fad217fd5;hb=35651d6a6ba7cd83b93d3970f079ecb5061f4aad;hp=9ed17ed89343b6f62c44d230500dd0454e59de9f;hpb=3a14d239d785a251dc3a1070bf16445c51616833;p=sliver-openvswitch.git diff --git a/lib/odp-util.c b/lib/odp-util.c index 9ed17ed89..4084e55d6 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -924,6 +924,30 @@ parse_odp_key_attr(const char *s, const struct simap *port_names, } } + { + char tun_id_s[32]; + unsigned long long int flags; + int tos, ttl; + struct ovs_key_ipv4_tunnel tun_key; + int n = -1; + + if (sscanf(s, "ipv4_tunnel(tun_id=%31[x0123456789abcdefABCDEF]," + "flags=%lli,src="IP_SCAN_FMT",dst="IP_SCAN_FMT + ",tos=%i,ttl=%i)%n", tun_id_s, &flags, + IP_SCAN_ARGS(&tun_key.ipv4_src), + IP_SCAN_ARGS(&tun_key.ipv4_dst), &tos, &ttl, + &n) > 0 && n > 0) { + tun_key.tun_id = htonll(strtoull(tun_id_s, NULL, 0)); + tun_key.tun_flags = flags; + tun_key.ipv4_tos = tos; + tun_key.ipv4_ttl = ttl; + memset(&tun_key.pad, 0, sizeof tun_key.pad); + nl_msg_put_unspec(key, OVS_KEY_ATTR_IPV4_TUNNEL, &tun_key, + sizeof tun_key); + return n; + } + } + { unsigned long long int in_port; int n = -1;