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>
This commit is contained in:
Rémi Denis-Courmont
2009-07-21 01:57:57 +00:00
committed by David S. Miller
parent e8834a63bd
commit c1dc13e9d0
3 changed files with 105 additions and 0 deletions

View File

@@ -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);
}