libtins 4.5
|
Class that represent DNS resource records. More...
#include <dns.h>
Public Member Functions | |
resource (std::string dname, std::string data, uint16_t type, uint16_t rclass, uint32_t ttl, uint16_t preference=0) | |
const std::string & | dname () const |
Getter for the domain name field. | |
const std::string & | data () const |
uint16_t | query_type () const |
TINS_DEPRECATED (uint16_t type() const) | |
Getter for the query type field. | |
uint16_t | query_class () const |
uint32_t | ttl () const |
uint16_t | preference () const |
Getter for the preferece field. | |
void | dname (const std::string &data) |
void | data (const std::string &data) |
Setter for the data field. | |
void | data (const soa_record &data) |
Sets the contents of this resource to the provided SOA record. | |
void | query_type (uint16_t data) |
TINS_DEPRECATED (void type(uint16_t data)) | |
Setter for the query type field. | |
void | query_class (uint16_t data) |
void | ttl (uint32_t data) |
void | preference (uint16_t data) |
Setter for the preference field. | |
Class that represent DNS resource records.
|
inline |
Constructs a Resource object.
dname | The domain name for which this records provides an answer. |
data | The resource's payload. |
type | The type of this record. |
rclass | The class of this record. |
ttl | The time-to-live of this record. |
|
inline |
Getter for the data field.
|
inline |
Sets the contents of this resource to the provided SOA record.
data | The SOA record that will be stored in this resource |
Setter for the data field.
The data will be encoded properly by the DNS class before being added to this packet. That means that if the type is A or AAAA, it will be properly encoded as an IPv4 or IPv6 address.
The same happens for records that contain domain names, such as NS or CNAME. This data will be encoded using DNS domain name encoding.
|
inline |
Getter for the domain name field.
This returns the domain name for which this record provides an answer.
Setter for the domain name field.
|
inline |
Getter for the preferece field.
This field is only valid for MX resources.
Setter for the preference field.
This field is only valid for MX resources.
|
inline |
Getter for the query class field.
|
inline |
Getter for the query type field.
Getter for the query type field.
This method is deprecated. Use resource::query_type
|
inline |
Setter for the query type field.
This method is deprecated. Use query::query_type
|
inline |
Getter for the time-to-live field.