2018-08-08 19:37:33 +00:00
|
|
|
#ifndef LLARP_SERVICE_HANDLER_HPP
|
|
|
|
#define LLARP_SERVICE_HANDLER_HPP
|
2018-12-12 02:15:08 +00:00
|
|
|
|
2019-01-13 16:30:07 +00:00
|
|
|
#include <crypto/types.hpp>
|
2019-01-11 01:19:36 +00:00
|
|
|
#include <path/path_types.hpp>
|
2019-04-22 18:35:19 +00:00
|
|
|
#include <service/intro_set.hpp>
|
2019-01-10 19:41:51 +00:00
|
|
|
#include <util/aligned.hpp>
|
2019-05-03 13:15:03 +00:00
|
|
|
#include <memory>
|
2018-09-14 13:43:42 +00:00
|
|
|
|
2018-08-08 19:37:33 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace service
|
|
|
|
{
|
2019-04-22 18:35:19 +00:00
|
|
|
using ConvoTag = AlignedBuffer< 16 >;
|
2018-08-09 19:02:17 +00:00
|
|
|
|
|
|
|
struct ProtocolMessage;
|
2018-08-08 19:37:33 +00:00
|
|
|
struct IDataHandler
|
|
|
|
{
|
2018-09-18 11:08:47 +00:00
|
|
|
virtual bool
|
2019-05-03 13:15:03 +00:00
|
|
|
HandleDataMessage(const PathID_t&,
|
|
|
|
std::shared_ptr< ProtocolMessage > msg) = 0;
|
2018-08-09 19:02:17 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
GetCachedSessionKeyFor(const ConvoTag& remote,
|
2019-01-02 01:04:04 +00:00
|
|
|
SharedSecret& secret) const = 0;
|
2018-08-09 19:02:17 +00:00
|
|
|
virtual void
|
|
|
|
PutCachedSessionKeyFor(const ConvoTag& remote,
|
|
|
|
const SharedSecret& secret) = 0;
|
|
|
|
|
2019-03-08 16:00:45 +00:00
|
|
|
virtual void
|
|
|
|
RemoveConvoTag(const ConvoTag& remote) = 0;
|
|
|
|
|
2019-03-08 17:00:13 +00:00
|
|
|
virtual bool
|
|
|
|
HasConvoTag(const ConvoTag& remote) const = 0;
|
|
|
|
|
2018-08-09 19:02:17 +00:00
|
|
|
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;
|
|
|
|
|
2019-02-21 17:41:29 +00:00
|
|
|
virtual void
|
|
|
|
PutReplyIntroFor(const ConvoTag& remote, const Introduction& intro) = 0;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
GetReplyIntroFor(const ConvoTag& remote, Introduction& intro) const = 0;
|
|
|
|
|
2018-08-09 19:02:17 +00:00
|
|
|
virtual bool
|
|
|
|
GetConvoTagsForService(const ServiceInfo& si,
|
|
|
|
std::set< ConvoTag >& tag) const = 0;
|
2018-08-08 19:37:33 +00:00
|
|
|
};
|
|
|
|
} // namespace service
|
|
|
|
} // namespace llarp
|
|
|
|
|
2018-09-14 13:43:42 +00:00
|
|
|
#endif
|