hostip.h 452 B

12345678910111213141516
  1. #pragma once
  2. #include <util/system/defaults.h>
  3. namespace NResolver {
  4. // resolve hostname and fills up to *slots slots in ip array;
  5. // actual number of slots filled is returned in *slots;
  6. int GetHostIP(const char* hostname, ui32* ip, size_t* slots);
  7. int GetDnsError();
  8. inline int GetHostIP(const char* hostname, ui32* ip) {
  9. size_t slots = 1;
  10. return GetHostIP(hostname, ip, &slots);
  11. }
  12. } // namespace NResolver