tfrc.c 1.2 KB

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