1 #ifndef __NET_PKT_CLS_H
2 #define __NET_PKT_CLS_H
20 static inline unsigned long
21 __cls_set_class(
unsigned long *clp,
unsigned long cl)
30 static inline unsigned long
31 cls_set_class(
struct tcf_proto *tp,
unsigned long *clp,
37 old_cl = __cls_set_class(clp, cl);
48 cl = tp->
q->ops->cl_ops->bind_tcf(tp->
q, base, r->
classid);
49 cl = cls_set_class(tp, &r->
class, cl);
51 tp->
q->ops->cl_ops->unbind_tcf(tp->
q, cl);
59 if ((cl = __cls_set_class(&r->
class, 0)) != 0)
60 tp->
q->ops->cl_ops->unbind_tcf(tp->
q, cl);
64 #ifdef CONFIG_NET_CLS_ACT
85 tcf_exts_is_predicative(
struct tcf_exts *exts)
87 #ifdef CONFIG_NET_CLS_ACT
88 return !!exts->action;
101 tcf_exts_is_available(
struct tcf_exts *exts)
104 return tcf_exts_is_predicative(exts);
122 #ifdef CONFIG_NET_CLS_ACT
148 #ifdef CONFIG_NET_EMATCH
150 struct tcf_ematch_ops;
162 struct tcf_ematch_ops *
ops;
169 static inline int tcf_em_is_container(
struct tcf_ematch *
em)
174 static inline int tcf_em_is_simple(
struct tcf_ematch *
em)
179 static inline int tcf_em_is_inverted(
struct tcf_ematch *
em)
184 static inline int tcf_em_last_match(
struct tcf_ematch *
em)
189 static inline int tcf_em_early_end(
struct tcf_ematch *em,
int result)
191 if (tcf_em_last_match(em))
211 struct tcf_ematch * matches;
227 struct tcf_ematch_ops {
231 int,
struct tcf_ematch *);
235 struct tcf_ematch *);
266 memcpy(dst, src,
sizeof(*dst));
288 if (tree->hdr.nmatches)
294 #define MODULE_ALIAS_TCF_EMATCH(kind) MODULE_ALIAS("ematch-kind-" __stringify(kind))
301 #define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0)
302 #define tcf_em_tree_destroy(tp, t) do { (void)(t); } while(0)
303 #define tcf_em_tree_dump(skb, t, tlv) (0)
304 #define tcf_em_tree_change(tp, dst, src) do { } while(0)
305 #define tcf_em_tree_match(skb, t, info) ((void)(info), 1)
309 static inline unsigned char * tcf_get_base_ptr(
struct sk_buff *skb,
int layer)
315 return skb_network_header(skb);
317 return skb_transport_header(skb);
323 static inline int tcf_valid_offset(
const struct sk_buff *skb,
324 const unsigned char *
ptr,
const int len)
326 return likely((ptr + len) <= skb_tail_pointer(skb) &&
328 (ptr <= (ptr + len)));
331 #ifdef CONFIG_NET_CLS_IND
335 tcf_change_indev(
struct tcf_proto *tp,
char *indev,
struct nlattr *indev_tlv)
343 tcf_match_indev(
struct sk_buff *skb,
char *indev)