summaryrefslogtreecommitdiff
path: root/net/phonet/pn_dev.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2009-07-21 01:57:57 +0000
committerDavid S. Miller <davem@davemloft.net>2009-07-23 17:58:19 -0700
commitc1dc13e9d0bc35a8d85bf4238c48c1b627d48f35 (patch)
tree7bc3ecf8a72b1dc940f6cd676eb9bcfebfc2402e /net/phonet/pn_dev.c
parente8834a63bddf87f7b85955d1ba60d28343d88469 (diff)
downloadlwn-c1dc13e9d0bc35a8d85bf4238c48c1b627d48f35.tar.gz
lwn-c1dc13e9d0bc35a8d85bf4238c48c1b627d48f35.zip
Phonet: sockets list through proc_fs
This provides a list of sockets with their Phonet bind addresses and some socket debug informations through /proc/net/phonet. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet/pn_dev.c')
-rw-r--r--net/phonet/pn_dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index b0d6ddd82a9d..5107b7949c9c 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -218,6 +218,11 @@ static int phonet_init_net(struct net *net)
if (!pnn)
return -ENOMEM;
+ if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops)) {
+ kfree(pnn);
+ return -ENOMEM;
+ }
+
INIT_LIST_HEAD(&pnn->pndevs.list);
spin_lock_init(&pnn->pndevs.lock);
net_assign_generic(net, phonet_net_id, pnn);
@@ -233,6 +238,8 @@ static void phonet_exit_net(struct net *net)
for_each_netdev(net, dev)
phonet_device_destroy(dev);
rtnl_unlock();
+
+ proc_net_remove(net, "phonet");
kfree(pnn);
}