mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
initial support of LeaseSet2
This commit is contained in:
@@ -79,6 +79,15 @@ namespace data
|
||||
void Encrypt (const uint8_t * data, uint8_t * encrypted, BN_CTX * ctx) const;
|
||||
bool IsDestination () const { return true; };
|
||||
|
||||
protected:
|
||||
|
||||
// called from LeaseSet2
|
||||
LeaseSet ();
|
||||
void SetBuffer (const uint8_t * buf, size_t len);
|
||||
void SetIdentity (std::shared_ptr<const IdentityEx> identity) { m_Identity = identity; };
|
||||
void SetExpirationTime (uint64_t t) { m_ExpirationTime = t; };
|
||||
void SetIsValid (bool isValid) { m_IsValid = isValid; };
|
||||
|
||||
private:
|
||||
|
||||
void ReadFromBuffer (bool readIdentity = true, bool verifySignature = true);
|
||||
@@ -101,6 +110,17 @@ namespace data
|
||||
*/
|
||||
bool LeaseSetBufferValidate(const uint8_t * ptr, size_t sz, uint64_t & expires);
|
||||
|
||||
class LeaseSet2: public LeaseSet
|
||||
{
|
||||
public:
|
||||
|
||||
LeaseSet2 (uint8_t storeType, const uint8_t * buf, size_t len);
|
||||
|
||||
private:
|
||||
|
||||
void ReadFromBuffer (uint8_t storeType, const uint8_t * buf, size_t len);
|
||||
};
|
||||
|
||||
class LocalLeaseSet
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user