---
title: llarp::dns::ResourceRecord

---

# llarp::dns::ResourceRecord





## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[ResourceRecord](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**() =default |
| | **[ResourceRecord](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**(std::string name, RRType type, [RData](Classes/classllarp_1_1dns_1_1RData.md) rdata, uint32_t ttl) |
| | **[ResourceRecord](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**([byte_view_t](Namespaces/namespacellarp.md#typedef-byte-view-t) & raw)<br>construct from raw bytes, modifies raw.  |
| [bstring_t](Namespaces/namespacellarp.md#using-bstring-t) | **[encode_dns](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-encode-dns)**() const |
| util::StatusObject | **[to_json](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-to-json)**() const |
| std::string | **[ToString](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-tostring)**() const |
| bool | **[HasCNameForTLD](Classes/classllarp_1_1dns_1_1ResourceRecord.md#function-hascnamefortld)**(const std::string & tld) const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::vector< std::string > | **[rr_name_labels](Classes/classllarp_1_1dns_1_1ResourceRecord.md#variable-rr-name-labels)**  |
| RRType | **[rr_type](Classes/classllarp_1_1dns_1_1ResourceRecord.md#variable-rr-type)**  |
| uint32_t | **[rr_ttl](Classes/classllarp_1_1dns_1_1ResourceRecord.md#variable-rr-ttl)**  |
| [RData](Classes/classllarp_1_1dns_1_1RData.md) | **[rr_data](Classes/classllarp_1_1dns_1_1ResourceRecord.md#variable-rr-data)**  |

## Public Functions Documentation

### function ResourceRecord

```cpp
ResourceRecord() =default
```


### function ResourceRecord

```cpp
ResourceRecord(
    std::string name,
    RRType type,
    RData rdata,
    uint32_t ttl
)
```


### function ResourceRecord

```cpp
explicit ResourceRecord(
    byte_view_t & raw
)
```

construct from raw bytes, modifies raw. 

### function encode_dns

```cpp
bstring_t encode_dns() const
```


### function to_json

```cpp
util::StatusObject to_json() const
```


### function ToString

```cpp
std::string ToString() const
```


### function HasCNameForTLD

```cpp
bool HasCNameForTLD(
    const std::string & tld
) const
```


## Public Attributes Documentation

### variable rr_name_labels

```cpp
std::vector< std::string > rr_name_labels;
```


### variable rr_type

```cpp
RRType rr_type;
```


### variable rr_ttl

```cpp
uint32_t rr_ttl;
```


### variable rr_data

```cpp
RData rr_data;
```


-------------------------------

Updated on 2023-04-27 at 04:17:17 +0000