---
title: llarp::dht::GotRouterMessage

---

# llarp::dht::GotRouterMessage





Inherits from [llarp::dht::IMessage](Classes/structllarp_1_1dht_1_1IMessage.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(const [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) & from, bool tunneled) |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(const [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) & from, uint64_t id, const std::vector< [RouterContact](Classes/structllarp_1_1RouterContact.md) > & results, bool tunneled) |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(const [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) & from, const [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) & closer, uint64_t id, bool tunneled) |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(uint64_t id, std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > _near, bool tunneled) |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(const [RouterContact](Classes/structllarp_1_1RouterContact.md) rc)<br>gossip message  |
| | **[GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-gotroutermessage)**(const [GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md) & other) |
| | **[~GotRouterMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-~gotroutermessage)**() override |
| virtual bool | **[BEncode](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const override |
| virtual bool | **[DecodeKey](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-decodekey)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & key, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * val) override |
| bool | **[HandleMessage](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#function-handlemessage)**([llarp_dht_context](Classes/structllarp__dht__context.md) * ctx, std::vector< std::unique_ptr< [IMessage](Classes/structllarp_1_1dht_1_1IMessage.md) >> & replies) const override |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::vector< [RouterContact](Classes/structllarp_1_1RouterContact.md) > | **[foundRCs](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#variable-foundrcs)**  |
| std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > | **[nearKeys](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#variable-nearkeys)**  |
| std::unique_ptr< [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) > | **[closerTarget](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#variable-closertarget)**  |
| uint64_t | **[txid](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#variable-txid)**  |
| bool | **[relayed](Classes/structllarp_1_1dht_1_1GotRouterMessage.md#variable-relayed)**  |

## Additional inherited members

**Public Types inherited from [llarp::dht::IMessage](Classes/structllarp_1_1dht_1_1IMessage.md)**

|                | Name           |
| -------------- | -------------- |
| using std::unique_ptr< [IMessage](Classes/structllarp_1_1dht_1_1IMessage.md) > | **[Ptr_t](Classes/structllarp_1_1dht_1_1IMessage.md#using-ptr-t)**  |

**Public Functions inherited from [llarp::dht::IMessage](Classes/structllarp_1_1dht_1_1IMessage.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~IMessage](Classes/structllarp_1_1dht_1_1IMessage.md#function-~imessage)**() =default |
| | **[IMessage](Classes/structllarp_1_1dht_1_1IMessage.md#function-imessage)**(const [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) & from)<br>construct  |

**Public Attributes inherited from [llarp::dht::IMessage](Classes/structllarp_1_1dht_1_1IMessage.md)**

|                | Name           |
| -------------- | -------------- |
| [Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) | **[From](Classes/structllarp_1_1dht_1_1IMessage.md#variable-from)**  |
| [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[pathID](Classes/structllarp_1_1dht_1_1IMessage.md#variable-pathid)**  |
| uint64_t | **[version](Classes/structllarp_1_1dht_1_1IMessage.md#variable-version)**  |


## Public Functions Documentation

### function GotRouterMessage

```cpp
inline GotRouterMessage(
    const Key_t & from,
    bool tunneled
)
```


### function GotRouterMessage

```cpp
inline GotRouterMessage(
    const Key_t & from,
    uint64_t id,
    const std::vector< RouterContact > & results,
    bool tunneled
)
```


### function GotRouterMessage

```cpp
inline GotRouterMessage(
    const Key_t & from,
    const Key_t & closer,
    uint64_t id,
    bool tunneled
)
```


### function GotRouterMessage

```cpp
inline GotRouterMessage(
    uint64_t id,
    std::vector< RouterID > _near,
    bool tunneled
)
```


### function GotRouterMessage

```cpp
inline GotRouterMessage(
    const RouterContact rc
)
```

gossip message 

### function GotRouterMessage

```cpp
inline GotRouterMessage(
    const GotRouterMessage & other
)
```


### function ~GotRouterMessage

```cpp
~GotRouterMessage() override
```


### function BEncode

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


**Reimplements**: [llarp::dht::IMessage::BEncode](Classes/structllarp_1_1dht_1_1IMessage.md#function-bencode)


### function DecodeKey

```cpp
virtual bool DecodeKey(
    const llarp_buffer_t & key,
    llarp_buffer_t * val
) override
```


**Reimplements**: [llarp::dht::IMessage::DecodeKey](Classes/structllarp_1_1dht_1_1IMessage.md#function-decodekey)


### function HandleMessage

```cpp
bool HandleMessage(
    llarp_dht_context * ctx,
    std::vector< std::unique_ptr< IMessage >> & replies
) const override
```


## Public Attributes Documentation

### variable foundRCs

```cpp
std::vector< RouterContact > foundRCs;
```


### variable nearKeys

```cpp
std::vector< RouterID > nearKeys;
```


### variable closerTarget

```cpp
std::unique_ptr< Key_t > closerTarget;
```


### variable txid

```cpp
uint64_t txid = 0;
```


### variable relayed

```cpp
bool relayed = false;
```


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

Updated on 2023-01-06 at 19:35:06 +0000