lokinet/llarp/exit/policy.hpp
dr7ana 11e54f6552 More message refactoring
- 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
2023-08-31 09:28:16 -07:00

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