Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / net / dccp / ccids / lib / tfrc.c
blobd1dfbb8de64ce0c26d0698e1868ba1b4b23e42f1
1 /*
2 * TFRC: main module holding the pieces of the TFRC library together
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"
11 #ifdef CONFIG_IP_DCCP_TFRC_DEBUG
12 int tfrc_debug;
13 module_param(tfrc_debug, bool, 0444);
14 MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
15 #endif
17 extern int tfrc_tx_packet_history_init(void);
18 extern void tfrc_tx_packet_history_exit(void);
19 extern int tfrc_rx_packet_history_init(void);
20 extern void tfrc_rx_packet_history_exit(void);
22 extern int tfrc_li_init(void);
23 extern void tfrc_li_exit(void);
25 static int __init tfrc_module_init(void)
27 int rc = tfrc_li_init();
29 if (rc)
30 goto out;
32 rc = tfrc_tx_packet_history_init();
33 if (rc)
34 goto out_free_loss_intervals;
36 rc = tfrc_rx_packet_history_init();
37 if (rc)
38 goto out_free_tx_history;
39 return 0;
41 out_free_tx_history:
42 tfrc_tx_packet_history_exit();
43 out_free_loss_intervals:
44 tfrc_li_exit();
45 out:
46 return rc;
49 static void __exit tfrc_module_exit(void)
51 tfrc_rx_packet_history_exit();
52 tfrc_tx_packet_history_exit();
53 tfrc_li_exit();
56 module_init(tfrc_module_init);
57 module_exit(tfrc_module_exit);
59 MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, "
60 "Ian McDonald <ian.mcdonald@jandi.co.nz>, "
61 "Arnaldo Carvalho de Melo <acme@redhat.com>");
62 MODULE_DESCRIPTION("DCCP TFRC library");
63 MODULE_LICENSE("GPL");