---
title: llarp::dns::MessageHeader

---

# llarp::dns::MessageHeader





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

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[MessageHeader](Classes/structllarp_1_1dns_1_1MessageHeader.md#function-messageheader)**() =default |
| virtual bool | **[Encode](Classes/structllarp_1_1dns_1_1MessageHeader.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_1MessageHeader.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_1MessageHeader.md#function-tojson)**() const override<br>convert this whatever into json  |
| bool | **[operator==](Classes/structllarp_1_1dns_1_1MessageHeader.md#function-operator==)**(const [MessageHeader](Classes/structllarp_1_1dns_1_1MessageHeader.md) & other) const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| constexpr size_t | **[Size](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-size)**  |
| MsgID_t | **[id](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-id)**  |
| Fields_t | **[fields](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-fields)**  |
| Count_t | **[qd_count](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-qd-count)**  |
| Count_t | **[an_count](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-an-count)**  |
| Count_t | **[ns_count](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-ns-count)**  |
| Count_t | **[ar_count](Classes/structllarp_1_1dns_1_1MessageHeader.md#variable-ar-count)**  |

## 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 MessageHeader

```cpp
MessageHeader() =default
```


### 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 operator==

```cpp
inline bool operator==(
    const MessageHeader & other
) const
```


## Public Attributes Documentation

### variable Size

```cpp
static constexpr size_t Size = 12;
```


### variable id

```cpp
MsgID_t id;
```


### variable fields

```cpp
Fields_t fields;
```


### variable qd_count

```cpp
Count_t qd_count;
```


### variable an_count

```cpp
Count_t an_count;
```


### variable ns_count

```cpp
Count_t ns_count;
```


### variable ar_count

```cpp
Count_t ar_count;
```


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

Updated on 2022-11-17 at 22:27:41 +0000