Lines Matching refs:tp

66 	struct tcf_proto_ops *t, **tp;  in register_tcf_proto_ops()  local
69 for (tp = &tcf_proto_base; (t=*tp) != NULL; tp = &t->next) { in register_tcf_proto_ops()
77 *tp = ops; in register_tcf_proto_ops()
84 struct tcf_proto_ops *t, **tp; in unregister_tcf_proto_ops() local
87 for (tp = &tcf_proto_base; (t=*tp) != NULL; tp = &t->next) in unregister_tcf_proto_ops()
95 *tp = t->next; in unregister_tcf_proto_ops()
101 struct tcf_proto *tp, unsigned long fh, int event);
106 static __inline__ u32 tcf_auto_prio(struct tcf_proto *tp) in tcf_auto_prio() argument
110 if (tp) in tcf_auto_prio()
111 first = tp->prio-1; in tcf_auto_prio()
129 struct tcf_proto *tp = NULL; in tc_ctl_tfilter() local
174 for (back = chain; (tp=*back) != NULL; back = &tp->next) { in tc_ctl_tfilter()
175 if (tp->prio >= prio) { in tc_ctl_tfilter()
176 if (tp->prio == prio) { in tc_ctl_tfilter()
177 if (!nprio || (tp->protocol != protocol && protocol)) in tc_ctl_tfilter()
180 tp = NULL; in tc_ctl_tfilter()
185 if (tp == NULL) { in tc_ctl_tfilter()
199 if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL) in tc_ctl_tfilter()
216 kfree(tp); in tc_ctl_tfilter()
219 memset(tp, 0, sizeof(*tp)); in tc_ctl_tfilter()
220 tp->ops = tp_ops; in tc_ctl_tfilter()
221 tp->protocol = protocol; in tc_ctl_tfilter()
222 tp->prio = nprio ? : tcf_auto_prio(*back); in tc_ctl_tfilter()
223 tp->q = q; in tc_ctl_tfilter()
224 tp->classify = tp_ops->classify; in tc_ctl_tfilter()
225 tp->classid = parent; in tc_ctl_tfilter()
226 err = tp_ops->init(tp); in tc_ctl_tfilter()
228 kfree(tp); in tc_ctl_tfilter()
233 tp->next = *back; in tc_ctl_tfilter()
234 *back = tp; in tc_ctl_tfilter()
237 } else if (tca[TCA_KIND-1] && rtattr_strcmp(tca[TCA_KIND-1], tp->ops->kind)) in tc_ctl_tfilter()
240 fh = tp->ops->get(tp, t->tcm_handle); in tc_ctl_tfilter()
246 *back = tp->next; in tc_ctl_tfilter()
249 tcf_destroy(tp); in tc_ctl_tfilter()
265 err = tp->ops->delete(tp, fh); in tc_ctl_tfilter()
268 err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
276 err = tp->ops->change(tp, cl, t->tcm_handle, tca, &fh); in tc_ctl_tfilter()
278 tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER); in tc_ctl_tfilter()
287 tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh, in tcf_fill_node() argument
300 tcm->tcm_ifindex = tp->q->dev->ifindex; in tcf_fill_node()
301 tcm->tcm_parent = tp->classid; in tcf_fill_node()
303 tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol); in tcf_fill_node()
304 RTA_PUT(skb, TCA_KIND, IFNAMSIZ, tp->ops->kind); in tcf_fill_node()
305 if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0) in tcf_fill_node()
317 struct tcf_proto *tp, unsigned long fh, int event) in tfilter_notify() argument
326 if (tcf_fill_node(skb, tp, fh, pid, n->nlmsg_seq, 0, event) <= 0) { in tfilter_notify()
341 static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, struct tcf_walker *arg) in tcf_node_dump() argument
345 return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).pid, in tcf_node_dump()
355 struct tcf_proto *tp, **chain; in tc_dump_tfilter() local
389 for (tp=*chain, t=0; tp; tp = tp->next, t++) { in tc_dump_tfilter()
392 TC_H_MAJ(tcm->tcm_info) != tp->prio) in tc_dump_tfilter()
395 TC_H_MIN(tcm->tcm_info) != tp->protocol) in tc_dump_tfilter()
400 if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).pid, in tc_dump_tfilter()
406 if (tp->ops->walk == NULL) in tc_dump_tfilter()
414 tp->ops->walk(tp, &arg.w); in tc_dump_tfilter()