mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-19 09:25:28 +00:00
11e54f6552
- routing messages and surrounding code - shim code in place for iteration and optimization after deciding what to do with buffer, string handling, and subsequent function calls
33 lines
600 B
C++
33 lines
600 B
C++
#pragma once
|
|
|
|
#include <oxenc/bt.h>
|
|
#include <llarp/util/bencode.hpp>
|
|
|
|
namespace
|
|
{
|
|
static auto policy_cat = llarp::log::Cat("lokinet.policy");
|
|
} // namespace
|
|
|
|
namespace llarp::exit
|
|
{
|
|
struct Policy
|
|
{
|
|
uint64_t proto = 0;
|
|
uint64_t port = 0;
|
|
uint64_t drop = 0;
|
|
uint64_t version = llarp::constants::proto_version;
|
|
|
|
bool
|
|
BDecode(llarp_buffer_t* buf)
|
|
{
|
|
return bencode_decode_dict(*this, buf);
|
|
}
|
|
|
|
bool
|
|
decode_key(const llarp_buffer_t& k, llarp_buffer_t* val);
|
|
|
|
void
|
|
bt_encode(oxenc::bt_dict_producer& btdp) const;
|
|
};
|
|
} // namespace llarp::exit
|