2018-08-08 19:37:33 +00:00
|
|
|
#ifndef LLARP_SERVICE_HANDLER_HPP
|
|
|
|
#define LLARP_SERVICE_HANDLER_HPP
|
2018-08-09 19:02:17 +00:00
|
|
|
#include <llarp/aligned.hpp>
|
|
|
|
#include <llarp/crypto.hpp>
|
|
|
|
#include <llarp/service/IntroSet.hpp>
|
2018-08-08 19:37:33 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
2018-08-09 19:02:17 +00:00
|
|
|
typedef llarp::AlignedBuffer< 16 > ConvoTag;
|
|
|
|
|
|
|
|
struct ProtocolMessage;
|
2018-08-08 19:37:33 +00:00
|
|
|
struct IDataHandler
|
|
|
|
{
|
|
|
|
virtual void
|
|
|
|
HandleDataMessage(ProtocolMessage* msg) = 0;
|
2018-08-09 19:02:17 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
GetCachedSessionKeyFor(const ConvoTag& remote,
|
2018-08-13 23:22:31 +00:00
|
|
|
const byte_t*& 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;
|
2018-08-08 19:37:33 +00:00
|
|
|
};
|
|
|
|
} // namespace service
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|