mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
NetDb added
This commit is contained in:
parent
89aa99c198
commit
1377aa2706
2 changed files with 144 additions and 0 deletions
43
NetDb.h
Normal file
43
NetDb.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#ifndef NETDB_H__
|
||||
#define NETDB_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include "RouterInfo.h"
|
||||
#include "LeaseSet.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace data
|
||||
{
|
||||
class NetDb
|
||||
{
|
||||
public:
|
||||
|
||||
NetDb ();
|
||||
~NetDb ();
|
||||
|
||||
void AddRouterInfo (uint8_t * buf, int len);
|
||||
void AddLeaseSet (uint8_t * buf, int len);
|
||||
RouterInfo * FindRouter (const uint8_t * ident);
|
||||
|
||||
void RequestDestination (const uint8_t * destination, const uint8_t * router);
|
||||
|
||||
const RouterInfo * GetNextFloodfill () const;
|
||||
|
||||
private:
|
||||
|
||||
void Load (const char * directory);
|
||||
|
||||
private:
|
||||
|
||||
std::map<std::string, LeaseSet *> m_LeaseSets;
|
||||
std::map<std::string, RouterInfo *> m_RouterInfos;
|
||||
};
|
||||
|
||||
extern NetDb netdb;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue