---
title: llarp::rpc

---

# llarp::rpc



## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::rpc::EndpointAuthRPC](Classes/structllarp_1_1rpc_1_1EndpointAuthRPC.md)**  |
| class | **[llarp::rpc::json_binary_proxy](Classes/classllarp_1_1rpc_1_1json__binary__proxy.md)**  |
| struct | **[llarp::rpc::LokidRpcClient](Classes/structllarp_1_1rpc_1_1LokidRpcClient.md)** <br>The [LokidRpcClient]() uses loki-mq to talk to make API requests to lokid.  |
| struct | **[llarp::rpc::required](Classes/structllarp_1_1rpc_1_1required.md)**  |
| struct | **[llarp::rpc::ignore_empty_string](Classes/structllarp_1_1rpc_1_1ignore__empty__string.md)**  |
| struct | **[llarp::rpc::RPCRequest](Classes/structllarp_1_1rpc_1_1RPCRequest.md)**  |
| struct | **[llarp::rpc::NoArgs](Classes/structllarp_1_1rpc_1_1NoArgs.md)**  |
| struct | **[llarp::rpc::Immediate](Classes/structllarp_1_1rpc_1_1Immediate.md)**  |
| struct | **[llarp::rpc::Halt](Classes/structllarp_1_1rpc_1_1Halt.md)**  |
| struct | **[llarp::rpc::Version](Classes/structllarp_1_1rpc_1_1Version.md)**  |
| struct | **[llarp::rpc::Status](Classes/structllarp_1_1rpc_1_1Status.md)**  |
| struct | **[llarp::rpc::GetStatus](Classes/structllarp_1_1rpc_1_1GetStatus.md)**  |
| struct | **[llarp::rpc::QuicConnect](Classes/structllarp_1_1rpc_1_1QuicConnect.md)**  |
| struct | **[llarp::rpc::QuicListener](Classes/structllarp_1_1rpc_1_1QuicListener.md)**  |
| struct | **[llarp::rpc::LookupSnode](Classes/structllarp_1_1rpc_1_1LookupSnode.md)**  |
| struct | **[llarp::rpc::MapExit](Classes/structllarp_1_1rpc_1_1MapExit.md)**  |
| struct | **[llarp::rpc::ListExits](Classes/structllarp_1_1rpc_1_1ListExits.md)**  |
| struct | **[llarp::rpc::UnmapExit](Classes/structllarp_1_1rpc_1_1UnmapExit.md)**  |
| struct | **[llarp::rpc::DNSQuery](Classes/structllarp_1_1rpc_1_1DNSQuery.md)**  |
| struct | **[llarp::rpc::Config](Classes/structllarp_1_1rpc_1_1Config.md)**  |
| struct | **[llarp::rpc::rpc_callback](Classes/structllarp_1_1rpc_1_1rpc__callback.md)**  |
| struct | **[llarp::rpc::rpc_error](Classes/structllarp_1_1rpc_1_1rpc__error.md)**  |
| class | **[llarp::rpc::RPCServer](Classes/classllarp_1_1rpc_1_1RPCServer.md)**  |
| class | **[llarp::rpc::EndpointHandler](Classes/classllarp_1_1rpc_1_1EndpointHandler.md)**  |

## Types

