---
title: llarp::RCLookupHandler

---

# llarp::RCLookupHandler





Inherits from [llarp::I_RCLookupHandler](Classes/structllarp_1_1I__RCLookupHandler.md)

## Public Types

|                | Name           |
| -------------- | -------------- |
| using std::function< void(void)> | **[Work_t](Classes/structllarp_1_1RCLookupHandler.md#using-work-t)**  |
| using std::function< void(Work_t)> | **[WorkerFunc_t](Classes/structllarp_1_1RCLookupHandler.md#using-workerfunc-t)**  |
| using std::list< RCRequestCallback > | **[CallbacksQueue](Classes/structllarp_1_1RCLookupHandler.md#using-callbacksqueue)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[~RCLookupHandler](Classes/structllarp_1_1RCLookupHandler.md#function-~rclookuphandler)**() override =default |
| virtual void | **[AddValidRouter](Classes/structllarp_1_1RCLookupHandler.md#function-addvalidrouter)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) override |
| virtual void | **[RemoveValidRouter](Classes/structllarp_1_1RCLookupHandler.md#function-removevalidrouter)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router) override |
| virtual void | **[SetRouterWhitelist](Classes/structllarp_1_1RCLookupHandler.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) > & greenlist) override |
| virtual bool | **[HaveReceivedWhitelist](Classes/structllarp_1_1RCLookupHandler.md#function-havereceivedwhitelist)**() const override |
| virtual void | **[GetRC](Classes/structllarp_1_1RCLookupHandler.md#function-getrc)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & router, RCRequestCallback callback, bool forceLookup =false) override |
| virtual bool | **[PathIsAllowed](Classes/structllarp_1_1RCLookupHandler.md#function-pathisallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote) const override |
| virtual bool | **[SessionIsAllowed](Classes/structllarp_1_1RCLookupHandler.md#function-sessionisallowed)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote) const override |
| virtual bool | **[IsGreylisted](Classes/structllarp_1_1RCLookupHandler.md#function-isgreylisted)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote) const override |
| virtual bool | **[IsGreenlisted](Classes/structllarp_1_1RCLookupHandler.md#function-isgreenlisted)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote) const override |
| virtual bool | **[IsRegistered](Classes/structllarp_1_1RCLookupHandler.md#function-isregistered)**(const [RouterID](Classes/structllarp_1_1RouterID.md) & remote) const override |
| virtual bool | **[CheckRC](Classes/structllarp_1_1RCLookupHandler.md#function-checkrc)**(const [RouterContact](Classes/structllarp_1_1RouterContact.md) & rc) const override |
| virtual bool | **[GetRandomWhitelistRouter](Classes/structllarp_1_1RCLookupHandler.md#function-getrandomwhitelistrouter)**([RouterID](Classes/structllarp_1_1RouterID.md) & router) const override |
| virtual bool | **[CheckRenegotiateValid](Classes/structllarp_1_1RCLookupHandler.md#function-checkrenegotiatevalid)**([RouterContact](Classes/structllarp_1_1RouterContact.md) newrc, [RouterContact](Classes/structllarp_1_1RouterContact.md) oldrc) override |
| virtual void | **[PeriodicUpdate](Classes/structllarp_1_1RCLookupHandler.md#function-periodicupdate)**(llarp_time_t now) override |
| virtual void | **[ExploreNetwork](Classes/structllarp_1_1RCLookupHandler.md#function-explorenetwork)**() override |
| virtual size_t | **[NumberOfStrictConnectRouters](Classes/structllarp_1_1RCLookupHandler.md#function-numberofstrictconnectrouters)**() const override |
| void | **[Init](Classes/structllarp_1_1RCLookupHandler.md#function-init)**([llarp_dht_context](Classes/structllarp__dht__context.md) * dht, std::shared_ptr< [NodeDB](Classes/classllarp_1_1NodeDB.md) > nodedb, std::shared_ptr< [EventLoop](Classes/classllarp_1_1EventLoop.md) > loop, WorkerFunc_t dowork, [ILinkManager](Classes/structllarp_1_1ILinkManager.md) * linkManager, [service::Context](Classes/structllarp_1_1service_1_1Context.md) * hiddenServiceContext, const std::unordered_set< [RouterID](Classes/structllarp_1_1RouterID.md) > & strictConnectPubkeys, const std::set< [RouterContact](Classes/structllarp_1_1RouterContact.md) > & bootstrapRCList, bool useWhitelist_arg, bool isServiceNode_arg) |
| std::unordered_set< [RouterID](Classes/structllarp_1_1RouterID.md) > | **[Whitelist](Classes/structllarp_1_1RCLookupHandler.md#function-whitelist)**() const |

## Additional inherited members

**Public Functions inherited from [llarp::I_RCLookupHandler](Classes/structllarp_1_1I__RCLookupHandler.md)**

|                | Name           |
| -------------- | -------------- |
| virtual | **[~I_RCLookupHandler](Classes/structllarp_1_1I__RCLookupHandler.md#function-~i-rclookuphandler)**() =default |


## Public Types Documentation

### using Work_t

```cpp
using llarp::RCLookupHandler::Work_t =  std::function<void(void)>;
```


### using WorkerFunc_t

```cpp
using llarp::RCLookupHandler::WorkerFunc_t =  std::function<void(Work_t)>;
```


### using CallbacksQueue

```cpp
using llarp::RCLookupHandler::CallbacksQueue =  std::list<RCRequestCallback>;
```


## Public Functions Documentation

### function ~RCLookupHandler

```cpp
~RCLookupHandler() override =default
```


### function AddValidRouter

```cpp
virtual void AddValidRouter(
    const RouterID & router
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::AddValidRouter](Classes/structllarp_1_1I__RCLookupHandler.md#function-addvalidrouter)


### function RemoveValidRouter

```cpp
virtual void RemoveValidRouter(
    const RouterID & router
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::RemoveValidRouter](Classes/structllarp_1_1I__RCLookupHandler.md#function-removevalidrouter)


### function SetRouterWhitelist

```cpp
virtual void SetRouterWhitelist(
    const std::vector< RouterID > & whitelist,
    const std::vector< RouterID > & greylist,
    const std::vector< RouterID > & greenlist
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::SetRouterWhitelist](Classes/structllarp_1_1I__RCLookupHandler.md#function-setrouterwhitelist)


### function HaveReceivedWhitelist

```cpp
virtual bool HaveReceivedWhitelist() const override
```


**Reimplements**: [llarp::I_RCLookupHandler::HaveReceivedWhitelist](Classes/structllarp_1_1I__RCLookupHandler.md#function-havereceivedwhitelist)


### function GetRC

```cpp
virtual void GetRC(
    const RouterID & router,
    RCRequestCallback callback,
    bool forceLookup =false
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::GetRC](Classes/structllarp_1_1I__RCLookupHandler.md#function-getrc)


### function PathIsAllowed

```cpp
virtual bool PathIsAllowed(
    const RouterID & remote
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::PathIsAllowed](Classes/structllarp_1_1I__RCLookupHandler.md#function-pathisallowed)


### function SessionIsAllowed

```cpp
virtual bool SessionIsAllowed(
    const RouterID & remote
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::SessionIsAllowed](Classes/structllarp_1_1I__RCLookupHandler.md#function-sessionisallowed)


### function IsGreylisted

```cpp
virtual bool IsGreylisted(
    const RouterID & remote
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::IsGreylisted](Classes/structllarp_1_1I__RCLookupHandler.md#function-isgreylisted)


### function IsGreenlisted

```cpp
virtual bool IsGreenlisted(
    const RouterID & remote
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::IsGreenlisted](Classes/structllarp_1_1I__RCLookupHandler.md#function-isgreenlisted)


### function IsRegistered

```cpp
virtual bool IsRegistered(
    const RouterID & remote
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::IsRegistered](Classes/structllarp_1_1I__RCLookupHandler.md#function-isregistered)


### function CheckRC

```cpp
virtual bool CheckRC(
    const RouterContact & rc
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::CheckRC](Classes/structllarp_1_1I__RCLookupHandler.md#function-checkrc)


### function GetRandomWhitelistRouter

```cpp
virtual bool GetRandomWhitelistRouter(
    RouterID & router
) const override
```


**Reimplements**: [llarp::I_RCLookupHandler::GetRandomWhitelistRouter](Classes/structllarp_1_1I__RCLookupHandler.md#function-getrandomwhitelistrouter)


### function CheckRenegotiateValid

```cpp
virtual bool CheckRenegotiateValid(
    RouterContact newrc,
    RouterContact oldrc
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::CheckRenegotiateValid](Classes/structllarp_1_1I__RCLookupHandler.md#function-checkrenegotiatevalid)


### function PeriodicUpdate

```cpp
virtual void PeriodicUpdate(
    llarp_time_t now
) override
```


**Reimplements**: [llarp::I_RCLookupHandler::PeriodicUpdate](Classes/structllarp_1_1I__RCLookupHandler.md#function-periodicupdate)


### function ExploreNetwork

```cpp
virtual void ExploreNetwork() override
```


**Reimplements**: [llarp::I_RCLookupHandler::ExploreNetwork](Classes/structllarp_1_1I__RCLookupHandler.md#function-explorenetwork)


### function NumberOfStrictConnectRouters

```cpp
virtual size_t NumberOfStrictConnectRouters() const override
```


**Reimplements**: [llarp::I_RCLookupHandler::NumberOfStrictConnectRouters](Classes/structllarp_1_1I__RCLookupHandler.md#function-numberofstrictconnectrouters)


### function Init

```cpp
void Init(
    llarp_dht_context * dht,
    std::shared_ptr< NodeDB > nodedb,
    std::shared_ptr< EventLoop > loop,
    WorkerFunc_t dowork,
    ILinkManager * linkManager,
    service::Context * hiddenServiceContext,
    const std::unordered_set< RouterID > & strictConnectPubkeys,
    const std::set< RouterContact > & bootstrapRCList,
    bool useWhitelist_arg,
    bool isServiceNode_arg
)
```


### function Whitelist

```cpp
inline std::unordered_set< RouterID > Whitelist() const
```


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

Updated on 2022-10-17 at 13:14:48 +0000