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
62 typedef std::map<std::string, int>
HostMap;
73 static HostMap resolve(
const std::string& service,
const std::string& proto,
74 const std::string& domain,
const LogSink& logInstance );
84 static HostMap resolve(
const std::string& domain,
const LogSink& logInstance )
85 {
return resolve(
"xmpp-client",
"tcp", domain, logInstance ); }
94 static int connect(
const std::string& domain,
const LogSink& logInstance );
104 static int connect(
const std::string& domain,
unsigned short port,
const LogSink& logInstance );
110 static int getSocket();
116 static void closeSocket(
int fd );
119 static HostMap defaultHostMap(
const std::string& domain,
const LogSink& logInstance );
120 static void cleanup();
122 typedef struct buffer
124 unsigned char buf[NS_PACKETSZ];
127 typedef unsigned char name[NS_MAXDNAME];