2019-01-22 01:14:02 +00:00
|
|
|
#ifndef LLARP_DHT_PUBLISHSERVICEJOB
|
|
|
|
#define LLARP_DHT_PUBLISHSERVICEJOB
|
|
|
|
|
2021-03-09 22:24:35 +00:00
|
|
|
#include "tx.hpp"
|
|
|
|
#include "txowner.hpp"
|
|
|
|
#include <llarp/service/address.hpp>
|
|
|
|
#include <llarp/service/intro_set.hpp>
|
2019-01-22 01:14:02 +00:00
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace dht
|
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
struct PublishServiceJob : public TX<TXOwner, service::EncryptedIntroSet>
|
2019-01-22 01:14:02 +00:00
|
|
|
{
|
2020-02-20 00:07:46 +00:00
|
|
|
uint64_t relayOrder;
|
2020-01-27 21:30:41 +00:00
|
|
|
service::EncryptedIntroSet introset;
|
2019-01-22 01:14:02 +00:00
|
|
|
|
2020-04-07 18:38:56 +00:00
|
|
|
PublishServiceJob(
|
|
|
|
const TXOwner& asker,
|
|
|
|
const service::EncryptedIntroSet& introset,
|
|
|
|
AbstractContext* ctx,
|
|
|
|
uint64_t relayOrder);
|
2019-01-22 01:14:02 +00:00
|
|
|
|
|
|
|
bool
|
2020-04-07 18:38:56 +00:00
|
|
|
Validate(const service::EncryptedIntroSet& introset) const override;
|
2019-01-22 01:14:02 +00:00
|
|
|
|
|
|
|
void
|
2020-04-07 18:38:56 +00:00
|
|
|
Start(const TXOwner& peer) override;
|
2019-01-22 01:14:02 +00:00
|
|
|
|
2020-03-01 17:30:05 +00:00
|
|
|
virtual void
|
|
|
|
SendReply() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct LocalPublishServiceJob : public PublishServiceJob
|
|
|
|
{
|
|
|
|
PathID_t localPath;
|
|
|
|
uint64_t txid;
|
2020-04-07 18:38:56 +00:00
|
|
|
LocalPublishServiceJob(
|
|
|
|
const TXOwner& peer,
|
|
|
|
const PathID_t& fromID,
|
|
|
|
uint64_t txid,
|
|
|
|
const service::EncryptedIntroSet& introset,
|
|
|
|
AbstractContext* ctx,
|
|
|
|
uint64_t relayOrder);
|
2020-03-01 17:30:05 +00:00
|
|
|
|
2019-01-22 01:14:02 +00:00
|
|
|
void
|
2020-02-29 03:59:24 +00:00
|
|
|
SendReply() override;
|
2019-01-22 01:14:02 +00:00
|
|
|
};
|
|
|
|
} // namespace dht
|
|
|
|
} // namespace llarp
|
|
|
|
|
|
|
|
#endif
|