qos_load.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2007 SOMA Networks, Inc.
  5. * Written by Ovidiu Sas (osas)
  6. *
  7. * This file is part of Kamailio, a free SIP server.
  8. *
  9. * Kamailio is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version
  13. *
  14. * Kamailio is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * History:
  24. * --------
  25. * 2007-07-14 initial version (osas)
  26. */
  27. #ifndef _QOS_QOS_LOAD_H_
  28. #define _QOS_QOS_LOAD_H_
  29. #include "qos_cb.h"
  30. struct qos_binds {
  31. register_qoscb_f register_qoscb;
  32. };
  33. typedef int(*load_qos_f)( struct qos_binds *qosb );
  34. int load_qos( struct qos_binds *qosb);
  35. static inline int load_qos_api( struct qos_binds *qosb )
  36. {
  37. load_qos_f load_qos;
  38. /* import the QOS auto-loading function */
  39. if ( !(load_qos=(load_qos_f)find_export("load_qos", 0, 0))) {
  40. LM_ERR("can't import load_qos\n");
  41. return -1;
  42. }
  43. /* let the auto-loading function load all QOS stuff */
  44. if (load_qos( qosb )==-1)
  45. return -1;
  46. return 0;
  47. }
  48. #endif