mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-19 09:25:28 +00:00
7caa87862e
All #ifndef guards on headers have been removed, I think, in favor of #pragma once Headers are now included as `#include "filename"` if the included file resides in the same directory as the file including it, or any subdirectory therein. Otherwise they are included as `#include <project/top/dir/relative/path/filename>` The above does not include system/os headers.
49 lines
1003 B
C++
49 lines
1003 B
C++
#pragma once
|
|
|
|
#include <llarp/crypto/encrypted.hpp>
|
|
#include "message.hpp"
|
|
|
|
#include <vector>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace routing
|
|
{
|
|
constexpr size_t ExitPadSize = 512 - 48;
|
|
constexpr size_t MaxExitMTU = 1500;
|
|
constexpr size_t ExitOverhead = sizeof(uint64_t);
|
|
struct TransferTrafficMessage final : public IMessage
|
|
{
|
|
std::vector<llarp::Encrypted<MaxExitMTU + ExitOverhead>> X;
|
|
size_t _size = 0;
|
|
|
|
void
|
|
Clear() override
|
|
{
|
|
X.clear();
|
|
_size = 0;
|
|
version = 0;
|
|
}
|
|
|
|
size_t
|
|
Size() const
|
|
{
|
|
return _size;
|
|
}
|
|
|
|
/// append buffer to X
|
|
bool
|
|
PutBuffer(const llarp_buffer_t& buf, uint64_t counter);
|
|
|
|
bool
|
|
BEncode(llarp_buffer_t* buf) const override;
|
|
|
|
bool
|
|
DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* val) override;
|
|
|
|
bool
|
|
HandleMessage(IMessageHandler* h, AbstractRouter* r) const override;
|
|
};
|
|
} // namespace routing
|
|
} // namespace llarp
|