12 #include <linux/module.h>
13 #include <linux/slab.h>
14 #include <linux/types.h>
15 #include <linux/kernel.h>
16 #include <linux/string.h>
17 #include <linux/errno.h>
18 #include <linux/rtnetlink.h>
53 r = tcf_exts_exec(skb, &
f->exts, res);
63 unsigned long l = 0
UL;
71 if (
f->handle == handle)
72 l = (
unsigned long)
f;
81 static int basic_init(
struct tcf_proto *tp)
88 INIT_LIST_HEAD(&head->
flist);
95 tcf_unbind_filter(tp, &f->
res);
101 static void basic_destroy(
struct tcf_proto *tp)
108 basic_delete_filter(tp, f);
113 static int basic_delete(
struct tcf_proto *tp,
unsigned long arg)
123 basic_delete_filter(tp, t);
136 unsigned long base,
struct nlattr **
tb,
152 f->
res.classid = nla_get_u32(tb[TCA_BASIC_CLASSID]);
153 tcf_bind_filter(tp, &f->
res, base);
165 static int basic_change(
struct sk_buff *in_skb,
183 if (handle && f->
handle != handle)
185 return basic_set_parms(tp, f, base, tb, tca[
TCA_RATE]);
197 unsigned int i = 0x80000000;
201 }
while (--i > 0 && basic_get(tp, head->
hgenerator));
204 pr_err(
"Insufficient number of handles\n");
211 err = basic_set_parms(tp, f, base, tb, tca[
TCA_RATE]);
218 *arg = (
unsigned long) f;
222 if (*arg == 0
UL && f)
237 if (arg->
fn(tp, (
unsigned long) f, arg) < 0) {
246 static int basic_dump(
struct tcf_proto *tp,
unsigned long fh,
259 goto nla_put_failure;
261 if (f->
res.classid &&
263 goto nla_put_failure;
267 goto nla_put_failure;
269 nla_nest_end(skb, nest);
272 goto nla_put_failure;
277 nla_nest_cancel(skb, nest);
283 .classify = basic_classify,
285 .destroy = basic_destroy,
288 .change = basic_change,
289 .delete = basic_delete,
295 static int __init init_basic(
void)
300 static void __exit exit_basic(
void)