Class that represent DNS resource records.
More...
#include <dns.h>
Class that represent DNS resource records.
Tins::DNS::resource::resource |
( |
std::string |
dname, |
|
|
std::string |
data, |
|
|
uint16_t |
type, |
|
|
uint16_t |
rclass, |
|
|
uint32_t |
ttl, |
|
|
uint16_t |
preference = 0 |
|
) |
| |
|
inline |
Constructs a Resource object.
- Parameters
-
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. |
const std::string& Tins::DNS::resource::data |
( |
| ) |
const |
|
inline |
Getter for the data field.
void Tins::DNS::resource::data |
( |
const std::string & |
data | ) |
|
|
inline |
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.
void Tins::DNS::resource::data |
( |
const soa_record & |
data | ) |
|
|
inline |
Sets the contents of this resource to the provided SOA record.
- Parameters
-
data | The SOA record that will be stored in this resource |
const std::string& Tins::DNS::resource::dname |
( |
| ) |
const |
|
inline |
Getter for the domain name field.
This returns the domain name for which this record provides an answer.
void Tins::DNS::resource::dname |
( |
const std::string & |
data | ) |
|
|
inline |
Setter for the domain name field.
uint16_t Tins::DNS::resource::preference |
( |
| ) |
const |
|
inline |
Getter for the preferece field.
This field is only valid for MX resources.
void Tins::DNS::resource::preference |
( |
uint16_t |
data | ) |
|
|
inline |
Setter for the preference field.
This field is only valid for MX resources.
uint16_t Tins::DNS::resource::query_class |
( |
| ) |
const |
|
inline |
Getter for the query class field.
void Tins::DNS::resource::query_class |
( |
uint16_t |
data | ) |
|
|
inline |
Setter for the query class field.
uint16_t Tins::DNS::resource::query_type |
( |
| ) |
const |
|
inline |
Getter for the query type field.
void Tins::DNS::resource::query_type |
( |
uint16_t |
data | ) |
|
|
inline |
Setter for the query type field.
Tins::DNS::resource::TINS_DEPRECATED |
( |
uint16_t type() |
const | ) |
|
|
inline |
Tins::DNS::resource::TINS_DEPRECATED |
( |
void |
typeuint16_t data | ) |
|
|
inline |
uint32_t Tins::DNS::resource::ttl |
( |
| ) |
const |
|
inline |
Getter for the time-to-live field.
void Tins::DNS::resource::ttl |
( |
uint32_t |
data | ) |
|
|
inline |
Setter for the time-to-live field.
The documentation for this class was generated from the following file:
- /home/matias/Projects/libtins/code/include/tins/dns.h