+ enum ip_src_type {
+ IP_SRC_CFG, /* ip_src must equal configured address. */
+ IP_SRC_ANY, /* Any ip_src is acceptable. */
+ IP_SRC_FLOW /* ip_src is handled in flow table. */
+ };
+
+ struct tnl_match_pattern {
+ bool in_key_flow;
+ bool ip_dst_flow;
+ enum ip_src_type ip_src;
+ };
+
+ static const struct tnl_match_pattern patterns[] = {
+ { false, false, IP_SRC_CFG }, /* remote_ip, local_ip, in_key. */
+ { false, false, IP_SRC_ANY }, /* remote_ip, in_key. */
+ { true, false, IP_SRC_CFG }, /* remote_ip, local_ip. */
+ { true, false, IP_SRC_ANY }, /* remote_ip. */
+ { true, true, IP_SRC_ANY }, /* Flow-based remote. */
+ { true, true, IP_SRC_FLOW }, /* Flow-based everything. */
+ };
+
+ const struct tnl_match_pattern *p;
+ struct tnl_match match;