aboutsummaryrefslogtreecommitdiffstats
path: root/util/network/hostip.h
blob: 9cc00f6af1eb612f9015dace0a266ccec4dd7b51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <util/system/defaults.h>

namespace NResolver { 
    // resolve hostname and fills up to *slots slots in ip array;
    // actual number of slots filled is returned in *slots;
    int GetHostIP(const char* hostname, ui32* ip, size_t* slots); 
    int GetDnsError(); 
 
    inline int GetHostIP(const char* hostname, ui32* ip) { 
        size_t slots = 1; 
 
        return GetHostIP(hostname, ip, &slots); 
    } 
}