Cc: Kyle Mestery <kmest...@cisco.com>
Signed-off-by: Simon Horman <ho...@verge.net.au>
---
 lib/odp-util.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 2829a85..7316e19 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -927,6 +927,30 @@ parse_odp_key_attr(const char *s, const struct shash 
*port_names,
     }
 
     {
+        ovs_be32 ipv4_src;
+        ovs_be32 ipv4_dst;
+        int ipv4_tos;
+        int ipv4_ttl;
+        int n = -1;
+
+        if (sscanf(s, "tun_key(src="IP_SCAN_FMT",dst="IP_SCAN_FMT","
+                   "tos=%i,ttl=%i)%n",
+                   IP_SCAN_ARGS(&ipv4_src), IP_SCAN_ARGS(&ipv4_dst),
+                   &ipv4_tos, &ipv4_ttl, &n) > 0
+            && n > 0) {
+            struct ovs_key_ipv4_tunnel tun_key;
+
+            tun_key.ipv4_src = ipv4_src;
+            tun_key.ipv4_dst = ipv4_dst;
+            tun_key.ipv4_tos = ipv4_tos;
+            tun_key.ipv4_ttl = ipv4_ttl;
+            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;
 
-- 
1.7.10

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to