tfrc.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifdef CONFIG_IP_DCCP_TFRC_DEBUG
  11. int tfrc_debug;
  12. module_param(tfrc_debug, bool, 0444);
  13. MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
  14. #endif
  15. extern int tfrc_tx_packet_history_init(void);
  16. extern void tfrc_tx_packet_history_exit(void);
  17. extern int tfrc_rx_packet_history_init(void);
  18. extern void tfrc_rx_packet_history_exit(void);
  19. extern int tfrc_li_init(void);
  20. extern void tfrc_li_exit(void);
  21. static int __init tfrc_module_init(void)
  22. {
  23. int rc = tfrc_li_init();
  24. if (rc)
  25. goto out;
  26. rc = tfrc_tx_packet_history_init();
  27. if (rc)
  28. goto out_free_loss_intervals;
  29. rc = tfrc_rx_packet_history_init();
  30. if (rc)
  31. goto out_free_tx_history;
  32. return 0;
  33. out_free_tx_history:
  34. tfrc_tx_packet_history_exit();
  35. out_free_loss_intervals:
  36. tfrc_li_exit();
  37. out:
  38. return rc;
  39. }
  40. static void __exit tfrc_module_exit(void)
  41. {
  42. tfrc_rx_packet_history_exit();
  43. tfrc_tx_packet_history_exit();
  44. tfrc_li_exit();
  45. }
  46. module_init(tfrc_module_init);
  47. module_exit(tfrc_module_exit);
  48. MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, "
  49. "Ian McDonald <ian.mcdonald@jandi.co.nz>, "
  50. "Arnaldo Carvalho de Melo <acme@redhat.com>");
  51. MODULE_DESCRIPTION("DCCP TFRC library");
  52. MODULE_LICENSE("GPL");