---
title: llarp::ILinkMessage
summary: parsed link layer message 

---

# llarp::ILinkMessage



parsed link layer message 


`#include <link_message.hpp>`

Inherited by [llarp::DHTImmediateMessage](Classes/structllarp_1_1DHTImmediateMessage.md), [llarp::DiscardMessage](Classes/structllarp_1_1DiscardMessage.md), [llarp::LR_CommitMessage](Classes/structllarp_1_1LR__CommitMessage.md), [llarp::LR_StatusMessage](Classes/structllarp_1_1LR__StatusMessage.md), [llarp::LinkIntroMessage](Classes/structllarp_1_1LinkIntroMessage.md), [llarp::RelayDownstreamMessage](Classes/structllarp_1_1RelayDownstreamMessage.md), [llarp::RelayUpstreamMessage](Classes/structllarp_1_1RelayUpstreamMessage.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[ILinkMessage](Classes/structllarp_1_1ILinkMessage.md#function-ilinkmessage)**() =default |
| virtual | **[~ILinkMessage](Classes/structllarp_1_1ILinkMessage.md#function-~ilinkmessage)**() =default |
| virtual bool | **[DecodeKey](Classes/structllarp_1_1ILinkMessage.md#function-decodekey)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & key, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * val) =0 |
| bool | **[BDecode](Classes/structllarp_1_1ILinkMessage.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| virtual bool | **[BEncode](Classes/structllarp_1_1ILinkMessage.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const =0 |
| virtual bool | **[HandleMessage](Classes/structllarp_1_1ILinkMessage.md#function-handlemessage)**([AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * router) const =0 |
| virtual void | **[Clear](Classes/structllarp_1_1ILinkMessage.md#function-clear)**() =0 |
| virtual const char * | **[Name](Classes/structllarp_1_1ILinkMessage.md#function-name)**() const =0 |
| virtual uint16_t | **[Priority](Classes/structllarp_1_1ILinkMessage.md#function-priority)**() const<br>get message prority, higher value means more important  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [ILinkSession](Classes/structllarp_1_1ILinkSession.md) * | **[session](Classes/structllarp_1_1ILinkMessage.md#variable-session)** <br>who did this message come from or is going to  |
| uint64_t | **[version](Classes/structllarp_1_1ILinkMessage.md#variable-version)**  |
| [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[pathid](Classes/structllarp_1_1ILinkMessage.md#variable-pathid)**  |

## Public Functions Documentation

### function ILinkMessage

```cpp
ILinkMessage() =default
```


### function ~ILinkMessage

```cpp
virtual ~ILinkMessage() =default
```


### function DecodeKey

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


**Reimplemented by**: [llarp::DHTImmediateMessage::DecodeKey](Classes/structllarp_1_1DHTImmediateMessage.md#function-decodekey), [llarp::DiscardMessage::DecodeKey](Classes/structllarp_1_1DiscardMessage.md#function-decodekey), [llarp::LinkIntroMessage::DecodeKey](Classes/structllarp_1_1LinkIntroMessage.md#function-decodekey), [llarp::RelayUpstreamMessage::DecodeKey](Classes/structllarp_1_1RelayUpstreamMessage.md#function-decodekey), [llarp::RelayDownstreamMessage::DecodeKey](Classes/structllarp_1_1RelayDownstreamMessage.md#function-decodekey), [llarp::LR_CommitMessage::DecodeKey](Classes/structllarp_1_1LR__CommitMessage.md#function-decodekey), [llarp::LR_StatusMessage::DecodeKey](Classes/structllarp_1_1LR__StatusMessage.md#function-decodekey)


### function BDecode

```cpp
inline bool BDecode(
    llarp_buffer_t * buf
)
```


### function BEncode

```cpp
virtual bool BEncode(
    llarp_buffer_t * buf
) const =0
```


**Reimplemented by**: [llarp::DHTImmediateMessage::BEncode](Classes/structllarp_1_1DHTImmediateMessage.md#function-bencode), [llarp::DiscardMessage::BEncode](Classes/structllarp_1_1DiscardMessage.md#function-bencode), [llarp::LinkIntroMessage::BEncode](Classes/structllarp_1_1LinkIntroMessage.md#function-bencode), [llarp::RelayUpstreamMessage::BEncode](Classes/structllarp_1_1RelayUpstreamMessage.md#function-bencode), [llarp::RelayDownstreamMessage::BEncode](Classes/structllarp_1_1RelayDownstreamMessage.md#function-bencode), [llarp::LR_CommitMessage::BEncode](Classes/structllarp_1_1LR__CommitMessage.md#function-bencode), [llarp::LR_StatusMessage::BEncode](Classes/structllarp_1_1LR__StatusMessage.md#function-bencode)


### function HandleMessage

```cpp
virtual bool HandleMessage(
    AbstractRouter * router
) const =0
```


**Reimplemented by**: [llarp::DiscardMessage::HandleMessage](Classes/structllarp_1_1DiscardMessage.md#function-handlemessage), [llarp::DHTImmediateMessage::HandleMessage](Classes/structllarp_1_1DHTImmediateMessage.md#function-handlemessage), [llarp::LinkIntroMessage::HandleMessage](Classes/structllarp_1_1LinkIntroMessage.md#function-handlemessage), [llarp::RelayUpstreamMessage::HandleMessage](Classes/structllarp_1_1RelayUpstreamMessage.md#function-handlemessage), [llarp::RelayDownstreamMessage::HandleMessage](Classes/structllarp_1_1RelayDownstreamMessage.md#function-handlemessage), [llarp::LR_CommitMessage::HandleMessage](Classes/structllarp_1_1LR__CommitMessage.md#function-handlemessage), [llarp::LR_StatusMessage::HandleMessage](Classes/structllarp_1_1LR__StatusMessage.md#function-handlemessage)


### function Clear

```cpp
virtual void Clear() =0
```


**Reimplemented by**: [llarp::DHTImmediateMessage::Clear](Classes/structllarp_1_1DHTImmediateMessage.md#function-clear), [llarp::DiscardMessage::Clear](Classes/structllarp_1_1DiscardMessage.md#function-clear), [llarp::LinkIntroMessage::Clear](Classes/structllarp_1_1LinkIntroMessage.md#function-clear), [llarp::RelayUpstreamMessage::Clear](Classes/structllarp_1_1RelayUpstreamMessage.md#function-clear), [llarp::RelayDownstreamMessage::Clear](Classes/structllarp_1_1RelayDownstreamMessage.md#function-clear), [llarp::LR_CommitMessage::Clear](Classes/structllarp_1_1LR__CommitMessage.md#function-clear), [llarp::LR_StatusMessage::Clear](Classes/structllarp_1_1LR__StatusMessage.md#function-clear)


### function Name

```cpp
virtual const char * Name() const =0
```


**Reimplemented by**: [llarp::DHTImmediateMessage::Name](Classes/structllarp_1_1DHTImmediateMessage.md#function-name), [llarp::DiscardMessage::Name](Classes/structllarp_1_1DiscardMessage.md#function-name), [llarp::LinkIntroMessage::Name](Classes/structllarp_1_1LinkIntroMessage.md#function-name), [llarp::RelayUpstreamMessage::Name](Classes/structllarp_1_1RelayUpstreamMessage.md#function-name), [llarp::RelayDownstreamMessage::Name](Classes/structllarp_1_1RelayDownstreamMessage.md#function-name), [llarp::LR_CommitMessage::Name](Classes/structllarp_1_1LR__CommitMessage.md#function-name), [llarp::LR_StatusMessage::Name](Classes/structllarp_1_1LR__StatusMessage.md#function-name)


### function Priority

```cpp
inline virtual uint16_t Priority() const
```

get message prority, higher value means more important 

**Reimplemented by**: [llarp::LinkIntroMessage::Priority](Classes/structllarp_1_1LinkIntroMessage.md#function-priority), [llarp::RelayUpstreamMessage::Priority](Classes/structllarp_1_1RelayUpstreamMessage.md#function-priority), [llarp::RelayDownstreamMessage::Priority](Classes/structllarp_1_1RelayDownstreamMessage.md#function-priority), [llarp::LR_CommitMessage::Priority](Classes/structllarp_1_1LR__CommitMessage.md#function-priority), [llarp::LR_StatusMessage::Priority](Classes/structllarp_1_1LR__StatusMessage.md#function-priority)


## Public Attributes Documentation

### variable session

```cpp
ILinkSession * session = nullptr;
```

who did this message come from or is going to 

### variable version

```cpp
uint64_t version = llarp::constants::proto_version;
```


### variable pathid

```cpp
PathID_t pathid;
```


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

Updated on 2023-01-20 at 23:19:39 +0000