sch_ingress.c (891687649a5c44a1d53668b4f7728bf97c8db8d5) | sch_ingress.c (1e90474c377e92db7262a8968a45c1dd980ca9e5) |
---|---|
1/* net/sched/sch_ingress.c - Ingress qdisc 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 5 * 2 of the License, or (at your option) any later version. 6 * 7 * Authors: Jamal Hadi Salim 1999 8 */ --- 43 unchanged lines hidden (view full) --- 52 return ingress_get(sch, classid); 53} 54 55static void ingress_put(struct Qdisc *sch, unsigned long cl) 56{ 57} 58 59static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent, | 1/* net/sched/sch_ingress.c - Ingress qdisc 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 5 * 2 of the License, or (at your option) any later version. 6 * 7 * Authors: Jamal Hadi Salim 1999 8 */ --- 43 unchanged lines hidden (view full) --- 52 return ingress_get(sch, classid); 53} 54 55static void ingress_put(struct Qdisc *sch, unsigned long cl) 56{ 57} 58 59static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent, |
60 struct rtattr **tca, unsigned long *arg) | 60 struct nlattr **tca, unsigned long *arg) |
61{ 62 return 0; 63} 64 65static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker) 66{ 67 return; 68} --- 82 unchanged lines hidden (view full) --- 151 .owner = THIS_MODULE, 152 .pf = PF_INET6, 153 .hooknum = NF_INET_PRE_ROUTING, 154 .priority = NF_IP6_PRI_FILTER + 1, 155 }, 156}; 157#endif 158 | 61{ 62 return 0; 63} 64 65static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker) 66{ 67 return; 68} --- 82 unchanged lines hidden (view full) --- 151 .owner = THIS_MODULE, 152 .pf = PF_INET6, 153 .hooknum = NF_INET_PRE_ROUTING, 154 .priority = NF_IP6_PRI_FILTER + 1, 155 }, 156}; 157#endif 158 |
159static int ingress_init(struct Qdisc *sch, struct rtattr *opt) | 159static int ingress_init(struct Qdisc *sch, struct nlattr *opt) |
160{ 161#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER) 162 printk("Ingress scheduler: Classifier actions prefered over netfilter\n"); 163 164 if (!nf_registered) { 165 if (nf_register_hooks(ing_ops, ARRAY_SIZE(ing_ops)) < 0) { 166 printk("ingress qdisc registration error \n"); 167 return -EINVAL; --- 11 unchanged lines hidden (view full) --- 179 struct ingress_qdisc_data *p = qdisc_priv(sch); 180 181 tcf_destroy_chain(p->filter_list); 182} 183 184static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) 185{ 186 unsigned char *b = skb_tail_pointer(skb); | 160{ 161#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER) 162 printk("Ingress scheduler: Classifier actions prefered over netfilter\n"); 163 164 if (!nf_registered) { 165 if (nf_register_hooks(ing_ops, ARRAY_SIZE(ing_ops)) < 0) { 166 printk("ingress qdisc registration error \n"); 167 return -EINVAL; --- 11 unchanged lines hidden (view full) --- 179 struct ingress_qdisc_data *p = qdisc_priv(sch); 180 181 tcf_destroy_chain(p->filter_list); 182} 183 184static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) 185{ 186 unsigned char *b = skb_tail_pointer(skb); |
187 struct rtattr *rta; | 187 struct nlattr *nla; |
188 | 188 |
189 rta = (struct rtattr *)b; 190 RTA_PUT(skb, TCA_OPTIONS, 0, NULL); 191 rta->rta_len = skb_tail_pointer(skb) - b; | 189 nla = (struct nlattr *)b; 190 NLA_PUT(skb, TCA_OPTIONS, 0, NULL); 191 nla->nla_len = skb_tail_pointer(skb) - b; |
192 return skb->len; 193 | 192 return skb->len; 193 |
194rtattr_failure: | 194nla_put_failure: |
195 nlmsg_trim(skb, b); 196 return -1; 197} 198 199static const struct Qdisc_class_ops ingress_class_ops = { 200 .graft = ingress_graft, 201 .leaf = ingress_leaf, 202 .get = ingress_get, --- 36 unchanged lines hidden --- | 195 nlmsg_trim(skb, b); 196 return -1; 197} 198 199static const struct Qdisc_class_ops ingress_class_ops = { 200 .graft = ingress_graft, 201 .leaf = ingress_leaf, 202 .get = ingress_get, --- 36 unchanged lines hidden --- |