dns_func.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2013 [email protected]
  5. *
  6. * Permission to use, copy, modify, and distribute this software for any
  7. * purpose with or without fee is hereby granted, provided that the above
  8. * copyright notice and this permission notice appear in all copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  11. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  12. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  13. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  14. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  15. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  16. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /*
  19. * DNS Wrapper functions
  20. */
  21. /*
  22. * History:
  23. * --------
  24. * 2013-03 initial version (marius)
  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