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.
36 lines
724 B
C++
36 lines
724 B
C++
#include <llarp/api/messages.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace api
|
|
{
|
|
SpawnMessage::~SpawnMessage()
|
|
{
|
|
}
|
|
|
|
bool
|
|
SpawnMessage::EncodeParams(llarp_buffer_t *buf) const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool
|
|
SpawnMessage::DecodeKey(llarp_buffer_t key, llarp_buffer_t *val)
|
|
{
|
|
if(llarp_buffer_eq(key, "N"))
|
|
{
|
|
llarp_buffer_t strbuf;
|
|
if(!bencode_read_string(val, &strbuf))
|
|
return false;
|
|
SessionName = std::string((char *)strbuf.cur, strbuf.sz);
|
|
return true;
|
|
}
|
|
if(llarp_buffer_eq(key, "S"))
|
|
{
|
|
return Info.BDecode(val);
|
|
}
|
|
return IMessage::DecodeKey(key, val);
|
|
}
|
|
|
|
} // namespace api
|
|
} // namespace llarp
|