2013-06-09 01:59:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2020-07-17 01:54:37 +00:00
|
|
|
#include <vector>
|
2013-06-09 01:59:11 +00:00
|
|
|
|
|
|
|
struct addrinfo;
|
2012-06-03 17:01:08 +00:00
|
|
|
|
|
|
|
namespace net {
|
|
|
|
|
2012-07-15 15:04:27 +00:00
|
|
|
// Strictly only required on Win32, but all platforms should call it.
|
2012-06-03 17:01:08 +00:00
|
|
|
void Init();
|
2012-07-15 15:04:27 +00:00
|
|
|
void Shutdown();
|
2012-06-03 17:01:08 +00:00
|
|
|
|
2018-05-01 00:06:54 +00:00
|
|
|
enum class DNSType {
|
|
|
|
ANY = 0,
|
|
|
|
IPV4 = 1,
|
|
|
|
IPV6 = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
bool DNSResolve(const std::string &host, const std::string &service, addrinfo **res, std::string &error, DNSType type = DNSType::ANY);
|
2013-06-09 01:59:11 +00:00
|
|
|
void DNSResolveFree(addrinfo *res);
|
2020-07-17 01:54:37 +00:00
|
|
|
bool GetIPList(std::vector<std::string>& IP4s);
|
2013-06-09 01:59:11 +00:00
|
|
|
|
2013-03-04 22:48:18 +00:00
|
|
|
int inet_pton(int af, const char* src, void* dst);
|
2012-06-03 17:01:08 +00:00
|
|
|
} // namespace net
|