proc.c (3f3942aca6da351a12543aa776467791b63b3a78) proc.c (3617d9496cd92dcca4d0893191d95554590d8d9f)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * This file implements the various access functions for the
7 * PROC file system. This is very similar to the IPv4 version,
8 * except it reports the sockets in the INET6 address family.

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

48 seq_printf(seq, "RAW6: inuse %d\n",
49 sock_prot_inuse_get(net, &rawv6_prot));
50 seq_printf(seq, "FRAG6: inuse %u memory %lu\n",
51 atomic_read(&net->ipv6.frags.rhashtable.nelems),
52 frag_mem_limit(&net->ipv6.frags));
53 return 0;
54}
55
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * This file implements the various access functions for the
7 * PROC file system. This is very similar to the IPv4 version,
8 * except it reports the sockets in the INET6 address family.

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

48 seq_printf(seq, "RAW6: inuse %d\n",
49 sock_prot_inuse_get(net, &rawv6_prot));
50 seq_printf(seq, "FRAG6: inuse %u memory %lu\n",
51 atomic_read(&net->ipv6.frags.rhashtable.nelems),
52 frag_mem_limit(&net->ipv6.frags));
53 return 0;
54}
55
56static int sockstat6_seq_open(struct inode *inode, struct file *file)
57{
58 return single_open_net(inode, file, sockstat6_seq_show);
59}
60
61static const struct file_operations sockstat6_seq_fops = {
62 .open = sockstat6_seq_open,
63 .read = seq_read,
64 .llseek = seq_lseek,
65 .release = single_release_net,
66};
67
68static const struct snmp_mib snmp6_ipstats_list[] = {
69/* ipv6 mib according to RFC 2465 */
70 SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INPKTS),
71 SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
72 SNMP_MIB_ITEM("Ip6InTooBigErrors", IPSTATS_MIB_INTOOBIGERRORS),
73 SNMP_MIB_ITEM("Ip6InNoRoutes", IPSTATS_MIB_INNOROUTES),
74 SNMP_MIB_ITEM("Ip6InAddrErrors", IPSTATS_MIB_INADDRERRORS),
75 SNMP_MIB_ITEM("Ip6InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),

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

237 snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs);
238 snmp6_seq_show_item(seq, net->mib.udp_stats_in6,
239 NULL, snmp6_udp6_list);
240 snmp6_seq_show_item(seq, net->mib.udplite_stats_in6,
241 NULL, snmp6_udplite6_list);
242 return 0;
243}
244
56static const struct snmp_mib snmp6_ipstats_list[] = {
57/* ipv6 mib according to RFC 2465 */
58 SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INPKTS),
59 SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
60 SNMP_MIB_ITEM("Ip6InTooBigErrors", IPSTATS_MIB_INTOOBIGERRORS),
61 SNMP_MIB_ITEM("Ip6InNoRoutes", IPSTATS_MIB_INNOROUTES),
62 SNMP_MIB_ITEM("Ip6InAddrErrors", IPSTATS_MIB_INADDRERRORS),
63 SNMP_MIB_ITEM("Ip6InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),

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

225 snmp6_seq_show_icmpv6msg(seq, net->mib.icmpv6msg_statistics->mibs);
226 snmp6_seq_show_item(seq, net->mib.udp_stats_in6,
227 NULL, snmp6_udp6_list);
228 snmp6_seq_show_item(seq, net->mib.udplite_stats_in6,
229 NULL, snmp6_udplite6_list);
230 return 0;
231}
232
245static int snmp6_seq_open(struct inode *inode, struct file *file)
246{
247 return single_open_net(inode, file, snmp6_seq_show);
248}
249
250static const struct file_operations snmp6_seq_fops = {
251 .open = snmp6_seq_open,
252 .read = seq_read,
253 .llseek = seq_lseek,
254 .release = single_release_net,
255};
256
257static int snmp6_dev_seq_show(struct seq_file *seq, void *v)
258{
259 struct inet6_dev *idev = (struct inet6_dev *)seq->private;
260
261 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex);
262 snmp6_seq_show_item64(seq, idev->stats.ipv6,
263 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp));
264 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs,

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

297 return -EINVAL;
298 proc_remove(idev->stats.proc_dir_entry);
299 idev->stats.proc_dir_entry = NULL;
300 return 0;
301}
302
303static int __net_init ipv6_proc_init_net(struct net *net)
304{
233static int snmp6_dev_seq_show(struct seq_file *seq, void *v)
234{
235 struct inet6_dev *idev = (struct inet6_dev *)seq->private;
236
237 seq_printf(seq, "%-32s\t%u\n", "ifIndex", idev->dev->ifindex);
238 snmp6_seq_show_item64(seq, idev->stats.ipv6,
239 snmp6_ipstats_list, offsetof(struct ipstats_mib, syncp));
240 snmp6_seq_show_item(seq, NULL, idev->stats.icmpv6dev->mibs,

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

273 return -EINVAL;
274 proc_remove(idev->stats.proc_dir_entry);
275 idev->stats.proc_dir_entry = NULL;
276 return 0;
277}
278
279static int __net_init ipv6_proc_init_net(struct net *net)
280{
305 if (!proc_create("sockstat6", 0444, net->proc_net,
306 &sockstat6_seq_fops))
281 if (!proc_create_net_single("sockstat6", 0444, net->proc_net,
282 sockstat6_seq_show, NULL))
307 return -ENOMEM;
308
283 return -ENOMEM;
284
309 if (!proc_create("snmp6", 0444, net->proc_net, &snmp6_seq_fops))
285 if (!proc_create_net_single("snmp6", 0444, net->proc_net,
286 snmp6_seq_show, NULL))
310 goto proc_snmp6_fail;
311
312 net->mib.proc_net_devsnmp6 = proc_mkdir("dev_snmp6", net->proc_net);
313 if (!net->mib.proc_net_devsnmp6)
314 goto proc_dev_snmp6_fail;
315 return 0;
316
317proc_dev_snmp6_fail:

--- 27 unchanged lines hidden ---
287 goto proc_snmp6_fail;
288
289 net->mib.proc_net_devsnmp6 = proc_mkdir("dev_snmp6", net->proc_net);
290 if (!net->mib.proc_net_devsnmp6)
291 goto proc_dev_snmp6_fail;
292 return 0;
293
294proc_dev_snmp6_fail:

--- 27 unchanged lines hidden ---