|                | Name           |
| -------------- | -------------- |
| typedef std::shared_ptr< oxenmq::OxenMQ > | **[LMQ_ptr](Namespaces/namespacellarp_1_1rpc.md#typedef-lmq-ptr)**  |
| using std::pair< nlohmann::json::const_iterator, nlohmann::json::const_iterator > | **[json_range](Namespaces/namespacellarp_1_1rpc.md#using-json-range)**  |
| typedef std::variant< std::monostate, nlohmann::json, oxenc::bt_dict_consumer > | **[rpc_input](Namespaces/namespacellarp_1_1rpc.md#typedef-rpc-input)**  |
| using [tools::type_list](Classes/structtools_1_1type__list.md)< [Halt](Classes/structllarp_1_1rpc_1_1Halt.md), [Version](Classes/structllarp_1_1rpc_1_1Version.md), [Status](Classes/structllarp_1_1rpc_1_1Status.md), [GetStatus](Classes/structllarp_1_1rpc_1_1GetStatus.md), [QuicConnect](Classes/structllarp_1_1rpc_1_1QuicConnect.md), [QuicListener](Classes/structllarp_1_1rpc_1_1QuicListener.md), [LookupSnode](Classes/structllarp_1_1rpc_1_1LookupSnode.md), [MapExit](Classes/structllarp_1_1rpc_1_1MapExit.md), [ListExits](Classes/structllarp_1_1rpc_1_1ListExits.md), [UnmapExit](Classes/structllarp_1_1rpc_1_1UnmapExit.md), [DNSQuery](Classes/structllarp_1_1rpc_1_1DNSQuery.md), [Config](Classes/structllarp_1_1rpc_1_1Config.md) > | **[rpc_request_types](Namespaces/namespacellarp_1_1rpc.md#using-rpc-request-types)**  |
| using oxenmq::Message::DeferredSend | **[DeferredSend](Namespaces/namespacellarp_1_1rpc.md#using-deferredsend)**  |

## Functions

|                | Name           |
| -------------- | -------------- |
| void | **[load_binary_parameter_impl](Namespaces/namespacellarp_1_1rpc.md#function-load-binary-parameter-impl)**(std::string_view bytes, size_t raw_size, bool allow_raw, uint8_t * val_data) |
| template <typename T ,typename  =std::enable_if_t<json_is_binary<T>>\> <br>void | **[load_binary_parameter](Namespaces/namespacellarp_1_1rpc.md#function-load-binary-parameter)**(std::string_view bytes, bool allow_raw, T & val) |
| oxenc::bt_value | **[json_to_bt](Namespaces/namespacellarp_1_1rpc.md#function-json-to-bt)**(json && j) |
| template <typename... Ignore\> <br>void | **[check_ascending_names](Namespaces/namespacellarp_1_1rpc.md#function-check-ascending-names)**(std::string_view name1, std::string_view name2, const Ignore & ...) |
| bool | **[skip_until](Namespaces/namespacellarp_1_1rpc.md#function-skip-until)**(oxenc::bt_dict_consumer & d, std::string_view name) |
| bool | **[skip_until](Namespaces/namespacellarp_1_1rpc.md#function-skip-until)**(json_range & it_range, std::string_view name) |
| template <typename TupleLike ,size_t... Is\> <br>void | **[load_tuple_values](Namespaces/namespacellarp_1_1rpc.md#function-load-tuple-values)**(oxenc::bt_list_consumer & c, TupleLike & val, std::index_sequence< Is... > ) |
| template <typename BTConsumer ,typename T ,std::enable_if_t< std::is_same_v< BTConsumer, oxenc::bt_dict_consumer >||std::is_same_v< BTConsumer, oxenc::bt_list_consumer >, int >  =0\> <br>void | **[load_value](Namespaces/namespacellarp_1_1rpc.md#function-load-value)**(BTConsumer & c, T & target) |
| template <typename T \> <br>void | **[load_value](Namespaces/namespacellarp_1_1rpc.md#function-load-value)**(json_range & range_itr, T & target) |
| template <typename In ,typename T \> <br>void | **[load_curr_value](Namespaces/namespacellarp_1_1rpc.md#function-load-curr-value)**(In & in, T & val) |
| template <typename In ,typename T \> <br>void | **[get_next_value](Namespaces/namespacellarp_1_1rpc.md#function-get-next-value)**(In & in, ] std::string_view name, T & val) |
| template <typename Input ,typename T ,typename... More\> <br>void | **[get_values](Namespaces/namespacellarp_1_1rpc.md#function-get-values)**(Input & in, std::string_view name, T && val, More &&... more) |
| template <typename RPC \> <br>auto | **[make_invoke](Namespaces/namespacellarp_1_1rpc.md#function-make-invoke)**() |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([NoArgs](Classes/structllarp_1_1rpc_1_1NoArgs.md) & , rpc_input ) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([QuicConnect](Classes/structllarp_1_1rpc_1_1QuicConnect.md) & quicconnect, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([QuicListener](Classes/structllarp_1_1rpc_1_1QuicListener.md) & quiclistener, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([LookupSnode](Classes/structllarp_1_1rpc_1_1LookupSnode.md) & lookupsnode, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([MapExit](Classes/structllarp_1_1rpc_1_1MapExit.md) & mapexit, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([UnmapExit](Classes/structllarp_1_1rpc_1_1UnmapExit.md) & unmapexit, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([DNSQuery](Classes/structllarp_1_1rpc_1_1DNSQuery.md) & dnsquery, rpc_input input) |
| void | **[parse_request](Namespaces/namespacellarp_1_1rpc.md#function-parse-request)**([Config](Classes/structllarp_1_1rpc_1_1Config.md) & config, rpc_input input) |
| template <typename Result_t \> <br>void | **[SetJSONResponse](Namespaces/namespacellarp_1_1rpc.md#function-setjsonresponse)**(Result_t result, json & j) |
| void | **[SetJSONError](Namespaces/namespacellarp_1_1rpc.md#function-setjsonerror)**(std::string_view msg, json & j) |

## Attributes

|                | Name           |
| -------------- | -------------- |
| constexpr bool | **[json_is_binary](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary)**  |
| constexpr bool | **[json_is_binary_container](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary-container)**  |
| constexpr bool | **[json_is_binary< const T & >](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary<-const-t-&->)**  |
| constexpr bool | **[json_is_binary< T && >](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary<-t-&&->)**  |
| constexpr bool | **[json_is_binary_container< const T & >](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary-container<-const-t-&->)**  |
| constexpr bool | **[json_is_binary_container< T && >](Namespaces/namespacellarp_1_1rpc.md#variable-json-is-binary-container<-t-&&->)**  |
| constexpr bool | **[is_required_wrapper](Namespaces/namespacellarp_1_1rpc.md#variable-is-required-wrapper)**  |
| constexpr bool | **[is_required_wrapper< required< T > >](Namespaces/namespacellarp_1_1rpc.md#variable-is-required-wrapper<-required<-t->->)**  |
| constexpr bool | **[is_std_optional](Namespaces/namespacellarp_1_1rpc.md#variable-is-std-optional)**  |
| constexpr bool | **[is_ignore_empty_string_wrapper](Namespaces/namespacellarp_1_1rpc.md#variable-is-ignore-empty-string-wrapper)**  |
| constexpr bool | **[is_ignore_empty_string_wrapper< ignore_empty_string< T > >](Namespaces/namespacellarp_1_1rpc.md#variable-is-ignore-empty-string-wrapper<-ignore-empty-string<-t->->)**  |
| constexpr bool | **[is_expandable_list](Namespaces/namespacellarp_1_1rpc.md#variable-is-expandable-list)**  |
| constexpr bool | **[is_string_constructible](Namespaces/namespacellarp_1_1rpc.md#variable-is-string-constructible)**  |
| constexpr bool | **[is_string_constructible< IPRange >](Namespaces/namespacellarp_1_1rpc.md#variable-is-string-constructible<-iprange->)**  |
| constexpr bool | **[is_tuple_like](Namespaces/namespacellarp_1_1rpc.md#variable-is-tuple-like)**  |
| constexpr bool | **[is_unordered_string_map](Namespaces/namespacellarp_1_1rpc.md#variable-is-unordered-string-map)**  |
| const std::unordered_map< std::string, [rpc_callback](Classes/structllarp_1_1rpc_1_1rpc__callback.md) > | **[rpc_request_map](Namespaces/namespacellarp_1_1rpc.md#variable-rpc-request-map)**  |

## Types Documentation

### typedef LMQ_ptr

```cpp
typedef std::shared_ptr< oxenmq::OxenMQ > llarp::rpc::LMQ_ptr;
```


### using json_range

```cpp
using llarp::rpc::json_range = typedef std::pair<nlohmann::json::const_iterator, nlohmann::json::const_iterator>;
```


### typedef rpc_input

```cpp
typedef std::variant< std::monostate, nlohmann::json, oxenc::bt_dict_consumer > llarp::rpc::rpc_input;
```


### using rpc_request_types

```cpp
using llarp::rpc::rpc_request_types = typedef tools::type_list< Halt, Version, Status, GetStatus, QuicConnect, QuicListener, LookupSnode, MapExit, ListExits, UnmapExit, DNSQuery, Config>;
```


### using DeferredSend

```cpp
using llarp::rpc::DeferredSend = typedef oxenmq::Message::DeferredSend;
```



## Functions Documentation

### function load_binary_parameter_impl

```cpp
void load_binary_parameter_impl(
    std::string_view bytes,
    size_t raw_size,
    bool allow_raw,
    uint8_t * val_data
)
```


### function load_binary_parameter

```cpp
template <typename T ,
typename  =std::enable_if_t<json_is_binary<T>>>
void load_binary_parameter(
    std::string_view bytes,
    bool allow_raw,
    T & val
)
```


### function json_to_bt

```cpp
inline oxenc::bt_value json_to_bt(
    json && j
)
```


### function check_ascending_names

```cpp
template <typename... Ignore>
void check_ascending_names(
    std::string_view name1,
    std::string_view name2,
    const Ignore & ...
)
```


### function skip_until

```cpp
inline bool skip_until(
    oxenc::bt_dict_consumer & d,
    std::string_view name
)
```


### function skip_until

```cpp
inline bool skip_until(
    json_range & it_range,
    std::string_view name
)
```


### function load_tuple_values

```cpp
template <typename TupleLike ,
size_t... Is>
void load_tuple_values(
    oxenc::bt_list_consumer & c,
    TupleLike & val,
    std::index_sequence< Is... > 
)
```


### function load_value

```cpp
template <typename BTConsumer ,
typename T ,
std::enable_if_t< std::is_same_v< BTConsumer, oxenc::bt_dict_consumer >||std::is_same_v< BTConsumer, oxenc::bt_list_consumer >, int >  =0>
void load_value(
    BTConsumer & c,
    T & target
)
```


### function load_value

```cpp
template <typename T >
void load_value(
    json_range & range_itr,
    T & target
)
```


### function load_curr_value

```cpp
template <typename In ,
typename T >
void load_curr_value(
    In & in,
    T & val
)
```


### function get_next_value

```cpp
template <typename In ,
typename T >
void get_next_value(
    In & in,
    ] std::string_view name,
    T & val
)
```


### function get_values

```cpp
template <typename Input ,
typename T ,
typename... More>
void get_values(
    Input & in,
    std::string_view name,
    T && val,
    More &&... more
)
```


### function make_invoke

```cpp
template <typename RPC >
auto make_invoke()
```


### function parse_request

```cpp
inline void parse_request(
    NoArgs & ,
    rpc_input 
)
```


### function parse_request

```cpp
void parse_request(
    QuicConnect & quicconnect,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    QuicListener & quiclistener,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    LookupSnode & lookupsnode,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    MapExit & mapexit,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    UnmapExit & unmapexit,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    DNSQuery & dnsquery,
    rpc_input input
)
```


### function parse_request

```cpp
void parse_request(
    Config & config,
    rpc_input input
)
```


### function SetJSONResponse

```cpp
template <typename Result_t >
void SetJSONResponse(
    Result_t result,
    json & j
)
```


### function SetJSONError

```cpp
inline void SetJSONError(
    std::string_view msg,
    json & j
)
```



## Attributes Documentation

### variable json_is_binary

```cpp
constexpr bool json_is_binary = false;
```


### variable json_is_binary_container

```cpp
constexpr bool json_is_binary_container = false;
```


### variable json_is_binary< const T & >

```cpp
constexpr bool json_is_binary< const T & > = json_is_binary<T>;
```


### variable json_is_binary< T && >

```cpp
constexpr bool json_is_binary< T && > = json_is_binary<T>;
```


### variable json_is_binary_container< const T & >

```cpp
constexpr bool json_is_binary_container< const T & > = json_is_binary_container<T>;
```


### variable json_is_binary_container< T && >

```cpp
constexpr bool json_is_binary_container< T && > = json_is_binary_container<T>;
```


### variable is_required_wrapper

```cpp
constexpr bool is_required_wrapper = false;
```


### variable is_required_wrapper< required< T > >

```cpp
constexpr bool is_required_wrapper< required< T > > = true;
```


### variable is_std_optional

```cpp
constexpr bool is_std_optional = false;
```


### variable is_ignore_empty_string_wrapper

```cpp
constexpr bool is_ignore_empty_string_wrapper = false;
```


### variable is_ignore_empty_string_wrapper< ignore_empty_string< T > >

```cpp
constexpr bool is_ignore_empty_string_wrapper< ignore_empty_string< T > > = true;
```


### variable is_expandable_list

```cpp
constexpr bool is_expandable_list = false;
```


### variable is_string_constructible

```cpp
constexpr bool is_string_constructible = false;
```


### variable is_string_constructible< IPRange >

```cpp
constexpr bool is_string_constructible< IPRange > = true;
```


### variable is_tuple_like

```cpp
constexpr bool is_tuple_like = false;
```


### variable is_unordered_string_map

```cpp
constexpr bool is_unordered_string_map = false;
```


### variable rpc_request_map

```cpp
const std::unordered_map< std::string, rpc_callback > rpc_request_map;
```





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

Updated on 2023-01-27 at 23:09:26 +0000