fib_trie.c (c3506372277779fccbffee2475400fcd689d5738) fib_trie.c (3617d9496cd92dcca4d0893191d95554590d8d9f)
1/*
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 * Robert Olsson <robert.olsson@its.uu.se> Uppsala Universitet
8 * & Swedish University of Agricultural Sciences.

--- 2334 unchanged lines hidden (view full) ---

2343 trie_show_usage(seq, t->stats);
2344#endif
2345 }
2346 }
2347
2348 return 0;
2349}
2350
1/*
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 * Robert Olsson <robert.olsson@its.uu.se> Uppsala Universitet
8 * & Swedish University of Agricultural Sciences.

--- 2334 unchanged lines hidden (view full) ---

2343 trie_show_usage(seq, t->stats);
2344#endif
2345 }
2346 }
2347
2348 return 0;
2349}
2350
2351static int fib_triestat_seq_open(struct inode *inode, struct file *file)
2352{
2353 return single_open_net(inode, file, fib_triestat_seq_show);
2354}
2355
2356static const struct file_operations fib_triestat_fops = {
2357 .open = fib_triestat_seq_open,
2358 .read = seq_read,
2359 .llseek = seq_lseek,
2360 .release = single_release_net,
2361};
2362
2363static struct key_vector *fib_trie_get_idx(struct seq_file *seq, loff_t pos)
2364{
2365 struct fib_trie_iter *iter = seq->private;
2366 struct net *net = seq_file_net(seq);
2367 loff_t idx = 0;
2368 unsigned int h;
2369
2370 for (h = 0; h < FIB_TABLE_HASHSZ; h++) {

--- 343 unchanged lines hidden (view full) ---

2714};
2715
2716int __net_init fib_proc_init(struct net *net)
2717{
2718 if (!proc_create_net("fib_trie", 0444, net->proc_net, &fib_trie_seq_ops,
2719 sizeof(struct fib_trie_iter)))
2720 goto out1;
2721
2351static struct key_vector *fib_trie_get_idx(struct seq_file *seq, loff_t pos)
2352{
2353 struct fib_trie_iter *iter = seq->private;
2354 struct net *net = seq_file_net(seq);
2355 loff_t idx = 0;
2356 unsigned int h;
2357
2358 for (h = 0; h < FIB_TABLE_HASHSZ; h++) {

--- 343 unchanged lines hidden (view full) ---

2702};
2703
2704int __net_init fib_proc_init(struct net *net)
2705{
2706 if (!proc_create_net("fib_trie", 0444, net->proc_net, &fib_trie_seq_ops,
2707 sizeof(struct fib_trie_iter)))
2708 goto out1;
2709
2722 if (!proc_create("fib_triestat", 0444, net->proc_net,
2723 &fib_triestat_fops))
2710 if (!proc_create_net_single("fib_triestat", 0444, net->proc_net,
2711 fib_triestat_seq_show, NULL))
2724 goto out2;
2725
2726 if (!proc_create_net("route", 0444, net->proc_net, &fib_route_seq_ops,
2727 sizeof(struct fib_route_iter)))
2728 goto out3;
2729
2730 return 0;
2731

--- 16 unchanged lines hidden ---
2712 goto out2;
2713
2714 if (!proc_create_net("route", 0444, net->proc_net, &fib_route_seq_ops,
2715 sizeof(struct fib_route_iter)))
2716 goto out3;
2717
2718 return 0;
2719

--- 16 unchanged lines hidden ---