diff options
author | Gerrit Renker | 2007-12-06 15:26:38 +0100 |
---|---|---|
committer | David S. Miller | 2008-01-28 23:56:39 +0100 |
commit | c40616c597bf02a2346cbf2f120283734b436245 (patch) | |
tree | 2fb6f82ed8fec01038f4607b489086a8f2a719f9 /net/dccp/ccids/lib/tfrc.c | |
parent | [ARP]: Consolidate some code in arp_req_set/delete_publc (diff) | |
download | kernel-qcow2-linux-c40616c597bf02a2346cbf2f120283734b436245.tar.gz kernel-qcow2-linux-c40616c597bf02a2346cbf2f120283734b436245.tar.xz kernel-qcow2-linux-c40616c597bf02a2346cbf2f120283734b436245.zip |
[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.c | 48 |
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 @@ +/* + * TFRC: main module holding the pieces of the TFRC library together + * + * Copyright (c) 2007 The University of Aberdeen, Scotland, UK + * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> + */ +#include <linux/module.h> +#include <linux/moduleparam.h> +#include "tfrc.h" + +#ifdef CONFIG_IP_DCCP_TFRC_DEBUG +int tfrc_debug; +module_param(tfrc_debug, bool, 0444); +MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); +#endif + +extern int dccp_li_init(void); +extern void dccp_li_exit(void); +extern int packet_history_init(void); +extern void packet_history_exit(void); + +static int __init tfrc_module_init(void) +{ + int rc = dccp_li_init(); + + if (rc == 0) { + rc = packet_history_init(); + if (rc != 0) + dccp_li_exit(); + } + + return rc; +} + +static void __exit tfrc_module_exit(void) +{ + packet_history_exit(); + dccp_li_exit(); +} + +module_init(tfrc_module_init); +module_exit(tfrc_module_exit); + +MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, " + "Ian McDonald <ian.mcdonald@jandi.co.nz>, " + "Arnaldo Carvalho de Melo <acme@redhat.com>"); +MODULE_DESCRIPTION("DCCP TFRC library"); +MODULE_LICENSE("GPL"); |