domain_api.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Domain module internal API
  3. *
  4. * Copyright (C) 2002-2003 Juha Heinanen
  5. *
  6. * This file is part of sip-router, a free SIP server.
  7. *
  8. * sip-router is free software; you can redistribute it and/or modify it under
  9. * the terms of the GNU General Public License as published by the Free
  10. * Software Foundation; either version 2 of the License, or (at your option)
  11. * any later version
  12. *
  13. * sip-router is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef _DOMAIN_API_H
  23. #define _DOMAIN_API_H
  24. #include "../../sr_module.h"
  25. #include "../../dprint.h"
  26. #include "domain.h"
  27. typedef struct domain_api {
  28. is_domain_local_f is_domain_local;
  29. } domain_api_t;
  30. typedef int (*bind_domain_f)(domain_api_t* api);
  31. int bind_domain(domain_api_t* api);
  32. static inline int load_domain_api(domain_api_t* api)
  33. {
  34. bind_domain_f bind_domain;
  35. bind_domain = (bind_domain_f)find_export("bind_domain", 0, 0);
  36. if (bind_domain == NULL) {
  37. ERR("Cannot import bind_domain function from domain module\n");
  38. return -1;
  39. }
  40. if (bind_domain(api) == -1) {
  41. return -1;
  42. }
  43. return 0;
  44. }
  45. #endif /* _DOMAIN_API_H */