aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-12 08:27:49 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:57:38 -0400
commit4f5736c4c7cf6f9bd8db82b712cfdd51c87e06b9 (patch)
tree403d4b49b4c1d51445f3ff279d75f74a39e2cc17 /net/dccp
parent5324a040ccc708998e61ea93e669b81312f0ae11 (diff)
[TCPDIAG]: Introduce inet_diag_{register,unregister}
Next changeset will rename tcp_diag to inet_diag and move the tcp_diag code out of it and into a new tcp_diag.c, similar to the net/dccp/diag.c introduced in this changeset, completing the transition to a generic inet_diag infrastructure. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
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
19 19
20 If in doubt, say N. 20 If in doubt, say N.
21 21
22config IP_DCCP_DIAG
23 depends on IP_DCCP && IP_TCPDIAG
24 def_tristate y if (IP_DCCP = y && IP_TCPDIAG = y)
25 def_tristate m
26
22source "net/dccp/ccids/Kconfig" 27source "net/dccp/ccids/Kconfig"
23 28
24endmenu 29endmenu
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
3dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \ 3dccp-y := ccid.o input.o ipv4.o minisocks.o options.o output.o proto.o \
4 timer.o packet_history.o 4 timer.o packet_history.o
5 5
6obj-$(CONFIG_IP_DCCP_DIAG) += dccp_diag.o
7
6obj-y += ccids/ 8obj-y += ccids/
9
10dccp_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 @@
1/*
2 * net/dccp/diag.c
3 *
4 * An implementation of the DCCP protocol
5 * Arnaldo Carvalho de Melo <acme@mandriva.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/config.h>
13
14#include <linux/module.h>
15#include <linux/tcp_diag.h>
16
17#include "dccp.h"
18
19static void dccp_diag_get_info(struct sock *sk, struct tcpdiagmsg *r,
20 void *_info)
21{
22 r->tcpdiag_rqueue = r->tcpdiag_wqueue = 0;
23}
24
25static struct inet_diag_handler dccp_diag_handler = {
26 .idiag_hashinfo = &dccp_hashinfo,
27 .idiag_get_info = dccp_diag_get_info,
28 .idiag_type = DCCPDIAG_GETSOCK,
29 .idiag_info_size = 0,
30};
31
32static int __init dccp_diag_init(void)
33{
34 return inet_diag_register(&dccp_diag_handler);
35}
36
37static void __exit dccp_diag_fini(void)
38{
39 inet_diag_unregister(&dccp_diag_handler);
40}
41
42module_init(dccp_diag_init);
43module_exit(dccp_diag_fini);
44
45MODULE_LICENSE("GPL");
46MODULE_AUTHOR("Arnaldo Carvalho de Melo <acme@mandriva.com>");
47MODULE_DESCRIPTION("DCCP inet_diag handler");