+ gre_tunnel_type_t type;
+ tunnel_mode_t mode;
+ u8 is_ipv6;
+ u32 instance;
+ ip46_address_t src, dst;
+ u32 outer_table_id;
+ u16 session_id;
+ tunnel_encap_decap_flags_t flags;
+} vnet_gre_tunnel_add_del_args_t;
+
+extern int vnet_gre_tunnel_add_del (vnet_gre_tunnel_add_del_args_t * a,
+ u32 * sw_if_indexp);
+
+static inline void
+gre_mk_key4 (ip4_address_t src,
+ ip4_address_t dst,
+ u32 fib_index,
+ gre_tunnel_type_t ttype,
+ tunnel_mode_t tmode, u16 session_id, gre_tunnel_key4_t * key)
+{
+ key->gtk_src = src;
+ key->gtk_dst = dst;
+ key->gtk_common.type = ttype;
+ key->gtk_common.mode = tmode;
+ key->gtk_common.fib_index = fib_index;
+ key->gtk_common.session_id = session_id;
+}
+
+static inline int
+gre_match_key4 (const gre_tunnel_key4_t * key1,
+ const gre_tunnel_key4_t * key2)
+{
+ return ((key1->gtk_as_u64 == key2->gtk_as_u64) &&
+ (key1->gtk_common.as_u64 == key2->gtk_common.as_u64));
+}
+
+static inline void
+gre_mk_key6 (const ip6_address_t * src,
+ const ip6_address_t * dst,
+ u32 fib_index,
+ gre_tunnel_type_t ttype,
+ tunnel_mode_t tmode, u16 session_id, gre_tunnel_key6_t * key)
+{
+ key->gtk_src = *src;
+ key->gtk_dst = *dst;
+ key->gtk_common.type = ttype;
+ key->gtk_common.mode = tmode;
+ key->gtk_common.fib_index = fib_index;
+ key->gtk_common.session_id = session_id;
+}