-/*
- * The GRE header is composed of a series of sections: a base and then a variable
- * number of options.
- */
-#define GRE_HEADER_SECTION 4
-
-struct gre_base_hdr {
- __be16 flags;
- __be16 protocol;
-};
-
-static int gre_hdr_len(const struct tnl_mutable_config *mutable,
- const struct ovs_key_ipv4_tunnel *tun_key)
-{
- int len;
- u32 flags;
- __be64 out_key;
-
- tnl_get_param(mutable, tun_key, &flags, &out_key);
- len = GRE_HEADER_SECTION;
-
- if (flags & TNL_F_CSUM)
- len += GRE_HEADER_SECTION;
-
- /* Set key for GRE64 tunnels, even when key if is zero. */
- if (out_key ||
- mutable->key.tunnel_type & TNL_T_PROTO_GRE64 ||
- flags & TNL_F_OUT_KEY_ACTION) {
-
- len += GRE_HEADER_SECTION;
- if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
- len += GRE_HEADER_SECTION;
- }
- return len;
-}
-
-