aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib/tfrc.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-12-06 09:26:38 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:39 -0500
commitc40616c597bf02a2346cbf2f120283734b436245 (patch)
tree2fb6f82ed8fec01038f4607b489086a8f2a719f9 /net/dccp/ccids/lib/tfrc.c
parentf8b33fdfafea0f909712a55fbb3d83b89f70f3f5 (diff)
[TFRC]: Provide central source file and debug facility
This patch changes the tfrc_lib module in the following manner: (1) a dedicated tfrc source file to call the packet history & loss interval init/exit functions. (2) a dedicated tfrc_pr_debug macro with toggle switch `tfrc_debug'. Commiter note: renamed tfrc_module.c to tfrc.c, and made CONFIG_IP_DCCP_CCID3 select IP_DCCP_TFRC_LIB. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/lib/tfrc.c')
-rw-r--r--net/dccp/ccids/lib/tfrc.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c
new file mode 100644
index 000000000000..3a7a1838a64b
--- /dev/null
+++ b/net/dccp/ccids/lib/tfrc.c
@@ -0,0 +1,48 @@
1/*
2 * TFRC: main module holding the pieces of the TFRC library together
3 *
4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
5 * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
6 */
7#include <linux/module.h>
8#include <linux/moduleparam.h>
9#include "tfrc.h"
10
11#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
12int tfrc_debug;
13module_param(tfrc_debug, bool, 0444);
14MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
15#endif
16
17extern int dccp_li_init(void);
18extern void dccp_li_exit(void);
19extern int packet_history_init(void);
20extern void packet_history_exit(void);
21
22static int __init tfrc_module_init(void)
23{
24 int rc = dccp_li_init();
25
26 if (rc == 0) {
27 rc = packet_history_init();
28 if (rc != 0)
29 dccp_li_exit();
30 }
31
32 return rc;
33}
34
35static void __exit tfrc_module_exit(void)
36{
37 packet_history_exit();
38 dccp_li_exit();
39}
40
41module_init(tfrc_module_init);
42module_exit(tfrc_module_exit);
43
44MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, "
45 "Ian McDonald <ian.mcdonald@jandi.co.nz>, "
46 "Arnaldo Carvalho de Melo <acme@redhat.com>");
47MODULE_DESCRIPTION("DCCP TFRC library");
48MODULE_LICENSE("GPL");