31#ifndef ASYNC_DNS_RESOURCE_RECORD_INCLUDED
32#define ASYNC_DNS_RESOURCE_RECORD_INCLUDED
128 static const std::map<Type, std::string> type_map = {
132 static const std::string UNKNOWN =
"?";
133 const auto& it = type_map.find(
type);
134 if (it == type_map.end())
178 std::ostringstream os;
185 const std::string&
name(
void)
const {
return m_name; }
188 uint32_t
ttl(
void)
const {
return m_ttl; }
210 std::ostringstream os;
229 const std::string&
dname=
"")
236 std::ostringstream os;
242 const std::string&
dname(
void)
const {
return m_dname; }
255 const std::string&
cname=
"")
262 std::ostringstream os;
268 const std::string&
cname(
void)
const {
return m_cname; }
290 std::ostringstream os;
297 unsigned int prio(
void)
const {
return m_prio; }
300 unsigned int weight(
void)
const {
return m_weight; }
303 unsigned int port(
void)
const {
return m_port; }
306 const std::string&
target(
void)
const {
return m_target; }
310 unsigned int m_weight;
312 std::string m_target;
Platform independent representation of an IP address.
A class for representing an A DNS resource record.
static const Type staticType(void)
const Ip & ip(void) const
The IP address for this record.
const IpAddress & ip(void) const
DnsResourceRecordA(const std::string &name, uint32_t ttl, const IpAddress &ip=IpAddress())
virtual std::string toString(void) const
The string representation of this record.
void setIp(const IpAddress &ip)
~DnsResourceRecordA(void)
virtual const Type type(void) const
The type of record.
A class for representing a CNAME DNS resource record.
const CName & cname(void) const
The FQDN for this record.
~DnsResourceRecordCNAME(void)
static const Type staticType(void)
virtual std::string toString(void) const
The string representation of this record.
void setName(const std::string &cname)
const std::string & cname(void) const
DnsResourceRecordCNAME(const std::string &name, uint32_t ttl, const std::string &cname="")
virtual const Type type(void) const
The type of record.
A class for representing a PTR DNS resource record.
DnsResourceRecordPTR(const std::string &name, uint32_t ttl, const std::string &dname="")
const DName & dname(void) const
The FQDN for this record.
void setName(const std::string &dname)
const std::string & dname(void) const
~DnsResourceRecordPTR(void)
static const Type staticType(void)
virtual std::string toString(void) const
The string representation of this record.
virtual const Type type(void) const
The type of record.
A class for representing a SRV DNS resource record.
void setPrio(unsigned int prio)
unsigned int prio(void) const
Prio prio(void) const
The prio for this record.
DnsResourceRecordSRV(const std::string &name, uint32_t ttl, unsigned int prio, unsigned int weight, unsigned int port, const std::string &target)
~DnsResourceRecordSRV(void)
void setWeight(unsigned int weight)
unsigned int port(void) const
Port port(void) const
The network port for this record.
Weight weight(void) const
The weight for this record.
unsigned int weight(void) const
const Target & target(void) const
The FQDN for this record.
virtual std::string toString(void) const
The string representation of this record.
const std::string & target(void) const
static const Type staticType(void)
void setTarget(const std::string &target)
virtual const Type type(void) const
The type of record.
void setPort(unsigned int port)
The base class for representing a DNS resource record.
const std::string & typeStr(void) const
DnsResourceRecord & operator=(const DnsResourceRecord &)=delete
Disallow copy assignment.
virtual ~DnsResourceRecord(void)
Destructor.
virtual std::string toString(void) const
DnsResourceRecord(const std::string &name, uint32_t ttl)
Default constructor.
const Name & name(void) const
The name of this record.
void setName(const std::string &name)
static const std::string & typeToString(Type type)
DnsResourceRecord(const DnsResourceRecord &)=delete
Disallow copy construction.
virtual const Type type(void) const =0
The type of record.
const std::string & name(void) const
const char * classStr(void) const
Class classId(void) const
A_brief_member_function_description.
Ttl ttl(void) const
The TTL for this record.
void setTtl(uint32_t ttl)
A class for representing an IP address in an OS independent way.
Namespace for the asynchronous programming classes.