EpcTools
An event based multi-threaded C++ development framework.
|
Go to the documentation of this file.
26 #include <netinet/in.h>
27 #include <arpa/nameser.h>
28 #include <arpa/inet.h>
47 Question(
const std::string& qname, ns_type qtype, ns_class qclass )
67 std::cout <<
"Question:"
68 <<
" qtype=" << m_qtype
69 <<
" qclass=" << m_qclass
70 <<
" qname=" << m_qname
86 class QuestionList :
public std::list<Question*>
94 Question *q = *begin();
123 m_expires( time(NULL) + ttl )
154 std::cout <<
"ResourceRecord:"
175 class ResourceRecordList :
public std::list<ResourceRecord*>
178 ResourceRecordList() {}
179 ~ResourceRecordList()
183 ResourceRecord *rr = *begin();
204 const struct in_addr &address )
207 memcpy( &m_address, &address,
sizeof(m_address) );
218 char address[ INET_ADDRSTRLEN ];
219 inet_ntop( AF_INET, &m_address, address,
sizeof(address) );
226 std::cout <<
"RRecordA:"
237 struct in_addr m_address;
253 const std::string &ns )
264 std::cout <<
"RRecordNS:"
291 const struct in6_addr &address )
294 memcpy( &m_address, &address,
sizeof(m_address) );
301 char address[ INET6_ADDRSTRLEN ];
302 inet_ntop( AF_INET6, &m_address, address,
sizeof(address) );
309 std::cout <<
"RRecordAAAA:"
320 struct in6_addr m_address;
336 const std::string &alias )
347 std::cout <<
"RRecordCNAME:"
380 const std::string &target)
382 m_priority( priority ),
405 std::cout <<
"RRecordSRV:"
452 const std::string &flags,
453 const std::string &service,
454 const std::string ®exp,
455 const std::string &replacement )
458 m_preference( preference ),
460 m_service( service ),
462 m_replacement( replacement )
470 const uint16_t
getOrder()
const {
return m_order; }
493 std::cout <<
"RRecordNAPTR:"
510 uint16_t m_preference;
518 #endif // #ifdef __DNSRECORD_H
RRecordA(const std::string &name, int32_t ttl, const struct in_addr &address)
Class constructor.
Definition: dnsrecord.h:202
Bool isExpired()
Determines if this resource record has expired.
Definition: dnsrecord.h:149
virtual Void dump()
Prints the contents fo this SRV record.
Definition: dnsrecord.h:403
EString getAddressString()
Definition: dnsrecord.h:299
time_t getExpires()
Retrieves the expiration time of this resource record.
Definition: dnsrecord.h:145
const EString & getReplacement()
Retrieves the replacement string associated with this NAPTR record.
Definition: dnsrecord.h:488
virtual Void dump()
Prints the contents fo this CNAME record.
Definition: dnsrecord.h:345
const EString & getTarget()
The domain name of the target host.
Definition: dnsrecord.h:400
const struct in6_addr & getAddress()
Definition: dnsrecord.h:297
ns_type getQType()
Retrieves the query type for the requested resource.
Definition: dnsrecord.h:59
uint32_t getTTL()
Retrieves the time interval (in seconds) that the resource record may be cached before it should be d...
Definition: dnsrecord.h:142
Represents an NAPTR resource record.
Definition: dnsrecord.h:429
EString & getQName()
Retrieves the query name of the requested resource.
Definition: dnsrecord.h:56
const EString & getAlias()
Definition: dnsrecord.h:342
virtual Void dump()
Prints the contents fo this AAAA record.
Definition: dnsrecord.h:307
uint16_t getWeight()
Retrieves.
Definition: dnsrecord.h:394
Represents a DNS Resource Record.
Definition: dnsrecord.h:106
virtual Void dump()
Prints the contents fo this NAPTR record.
Definition: dnsrecord.h:491
virtual Void dump()
Prints the contents of this resource record.
Definition: dnsrecord.h:152
uint16_t getPriority()
Retrieves the priority of this target host.
Definition: dnsrecord.h:391
const uint16_t getOrder() const
Retrieves the order in which the NAPTR records MUST be processed in order to accurately represent the...
Definition: dnsrecord.h:470
const EString & getNamedServer()
Definition: dnsrecord.h:259
Represents an SRV resource record.
Definition: dnsrecord.h:365
const struct in_addr & getAddress()
Retrieves the IP address for this A record.
Definition: dnsrecord.h:212
ns_class getQClass()
Retrieves the class of the query.
Definition: dnsrecord.h:62
RRecordNAPTR(const std::string &name, int32_t ttl, uint16_t order, uint16_t preference, const std::string &flags, const std::string &service, const std::string ®exp, const std::string &replacement)
Class constructor.
Definition: dnsrecord.h:448
const EString & getName()
Retrieves the domain name to which this resource record pertains.
Definition: dnsrecord.h:131
const EString & getFlags()
Retrieves the flags associated with this NAPTR record.
Definition: dnsrecord.h:478
const EString & getService()
Retrieves the Service Parameters applicable to this this delegation path.
Definition: dnsrecord.h:482
RRecordSRV(const std::string &name, int32_t ttl, uint16_t priority, uint16_t weight, uint16_t port, const std::string &target)
Class constructor.
Definition: dnsrecord.h:375
const uint16_t getPreference() const
Retrieves he order in which NAPTR records with equal Order values SHOULD be processed,...
Definition: dnsrecord.h:475
virtual ~ResourceRecord()
Class destructor.
Definition: dnsrecord.h:127
Represents an A resource record.
Definition: dnsrecord.h:195
Represents an NS resource record.
Definition: dnsrecord.h:244
ResourceRecord(const std::string &name, ns_type rtype, ns_class rclass, int32_t ttl)
Class constructor.
Definition: dnsrecord.h:115
EString getAddressString()
Convert the IPv4 address to a string.
Definition: dnsrecord.h:216
Question(const std::string &qname, ns_type qtype, ns_class qclass)
Class constructor.
Definition: dnsrecord.h:47
Represents an CNAME resource record.
Definition: dnsrecord.h:327
Definition: dnscache.h:33
String class.
Definition: estring.h:30
ns_class getClass()
Retrieves the class of the data in the RDATA field.
Definition: dnsrecord.h:137
Represents the question for the name server.
Definition: dnsrecord.h:40
Represents an AAAA resource record.
Definition: dnsrecord.h:282
const EString & getRegexp()
Retrieves the regular expression associated with this NAPTR record.
Definition: dnsrecord.h:485
ns_type getType()
Retrieves the resource type.
Definition: dnsrecord.h:134
Encapsulates and extends a std::string object.
RRecordNS(const std::string &name, int32_t ttl, const std::string &ns)
Class constructor.
Definition: dnsrecord.h:251
virtual Void dump()
Prints the contents fo this A record.
Definition: dnsrecord.h:224
RRecordAAAA(const std::string &name, int32_t ttl, const struct in6_addr &address)
Class constructor.
Definition: dnsrecord.h:289
virtual Void dump()
Prints the contents fo this NS record.
Definition: dnsrecord.h:262
uint16_t getPort()
Retrieves the relative weight for entries with the same priority.
Definition: dnsrecord.h:397
Void dump()
Prints the contents the stdout.
Definition: dnsrecord.h:65
RRecordCNAME(const std::string &name, int32_t ttl, const std::string &alias)
Class constructor.
Definition: dnsrecord.h:334