Lines Matching refs:f
67 struct fw_filter *f; in fw_classify() local
77 for (f=head->ht[fw_hash(id)]; f; f=f->next) { in fw_classify()
78 if (f->id == id) { in fw_classify()
79 *res = f->res; in fw_classify()
81 if (f->police) in fw_classify()
82 return tcf_police(skb, f->police); in fw_classify()
102 struct fw_filter *f; in fw_get() local
107 for (f=head->ht[fw_hash(handle)]; f; f=f->next) { in fw_get()
108 if (f->id == handle) in fw_get()
109 return (unsigned long)f; in fw_get()
114 static void fw_put(struct tcf_proto *tp, unsigned long f) in fw_put() argument
127 struct fw_filter *f; in fw_destroy() local
136 while ((f=head->ht[h]) != NULL) { in fw_destroy()
138 head->ht[h] = f->next; in fw_destroy()
140 if ((cl = __cls_set_class(&f->res.class, 0)) != 0) in fw_destroy()
143 tcf_police_release(f->police); in fw_destroy()
145 kfree(f); in fw_destroy()
155 struct fw_filter *f = (struct fw_filter*)arg; in fw_delete() local
158 if (head == NULL || f == NULL) in fw_delete()
161 for (fp=&head->ht[fw_hash(f->id)]; *fp; fp = &(*fp)->next) { in fw_delete()
162 if (*fp == f) { in fw_delete()
166 *fp = f->next; in fw_delete()
169 if ((cl = cls_set_class(tp, &f->res.class, 0)) != 0) in fw_delete()
172 tcf_police_release(f->police); in fw_delete()
174 kfree(f); in fw_delete()
187 struct fw_filter *f; in fw_change() local
198 if ((f = (struct fw_filter*)*arg) != NULL) { in fw_change()
201 if (f->id != handle && handle) in fw_change()
206 f->res.classid = *(u32*)RTA_DATA(tb[TCA_FW_CLASSID-1]); in fw_change()
207 cl = tp->q->ops->cl_ops->bind_tcf(tp->q, base, f->res.classid); in fw_change()
208 cl = cls_set_class(tp, &f->res.class, cl); in fw_change()
217 police = xchg(&f->police, police); in fw_change()
240 f = kmalloc(sizeof(struct fw_filter), GFP_KERNEL); in fw_change()
241 if (f == NULL) in fw_change()
243 memset(f, 0, sizeof(*f)); in fw_change()
245 f->id = handle; in fw_change()
251 f->res.classid = *(u32*)RTA_DATA(tb[TCA_FW_CLASSID-1]); in fw_change()
252 cls_set_class(tp, &f->res.class, tp->q->ops->cl_ops->bind_tcf(tp->q, base, f->res.classid)); in fw_change()
257 f->police = tcf_police_locate(tb[TCA_FW_POLICE-1], tca[TCA_RATE-1]); in fw_change()
260 f->next = head->ht[fw_hash(handle)]; in fw_change()
262 head->ht[fw_hash(handle)] = f; in fw_change()
265 *arg = (unsigned long)f; in fw_change()
269 if (f) in fw_change()
270 kfree(f); in fw_change()
286 struct fw_filter *f; in fw_walk() local
288 for (f = head->ht[h]; f; f = f->next) { in fw_walk()
293 if (arg->fn(tp, (unsigned long)f, arg) < 0) { in fw_walk()
305 struct fw_filter *f = (struct fw_filter*)fh; in fw_dump() local
309 if (f == NULL) in fw_dump()
312 t->tcm_handle = f->id; in fw_dump()
314 if (!f->res.classid in fw_dump()
316 && !f->police in fw_dump()
324 if (f->res.classid) in fw_dump()
325 RTA_PUT(skb, TCA_FW_CLASSID, 4, &f->res.classid); in fw_dump()
327 if (f->police) { in fw_dump()
332 if (tcf_police_dump(skb, f->police) < 0) in fw_dump()
341 if (f->police) { in fw_dump()
342 if (qdisc_copy_stats(skb, &f->police->stats)) in fw_dump()