dns_func.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2013 [email protected]
  3. *
  4. * Permission to use, copy, modify, and distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /*!
  17. * \file
  18. * \brief Kamailio core :: DNS wrapper functions
  19. * \author [email protected]
  20. *
  21. * \ingroup core
  22. * Module: \ref core
  23. *
  24. *
  25. */
  26. #ifndef DNS_FUNC_H
  27. #define DNS_FUNC_H
  28. #include <sys/socket.h>
  29. struct hostent;
  30. typedef int (*res_init_t)(void);
  31. typedef int (*res_search_t)(const char*, int, int, unsigned char*, int);
  32. typedef struct hostent* (*gethostbyname_t)(const char*);
  33. typedef struct hostent* (*gethostbyname2_t)(const char*, int);
  34. struct dns_func_t {
  35. res_init_t sr_res_init;
  36. res_search_t sr_res_search;
  37. gethostbyname_t sr_gethostbyname;
  38. gethostbyname2_t sr_gethostbyname2;
  39. };
  40. /*
  41. * initiate structure with system values
  42. */
  43. //extern struct dns_func_t dns_func;
  44. extern
  45. void load_dnsfunc(struct dns_func_t *d);
  46. #endif