---
title: llarp::service::ProtocolFrame
summary: outer message 

---

# llarp::service::ProtocolFrame



outer message 


`#include <protocol.hpp>`

Inherits from [llarp::routing::IMessage](Classes/structllarp_1_1routing_1_1IMessage.md)

## Public Types

|                | Name           |
| -------------- | -------------- |
| using [Encrypted](Classes/structllarp_1_1Encrypted.md)< 2048 > | **[Encrypted_t](Classes/structllarp_1_1service_1_1ProtocolFrame.md#using-encrypted-t)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-protocolframe)**(const [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & other) |
| | **[ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-protocolframe)**() |
| | **[~ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-~protocolframe)**() override |
| bool | **[operator==](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-operator==)**(const [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & other) const |
| bool | **[operator!=](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-operator!=)**(const [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & other) const |
| [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & | **[operator=](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-operator=)**(const [ProtocolFrame](Classes/structllarp_1_1service_1_1ProtocolFrame.md) & other) |
| bool | **[EncryptAndSign](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-encryptandsign)**(const [ProtocolMessage](Classes/structllarp_1_1service_1_1ProtocolMessage.md) & msg, const [SharedSecret](Classes/structllarp_1_1AlignedBuffer.md) & sharedkey, const [Identity](Classes/structllarp_1_1service_1_1Identity.md) & localIdent) |
| bool | **[Sign](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-sign)**(const [Identity](Classes/structllarp_1_1service_1_1Identity.md) & localIdent) |
| bool | **[AsyncDecryptAndVerify](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-asyncdecryptandverify)**(EventLoop_ptr loop, path::Path_ptr fromPath, const [Identity](Classes/structllarp_1_1service_1_1Identity.md) & localIdent, [Endpoint](Classes/structllarp_1_1service_1_1Endpoint.md) * handler, std::function< void(std::shared_ptr< [ProtocolMessage](Classes/structllarp_1_1service_1_1ProtocolMessage.md) >)> hook =nullptr) const |
| bool | **[DecryptPayloadInto](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-decryptpayloadinto)**(const [SharedSecret](Classes/structllarp_1_1AlignedBuffer.md) & sharedkey, [ProtocolMessage](Classes/structllarp_1_1service_1_1ProtocolMessage.md) & into) const |
| virtual bool | **[DecodeKey](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-decodekey)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & key, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * val) override |
| virtual bool | **[BEncode](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const override |
| bool | **[BDecode](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| virtual void | **[Clear](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-clear)**() override |
| bool | **[Verify](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-verify)**(const [ServiceInfo](Classes/structllarp_1_1service_1_1ServiceInfo.md) & from) const |
| virtual bool | **[HandleMessage](Classes/structllarp_1_1service_1_1ProtocolFrame.md#function-handlemessage)**([routing::IMessageHandler](Classes/structllarp_1_1routing_1_1IMessageHandler.md) * h, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r) const override |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [PQCipherBlock](Classes/structllarp_1_1AlignedBuffer.md) | **[C](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-c)**  |
| [Encrypted_t](Classes/structllarp_1_1Encrypted.md) | **[D](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-d)**  |
| uint64_t | **[R](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-r)**  |
| [KeyExchangeNonce](Classes/structllarp_1_1AlignedBuffer.md) | **[N](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-n)**  |
| [Signature](Classes/structllarp_1_1Signature.md) | **[Z](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-z)**  |
| [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[F](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-f)**  |
| [service::ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) | **[T](Classes/structllarp_1_1service_1_1ProtocolFrame.md#variable-t)**  |

## Additional inherited members

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

|                | Name           |
| -------------- | -------------- |
| | **[IMessage](Classes/structllarp_1_1routing_1_1IMessage.md#function-imessage)**() =default |
| virtual | **[~IMessage](Classes/structllarp_1_1routing_1_1IMessage.md#function-~imessage)**() =default |
| bool | **[operator<](Classes/structllarp_1_1routing_1_1IMessage.md#function-operator<)**(const [IMessage](Classes/structllarp_1_1routing_1_1IMessage.md) & other) const |

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

|                | Name           |
| -------------- | -------------- |
| [PathID_t](Classes/structllarp_1_1PathID__t.md) | **[from](Classes/structllarp_1_1routing_1_1IMessage.md#variable-from)**  |
| uint64_t | **[S](Classes/structllarp_1_1routing_1_1IMessage.md#variable-s)**  |
| uint64_t | **[version](Classes/structllarp_1_1routing_1_1IMessage.md#variable-version)**  |


## Public Types Documentation

### using Encrypted_t

```cpp
using llarp::service::ProtocolFrame::Encrypted_t =  Encrypted<2048>;
```


## Public Functions Documentation

### function ProtocolFrame

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


### function ProtocolFrame

```cpp
inline ProtocolFrame()
```


### function ~ProtocolFrame

```cpp
~ProtocolFrame() override
```


### function operator==

```cpp
bool operator==(
    const ProtocolFrame & other
) const
```


### function operator!=

```cpp
inline bool operator!=(
    const ProtocolFrame & other
) const
```


### function operator=

```cpp
ProtocolFrame & operator=(
    const ProtocolFrame & other
)
```


### function EncryptAndSign

```cpp
bool EncryptAndSign(
    const ProtocolMessage & msg,
    const SharedSecret & sharedkey,
    const Identity & localIdent
)
```


### function Sign

```cpp
bool Sign(
    const Identity & localIdent
)
```


### function AsyncDecryptAndVerify

```cpp
bool AsyncDecryptAndVerify(
    EventLoop_ptr loop,
    path::Path_ptr fromPath,
    const Identity & localIdent,
    Endpoint * handler,
    std::function< void(std::shared_ptr< ProtocolMessage >)> hook =nullptr
) const
```


### function DecryptPayloadInto

```cpp
bool DecryptPayloadInto(
    const SharedSecret & sharedkey,
    ProtocolMessage & into
) const
```


### function DecodeKey

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


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


### function BEncode

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


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


### function BDecode

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


### function Clear

```cpp
inline virtual void Clear() override
```


**Reimplements**: [llarp::routing::IMessage::Clear](Classes/structllarp_1_1routing_1_1IMessage.md#function-clear)


### function Verify

```cpp
bool Verify(
    const ServiceInfo & from
) const
```


### function HandleMessage

```cpp
virtual bool HandleMessage(
    routing::IMessageHandler * h,
    AbstractRouter * r
) const override
```


**Reimplements**: [llarp::routing::IMessage::HandleMessage](Classes/structllarp_1_1routing_1_1IMessage.md#function-handlemessage)


## Public Attributes Documentation

### variable C

```cpp
PQCipherBlock C;
```


### variable D

```cpp
Encrypted_t D;
```


### variable R

```cpp
uint64_t R;
```


### variable N

```cpp
KeyExchangeNonce N;
```


### variable Z

```cpp
Signature Z;
```


### variable F

```cpp
PathID_t F;
```


### variable T

```cpp
service::ConvoTag T;
```


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

Updated on 2022-10-26 at 17:18:04 +0000