2019-01-22 01:14:02 +00:00
|
|
|
#ifndef LLARP_DHT_PUBLISHSERVICEJOB
|
|
|
|
#define LLARP_DHT_PUBLISHSERVICEJOB
|
|
|
|
|
|
|
|
#include <dht/tx.hpp>
|
|
|
|
#include <dht/txowner.hpp>
|
|
|
|
#include <service/address.hpp>
|
2019-04-22 18:35:19 +00:00
|
|
|
#include <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
|