-static void gre_build_header(const struct vport *vport,
- const struct tnl_mutable_config *mutable,
- const struct ovs_key_ipv4_tunnel *tun_key,
- void *header)
-{
- struct gre_base_hdr *greh = header;
- __be32 *options = (__be32 *)(greh + 1);
- u32 flags;
- u32 tunnel_type;
- __be64 out_key;
-
- get_gre_param(mutable, tun_key, &flags, &tunnel_type, &out_key);
-
- greh->protocol = htons(ETH_P_TEB);
- greh->flags = 0;
-
- if (flags & TNL_F_CSUM) {
- greh->flags |= GRE_CSUM;
- *options = 0;
- options++;
- }
-
- if (flags & TNL_F_OUT_KEY_ACTION) {
- greh->flags |= GRE_KEY;
- if (tunnel_type & TNL_T_PROTO_GRE64)
- greh->flags |= GRE_SEQ;
-
- } else if (out_key ||
- tunnel_type & TNL_T_PROTO_GRE64) {
- greh->flags |= GRE_KEY;
- *options = be64_get_low32(out_key);
- if (tunnel_type & TNL_T_PROTO_GRE64) {
- options++;
- *options = be64_get_high32(out_key);
- greh->flags |= GRE_SEQ;
- }
- }
-}
-
-static struct sk_buff *gre_update_header(const struct vport *vport,