2018-11-12 16:43:40 +00:00
|
|
|
#ifndef LLARP_EXIT_POLICY_HPP
|
|
|
|
#define LLARP_EXIT_POLICY_HPP
|
2018-12-12 02:52:51 +00:00
|
|
|
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <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
|
|
|
{
|
2019-05-24 02:01:36 +00:00
|
|
|
uint64_t proto = 0;
|
|
|
|
uint64_t port = 0;
|
|
|
|
uint64_t drop = 0;
|
|
|
|
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
|
|
|
|
|
2018-12-12 02:52:51 +00:00
|
|
|
#endif
|