mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-29 11:05:43 +00:00
40 lines
461 B
C++
40 lines
461 B
C++
|
#pragma once
|
||
|
|
||
|
#include "llarp/buffer.h"
|
||
|
|
||
|
enum header_flag
|
||
|
{
|
||
|
eSessionInvalidated = (1 << 0),
|
||
|
eHighPacketDrop = (1 << 1),
|
||
|
eHighMTUDetected = (1 << 2),
|
||
|
eProtoUpgrade = (1 << 3)
|
||
|
};
|
||
|
|
||
|
struct frame_header
|
||
|
{
|
||
|
byte_t *ptr;
|
||
|
|
||
|
frame_header(byte_t *buf);
|
||
|
|
||
|
byte_t *
|
||
|
data();
|
||
|
|
||
|
uint8_t &
|
||
|
version();
|
||
|
|
||
|
uint8_t &
|
||
|
msgtype();
|
||
|
|
||
|
uint16_t
|
||
|
size() const;
|
||
|
|
||
|
void
|
||
|
setsize(uint16_t sz);
|
||
|
|
||
|
uint8_t &
|
||
|
flags();
|
||
|
|
||
|
void
|
||
|
setflag(header_flag f);
|
||
|
};
|