blob: 185916218e07161ecec75fbd6095dfbfd32c23e0 [file] [log] [blame]
Gerrit Renkerc40616c2007-12-06 12:26:38 -02001/*
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;
Gerrit Renker157439f2008-08-23 13:28:27 +020013module_param(tfrc_debug, bool, 0644);
Gerrit Renkerc40616c2007-12-06 12:26:38 -020014MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
15#endif
16
Gerrit Renkerc40616c2007-12-06 12:26:38 -020017static int __init tfrc_module_init(void)
18{
Gerrit Renker954c2db2007-12-12 14:06:14 -020019 int rc = tfrc_li_init();
Gerrit Renkerc40616c2007-12-06 12:26:38 -020020
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020021 if (rc)
22 goto out;
Gerrit Renkerc40616c2007-12-06 12:26:38 -020023
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020024 rc = tfrc_tx_packet_history_init();
25 if (rc)
26 goto out_free_loss_intervals;
27
28 rc = tfrc_rx_packet_history_init();
29 if (rc)
30 goto out_free_tx_history;
31 return 0;
32
33out_free_tx_history:
34 tfrc_tx_packet_history_exit();
35out_free_loss_intervals:
Gerrit Renker954c2db2007-12-12 14:06:14 -020036 tfrc_li_exit();
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020037out:
Gerrit Renkerc40616c2007-12-06 12:26:38 -020038 return rc;
39}
40
41static void __exit tfrc_module_exit(void)
42{
Gerrit Renkerdf8f83f2007-12-12 12:24:49 -020043 tfrc_rx_packet_history_exit();
44 tfrc_tx_packet_history_exit();
Gerrit Renker954c2db2007-12-12 14:06:14 -020045 tfrc_li_exit();
Gerrit Renkerc40616c2007-12-06 12:26:38 -020046}
47
48module_init(tfrc_module_init);
49module_exit(tfrc_module_exit);
50
51MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, "
52 "Ian McDonald <ian.mcdonald@jandi.co.nz>, "
53 "Arnaldo Carvalho de Melo <acme@redhat.com>");
54MODULE_DESCRIPTION("DCCP TFRC library");
55MODULE_LICENSE("GPL");