lokinet/llarp/service/handler.hpp

48 lines
1.2 KiB
C++
Raw Normal View History

#ifndef LLARP_SERVICE_HANDLER_HPP
#define LLARP_SERVICE_HANDLER_HPP
2018-12-12 02:15:08 +00:00
#include <crypto/types.hpp>
2019-01-11 01:19:36 +00:00
#include <path/path_types.hpp>
2018-12-12 02:15:08 +00:00
#include <service/IntroSet.hpp>
#include <util/aligned.hpp>
namespace llarp
{
namespace service
{
using ConvoTag = llarp::AlignedBuffer< 16 >;
2018-08-09 19:02:17 +00:00
struct ProtocolMessage;
struct IDataHandler
{
virtual bool
HandleDataMessage(const PathID_t&, ProtocolMessage* msg) = 0;
2018-08-09 19:02:17 +00:00
virtual bool
GetCachedSessionKeyFor(const ConvoTag& remote,
SharedSecret& secret) const = 0;
2018-08-09 19:02:17 +00:00
virtual void
PutCachedSessionKeyFor(const ConvoTag& remote,
const SharedSecret& secret) = 0;
virtual void
PutSenderFor(const ConvoTag& remote, const ServiceInfo& si) = 0;
virtual bool
GetSenderFor(const ConvoTag& remote, ServiceInfo& si) const = 0;
virtual void
PutIntroFor(const ConvoTag& remote, const Introduction& intro) = 0;
virtual bool
GetIntroFor(const ConvoTag& remote, Introduction& intro) const = 0;
virtual bool
GetConvoTagsForService(const ServiceInfo& si,
std::set< ConvoTag >& tag) const = 0;
};
} // namespace service
} // namespace llarp
#endif