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

---

# llarp::dns::ResourceRecord





Inherits from [llarp::dns::Serialize](Classes/structllarp_1_1dns_1_1Serialize.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**() =default |
| | **[ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**(const [ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md) & other) |
| | **[ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**([ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md) && other) |
| | **[ResourceRecord](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-resourcerecord)**(std::string name, RRType_t type, RR_RData_t rdata) |
| virtual bool | **[Encode](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-encode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const override<br>encode entity to buffer  |
| virtual bool | **[Decode](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-decode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) override<br>decode entity from buffer  |
| virtual util::StatusObject | **[ToJSON](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-tojson)**() const override<br>convert this whatever into json  |
| std::string | **[ToString](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-tostring)**() const |
| bool | **[HasCNameForTLD](Classes/structllarp_1_1dns_1_1ResourceRecord.md#function-hascnamefortld)**(const std::string & tld) const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::string | **[rr_name](Classes/structllarp_1_1dns_1_1ResourceRecord.md#variable-rr-name)**  |
| RRType_t | **[rr_type](Classes/structllarp_1_1dns_1_1ResourceRecord.md#variable-rr-type)**  |
| RRClass_t | **[rr_class](Classes/structllarp_1_1dns_1_1ResourceRecord.md#variable-rr-class)**  |
| RR_TTL_t | **[ttl](Classes/structllarp_1_1dns_1_1ResourceRecord.md#variable-ttl)**  |
| RR_RData_t | **[rData](Classes/structllarp_1_1dns_1_1ResourceRecord.md#variable-rdata)**  |

## Additional inherited members

**Public Functions inherited from [llarp::dns::Serialize](Classes/structllarp_1_1dns_1_1Serialize.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~Serialize](Classes/structllarp_1_1dns_1_1Serialize.md#function-~serialize)**() =0 |


## Public Functions Documentation

### function ResourceRecord

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


### function ResourceRecord

```cpp
ResourceRecord(
    const ResourceRecord & other
)
```


### function ResourceRecord

```cpp
ResourceRecord(
    ResourceRecord && other
)
```


### function ResourceRecord

```cpp
explicit ResourceRecord(
    std::string name,
    RRType_t type,
    RR_RData_t rdata
)
```


### function Encode

```cpp
virtual bool Encode(
    llarp_buffer_t * buf
) const override
```

encode entity to buffer 

**Reimplements**: [llarp::dns::Serialize::Encode](Classes/structllarp_1_1dns_1_1Serialize.md#function-encode)


### function Decode

```cpp
virtual bool Decode(
    llarp_buffer_t * buf
) override
```

decode entity from buffer 

**Reimplements**: [llarp::dns::Serialize::Decode](Classes/structllarp_1_1dns_1_1Serialize.md#function-decode)


### function ToJSON

```cpp
virtual util::StatusObject ToJSON() const override
```

convert this whatever into json 

**Reimplements**: [llarp::dns::Serialize::ToJSON](Classes/structllarp_1_1dns_1_1Serialize.md#function-tojson)


### function ToString

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


### function HasCNameForTLD

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


## Public Attributes Documentation

### variable rr_name

```cpp
std::string rr_name;
```


### variable rr_type

```cpp
RRType_t rr_type;
```


### variable rr_class

```cpp
RRClass_t rr_class;
```


### variable ttl

```cpp
RR_TTL_t ttl;
```


### variable rData

```cpp
RR_RData_t rData;
```


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

Updated on 2023-01-26 at 19:35:17 +0000