tfrc.c 815 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * TFRC library initialisation
  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 "tfrc.h"
  8. #ifdef CONFIG_IP_DCCP_TFRC_DEBUG
  9. int tfrc_debug;
  10. module_param(tfrc_debug, bool, 0644);
  11. MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");
  12. #endif
  13. int __init tfrc_lib_init(void)
  14. {
  15. int rc = tfrc_li_init();
  16. if (rc)
  17. goto out;
  18. rc = tfrc_tx_packet_history_init();
  19. if (rc)
  20. goto out_free_loss_intervals;
  21. rc = tfrc_rx_packet_history_init();
  22. if (rc)
  23. goto out_free_tx_history;
  24. return 0;
  25. out_free_tx_history:
  26. tfrc_tx_packet_history_exit();
  27. out_free_loss_intervals:
  28. tfrc_li_exit();
  29. out:
  30. return rc;
  31. }
  32. void tfrc_lib_exit(void)
  33. {
  34. tfrc_rx_packet_history_exit();
  35. tfrc_tx_packet_history_exit();
  36. tfrc_li_exit();
  37. }