lokinet/llarp/router/route_poker.hpp
Jeff 252692a55b
dont poke routes if we have no exit (#1352)
* * 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
2020-09-23 20:28:38 -04:00

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