summaryrefslogtreecommitdiff
path: root/include/net/vxlan.h
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2015-01-08 23:31:18 +0300
committerDavid S. Miller <davem@davemloft.net>2015-01-13 00:05:01 +0300
commit3bf3947526c1053ddf2523f261395d682718f56c (patch)
tree5919aa9d9cb34576a14d02d4753390ee71a6a9d6 /include/net/vxlan.h
parenteee2f04b801ebc95da16f91fef029a083ba1a216 (diff)
downloadlinux-3bf3947526c1053ddf2523f261395d682718f56c.tar.xz
vxlan: Improve support for header flags
This patch cleans up the header flags of VXLAN in anticipation of defining some new ones: - Move header related definitions from vxlan.c to vxlan.h - Change VXLAN_FLAGS to be VXLAN_HF_VNI (only currently defined flag) - Move check for unknown flags to after we find vxlan_sock, this assumes that some flags may be processed based on tunnel configuration - Add a comment about why the stack treating unknown set flags as an error instead of ignoring them Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/vxlan.h')
-rw-r--r--include/net/vxlan.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 903461aa5644..a0d80736224f 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -17,6 +17,13 @@ struct vxlanhdr {
__be32 vx_vni;
};
+/* VXLAN header flags. */
+#define VXLAN_HF_VNI 0x08000000
+
+#define VXLAN_N_VID (1u << 24)
+#define VXLAN_VID_MASK (VXLAN_N_VID - 1)
+#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr))
+
struct vxlan_sock;
typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key);