aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_ppp.c
diff options
context:
space:
mode:
authorJames Chapman <jchapman@katalix.com>2010-04-02 02:19:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-03 17:56:07 -0400
commit0ad6614048cf722e4d27909665b4846805357f1b (patch)
tree182349ddf6e2b8e8478a5451cd0ed9684c14f0e8 /net/l2tp/l2tp_ppp.c
parentd9e31d17ceba5f0736f5a34bbc236239cd42b420 (diff)
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_ppp.c')
-rw-r--r--net/l2tp/l2tp_ppp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index d64f081f2b1c..1ef10e4118d2 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -597,6 +597,20 @@ out:
597 return error; 597 return error;
598} 598}
599 599
600#ifdef CONFIG_L2TP_DEBUGFS
601static void pppol2tp_show(struct seq_file *m, void *arg)
602{
603 struct l2tp_session *session = arg;
604 struct pppol2tp_session *ps = l2tp_session_priv(session);
605
606 if (ps) {
607 struct pppox_sock *po = pppox_sk(ps->sock);
608 if (po)
609 seq_printf(m, " interface %s\n", ppp_dev_name(&po->chan));
610 }
611}
612#endif
613
600/* connect() handler. Attach a PPPoX socket to a tunnel UDP socket 614/* connect() handler. Attach a PPPoX socket to a tunnel UDP socket
601 */ 615 */
602static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr, 616static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
@@ -734,6 +748,9 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
734 748
735 session->recv_skb = pppol2tp_recv; 749 session->recv_skb = pppol2tp_recv;
736 session->session_close = pppol2tp_session_close; 750 session->session_close = pppol2tp_session_close;
751#ifdef CONFIG_L2TP_DEBUGFS
752 session->show = pppol2tp_show;
753#endif
737 754
738 /* We need to know each time a skb is dropped from the reorder 755 /* We need to know each time a skb is dropped from the reorder
739 * queue. 756 * queue.