1#if !defined(RESIP_DNSUTIL_HXX)
2#define RESIP_DNSUTIL_HXX
10#include <netinet/in.h>
39 const char*
name() const noexcept
override {
return "DnsUtil::Exception"; }
80 static int inet_pton(
const Data& printableIp,
struct in_addr& dst);
103 static int inet_pton(
const Data& printableIp,
struct in6_addr& dst);
119 static const char *
inet_ntop(
int af,
const void* src,
char* dst,
size_t size);
122 static const Data UInt8ToStr[256];
135 static int inet_pton(
int af,
const char * src,
void * dst);
154 static Data lookupLocalHostName();
Handles cross-platform sockets compatibility.
The abstract base-class for all exceptions thrown by resip code.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
static const Data Empty
Constant that represents a zero-length data.
Exception(const Data &msg, const Data &file, const int line)
const char * name() const noexcept override
Provides a collection of utility functions for manipulating DNS names and IP addresses and discoverin...
static bool isIpV6Address(const Data &ipAddress)
static Data canonicalizeIpV6Address(const Data &ipV6Address)
Converts the printable form of an IPv6 address into consistent format so that string comparisons will...
static Data getLocalDomainName()
static std::list< std::pair< Data, Data > > getInterfaces(const Data &matchingInterface=Data::Empty)
static bool isIpAddress(const Data &ipAddress)
static const Data & getLocalHostName()
static int inet_pton(const Data &printableIp, struct in_addr &dst)
Convert from the presentation format of the IPv4 address to struct in_addr.
static Data inet_ntop(const struct in_addr &addr)
Converts from the network format to presentation format.
static bool isIpV4Address(const Data &ipAddress)
static std::list< Data > lookupARecords(const Data &host)
Used to synchronously query A records - only for test code usage.
static Data getLocalIpAddress(const Data &defaultInterface=Data::Empty)
Gets the IP address of "the" local interface.
dcm! – add UnusedChecking(_enum) below;