aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-11 02:08:33 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:54:24 -0400
commit2dfe55b47e3d66ded5a84caf71e0da5710edf48b (patch)
treef3818a7016985f79856212d797921e319bff8cd2
parentd924424aaed116b362c6d0e667d912b77e655085 (diff)
[NET]: Use u32 for routing table IDs
Use u32 for routing table IDs in net/ipv4 and net/decnet in preparation of support for a larger number of routing tables. net/ipv6 already uses u32 everywhere and needs no further changes. No functional changes are made by this patch. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/dn_fib.h4
-rw-r--r--include/net/ip_fib.h14
-rw-r--r--net/decnet/dn_fib.c6
-rw-r--r--net/decnet/dn_table.c10
-rw-r--r--net/ipv4/fib_frontend.c8
-rw-r--r--net/ipv4/fib_hash.c4
-rw-r--r--net/ipv4/fib_lookup.h4
-rw-r--r--net/ipv4/fib_rules.c2
-rw-r--r--net/ipv4/fib_semantics.c4
-rw-r--r--net/ipv4/fib_trie.c6
10 files changed, 31 insertions, 31 deletions
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
index 32bc8ce5c5ce..cd9c3782f838 100644
--- a/include/net/dn_fib.h
+++ b/include/net/dn_fib.h
@@ -94,7 +94,7 @@ struct dn_fib_node {
94 94
95 95
96struct dn_fib_table { 96struct dn_fib_table {
97 int n; 97 u32 n;
98 98
99 int (*insert)(struct dn_fib_table *t, struct rtmsg *r, 99 int (*insert)(struct dn_fib_table *t, struct rtmsg *r,
100 struct dn_kern_rta *rta, struct nlmsghdr *n, 100 struct dn_kern_rta *rta, struct nlmsghdr *n,
@@ -137,7 +137,7 @@ extern int dn_fib_sync_up(struct net_device *dev);
137/* 137/*
138 * dn_tables.c 138 * dn_tables.c
139 */ 139 */
140extern struct dn_fib_table *dn_fib_get_table(int n, int creat); 140extern struct dn_fib_table *dn_fib_get_table(u32 n, int creat);
141extern struct dn_fib_table *dn_fib_empty_table(void); 141extern struct dn_fib_table *dn_fib_empty_table(void);
142extern void dn_fib_table_init(void); 142extern void dn_fib_table_init(void);
143extern void dn_fib_table_cleanup(void); 143extern void dn_fib_table_cleanup(void);
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index adf73586bc05..0dcbf166eb94 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -150,7 +150,7 @@ struct fib_result_nl {
150#endif /* CONFIG_IP_ROUTE_MULTIPATH_WRANDOM */ 150#endif /* CONFIG_IP_ROUTE_MULTIPATH_WRANDOM */
151 151
152struct fib_table { 152struct fib_table {
153 unsigned char tb_id; 153 u32 tb_id;
154 unsigned tb_stamp; 154 unsigned tb_stamp;
155 int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); 155 int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res);
156 int (*tb_insert)(struct fib_table *table, struct rtmsg *r, 156 int (*tb_insert)(struct fib_table *table, struct rtmsg *r,
@@ -173,14 +173,14 @@ struct fib_table {
173extern struct fib_table *ip_fib_local_table; 173extern struct fib_table *ip_fib_local_table;
174extern struct fib_table *ip_fib_main_table; 174extern struct fib_table *ip_fib_main_table;
175 175
176static inline struct fib_table *fib_get_table(int id) 176static inline struct fib_table *fib_get_table(u32 id)
177{ 177{
178 if (id != RT_TABLE_LOCAL) 178 if (id != RT_TABLE_LOCAL)
179 return ip_fib_main_table; 179 return ip_fib_main_table;
180 return ip_fib_local_table; 180 return ip_fib_local_table;
181} 181}
182 182
183static inline struct fib_table *fib_new_table(int id) 183static inline struct fib_table *fib_new_table(u32 id)
184{ 184{
185 return fib_get_table(id); 185 return fib_get_table(id);
186} 186}
@@ -205,9 +205,9 @@ static inline void fib_select_default(const struct flowi *flp, struct fib_result
205 205
206extern struct fib_table * fib_tables[RT_TABLE_MAX+1]; 206extern struct fib_table * fib_tables[RT_TABLE_MAX+1];
207extern int fib_lookup(struct flowi *flp, struct fib_result *res); 207extern int fib_lookup(struct flowi *flp, struct fib_result *res);
208extern struct fib_table *__fib_new_table(int id); 208extern struct fib_table *__fib_new_table(u32 id);
209 209
210static inline struct fib_table *fib_get_table(int id) 210static inline struct fib_table *fib_get_table(u32 id)
211{ 211{
212 if (id == 0) 212 if (id == 0)
213 id = RT_TABLE_MAIN; 213 id = RT_TABLE_MAIN;
@@ -215,7 +215,7 @@ static inline struct fib_table *fib_get_table(int id)
215 return fib_tables[id]; 215 return fib_tables[id];
216} 216}
217 217
218static inline struct fib_table *fib_new_table(int id) 218static inline struct fib_table *fib_new_table(u32 id)
219{ 219{
220 if (id == 0) 220 if (id == 0)
221 id = RT_TABLE_MAIN; 221 id = RT_TABLE_MAIN;
@@ -248,7 +248,7 @@ extern int fib_convert_rtentry(int cmd, struct nlmsghdr *nl, struct rtmsg *rtm,
248extern u32 __fib_res_prefsrc(struct fib_result *res); 248extern u32 __fib_res_prefsrc(struct fib_result *res);
249 249
250/* Exported by fib_hash.c */ 250/* Exported by fib_hash.c */
251extern struct fib_table *fib_hash_init(int id); 251extern struct fib_table *fib_hash_init(u32 id);
252 252
253#ifdef CONFIG_IP_MULTIPLE_TABLES 253#ifdef CONFIG_IP_MULTIPLE_TABLES
254extern int fib4_rules_dump(struct sk_buff *skb, struct netlink_callback *cb); 254extern int fib4_rules_dump(struct sk_buff *skb, struct netlink_callback *cb);
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index ed5fb5c3eab5..7b3bf5c3d720 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -534,8 +534,8 @@ int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
534 534
535int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) 535int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb)
536{ 536{
537 int t; 537 u32 t;
538 int s_t; 538 u32 s_t;
539 struct dn_fib_table *tb; 539 struct dn_fib_table *tb;
540 540
541 if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && 541 if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) &&
@@ -765,7 +765,7 @@ void dn_fib_flush(void)
765{ 765{
766 int flushed = 0; 766 int flushed = 0;
767 struct dn_fib_table *tb; 767 struct dn_fib_table *tb;
768 int id; 768 u32 id;
769 769
770 for(id = RT_TABLE_MAX; id > 0; id--) { 770 for(id = RT_TABLE_MAX; id > 0; id--) {
771 if ((tb = dn_fib_get_table(id, 0)) == NULL) 771 if ((tb = dn_fib_get_table(id, 0)) == NULL)
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index 2e01b67398c8..1601ee5406a8 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -264,7 +264,7 @@ static int dn_fib_nh_match(struct rtmsg *r, struct nlmsghdr *nlh, struct dn_kern
264} 264}
265 265
266static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 266static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
267 u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, 267 u32 tb_id, u8 type, u8 scope, void *dst, int dst_len,
268 struct dn_fib_info *fi, unsigned int flags) 268 struct dn_fib_info *fi, unsigned int flags)
269{ 269{
270 struct rtmsg *rtm; 270 struct rtmsg *rtm;
@@ -327,7 +327,7 @@ rtattr_failure:
327} 327}
328 328
329 329
330static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, int tb_id, 330static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id,
331 struct nlmsghdr *nlh, struct netlink_skb_parms *req) 331 struct nlmsghdr *nlh, struct netlink_skb_parms *req)
332{ 332{
333 struct sk_buff *skb; 333 struct sk_buff *skb;
@@ -740,7 +740,7 @@ out:
740} 740}
741 741
742 742
743struct dn_fib_table *dn_fib_get_table(int n, int create) 743struct dn_fib_table *dn_fib_get_table(u32 n, int create)
744{ 744{
745 struct dn_fib_table *t; 745 struct dn_fib_table *t;
746 746
@@ -777,7 +777,7 @@ struct dn_fib_table *dn_fib_get_table(int n, int create)
777 return t; 777 return t;
778} 778}
779 779
780static void dn_fib_del_tree(int n) 780static void dn_fib_del_tree(u32 n)
781{ 781{
782 struct dn_fib_table *t; 782 struct dn_fib_table *t;
783 783
@@ -791,7 +791,7 @@ static void dn_fib_del_tree(int n)
791 791
792struct dn_fib_table *dn_fib_empty_table(void) 792struct dn_fib_table *dn_fib_empty_table(void)
793{ 793{
794 int id; 794 u32 id;
795 795
796 for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++) 796 for(id = RT_TABLE_MIN; id <= RT_TABLE_MAX; id++)
797 if (dn_fib_tables[id] == NULL) 797 if (dn_fib_tables[id] == NULL)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index a83f1aa8034e..06f4b23f6f57 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -62,7 +62,7 @@ struct fib_table *ip_fib_main_table;
62 62
63struct fib_table *fib_tables[RT_TABLE_MAX+1]; 63struct fib_table *fib_tables[RT_TABLE_MAX+1];
64 64
65struct fib_table *__fib_new_table(int id) 65struct fib_table *__fib_new_table(u32 id)
66{ 66{
67 struct fib_table *tb; 67 struct fib_table *tb;
68 68
@@ -82,7 +82,7 @@ static void fib_flush(void)
82 int flushed = 0; 82 int flushed = 0;
83#ifdef CONFIG_IP_MULTIPLE_TABLES 83#ifdef CONFIG_IP_MULTIPLE_TABLES
84 struct fib_table *tb; 84 struct fib_table *tb;
85 int id; 85 u32 id;
86 86
87 for (id = RT_TABLE_MAX; id>0; id--) { 87 for (id = RT_TABLE_MAX; id>0; id--) {
88 if ((tb = fib_get_table(id))==NULL) 88 if ((tb = fib_get_table(id))==NULL)
@@ -333,8 +333,8 @@ int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
333 333
334int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) 334int inet_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
335{ 335{
336 int t; 336 u32 t;
337 int s_t; 337 u32 s_t;
338 struct fib_table *tb; 338 struct fib_table *tb;
339 339
340 if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && 340 if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) &&
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 72c633b357cf..f8d5c8024ccb 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -765,9 +765,9 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
765} 765}
766 766
767#ifdef CONFIG_IP_MULTIPLE_TABLES 767#ifdef CONFIG_IP_MULTIPLE_TABLES
768struct fib_table * fib_hash_init(int id) 768struct fib_table * fib_hash_init(u32 id)
769#else 769#else
770struct fib_table * __init fib_hash_init(int id) 770struct fib_table * __init fib_hash_init(u32 id)
771#endif 771#endif
772{ 772{
773 struct fib_table *tb; 773 struct fib_table *tb;
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
index ef6609ea0eb7..ddd52496b451 100644
--- a/net/ipv4/fib_lookup.h
+++ b/net/ipv4/fib_lookup.h
@@ -30,11 +30,11 @@ extern struct fib_info *fib_create_info(const struct rtmsg *r,
30extern int fib_nh_match(struct rtmsg *r, struct nlmsghdr *, 30extern int fib_nh_match(struct rtmsg *r, struct nlmsghdr *,
31 struct kern_rta *rta, struct fib_info *fi); 31 struct kern_rta *rta, struct fib_info *fi);
32extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 32extern int fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
33 u8 tb_id, u8 type, u8 scope, void *dst, 33 u32 tb_id, u8 type, u8 scope, void *dst,
34 int dst_len, u8 tos, struct fib_info *fi, 34 int dst_len, u8 tos, struct fib_info *fi,
35 unsigned int); 35 unsigned int);
36extern void rtmsg_fib(int event, u32 key, struct fib_alias *fa, 36extern void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
37 int z, int tb_id, 37 int z, u32 tb_id,
38 struct nlmsghdr *n, struct netlink_skb_parms *req); 38 struct nlmsghdr *n, struct netlink_skb_parms *req);
39extern struct fib_alias *fib_find_alias(struct list_head *fah, 39extern struct fib_alias *fib_find_alias(struct list_head *fah,
40 u8 tos, u32 prio); 40 u8 tos, u32 prio);
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index d242e5291fcc..58fb91b00fdf 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -169,7 +169,7 @@ static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
169 169
170static struct fib_table *fib_empty_table(void) 170static struct fib_table *fib_empty_table(void)
171{ 171{
172 int id; 172 u32 id;
173 173
174 for (id = 1; id <= RT_TABLE_MAX; id++) 174 for (id = 1; id <= RT_TABLE_MAX; id++)
175 if (fib_tables[id] == NULL) 175 if (fib_tables[id] == NULL)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 38bca473c7e2..c7a112b5a185 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -273,7 +273,7 @@ int ip_fib_check_default(u32 gw, struct net_device *dev)
273} 273}
274 274
275void rtmsg_fib(int event, u32 key, struct fib_alias *fa, 275void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
276 int z, int tb_id, 276 int z, u32 tb_id,
277 struct nlmsghdr *n, struct netlink_skb_parms *req) 277 struct nlmsghdr *n, struct netlink_skb_parms *req)
278{ 278{
279 struct sk_buff *skb; 279 struct sk_buff *skb;
@@ -939,7 +939,7 @@ u32 __fib_res_prefsrc(struct fib_result *res)
939 939
940int 940int
941fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, 941fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
942 u8 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos, 942 u32 tb_id, u8 type, u8 scope, void *dst, int dst_len, u8 tos,
943 struct fib_info *fi, unsigned int flags) 943 struct fib_info *fi, unsigned int flags)
944{ 944{
945 struct rtmsg *rtm; 945 struct rtmsg *rtm;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 01801c0f885d..4a27b2d573a3 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1148,7 +1148,7 @@ fn_trie_insert(struct fib_table *tb, struct rtmsg *r, struct kern_rta *rta,
1148 1148
1149 key = ntohl(key); 1149 key = ntohl(key);
1150 1150
1151 pr_debug("Insert table=%d %08x/%d\n", tb->tb_id, key, plen); 1151 pr_debug("Insert table=%u %08x/%d\n", tb->tb_id, key, plen);
1152 1152
1153 mask = ntohl(inet_make_mask(plen)); 1153 mask = ntohl(inet_make_mask(plen));
1154 1154
@@ -1943,9 +1943,9 @@ out:
1943/* Fix more generic FIB names for init later */ 1943/* Fix more generic FIB names for init later */
1944 1944
1945#ifdef CONFIG_IP_MULTIPLE_TABLES 1945#ifdef CONFIG_IP_MULTIPLE_TABLES
1946struct fib_table * fib_hash_init(int id) 1946struct fib_table * fib_hash_init(u32 id)
1947#else 1947#else
1948struct fib_table * __init fib_hash_init(int id) 1948struct fib_table * __init fib_hash_init(u32 id)
1949#endif 1949#endif
1950{ 1950{
1951 struct fib_table *tb; 1951 struct fib_table *tb;