mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
521 B
C++
32 lines
521 B
C++
4 years ago
|
#pragma once
|
||
|
|
||
|
#include <unordered_map>
|
||
|
#include <string>
|
||
|
#include <net/net_int.hpp>
|
||
|
|
||
|
namespace llarp
|
||
|
{
|
||
|
struct AbstractRouter;
|
||
|
|
||
|
struct RoutePoker
|
||
|
{
|
||
|
void
|
||
|
AddRoute(huint32_t ip);
|
||
|
|
||
|
void
|
||
|
DelRoute(huint32_t ip);
|
||
|
|
||
|
~RoutePoker();
|
||
|
|
||
|
void
|
||
|
Update(const AbstractRouter& router);
|
||
|
|
||
|
private:
|
||
|
std::optional<huint32_t>
|
||
|
GetDefaultGateway(const AbstractRouter& router) const;
|
||
|
|
||
|
std::unordered_map<huint32_t, huint32_t> m_PokedRoutes;
|
||
|
huint32_t m_CurrentGateway;
|
||
|
};
|
||
|
} // namespace llarp
|