aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/Kconfig5
-rw-r--r--net/dccp/Makefile4
-rw-r--r--net/dccp/diag.c47
3 files changed, 56 insertions, 0 deletions
diff --git a/net/dccp/Kconfig b/net/dccp/Kconfig
index 90460bc629b3..ff5b5459b97a 100644
--- a/net/dccp/Kconfig
+++ b/net/dccp/Kconfig
@@ -19,6 +19,11 @@ config IP_DCCP
If in doubt, say N.
+config IP_DCCP_DIAG
+ depends on IP_DCCP && IP_TCPDIAG
+ def_tristate y if (IP_DCCP = y && IP_TCPDIAG = y)
+ def_tristate m
+
source "net/dccp/ccids/Kconfig"
endmenu
diff --git a/net/dccp/Makefile b/net/dccp/Makefile
index 25a50bdbf1bb..5741fffc436f 100644
--- a/net/dccp/Makefile
+++ b/net/dccp/Makefile
@@ -3,4 +3,8 @@ obj-$(CONFIG_IP_DCCP) += dccp.o
dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \
timer.o packet_history.o
+obj-$(CONFIG_IP_DCCP_DIAG) += dccp_diag.o
+
obj-y += ccids/
+
+dccp_diag-y := diag.o
diff --git a/net/dccp/diag.c b/net/dccp/diag.c
new file mode 100644
index 000000000000..4d9037c56ddc
--- /dev/null
+++ b/net/dccp/diag.c
@@ -0,0 +1,47 @@
+/*
+ * net/dccp/diag.c
+ *
+ * An implementation of the DCCP protocol
+ * Arnaldo Carvalho de Melo <acme@mandriva.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/config.h>
+
+#include <linux/module.h>
+#include <linux/tcp_diag.h>
+
+#include "dccp.h"
+
+static void dccp_diag_get_info(struct sock *sk, struct tcpdiagmsg *r,
+ void *_info)
+{
+ r->tcpdiag_rqueue = r->tcpdiag_wqueue = 0;
+}
+
+static struct inet_diag_handler dccp_diag_handler = {
+ .idiag_hashinfo = &dccp_hashinfo,
+ .idiag_get_info = dccp_diag_get_info,
+ .idiag_type = DCCPDIAG_GETSOCK,
+ .idiag_info_size = 0,
+};
+
+static int __init dccp_diag_init(void)
+{
+ return inet_diag_register(&dccp_diag_handler);
+}
+
+static void __exit dccp_diag_fini(void)
+{
+ inet_diag_unregister(&dccp_diag_handler);
+}
+
+module_init(dccp_diag_init);
+module_exit(dccp_diag_fini);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
+MODULE_DESCRIPTION("DCCP inet_diag handler");