mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
create LeaseSet from local tunnel pool
This commit is contained in:
parent
4236299879
commit
ee2297c851
8 changed files with 72 additions and 25 deletions
20
LeaseSet.h
20
LeaseSet.h
|
@ -8,6 +8,12 @@
|
|||
|
||||
namespace i2p
|
||||
{
|
||||
|
||||
namespace tunnel
|
||||
{
|
||||
class TunnelPool;
|
||||
}
|
||||
|
||||
namespace data
|
||||
{
|
||||
|
||||
|
@ -28,14 +34,24 @@ namespace data
|
|||
}
|
||||
};
|
||||
|
||||
struct LeaseSetHeader
|
||||
{
|
||||
Identity destination;
|
||||
uint8_t encryptionKey[256];
|
||||
uint8_t signingKey[128];
|
||||
uint8_t num;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
const int MAX_LS_BUFFER_SIZE = 2048;
|
||||
class LeaseSet: public RoutingDestination
|
||||
{
|
||||
public:
|
||||
|
||||
LeaseSet (const uint8_t * buf, int len);
|
||||
LeaseSet (const LeaseSet& ) = default;
|
||||
LeaseSet (const i2p::tunnel::TunnelPool& pool);
|
||||
LeaseSet& operator=(const LeaseSet& ) = default;
|
||||
void Update (const uint8_t * buf, int len);
|
||||
|
||||
|
@ -51,7 +67,7 @@ namespace data
|
|||
|
||||
private:
|
||||
|
||||
void ReadFromBuffer (const uint8_t * buf, int len);
|
||||
void ReadFromBuffer ();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -59,6 +75,8 @@ namespace data
|
|||
Identity m_Identity;
|
||||
IdentHash m_IdentHash;
|
||||
uint8_t m_EncryptionKey[256];
|
||||
uint8_t m_Buffer[MAX_LS_BUFFER_SIZE];
|
||||
size_t m_BufferLen;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue