42 #ifndef _DWMDNSETCHOSTS_HH_ 43 #define _DWMDNSETCHOSTS_HH_ 46 #include <sys/types.h> 47 #include <sys/socket.h> 48 #include <netinet/in.h> 49 #include <arpa/inet.h> 76 EtcHosts(
const std::string & hostsFile =
"/etc/hosts");
83 bool Get(
const std::string & name, uint16_t rrtype,
84 std::vector<ResourceRecord> & results);
93 void Add(
const std::string & ipAddr,
const std::string & name);
96 std::map<std::string,in_addr> _namesToV4Addrs;
97 std::map<std::string,in6_addr> _namesToV6Addrs;
98 std::multimap<in6_addr,std::string> _v6addrsToNames;
99 std::multimap<in_addr,std::string> _v4addrsToNames;
106 #endif // _DWMDNSETCHOSTS_HH_ Encapsulates a resolver 'hosts' file, such as /etc/hosts.
Definition: DwmDnsEtcHosts.hh:68
Dwm::Dns::ResourceRecord class definition.
Utility functions for Dwm::Dns.
Definition: DwmDnsEtcHosts.hh:60
bool Get(const std::string &name, uint16_t rrtype, std::vector< ResourceRecord > &results)
Gets DNS resource records of type rrtype for the given host name.
void Add(const std::string &ipAddr, const std::string &name)
Adds an entry for the given IP address ipAddr named name.
EtcHosts(const std::string &hostsFile="/etc/hosts")
Construct from a path to the hosts file.