mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
919 B
C++
41 lines
919 B
C++
6 years ago
|
#include <llarp/time.h>
|
||
|
#include <llarp/bencode.hpp>
|
||
|
#include <llarp/messages/path_confirm.hpp>
|
||
|
|
||
|
namespace llarp
|
||
|
{
|
||
|
namespace routing
|
||
|
{
|
||
|
PathConfirmMessage::PathConfirmMessage(uint64_t lifetime)
|
||
|
: pathLifetime(lifetime), pathCreated(llarp_time_now_ms())
|
||
|
{
|
||
|
}
|
||
|
|
||
|
bool
|
||
|
PathConfirmMessage::BEncode(llarp_buffer_t* buf) const
|
||
|
{
|
||
|
if(!bencode_start_dict(buf))
|
||
|
return false;
|
||
|
if(!BEncodeWriteDictMsgType(buf, "A", "P"))
|
||
|
return false;
|
||
|
if(!BEncodeWriteDictInt(buf, "L", pathLifetime))
|
||
|
return false;
|
||
|
if(!BEncodeWriteDictInt(buf, "S", pathCreated))
|
||
|
return false;
|
||
|
return bencode_end(buf);
|
||
|
}
|
||
|
|
||
|
bool
|
||
|
PathConfirmMessage::BDecode(llarp_buffer_t* buf)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
bool
|
||
|
PathConfirmMessage::HandleMessage(llarp_router* r) const
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
} // namespace routing
|
||
|
} // namespace llarp
|