mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-31 09:20:21 +00:00
252692a55b
* * refactor route poking out of llarp::Router and into llarp::RoutePoker * only poke routes when we have an exit enabled as a client * add route_poker header so it compiles
32 lines
521 B
C++
32 lines
521 B
C++
#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
|