diff options
author | James Chapman <jchapman@katalix.com> | 2010-04-02 06:19:33 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-03 14:56:07 -0700 |
commit | 0ad6614048cf722e4d27909665b4846805357f1b (patch) | |
tree | 182349ddf6e2b8e8478a5451cd0ed9684c14f0e8 /net/l2tp/l2tp_eth.c | |
parent | d9e31d17ceba5f0736f5a34bbc236239cd42b420 (diff) | |
download | op-kernel-dev-0ad6614048cf722e4d27909665b4846805357f1b.zip op-kernel-dev-0ad6614048cf722e4d27909665b4846805357f1b.tar.gz |
l2tp: Add debugfs files for dumping l2tp debug info
The existing pppol2tp driver exports debug info to
/proc/net/pppol2tp. Rather than adding info to that file for the new
functionality added in this patch series, we add new files in debugfs,
leaving the old /proc file for backwards compatibility (L2TPv2 only).
Currently only one file is provided: l2tp/tunnels, which lists
internal debug info for all l2tp tunnels and sessions. More files may
be added later. The info is for debug and problem analysis only -
userspace apps should use netlink to obtain status about l2tp tunnels
and sessions.
Although debugfs does not support net namespaces, the tunnels and
sessions dumped in l2tp/tunnels are only those in the net namespace of
the process reading the file.
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_eth.c')
-rw-r--r-- | net/l2tp/l2tp_eth.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index 755c297..9848faa 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c @@ -172,6 +172,17 @@ static void l2tp_eth_delete(struct l2tp_session *session) } } +#ifdef CONFIG_L2TP_DEBUGFS +static void l2tp_eth_show(struct seq_file *m, void *arg) +{ + struct l2tp_session *session = arg; + struct l2tp_eth_sess *spriv = l2tp_session_priv(session); + struct net_device *dev = spriv->dev; + + seq_printf(m, " interface %s\n", dev->name); +} +#endif + static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 peer_session_id, struct l2tp_session_cfg *cfg) { struct net_device *dev; @@ -233,6 +244,9 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p priv->tunnel_sock = tunnel->sock; session->recv_skb = l2tp_eth_dev_recv; session->session_close = l2tp_eth_delete; +#ifdef CONFIG_L2TP_DEBUGFS + session->show = l2tp_eth_show; +#endif spriv = l2tp_session_priv(session); spriv->dev = dev; |