2021-03-09 22:24:35 +00:00
|
|
|
#pragma once
|
2018-12-12 02:52:51 +00:00
|
|
|
|
2021-03-09 22:24:35 +00:00
|
|
|
#include <llarp/util/bencode.hpp>
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace exit
|
|
|
|
{
|
2019-05-24 02:01:36 +00:00
|
|
|
struct Policy
|
2018-11-12 16:43:40 +00:00
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
uint64_t proto = 0;
|
|
|
|
uint64_t port = 0;
|
|
|
|
uint64_t drop = 0;
|
2019-05-24 02:01:36 +00:00
|
|
|
uint64_t version = LLARP_PROTO_VERSION;
|
2018-11-12 16:43:40 +00:00
|
|
|
|
2019-05-24 02:01:36 +00:00
|
|
|
bool
|
|
|
|
BDecode(llarp_buffer_t* buf)
|
|
|
|
{
|
|
|
|
return bencode_decode_dict(*this, buf);
|
|
|
|
}
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
bool
|
2019-05-24 02:01:36 +00:00
|
|
|
DecodeKey(const llarp_buffer_t& k, llarp_buffer_t* val);
|
2018-11-12 16:43:40 +00:00
|
|
|
|
|
|
|
bool
|
2019-05-24 02:01:36 +00:00
|
|
|
BEncode(llarp_buffer_t* buf) const;
|
2018-11-12 16:43:40 +00:00
|
|
|
};
|
|
|
|
} // namespace exit
|
|
|
|
} // namespace llarp
|