+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;
+}
+
+static inline int
+gre_match_key6 (const gre_tunnel_key6_t * key1,
+ const gre_tunnel_key6_t * key2)
+{
+ return (ip6_address_is_equal (&key1->gtk_src, &key2->gtk_src) &&
+ ip6_address_is_equal (&key1->gtk_dst, &key2->gtk_dst) &&
+ (key1->gtk_common.as_u64 == key2->gtk_common.as_u64));
+}
+
+static inline void
+gre_mk_sn_key (const gre_tunnel_t * gt, gre_sn_key_t * key)
+{
+ key->src = gt->tunnel_src;
+ key->dst = gt->tunnel_dst.fp_addr;
+ key->fib_index = gt->outer_fib_index;
+}