proc.c (c3506372277779fccbffee2475400fcd689d5738) | proc.c (3617d9496cd92dcca4d0893191d95554590d8d9f) |
---|---|
1/* SCTP kernel implementation 2 * Copyright (c) 2003 International Business Machines, Corp. 3 * 4 * This file is part of the SCTP kernel implementation 5 * 6 * This SCTP implementation is free software; 7 * you can redistribute it and/or modify it under the terms of 8 * the GNU General Public License as published by --- 74 unchanged lines hidden (view full) --- 83 net->sctp.sctp_statistics); 84 for (i = 0; sctp_snmp_list[i].name; i++) 85 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, 86 buff[i]); 87 88 return 0; 89} 90 | 1/* SCTP kernel implementation 2 * Copyright (c) 2003 International Business Machines, Corp. 3 * 4 * This file is part of the SCTP kernel implementation 5 * 6 * This SCTP implementation is free software; 7 * you can redistribute it and/or modify it under the terms of 8 * the GNU General Public License as published by --- 74 unchanged lines hidden (view full) --- 83 net->sctp.sctp_statistics); 84 for (i = 0; sctp_snmp_list[i].name; i++) 85 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, 86 buff[i]); 87 88 return 0; 89} 90 |
91/* Initialize the seq file operations for 'snmp' object. */ 92static int sctp_snmp_seq_open(struct inode *inode, struct file *file) 93{ 94 return single_open_net(inode, file, sctp_snmp_seq_show); 95} 96 97static const struct file_operations sctp_snmp_seq_fops = { 98 .open = sctp_snmp_seq_open, 99 .read = seq_read, 100 .llseek = seq_lseek, 101 .release = single_release_net, 102}; 103 | |
104/* Dump local addresses of an association/endpoint. */ 105static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 106{ 107 struct sctp_association *asoc; 108 struct sctp_sockaddr_entry *laddr; 109 struct sctp_transport *peer; 110 union sctp_addr *addr, *primary = NULL; 111 struct sctp_af *af; --- 291 unchanged lines hidden (view full) --- 403}; 404 405/* Set up the proc fs entry for the SCTP protocol. */ 406int __net_init sctp_proc_init(struct net *net) 407{ 408 net->sctp.proc_net_sctp = proc_net_mkdir(net, "sctp", net->proc_net); 409 if (!net->sctp.proc_net_sctp) 410 return -ENOMEM; | 91/* Dump local addresses of an association/endpoint. */ 92static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) 93{ 94 struct sctp_association *asoc; 95 struct sctp_sockaddr_entry *laddr; 96 struct sctp_transport *peer; 97 union sctp_addr *addr, *primary = NULL; 98 struct sctp_af *af; --- 291 unchanged lines hidden (view full) --- 390}; 391 392/* Set up the proc fs entry for the SCTP protocol. */ 393int __net_init sctp_proc_init(struct net *net) 394{ 395 net->sctp.proc_net_sctp = proc_net_mkdir(net, "sctp", net->proc_net); 396 if (!net->sctp.proc_net_sctp) 397 return -ENOMEM; |
411 if (!proc_create("snmp", 0444, net->sctp.proc_net_sctp, 412 &sctp_snmp_seq_fops)) | 398 if (!proc_create_net_single("snmp", 0444, net->sctp.proc_net_sctp, 399 sctp_snmp_seq_show, NULL)) |
413 goto cleanup; 414 if (!proc_create_net("eps", 0444, net->sctp.proc_net_sctp, 415 &sctp_eps_ops, sizeof(struct seq_net_private))) 416 goto cleanup; 417 if (!proc_create_net("assocs", 0444, net->sctp.proc_net_sctp, 418 &sctp_assoc_ops, sizeof(struct sctp_ht_iter))) 419 goto cleanup; 420 if (!proc_create_net("remaddr", 0444, net->sctp.proc_net_sctp, 421 &sctp_remaddr_ops, sizeof(struct sctp_ht_iter))) 422 goto cleanup; 423 return 0; 424 425cleanup: 426 remove_proc_subtree("sctp", net->proc_net); 427 net->sctp.proc_net_sctp = NULL; 428 return -ENOMEM; 429} | 400 goto cleanup; 401 if (!proc_create_net("eps", 0444, net->sctp.proc_net_sctp, 402 &sctp_eps_ops, sizeof(struct seq_net_private))) 403 goto cleanup; 404 if (!proc_create_net("assocs", 0444, net->sctp.proc_net_sctp, 405 &sctp_assoc_ops, sizeof(struct sctp_ht_iter))) 406 goto cleanup; 407 if (!proc_create_net("remaddr", 0444, net->sctp.proc_net_sctp, 408 &sctp_remaddr_ops, sizeof(struct sctp_ht_iter))) 409 goto cleanup; 410 return 0; 411 412cleanup: 413 remove_proc_subtree("sctp", net->proc_net); 414 net->sctp.proc_net_sctp = NULL; 415 return -ENOMEM; 416} |