---
title: tooling::HiveRouter
summary: HiveRouter is a subclass of Router which overrides specific behavior in order to perform testing-related functions. 

---

# tooling::HiveRouter



[HiveRouter]() is a subclass of Router which overrides specific behavior in order to perform testing-related functions.  [More...](#detailed-description)


`#include <hive_router.hpp>`

Inherits from [llarp::Router](Classes/structllarp_1_1Router.md), [llarp::AbstractRouter](Classes/structllarp_1_1AbstractRouter.md), std::enable_shared_from_this< AbstractRouter >

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[HiveRouter](Classes/structtooling_1_1HiveRouter.md#function-hiverouter)**(llarp::EventLoop_ptr loop, std::shared_ptr< [llarp::vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) > vpnPlatform, [RouterHive](Classes/structtooling_1_1RouterHive.md) * hive) |
| virtual | **[~HiveRouter](Classes/structtooling_1_1HiveRouter.md#function-~hiverouter)**() =default |
| virtual bool | **[disableGossipingRC_TestingOnly](Classes/structtooling_1_1HiveRouter.md#function-disablegossipingrc-testingonly)**() override<br>Override logic to prevent base Router class from gossiping its RC.  |
| void | **[disableGossiping](Classes/structtooling_1_1HiveRouter.md#function-disablegossiping)**() |
| void | **[enableGossiping](Classes/structtooling_1_1HiveRouter.md#function-enablegossiping)**() |

## Protected Functions

|                | Name           |
| -------------- | -------------- |
| virtual void | **[HandleRouterEvent](Classes/structtooling_1_1HiveRouter.md#function-handlerouterevent)**(RouterEventPtr event) const override<br>Virtual function to handle [RouterEvent]().  |

## Protected Attributes

|                | Name           |
| -------------- | -------------- |
| bool | **[m_disableGossiping](Classes/structtooling_1_1HiveRouter.md#variable-m-disablegossiping)**  |
| [RouterHive](Classes/structtooling_1_1RouterHive.md) * | **[m_hive](Classes/structtooling_1_1HiveRouter.md#variable-m-hive)**  |

## Additional inherited members

**Public Types inherited from [llarp::Router](Classes/structllarp_1_1Router.md)**

|                | Name           |
| -------------- | -------------- |
| using std::chrono::steady_clock | **[Clock_t](Classes/structllarp_1_1Router.md#using-clock-t)**  |
| using Clock_t::time_point | **[TimePoint_t](Classes/structllarp_1_1Router.md#using-timepoint-t)**  |

**Public Functions inherited from [llarp::Router](Classes/structllarp_1_1Router.md)**

|                | Name           |
| -------------- | -------------- |
| virtual [path::BuildLimiter](Classes/classllarp_1_1path_1_1BuildLimiter.md) & | **[pathBuildLimiter](Classes/structllarp_1_1Router.md#function-pathbuildlimiter)**() override |
| virtual const [llarp::net::Platform](Classes/classllarp_1_1net_1_1Platform.md) & | **[Net](Classes/structllarp_1_1Router.md#function-net)**() const override |
| virtual const LMQ_ptr & | **[lmq](Classes/structllarp_1_1Router.md#function-lmq)**() const override |
| virtual const std::shared_ptr< [rpc::LokidRpcClient](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md) > & | **[RpcClient](Classes/structllarp_1_1Router.md#function-rpcclient)**() const override |
| virtual [llarp_dht_context](Classes/structllarp__dht__context.md) * | **[dht](Classes/structllarp_1_1Router.md#function-dht)**() const override |
| virtual const std::unique_ptr< const [layers::Layers](Classes/structllarp_1_1layers_1_1Layers.md) > & | **[get_layers](Classes/structllarp_1_1Router.md#function-get-layers)**() const override |
| virtual const std::shared_ptr< [dns::Server](Classes/classllarp_1_1dns_1_1Server.md) > & | **[get_dns](Classes/structllarp_1_1Router.md#function-get-dns)**() const override |
| virtual const std::shared_ptr< [quic::TunnelManager](Classes/classllarp_1_1quic_1_1TunnelManager.md) > & | **[quic_tunnel](Classes/structllarp_1_1Router.md#function-quic-tunnel)**() const override |
| virtual std::optional< std::variant< nuint32_t, nuint128_t > > | **[OurPublicIP](Classes/structllarp_1_1Router.md#function-ourpublicip)**() const override<br>get what our real public ip is if we can know it  |
| virtual util::StatusObject | **[ExtractStatus](Classes/structllarp_1_1Router.md#function-extractstatus)**() const override |
| virtual util::StatusObject | **[ExtractSummaryStatus](Classes/structllarp_1_1Router.md#function-extractsummarystatus)**() const override |
| virtual const std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > & | **[nodedb](Classes/structllarp_1_1Router.md#function-nodedb)**() const override |
| virtual const [path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md) & | **[pathContext](Classes/structllarp_1_1Router.md#function-pathcontext)**() const override |
| virtual [path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md) & | **[pathContext](Classes/structllarp_1_1Router.md#function-pathcontext)**() override |
| virtual const [RouterContact](Classes/structllarp_1_1RouterContact.md) & | **[rc](Classes/structllarp_1_1Router.md#function-rc)**() const override |
| virtual void | **[ModifyOurRC](Classes/structllarp_1_1Router.md#function-modifyourrc)**(std::function< std::optional< [RouterContact](Classes/structllarp_1_1RouterContact.md) >([RouterContact](Classes/structllarp_1_1RouterContact.md))> modify) override<br>modify our rc modify returns nullopt if unmodified otherwise it returns the new rc to be sigend and published out  |
| virtual void | **[SetRouterWhitelist](Classes/structllarp_1_1Router.md#function-setrouterwhitelist)**(const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & whitelist, const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & greylist, const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & unfundedlist) override<br>set router's service node whitelist  |
| virtual std::unordered_set< [RouterID](Classes/structllarp_1_1RouterID.md) > | **[GetRouterWhitelist](Classes/structllarp_1_1Router.md#function-getrouterwhitelist)**() const override |
| virtual const std::shared_ptr< [KeyManager](Classes/structllarp_1_1KeyManager.md) > & | **[keyManager](Classes/structllarp_1_1Router.md#function-keymanager)**() const override |
| virtual const [SecretKey](Classes/structllarp_1_1SecretKey.md) & | **[identity](Classes/structllarp_1_1Router.md#function-identity)**() const override |
| virtual const [SecretKey](Classes/structllarp_1_1SecretKey.md) & | **[encryption](Classes/structllarp_1_1Router.md#function-encryption)**() const override |
| virtual [Profiling](Classes/structllarp_1_1Profiling.md) & | **[routerProfiling](Classes/structllarp_1_1Router.md#function-routerprofiling)**() override |
| virtual const EventLoop_ptr & | **[loop](Classes/structllarp_1_1Router.md#function-loop)**() const override |
| virtual [vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) * | **[GetVPNPlatform](Classes/structllarp_1_1Router.md#function-getvpnplatform)**() const override |
| virtual void | **[QueueWork](Classes/structllarp_1_1Router.md#function-queuework)**(std::function< void(void)> ) override<br>call function in crypto worker  |
| virtual void | **[QueueDiskIO](Classes/structllarp_1_1Router.md#function-queuediskio)**(std::function< void(void)> ) override<br>call function in disk io thread  |
| bool | **[LooksDecommissioned](Classes/structllarp_1_1Router.md#function-looksdecommissioned)**() const<br>return true if we look like we are a decommissioned service node  |
| bool | **[LooksFunded](Classes/structllarp_1_1Router.md#function-looksfunded)**() const<br>return true if we look like we are a registered, fully-staked service node (either active or decommissioned).  |
| bool | **[LooksRegistered](Classes/structllarp_1_1Router.md#function-looksregistered)**() const<br>return true if we a registered service node; not that this only requires a partial stake, and does not imply that this service node is _active_ or fully funded.  |
| bool | **[ShouldTestOtherRouters](Classes/structllarp_1_1Router.md#function-shouldtestotherrouters)**() const<br>return true if we look like we are allowed and able to test other routers  |
| virtual llarp_time_t | **[Uptime](Classes/structllarp_1_1Router.md#function-uptime)**() const override<br>returns milliseconds since started  |
| virtual bool | **[Sign](Classes/structllarp_1_1Router.md#function-sign)**([Signature](Classes/structllarp_1_1Signature.md) & sig, const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & buf) const override |
| virtual void | **[SetDownHook](Classes/structllarp_1_1Router.md#function-setdownhook)**(std::function< void(void)> hook) override |
| virtual bool | **[LooksAlive](Classes/structllarp_1_1Router.md#function-looksalive)**() const override |
| virtual const std::shared_ptr< [RoutePoker](Classes/structllarp_1_1RoutePoker.md) > & | **[routePoker](Classes/structllarp_1_1Router.md#function-routepoker)**() const override |
| virtual void | **[TriggerPump](Classes/structllarp_1_1Router.md#function-triggerpump)**() override<br>Trigger a pump of low level links. Idempotent.  |
| void | **[PumpLL](Classes/structllarp_1_1Router.md#function-pumpll)**() |
| virtual std::string | **[status_line](Classes/structllarp_1_1Router.md#function-status-line)**() override |
| virtual [IOutboundMessageHandler](Classes/structllarp_1_1IOutboundMessageHandler.md) & | **[outboundMessageHandler](Classes/structllarp_1_1Router.md#function-outboundmessagehandler)**() override |
| virtual void | **[connect_to_network](Classes/structllarp_1_1Router.md#function-connect-to-network)**() override |
| virtual [IOutboundSessionMaker](Classes/structllarp_1_1IOutboundSessionMaker.md) & | **[outboundSessionMaker](Classes/structllarp_1_1Router.md#function-outboundsessionmaker)**() override |
| virtual [ILinkManager](Classes/structllarp_1_1ILinkManager.md) & | **[linkManager](Classes/structllarp_1_1Router.md#function-linkmanager)**() override |
| virtual [I_RCLookupHandler](Classes/structllarp_1_1I__RCLookupHandler.md) & | **[rcLookupHandler](Classes/structllarp_1_1Router.md#function-rclookuphandler)**() override |
| virtual std::shared_ptr< [PeerDb](Classes/structllarp_1_1PeerDb.md) > | **[peerDb](Classes/structllarp_1_1Router.md#function-peerdb)**() override |
| virtual int | **[OutboundUDPSocket](Classes/structllarp_1_1Router.md#function-outboundudpsocket)**() const override |
| virtual void | **[GossipRCIfNeeded](Classes/structllarp_1_1Router.md#function-gossiprcifneeded)**(const [RouterContact](Classes/structllarp_1_1RouterContact.md) rc) override<br>gossip an rc if required  |
| | **[Router](Classes/structllarp_1_1Router.md#function-router)**(EventLoop_ptr loop, std::shared_ptr< [vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) > vpnPlatform) |
| virtual | **[~Router](Classes/structllarp_1_1Router.md#function-~router)**() override |
| virtual std::unique_ptr< const [layers::Layers](Classes/structllarp_1_1layers_1_1Layers.md) > | **[create_layers](Classes/structllarp_1_1Router.md#function-create-layers)**() override<br>overrideable creation of protocol layers  |
| virtual bool | **[HandleRecvLinkMessageBuffer](Classes/structllarp_1_1Router.md#function-handlerecvlinkmessagebuffer)**([ILinkSession](Classes/structllarp_1_1ILinkSession.md) * from, const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & msg) override |
| void | **[InitInboundLinks](Classes/structllarp_1_1Router.md#function-initinboundlinks)**() |
| void | **[InitOutboundLinks](Classes/structllarp_1_1Router.md#function-initoutboundlinks)**() |
| virtual bool | **[GetRandomGoodRouter](Classes/structllarp_1_1Router.md#function-getrandomgoodrouter)**([RouterID](Classes/structllarp_1_1RouterID.md) & r) override |
| bool | **[InitServiceNode](Classes/structllarp_1_1Router.md#function-initservicenode)**()<br>initialize us as a service node return true on success  |
| virtual bool | **[IsRunning](Classes/structllarp_1_1Router.md#function-isrunning)**() const override |
| virtual bool | **[IsServiceNode](Classes/structllarp_1_1Router.md#function-isservicenode)**() const override<br>return true if we are running in service node mode  |
| virtual std::optional< std::string > | **[OxendErrorState](Classes/structllarp_1_1Router.md#function-oxenderrorstate)**() const override<br>Called to determine if we're in a bad state (which gets reported to our oxend) that should prevent uptime proofs from going out to the network (so that the error state gets noticed).  |
| void | **[Close](Classes/structllarp_1_1Router.md#function-close)**() |
| virtual bool | **[Configure](Classes/structllarp_1_1Router.md#function-configure)**(std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > conf, bool isSNode, std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > nodedb) override |
| virtual bool | **[StartRpcServer](Classes/structllarp_1_1Router.md#function-startrpcserver)**() override |
| virtual void | **[Freeze](Classes/structllarp_1_1Router.md#function-freeze)**() override<br>indicate we are about to sleep for a while  |
| virtual void | **[Thaw](Classes/structllarp_1_1Router.md#function-thaw)**() override<br>thaw from long sleep or network changed event  |
| virtual bool | **[Run](Classes/structllarp_1_1Router.md#function-run)**() override |
| virtual void | **[Stop](Classes/structllarp_1_1Router.md#function-stop)**() override<br>stop running the router logic gracefully  |
| virtual void | **[Die](Classes/structllarp_1_1Router.md#function-die)**() override<br>non graceful stop router  |
| void | **[StopLinks](Classes/structllarp_1_1Router.md#function-stoplinks)**()<br>close all sessions and shutdown all links  |
| virtual void | **[PersistSessionUntil](Classes/structllarp_1_1Router.md#function-persistsessionuntil)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote, llarp_time_t until) override |
| bool | **[EnsureIdentity](Classes/structllarp_1_1Router.md#function-ensureidentity)**() |
| bool | **[EnsureEncryptionKey](Classes/structllarp_1_1Router.md#function-ensureencryptionkey)**() |
| virtual bool | **[SessionToRouterAllowed](Classes/structllarp_1_1Router.md#function-sessiontorouterallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const override |
| virtual bool | **[PathToRouterAllowed](Classes/structllarp_1_1Router.md#function-pathtorouterallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const override |
| void | **[HandleSaveRC](Classes/structllarp_1_1Router.md#function-handlesaverc)**() const |
| bool | **[SaveRC](Classes/structllarp_1_1Router.md#function-saverc)**() |
| virtual bool | **[HasClientExit](Classes/structllarp_1_1Router.md#function-hasclientexit)**() const override<br>return true if we are a client with an exit configured  |
| virtual const byte_t * | **[pubkey](Classes/structllarp_1_1Router.md#function-pubkey)**() const override |
| void | **[try_connect](Classes/structllarp_1_1Router.md#function-try-connect)**(fs::path rcfile) |
| virtual bool | **[TryConnectAsync](Classes/structllarp_1_1Router.md#function-tryconnectasync)**([RouterContact](Classes/structllarp_1_1RouterContact.md) rc, uint16_t tries) override |
| virtual bool | **[SendToOrQueue](Classes/structllarp_1_1Router.md#function-sendtoorqueue)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote, const [ILinkMessage](Classes/structllarp_1_1ILinkMessage.md) & msg, SendStatusHandler handler) override<br>send to remote router or queue for sending returns false on overflow returns true on successful queue NOT threadsafe MUST be called in the logic thread  |
| virtual void | **[ForEachPeer](Classes/structllarp_1_1Router.md#function-foreachpeer)**(std::function< void(const [ILinkSession](Classes/structllarp_1_1ILinkSession.md) *, bool)> visit, bool randomize =false) const override<br>visit each connected link session  |
| void | **[ForEachPeer](Classes/structllarp_1_1Router.md#function-foreachpeer)**(std::function< void([ILinkSession](Classes/structllarp_1_1ILinkSession.md) *)> visit) |
| virtual bool | **[IsBootstrapNode](Classes/structllarp_1_1Router.md#function-isbootstrapnode)**([RouterID](Classes/structllarp_1_1RouterID.md) ) const override |
| virtual bool | **[CheckRenegotiateValid](Classes/structllarp_1_1Router.md#function-checkrenegotiatevalid)**([RouterContact](Classes/structllarp_1_1RouterContact.md) newRc, [RouterContact](Classes/structllarp_1_1RouterContact.md) oldRC) override<br>check if newRc matches oldRC and update local rc for this remote contact if valid returns true on valid and updated returns false otherwise  |
| virtual void | **[SessionClosed](Classes/structllarp_1_1Router.md#function-sessionclosed)**([RouterID](Classes/structllarp_1_1RouterID.md) remote) override<br>called by link when a remote session has no more sessions open  |
| void | **[ConnectionTimedOut](Classes/structllarp_1_1Router.md#function-connectiontimedout)**([ILinkSession](Classes/structllarp_1_1ILinkSession.md) * session)<br>called by link when an unestablished connection times out  |
| bool | **[ConnectionEstablished](Classes/structllarp_1_1Router.md#function-connectionestablished)**([ILinkSession](Classes/structllarp_1_1ILinkSession.md) * session, bool inbound)<br>called by link when session is fully established  |
| void | **[Tick](Classes/structllarp_1_1Router.md#function-tick)**()<br>call internal router ticker  |
| virtual llarp_time_t | **[Now](Classes/structllarp_1_1Router.md#function-now)**() const override<br>returns system clock milliseconds since epoch  |
| virtual bool | **[ParseRoutingMessageBuffer](Classes/structllarp_1_1Router.md#function-parseroutingmessagebuffer)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & buf, [routing::IMessageHandler](Classes/structllarp_1_1routing_1_1IMessageHandler.md) * h, const [PathID_t](Classes/structllarp_1_1PathID__t.md) & rxid) override<br>parse a routing message in a buffer and handle it with a handler if successful parsing return true on parse and handle success otherwise return false  |
| virtual void | **[ConnectToRandomRouters](Classes/structllarp_1_1Router.md#function-connecttorandomrouters)**(int N) override<br>connect to N random routers  |
| virtual size_t | **[NumberOfConnectedRouters](Classes/structllarp_1_1Router.md#function-numberofconnectedrouters)**() const override<br>count the number of unique service nodes connected via pubkey  |
| virtual size_t | **[NumberOfConnectedClients](Classes/structllarp_1_1Router.md#function-numberofconnectedclients)**() const override<br>count the number of unique clients connected by pubkey  |
| virtual bool | **[GetRandomConnectedRouter](Classes/structllarp_1_1Router.md#function-getrandomconnectedrouter)**([RouterContact](Classes/structllarp_1_1RouterContact.md) & result) const override |
| virtual void | **[HandleDHTLookupForExplore](Classes/structllarp_1_1Router.md#function-handledhtlookupforexplore)**([RouterID](Classes/structllarp_1_1RouterID.md) remote, const std::vector< [RouterContact](Classes/structllarp_1_1RouterContact.md) > & results) override |
| virtual void | **[LookupRouter](Classes/structllarp_1_1Router.md#function-lookuprouter)**([RouterID](Classes/structllarp_1_1RouterID.md) remote, RouterLookupHandler resultHandler) override<br>lookup router by pubkey if we are a service node this is done direct otherwise it's done via path  |
| virtual bool | **[HasSessionTo](Classes/structllarp_1_1Router.md#function-hassessionto)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const override<br>return true if we have at least 1 session to this router in either direction  |
| virtual std::string | **[ShortName](Classes/structllarp_1_1Router.md#function-shortname)**() const override |
| virtual uint32_t | **[NextPathBuildNumber](Classes/structllarp_1_1Router.md#function-nextpathbuildnumber)**() override |
| void | **[AfterStopLinks](Classes/structllarp_1_1Router.md#function-afterstoplinks)**() |
| void | **[AfterStopIssued](Classes/structllarp_1_1Router.md#function-afterstopissued)**() |
| virtual std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > | **[GetConfig](Classes/structllarp_1_1Router.md#function-getconfig)**() const override |

**Public Attributes inherited from [llarp::Router](Classes/structllarp_1_1Router.md)**

|                | Name           |
| -------------- | -------------- |
| constexpr auto | **[router_alive_timeout](Classes/structllarp_1_1Router.md#variable-router-alive-timeout)** <br>bail if we hang for this amount of time.  |
| llarp_time_t | **[_lastPump](Classes/structllarp_1_1Router.md#variable--lastpump)**  |
| bool | **[ready](Classes/structllarp_1_1Router.md#variable-ready)**  |
| fs::path | **[transport_keyfile](Classes/structllarp_1_1Router.md#variable-transport-keyfile)**  |
| fs::path | **[ident_keyfile](Classes/structllarp_1_1Router.md#variable-ident-keyfile)**  |
| fs::path | **[encryption_keyfile](Classes/structllarp_1_1Router.md#variable-encryption-keyfile)**  |
| fs::path | **[our_rc_file](Classes/structllarp_1_1Router.md#variable-our-rc-file)**  |
| bool | **[m_UseFileLogging](Classes/structllarp_1_1Router.md#variable-m-usefilelogging)**  |
| [RouterContact](Classes/structllarp_1_1RouterContact.md) | **[_rc](Classes/structllarp_1_1Router.md#variable--rc)**  |
| bool | **[whitelistRouters](Classes/structllarp_1_1Router.md#variable-whitelistrouters)** <br>should we obey the service node whitelist?  |
| LMQ_ptr | **[m_lmq](Classes/structllarp_1_1Router.md#variable-m-lmq)**  |
| [path::BuildLimiter](Classes/classllarp_1_1path_1_1BuildLimiter.md) | **[m_PathBuildLimiter](Classes/structllarp_1_1Router.md#variable-m-pathbuildlimiter)**  |
| std::shared_ptr< [EventLoopWakeup](Classes/classllarp_1_1EventLoopWakeup.md) > | **[m_Pump](Classes/structllarp_1_1Router.md#variable-m-pump)**  |
| std::shared_ptr< [dns::Server](Classes/classllarp_1_1dns_1_1Server.md) > | **[m_DNS](Classes/structllarp_1_1Router.md#variable-m-dns)**  |
| std::unique_ptr< const [layers::Layers](Classes/structllarp_1_1layers_1_1Layers.md) > | **[m_Layers](Classes/structllarp_1_1Router.md#variable-m-layers)**  |
| std::shared_ptr< [quic::TunnelManager](Classes/classllarp_1_1quic_1_1TunnelManager.md) > | **[m_QUIC](Classes/structllarp_1_1Router.md#variable-m-quic)**  |
| std::optional< [SockAddr](Classes/structllarp_1_1SockAddr.md) > | **[_ourAddress](Classes/structllarp_1_1Router.md#variable--ouraddress)**  |
| EventLoop_ptr | **[_loop](Classes/structllarp_1_1Router.md#variable--loop)**  |
| std::shared_ptr< [vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) > | **[_vpnPlatform](Classes/structllarp_1_1Router.md#variable--vpnplatform)**  |
| [path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md) | **[paths](Classes/structllarp_1_1Router.md#variable-paths)**  |
| [SecretKey](Classes/structllarp_1_1SecretKey.md) | **[_identity](Classes/structllarp_1_1Router.md#variable--identity)**  |
| [SecretKey](Classes/structllarp_1_1SecretKey.md) | **[_encryption](Classes/structllarp_1_1Router.md#variable--encryption)**  |
| [llarp_dht_context](Classes/structllarp__dht__context.md) * | **[_dht](Classes/structllarp_1_1Router.md#variable--dht)**  |
| std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > | **[_nodedb](Classes/structllarp_1_1Router.md#variable--nodedb)**  |
| llarp_time_t | **[_startedAt](Classes/structllarp_1_1Router.md#variable--startedat)**  |
| const oxenmq::TaggedThreadID | **[m_DiskThread](Classes/structllarp_1_1Router.md#variable-m-diskthread)**  |
| llarp_time_t | **[rcRegenInterval](Classes/structllarp_1_1Router.md#variable-rcregeninterval)** <br>how often do we resign our RC? milliseconds.  |
| bool | **[sendPadding](Classes/structllarp_1_1Router.md#variable-sendpadding)**  |
| [LinkMessageParser](Classes/structllarp_1_1LinkMessageParser.md) | **[inbound_link_msg_parser](Classes/structllarp_1_1Router.md#variable-inbound-link-msg-parser)**  |
| [routing::InboundMessageParser](Classes/structllarp_1_1routing_1_1InboundMessageParser.md) | **[inbound_routing_msg_parser](Classes/structllarp_1_1Router.md#variable-inbound-routing-msg-parser)**  |
| llarp_time_t | **[_lastTick](Classes/structllarp_1_1Router.md#variable--lasttick)**  |
| std::function< void(void)> | **[_onDown](Classes/structllarp_1_1Router.md#variable--ondown)**  |
| [BootstrapList](Classes/structllarp_1_1BootstrapList.md) | **[bootstrapRCList](Classes/structllarp_1_1Router.md#variable-bootstraprclist)** <br>bootstrap RCs  |
| std::shared_ptr< [RoutePoker](Classes/structllarp_1_1RoutePoker.md) > | **[m_RoutePoker](Classes/structllarp_1_1Router.md#variable-m-routepoker)**  |
| std::unique_ptr< [rpc::RPCServer](Classes/classllarp_1_1rpc_1_1RPCServer.md) > | **[m_RPCServer](Classes/structllarp_1_1Router.md#variable-m-rpcserver)**  |
| const llarp_time_t | **[_randomStartDelay](Classes/structllarp_1_1Router.md#variable--randomstartdelay)**  |
| std::shared_ptr< [rpc::LokidRpcClient](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md) > | **[m_lokidRpcClient](Classes/structllarp_1_1Router.md#variable-m-lokidrpcclient)**  |
| oxenmq::address | **[lokidRPCAddr](Classes/structllarp_1_1Router.md#variable-lokidrpcaddr)**  |
| [Profiling](Classes/structllarp_1_1Profiling.md) | **[_routerProfiling](Classes/structllarp_1_1Router.md#variable--routerprofiling)**  |
| fs::path | **[_profilesFile](Classes/structllarp_1_1Router.md#variable--profilesfile)**  |
| [OutboundMessageHandler](Classes/structllarp_1_1OutboundMessageHandler.md) | **[_outboundMessageHandler](Classes/structllarp_1_1Router.md#variable--outboundmessagehandler)**  |
| [OutboundSessionMaker](Classes/structllarp_1_1OutboundSessionMaker.md) | **[_outboundSessionMaker](Classes/structllarp_1_1Router.md#variable--outboundsessionmaker)**  |
| [LinkManager](Classes/structllarp_1_1LinkManager.md) | **[_linkManager](Classes/structllarp_1_1Router.md#variable--linkmanager)**  |
| [RCLookupHandler](Classes/structllarp_1_1RCLookupHandler.md) | **[_rcLookupHandler](Classes/structllarp_1_1Router.md#variable--rclookuphandler)**  |
| [RCGossiper](Classes/structllarp_1_1RCGossiper.md) | **[_rcGossiper](Classes/structllarp_1_1Router.md#variable--rcgossiper)**  |
| std::mutex | **[_pump_mtx](Classes/structllarp_1_1Router.md#variable--pump-mtx)** <br>held when we are calling PumpLL() [TriggerPump()]() is nop when this mutex is locked.  |
| TimePoint_t | **[m_NextExploreAt](Classes/structllarp_1_1Router.md#variable-m-nextexploreat)**  |
| std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > | **[m_Config](Classes/structllarp_1_1Router.md#variable-m-config)**  |
| int | **[m_OutboundUDPSocket](Classes/structllarp_1_1Router.md#variable-m-outboundudpsocket)**  |

**Public Functions inherited from [llarp::AbstractRouter](Classes/structllarp_1_1AbstractRouter.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~AbstractRouter](Classes/structllarp_1_1AbstractRouter.md#function-~abstractrouter)**() =default |
| virtual std::unique_ptr< const [layers::Layers](Classes/structllarp_1_1layers_1_1Layers.md) > | **[create_layers](Classes/structllarp_1_1AbstractRouter.md#function-create-layers)**() =0<br>overrideable creation of protocol layers  |
| virtual const std::unique_ptr< const [layers::Layers](Classes/structllarp_1_1layers_1_1Layers.md) > & | **[get_layers](Classes/structllarp_1_1AbstractRouter.md#function-get-layers)**() const =0 |
| virtual const std::shared_ptr< [dns::Server](Classes/classllarp_1_1dns_1_1Server.md) > & | **[get_dns](Classes/structllarp_1_1AbstractRouter.md#function-get-dns)**() const =0 |
| virtual const std::shared_ptr< [quic::TunnelManager](Classes/classllarp_1_1quic_1_1TunnelManager.md) > & | **[quic_tunnel](Classes/structllarp_1_1AbstractRouter.md#function-quic-tunnel)**() const =0 |
| virtual bool | **[HandleRecvLinkMessageBuffer](Classes/structllarp_1_1AbstractRouter.md#function-handlerecvlinkmessagebuffer)**([ILinkSession](Classes/structllarp_1_1ILinkSession.md) * from, const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & msg) =0 |
| virtual const [net::Platform](Classes/classllarp_1_1net_1_1Platform.md) & | **[Net](Classes/structllarp_1_1AbstractRouter.md#function-net)**() const =0 |
| virtual const LMQ_ptr & | **[lmq](Classes/structllarp_1_1AbstractRouter.md#function-lmq)**() const =0 |
| virtual [vpn::Platform](Classes/classllarp_1_1vpn_1_1Platform.md) * | **[GetVPNPlatform](Classes/structllarp_1_1AbstractRouter.md#function-getvpnplatform)**() const =0 |
| virtual const std::shared_ptr< [rpc::LokidRpcClient](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md) > & | **[RpcClient](Classes/structllarp_1_1AbstractRouter.md#function-rpcclient)**() const =0 |
| virtual [llarp_dht_context](Classes/structllarp__dht__context.md) * | **[dht](Classes/structllarp_1_1AbstractRouter.md#function-dht)**() const =0 |
| virtual const std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > & | **[nodedb](Classes/structllarp_1_1AbstractRouter.md#function-nodedb)**() const =0 |
| virtual const [path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md) & | **[pathContext](Classes/structllarp_1_1AbstractRouter.md#function-pathcontext)**() const =0 |
| virtual [path::PathContext](Classes/structllarp_1_1path_1_1PathContext.md) & | **[pathContext](Classes/structllarp_1_1AbstractRouter.md#function-pathcontext)**() =0 |
| virtual const [RouterContact](Classes/structllarp_1_1RouterContact.md) & | **[rc](Classes/structllarp_1_1AbstractRouter.md#function-rc)**() const =0 |
| virtual void | **[ModifyOurRC](Classes/structllarp_1_1AbstractRouter.md#function-modifyourrc)**(std::function< std::optional< [RouterContact](Classes/structllarp_1_1RouterContact.md) >([RouterContact](Classes/structllarp_1_1RouterContact.md))> modify) =0<br>modify our rc modify returns nullopt if unmodified otherwise it returns the new rc to be sigend and published out  |
| virtual const std::shared_ptr< [KeyManager](Classes/structllarp_1_1KeyManager.md) > & | **[keyManager](Classes/structllarp_1_1AbstractRouter.md#function-keymanager)**() const =0 |
| virtual const [SecretKey](Classes/structllarp_1_1SecretKey.md) & | **[identity](Classes/structllarp_1_1AbstractRouter.md#function-identity)**() const =0 |
| virtual const [SecretKey](Classes/structllarp_1_1SecretKey.md) & | **[encryption](Classes/structllarp_1_1AbstractRouter.md#function-encryption)**() const =0 |
| virtual [Profiling](Classes/structllarp_1_1Profiling.md) & | **[routerProfiling](Classes/structllarp_1_1AbstractRouter.md#function-routerprofiling)**() =0 |
| virtual const EventLoop_ptr & | **[loop](Classes/structllarp_1_1AbstractRouter.md#function-loop)**() const =0 |
| virtual void | **[QueueWork](Classes/structllarp_1_1AbstractRouter.md#function-queuework)**(std::function< void(void)> ) =0<br>call function in crypto worker  |
| virtual void | **[QueueDiskIO](Classes/structllarp_1_1AbstractRouter.md#function-queuediskio)**(std::function< void(void)> ) =0<br>call function in disk io thread  |
| virtual std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > | **[GetConfig](Classes/structllarp_1_1AbstractRouter.md#function-getconfig)**() const =0 |
| virtual [IOutboundMessageHandler](Classes/structllarp_1_1IOutboundMessageHandler.md) & | **[outboundMessageHandler](Classes/structllarp_1_1AbstractRouter.md#function-outboundmessagehandler)**() =0 |
| virtual [IOutboundSessionMaker](Classes/structllarp_1_1IOutboundSessionMaker.md) & | **[outboundSessionMaker](Classes/structllarp_1_1AbstractRouter.md#function-outboundsessionmaker)**() =0 |
| virtual [ILinkManager](Classes/structllarp_1_1ILinkManager.md) & | **[linkManager](Classes/structllarp_1_1AbstractRouter.md#function-linkmanager)**() =0 |
| virtual const std::shared_ptr< [RoutePoker](Classes/structllarp_1_1RoutePoker.md) > & | **[routePoker](Classes/structllarp_1_1AbstractRouter.md#function-routepoker)**() const =0 |
| virtual [I_RCLookupHandler](Classes/structllarp_1_1I__RCLookupHandler.md) & | **[rcLookupHandler](Classes/structllarp_1_1AbstractRouter.md#function-rclookuphandler)**() =0 |
| virtual std::shared_ptr< [PeerDb](Classes/structllarp_1_1PeerDb.md) > | **[peerDb](Classes/structllarp_1_1AbstractRouter.md#function-peerdb)**() =0 |
| virtual bool | **[Sign](Classes/structllarp_1_1AbstractRouter.md#function-sign)**([Signature](Classes/structllarp_1_1Signature.md) & sig, const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & buf) const =0 |
| virtual bool | **[Configure](Classes/structllarp_1_1AbstractRouter.md#function-configure)**(std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > conf, bool isSNode, std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > nodedb) =0 |
| virtual bool | **[IsServiceNode](Classes/structllarp_1_1AbstractRouter.md#function-isservicenode)**() const =0 |
| virtual std::optional< std::string > | **[OxendErrorState](Classes/structllarp_1_1AbstractRouter.md#function-oxenderrorstate)**() const =0<br>Called to determine if we're in a bad state (which gets reported to our oxend) that should prevent uptime proofs from going out to the network (so that the error state gets noticed).  |
| virtual bool | **[StartRpcServer](Classes/structllarp_1_1AbstractRouter.md#function-startrpcserver)**() =0 |
| virtual bool | **[Run](Classes/structllarp_1_1AbstractRouter.md#function-run)**() =0 |
| virtual bool | **[IsRunning](Classes/structllarp_1_1AbstractRouter.md#function-isrunning)**() const =0 |
| virtual bool | **[LooksAlive](Classes/structllarp_1_1AbstractRouter.md#function-looksalive)**() const =0 |
| virtual void | **[Stop](Classes/structllarp_1_1AbstractRouter.md#function-stop)**() =0<br>stop running the router logic gracefully  |
| virtual void | **[Freeze](Classes/structllarp_1_1AbstractRouter.md#function-freeze)**() =0<br>indicate we are about to sleep for a while  |
| virtual void | **[Thaw](Classes/structllarp_1_1AbstractRouter.md#function-thaw)**() =0<br>thaw from long sleep or network changed event  |
| virtual void | **[Die](Classes/structllarp_1_1AbstractRouter.md#function-die)**() =0<br>non gracefully stop the router  |
| virtual void | **[TriggerPump](Classes/structllarp_1_1AbstractRouter.md#function-triggerpump)**() =0<br>Trigger a pump of low level links. Idempotent.  |
| virtual bool | **[IsBootstrapNode](Classes/structllarp_1_1AbstractRouter.md#function-isbootstrapnode)**([RouterID](Classes/structllarp_1_1RouterID.md) r) const =0 |
| virtual const byte_t * | **[pubkey](Classes/structllarp_1_1AbstractRouter.md#function-pubkey)**() const =0 |
| virtual std::optional< std::variant< nuint32_t, nuint128_t > > | **[OurPublicIP](Classes/structllarp_1_1AbstractRouter.md#function-ourpublicip)**() const =0<br>get what our real public ip is if we can know it  |
| virtual void | **[ConnectToRandomRouters](Classes/structllarp_1_1AbstractRouter.md#function-connecttorandomrouters)**(int N) =0<br>connect to N random routers  |
| virtual bool | **[TryConnectAsync](Classes/structllarp_1_1AbstractRouter.md#function-tryconnectasync)**([RouterContact](Classes/structllarp_1_1RouterContact.md) rc, uint16_t tries) =0 |
| virtual void | **[SessionClosed](Classes/structllarp_1_1AbstractRouter.md#function-sessionclosed)**([RouterID](Classes/structllarp_1_1RouterID.md) remote) =0<br>called by link when a remote session has no more sessions open  |
| virtual llarp_time_t | **[Now](Classes/structllarp_1_1AbstractRouter.md#function-now)**() const =0<br>returns system clock milliseconds since epoch  |
| virtual llarp_time_t | **[Uptime](Classes/structllarp_1_1AbstractRouter.md#function-uptime)**() const =0<br>returns milliseconds since started  |
| virtual bool | **[GetRandomGoodRouter](Classes/structllarp_1_1AbstractRouter.md#function-getrandomgoodrouter)**([RouterID](Classes/structllarp_1_1RouterID.md) & r) =0 |
| virtual bool | **[SendToOrQueue](Classes/structllarp_1_1AbstractRouter.md#function-sendtoorqueue)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote, const [ILinkMessage](Classes/structllarp_1_1ILinkMessage.md) & msg, SendStatusHandler handler =nullptr) =0 |
| virtual void | **[PersistSessionUntil](Classes/structllarp_1_1AbstractRouter.md#function-persistsessionuntil)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote, llarp_time_t until) =0 |
| virtual bool | **[ParseRoutingMessageBuffer](Classes/structllarp_1_1AbstractRouter.md#function-parseroutingmessagebuffer)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & buf, [routing::IMessageHandler](Classes/structllarp_1_1routing_1_1IMessageHandler.md) * h, const [PathID_t](Classes/structllarp_1_1PathID__t.md) & rxid) =0 |
| virtual size_t | **[NumberOfConnectedRouters](Classes/structllarp_1_1AbstractRouter.md#function-numberofconnectedrouters)**() const =0<br>count the number of service nodes we are connected to  |
| virtual size_t | **[NumberOfConnectedClients](Classes/structllarp_1_1AbstractRouter.md#function-numberofconnectedclients)**() const =0<br>count the number of clients that are connected to us  |
| virtual void | **[connect_to_network](Classes/structllarp_1_1AbstractRouter.md#function-connect-to-network)**() =0 |
| virtual bool | **[GetRandomConnectedRouter](Classes/structllarp_1_1AbstractRouter.md#function-getrandomconnectedrouter)**([RouterContact](Classes/structllarp_1_1RouterContact.md) & result) const =0 |
| virtual void | **[HandleDHTLookupForExplore](Classes/structllarp_1_1AbstractRouter.md#function-handledhtlookupforexplore)**([RouterID](Classes/structllarp_1_1RouterID.md) remote, const std::vector< [RouterContact](Classes/structllarp_1_1RouterContact.md) > & results) =0 |
| virtual void | **[SetDownHook](Classes/structllarp_1_1AbstractRouter.md#function-setdownhook)**(std::function< void(void)> ) |
| virtual void | **[LookupRouter](Classes/structllarp_1_1AbstractRouter.md#function-lookuprouter)**([RouterID](Classes/structllarp_1_1RouterID.md) remote, RouterLookupHandler resultHandler) =0<br>lookup router by pubkey if we are a service node this is done direct otherwise it's done via path  |
| virtual bool | **[CheckRenegotiateValid](Classes/structllarp_1_1AbstractRouter.md#function-checkrenegotiatevalid)**([RouterContact](Classes/structllarp_1_1RouterContact.md) newRc, [RouterContact](Classes/structllarp_1_1RouterContact.md) oldRC) =0<br>check if newRc matches oldRC and update local rc for this remote contact if valid returns true on valid and updated returns false otherwise  |
| virtual void | **[SetRouterWhitelist](Classes/structllarp_1_1AbstractRouter.md#function-setrouterwhitelist)**(const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & whitelist, const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & greylist, const std::vector< [RouterID](Classes/structllarp_1_1RouterID.md) > & unfundedlist) =0<br>set router's service node whitelist  |
| virtual std::unordered_set< [RouterID](Classes/structllarp_1_1RouterID.md) > | **[GetRouterWhitelist](Classes/structllarp_1_1AbstractRouter.md#function-getrouterwhitelist)**() const =0 |
| virtual void | **[ForEachPeer](Classes/structllarp_1_1AbstractRouter.md#function-foreachpeer)**(std::function< void(const [ILinkSession](Classes/structllarp_1_1ILinkSession.md) *, bool)> visit, bool randomize) const =0<br>visit each connected link session  |
| virtual bool | **[SessionToRouterAllowed](Classes/structllarp_1_1AbstractRouter.md#function-sessiontorouterallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const =0 |
| virtual bool | **[PathToRouterAllowed](Classes/structllarp_1_1AbstractRouter.md#function-pathtorouterallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const =0 |
| virtual bool | **[HasClientExit](Classes/structllarp_1_1AbstractRouter.md#function-hasclientexit)**() const<br>return true if we have an exit as a client  |
| virtual [path::BuildLimiter](Classes/classllarp_1_1path_1_1BuildLimiter.md) & | **[pathBuildLimiter](Classes/structllarp_1_1AbstractRouter.md#function-pathbuildlimiter)**() =0 |
| virtual bool | **[HasSessionTo](Classes/structllarp_1_1AbstractRouter.md#function-hassessionto)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) const =0<br>return true if we have at least 1 session to this router in either direction  |
| virtual uint32_t | **[NextPathBuildNumber](Classes/structllarp_1_1AbstractRouter.md#function-nextpathbuildnumber)**() =0 |
| virtual std::string | **[ShortName](Classes/structllarp_1_1AbstractRouter.md#function-shortname)**() const =0 |
| virtual util::StatusObject | **[ExtractStatus](Classes/structllarp_1_1AbstractRouter.md#function-extractstatus)**() const =0 |
| virtual util::StatusObject | **[ExtractSummaryStatus](Classes/structllarp_1_1AbstractRouter.md#function-extractsummarystatus)**() const =0 |
| virtual void | **[GossipRCIfNeeded](Classes/structllarp_1_1AbstractRouter.md#function-gossiprcifneeded)**(const [RouterContact](Classes/structllarp_1_1RouterContact.md) rc) =0<br>gossip an rc if required  |
| virtual std::string | **[status_line](Classes/structllarp_1_1AbstractRouter.md#function-status-line)**() =0 |
| template <class EventType ,class... Params\> <br>void | **[NotifyRouterEvent](Classes/structllarp_1_1AbstractRouter.md#function-notifyrouterevent)**(] Params &&... args) const<br>Templated convenience function to generate a RouterHive event and delegate to non-templated (and overridable) function for handling.  |
| virtual int | **[OutboundUDPSocket](Classes/structllarp_1_1AbstractRouter.md#function-outboundudpsocket)**() const |


## Detailed Description

```cpp
struct tooling::HiveRouter;
```

[HiveRouter]() is a subclass of Router which overrides specific behavior in order to perform testing-related functions. 

It exists largely to prevent this behavior (which may often be "dangerous") from leaking into release code. 

## Public Functions Documentation

### function HiveRouter

```cpp
explicit HiveRouter(
    llarp::EventLoop_ptr loop,
    std::shared_ptr< llarp::vpn::Platform > vpnPlatform,
    RouterHive * hive
)
```


### function ~HiveRouter

```cpp
virtual ~HiveRouter() =default
```


### function disableGossipingRC_TestingOnly

```cpp
virtual bool disableGossipingRC_TestingOnly() override
```

Override logic to prevent base Router class from gossiping its RC. 

**Reimplements**: [llarp::Router::disableGossipingRC_TestingOnly](Classes/structllarp_1_1Router.md#function-disablegossipingrc-testingonly)


### function disableGossiping

```cpp
void disableGossiping()
```


### function enableGossiping

```cpp
void enableGossiping()
```


## Protected Functions Documentation

### function HandleRouterEvent

```cpp
virtual void HandleRouterEvent(
    RouterEventPtr event
) const override
```

Virtual function to handle [RouterEvent](). 

**Reimplements**: [llarp::Router::HandleRouterEvent](Classes/structllarp_1_1Router.md#function-handlerouterevent)


[HiveRouter](Classes/structtooling_1_1HiveRouter.md) overrides this in order to inject the event. The default implementation in Router simply logs it. 


## Protected Attributes Documentation

### variable m_disableGossiping

```cpp
bool m_disableGossiping = false;
```


### variable m_hive

```cpp
RouterHive * m_hive = nullptr;
```


-------------------------------

Updated on 2023-04-27 at 04:17:16 +0000