3 * Generic internet FLOW.
10 #include <linux/in6.h>
11 #include <asm/atomic.h>
21 #define FLOWI_FLAG_ANYSRC 0x01
22 #define FLOWI_FLAG_PRECOW_METRICS 0x02
23 #define FLOWI_FLAG_CAN_SLEEP 0x04
52 struct flowi_common __fl_common;
59 struct flowi_common __fl_common;
60 struct in6_addr daddr;
61 struct in6_addr saddr;
67 struct flowi_common __fl_common;
75 struct flowi_common __fl_common;
80 #define flowi_oif u.__fl_common.flowic_oif
81 #define flowi_iif u.__fl_common.flowic_iif
82 #define flowi_mark u.__fl_common.flowic_mark
83 #define flowi_tos u.__fl_common.flowic_tos
84 #define flowi_scope u.__fl_common.flowic_scope
85 #define flowi_proto u.__fl_common.flowic_proto
86 #define flowi_flags u.__fl_common.flowic_flags
87 #define flowi_secid u.__fl_common.flowic_secid
88 #define fl4_tos flowi_tos
89 #define fl4_scope flowi_scope
90 #define fld_scope flowi_scope
92 #define fld_dst u.dn.daddr
93 #define fld_src u.dn.saddr
94 #define fl6_dst u.ip6.daddr
95 #define fl6_src u.ip6.saddr
96 #define fl6_flowlabel u.ip6.flowlabel
97 #define fl4_dst u.ip4.daddr
98 #define fl4_src u.ip4.saddr
99 #define fl4_sport u.ip4.uli.ports.sport
100 #define fl4_dport u.ip4.uli.ports.dport
101 #define fl4_icmp_type u.ip4.uli.icmpt.type
102 #define fl4_icmp_code u.ip4.uli.icmpt.code
103 #define fl4_ipsec_spi u.ip4.uli.spi
104 #define fl4_mh_type u.ip4.uli.mht.type
105 #define fl4_gre_key u.ip4.uli.gre_key
106 #define fl6_sport u.ip6.uli.ports.sport
107 #define fl6_dport u.ip6.uli.ports.dport
108 #define fl6_icmp_type u.ip6.uli.icmpt.type
109 #define fl6_icmp_code u.ip6.uli.icmpt.code
110 #define fl6_ipsec_spi u.ip6.uli.spi
111 #define fl6_mh_type u.ip6.uli.mht.type
112 #define fl6_gre_key u.ip6.uli.gre_key
113 } __attribute__((__aligned__(BITS_PER_LONG/8)));
115 #define FLOW_DIR_IN 0
116 #define FLOW_DIR_OUT 1
117 #define FLOW_DIR_FWD 2
121 struct flow_cache_ops;
123 struct flow_cache_object {
124 const struct flow_cache_ops *ops;
127 struct flow_cache_ops {
128 struct flow_cache_object *(*get)(struct flow_cache_object *);
129 int (*check)(struct flow_cache_object *);
130 void (*delete)(struct flow_cache_object *);
133 typedef struct flow_cache_object *(*flow_resolve_t)(
134 struct net *net, const struct flowi *key, u16 family,
135 u8 dir, struct flow_cache_object *oldobj, void *ctx);
137 extern struct flow_cache_object *flow_cache_lookup(
138 struct net *net, const struct flowi *key, u16 family,
139 u8 dir, flow_resolve_t resolver, void *ctx);
141 extern void flow_cache_flush(void);
142 extern atomic_t flow_cache_genid;