aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-07-05 19:25:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-06 05:52:16 -0400
commitdc7f9f6e8838556f226c2ebd1da7bb305cb25654 (patch)
treec346ae8a155e187f4f88ba70788dc10ef5ff4c43 /include
parent95ec3eb417115fbb2c73b59e2825f6dd5d2f6cf6 (diff)
net: sched: constify tcf_proto and tc_action
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/act_api.h6
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--include/net/sch_generic.h12
3 files changed, 12 insertions, 10 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index bab385f13ac3..c739531e1564 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -72,7 +72,7 @@ struct tcf_act_hdr {
72 72
73struct tc_action { 73struct tc_action {
74 void *priv; 74 void *priv;
75 struct tc_action_ops *ops; 75 const struct tc_action_ops *ops;
76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
77 __u32 order; 77 __u32 order;
78 struct tc_action *next; 78 struct tc_action *next;
@@ -86,7 +86,7 @@ struct tc_action_ops {
86 __u32 type; /* TBD to match kind */ 86 __u32 type; /* TBD to match kind */
87 __u32 capab; /* capabilities includes 4 bit version */ 87 __u32 capab; /* capabilities includes 4 bit version */
88 struct module *owner; 88 struct module *owner;
89 int (*act)(struct sk_buff *, struct tc_action *, struct tcf_result *); 89 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
90 int (*get_stats)(struct sk_buff *, struct tc_action *); 90 int (*get_stats)(struct sk_buff *, struct tc_action *);
91 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
92 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
@@ -115,7 +115,7 @@ extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
115extern int tcf_register_action(struct tc_action_ops *a); 115extern int tcf_register_action(struct tc_action_ops *a);
116extern int tcf_unregister_action(struct tc_action_ops *a); 116extern int tcf_unregister_action(struct tc_action_ops *a);
117extern void tcf_action_destroy(struct tc_action *a, int bind); 117extern void tcf_action_destroy(struct tc_action *a, int bind);
118extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); 118extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res);
119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 65afc4966204..fffdc603f4c8 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -99,9 +99,9 @@ static inline void qdisc_run(struct Qdisc *q)
99 __qdisc_run(q); 99 __qdisc_run(q);
100} 100}
101 101
102extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 102extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
103 struct tcf_result *res); 103 struct tcf_result *res);
104extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 104extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
105 struct tcf_result *res); 105 struct tcf_result *res);
106 106
107/* Calculate maximal size of packet seen by hard_start_xmit 107/* Calculate maximal size of packet seen by hard_start_xmit
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index b931f021d7ab..4fc88f3ccd5f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -181,8 +181,9 @@ struct tcf_proto_ops {
181 struct tcf_proto_ops *next; 181 struct tcf_proto_ops *next;
182 char kind[IFNAMSIZ]; 182 char kind[IFNAMSIZ];
183 183
184 int (*classify)(struct sk_buff*, struct tcf_proto*, 184 int (*classify)(struct sk_buff *,
185 struct tcf_result *); 185 const struct tcf_proto *,
186 struct tcf_result *);
186 int (*init)(struct tcf_proto*); 187 int (*init)(struct tcf_proto*);
187 void (*destroy)(struct tcf_proto*); 188 void (*destroy)(struct tcf_proto*);
188 189
@@ -205,8 +206,9 @@ struct tcf_proto {
205 /* Fast access part */ 206 /* Fast access part */
206 struct tcf_proto *next; 207 struct tcf_proto *next;
207 void *root; 208 void *root;
208 int (*classify)(struct sk_buff*, struct tcf_proto*, 209 int (*classify)(struct sk_buff *,
209 struct tcf_result *); 210 const struct tcf_proto *,
211 struct tcf_result *);
210 __be16 protocol; 212 __be16 protocol;
211 213
212 /* All the rest */ 214 /* All the rest */
@@ -214,7 +216,7 @@ struct tcf_proto {
214 u32 classid; 216 u32 classid;
215 struct Qdisc *q; 217 struct Qdisc *q;
216 void *data; 218 void *data;
217 struct tcf_proto_ops *ops; 219 const struct tcf_proto_ops *ops;
218}; 220};
219 221
220struct qdisc_skb_cb { 222struct qdisc_skb_cb {