25 #ifdef HAVE_ARPA_NAMESER_H
26 # include <arpa/nameser.h>
30 # include <arpa/nameser_compat.h>
34 # define NS_MAXDNAME 1025
38 # define NS_PACKETSZ 512
41 #ifdef HAVE_GETADDRINFO
42 # include <sys/types.h>
43 # include <sys/socket.h>
68 typedef std::map<std::string, int>
HostMap;
79 static HostMap resolve(
const std::string& service,
const std::string& proto,
80 const std::string& domain,
const LogSink& logInstance );
91 {
return resolve(
"xmpp-client",
"tcp", domain, logInstance ); }
100 static int connect(
const std::string& host,
const LogSink& logInstance );
110 static int connect(
const std::string& host,
int port,
const LogSink& logInstance );
117 static int getSocket(
const LogSink& logInstance );
124 static void closeSocket(
int fd,
const LogSink& logInstance );
127 #ifdef HAVE_GETADDRINFO
137 static void resolve(
struct addrinfo** res,
const std::string& service,
const std::string& proto,
138 const std::string& domain,
const LogSink& logInstance );
147 static void resolve(
struct addrinfo** res,
const std::string& domain,
const LogSink& logInstance )
148 { resolve( res,
"xmpp-client",
"tcp", domain, logInstance ); }
156 static int connect(
struct addrinfo* res,
const LogSink& logInstance );
165 static int getSocket(
int af,
int socktype,
int proto,
const LogSink& logInstance );
167 static HostMap defaultHostMap(
const std::string& domain,
const LogSink& logInstance );
168 static void cleanup(
const LogSink& logInstance );
172 unsigned char buf[NS_PACKETSZ];
This class holds a number of static functions used for DNS related stuff.
static HostMap resolve(const std::string &domain, const LogSink &logInstance)
std::map< std::string, int > HostMap
An implementation of log sink and source.
The namespace for the gloox library.