Global replace of Nicira Networks.
[sliver-openvswitch.git] / include / openvswitch / tunnel.h
index 3737975..c494791 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
  *
  * This file is offered under your choice of two licenses: Apache 2.0 or GNU
  * GPL 2.0 or later.  The permission statements for each of these licenses is
 #define OPENVSWITCH_TUNNEL_H 1
 
 #include <linux/types.h>
+#include <linux/openvswitch.h>
 
-#define TNL_F_CSUM             (1 << 1) /* Checksum packets. */
-#define TNL_F_IN_KEY_MATCH     (1 << 2) /* Store the key in tun_id to match in flow table. */
-#define TNL_F_OUT_KEY_ACTION   (1 << 3) /* Get the key from a SET_TUNNEL action. */
-#define TNL_F_TOS_INHERIT      (1 << 4) /* Inherit the ToS from the inner packet. */
-#define TNL_F_TTL_INHERIT      (1 << 5) /* Inherit the TTL from the inner packet. */
-#define TNL_F_PMTUD            (1 << 6) /* Enable path MTU discovery. */
-
-struct tnl_port_config {
-       __u32   flags;
-       __be32  saddr;
-       __be32  daddr;
-       __be32  in_key;
-       __be32  out_key;
-       __u8    tos;
-       __u8    ttl;
+/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels.
+ *
+ * OVS_TUNNEL_ATTR_FLAGS and OVS_TUNNEL_ATTR_DST_IPV4 are required.  All other
+ * attributes are optional.
+ */
+enum {
+       OVS_TUNNEL_ATTR_UNSPEC,
+       OVS_TUNNEL_ATTR_FLAGS,    /* 32-bit TNL_F_*. */
+       OVS_TUNNEL_ATTR_DST_IPV4, /* IPv4 destination address. */
+       OVS_TUNNEL_ATTR_SRC_IPV4, /* IPv4 source address. */
+       OVS_TUNNEL_ATTR_OUT_KEY,  /* __be64 key to use on output. */
+       OVS_TUNNEL_ATTR_IN_KEY,   /* __be64 key to match on input. */
+       OVS_TUNNEL_ATTR_TOS,      /* 8-bit TOS value. */
+       OVS_TUNNEL_ATTR_TTL,      /* 8-bit TTL value. */
+       __OVS_TUNNEL_ATTR_MAX
 };
 
+#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
+
+#define TNL_F_CSUM             (1 << 0) /* Checksum packets. */
+#define TNL_F_TOS_INHERIT      (1 << 1) /* Inherit ToS from inner packet. */
+#define TNL_F_TTL_INHERIT      (1 << 2) /* Inherit TTL from inner packet. */
+#define TNL_F_DF_INHERIT       (1 << 3) /* Inherit DF bit from inner packet. */
+#define TNL_F_DF_DEFAULT       (1 << 4) /* Set DF bit if inherit off or
+                                         * not IP. */
+#define TNL_F_PMTUD            (1 << 5) /* Enable path MTU discovery. */
+#define TNL_F_HDR_CACHE                (1 << 6) /* Enable tunnel header caching. */
+#define TNL_F_IPSEC            (1 << 7) /* Traffic is IPsec encrypted. */
+
 #endif /* openvswitch/tunnel.h */