hostip.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __HOSTIP_H
  2. #define __HOSTIP_H
  3. /*****************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 2000, Daniel Stenberg, <[email protected]>, et al.
  11. *
  12. * In order to be useful for every potential user, curl and libcurl are
  13. * dual-licensed under the MPL and the MIT/X-derivate licenses.
  14. *
  15. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. * copies of the Software, and permit persons to whom the Software is
  17. * furnished to do so, under the terms of the MPL or the MIT/X-derivate
  18. * licenses. You may pick one of these licenses.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. *****************************************************************************/
  25. #include "hash.h"
  26. struct addrinfo;
  27. struct hostent;
  28. struct SessionHandle;
  29. void Curl_global_host_cache_init(void);
  30. void Curl_global_host_cache_dtor(void);
  31. curl_hash *Curl_global_host_cache_get(void);
  32. #define Curl_global_host_cache_use(__p) ((__p)->set.global_dns_cache)
  33. Curl_addrinfo *Curl_resolv(struct SessionHandle *data,
  34. char *hostname,
  35. int port,
  36. char **bufp);
  37. /* Get name info */
  38. Curl_addrinfo *Curl_getaddrinfo(struct SessionHandle *data,
  39. char *hostname,
  40. int port,
  41. char **bufp);
  42. /* free name info */
  43. void Curl_freeaddrinfo(void *freethis);
  44. #ifdef MALLOCDEBUG
  45. void curl_freeaddrinfo(struct addrinfo *freethis,
  46. int line, const char *source);
  47. int curl_getaddrinfo(char *hostname, char *service,
  48. struct addrinfo *hints,
  49. struct addrinfo **result,
  50. int line, const char *source);
  51. #endif
  52. #endif