---
title: llarp::Config

---

# llarp::Config





## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[Config](Classes/structllarp_1_1Config.md#function-config)**(std::optional< fs::path > datadir =std::nullopt) |
| virtual | **[~Config](Classes/structllarp_1_1Config.md#function-~config)**() =default |
| virtual std::unique_ptr< [ConfigGenParameters](Classes/structllarp_1_1ConfigGenParameters.md) > | **[MakeGenParams](Classes/structllarp_1_1Config.md#function-makegenparams)**() const<br>create generation params (virtual for unit test mock)  |
| void | **[initializeConfig](Classes/structllarp_1_1Config.md#function-initializeconfig)**([ConfigDefinition](Classes/structllarp_1_1ConfigDefinition.md) & conf, const [ConfigGenParameters](Classes/structllarp_1_1ConfigGenParameters.md) & params) |
| void | **[addBackwardsCompatibleConfigOptions](Classes/structllarp_1_1Config.md#function-addbackwardscompatibleconfigoptions)**([ConfigDefinition](Classes/structllarp_1_1ConfigDefinition.md) & conf)<br>Insert config entries for backwards-compatibility (e.g.  |
| bool | **[Load](Classes/structllarp_1_1Config.md#function-load)**(std::optional< fs::path > fname =std::nullopt, bool isRelay =false) |
| bool | **[LoadString](Classes/structllarp_1_1Config.md#function-loadstring)**(std::string_view ini, bool isRelay =false) |
| std::string | **[generateBaseClientConfig](Classes/structllarp_1_1Config.md#function-generatebaseclientconfig)**() |
| std::string | **[generateBaseRouterConfig](Classes/structllarp_1_1Config.md#function-generatebaserouterconfig)**() |
| void | **[Save](Classes/structllarp_1_1Config.md#function-save)**() |
| void | **[Override](Classes/structllarp_1_1Config.md#function-override)**(std::string section, std::string key, std::string value) |
| void | **[AddDefault](Classes/structllarp_1_1Config.md#function-adddefault)**(std::string section, std::string key, std::string value) |
| std::shared_ptr< [Config](Classes/structllarp_1_1Config.md) > | **[EmbeddedConfig](Classes/structllarp_1_1Config.md#function-embeddedconfig)**()<br>create a config with the default parameters for an embedded lokinet  |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [RouterConfig](Classes/structllarp_1_1RouterConfig.md) | **[router](Classes/structllarp_1_1Config.md#variable-router)**  |
| [NetworkConfig](Classes/structllarp_1_1NetworkConfig.md) | **[network](Classes/structllarp_1_1Config.md#variable-network)**  |
| [PeerSelectionConfig](Classes/structllarp_1_1PeerSelectionConfig.md) | **[paths](Classes/structllarp_1_1Config.md#variable-paths)**  |
| [ConnectConfig](Classes/structllarp_1_1ConnectConfig.md) | **[connect](Classes/structllarp_1_1Config.md#variable-connect)**  |
| [DnsConfig](Classes/structllarp_1_1DnsConfig.md) | **[dns](Classes/structllarp_1_1Config.md#variable-dns)**  |
| [LinksConfig](Classes/structllarp_1_1LinksConfig.md) | **[links](Classes/structllarp_1_1Config.md#variable-links)**  |
| [ApiConfig](Classes/structllarp_1_1ApiConfig.md) | **[api](Classes/structllarp_1_1Config.md#variable-api)**  |
| [LokidConfig](Classes/structllarp_1_1LokidConfig.md) | **[lokid](Classes/structllarp_1_1Config.md#variable-lokid)**  |
| [BootstrapConfig](Classes/structllarp_1_1BootstrapConfig.md) | **[bootstrap](Classes/structllarp_1_1Config.md#variable-bootstrap)**  |
| [LoggingConfig](Classes/structllarp_1_1LoggingConfig.md) | **[logging](Classes/structllarp_1_1Config.md#variable-logging)**  |

## Public Functions Documentation

### function Config

```cpp
explicit Config(
    std::optional< fs::path > datadir =std::nullopt
)
```


### function ~Config

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


### function MakeGenParams

```cpp
virtual std::unique_ptr< ConfigGenParameters > MakeGenParams() const
```

create generation params (virtual for unit test mock) 

### function initializeConfig

```cpp
void initializeConfig(
    ConfigDefinition & conf,
    const ConfigGenParameters & params
)
```


### function addBackwardsCompatibleConfigOptions

```cpp
void addBackwardsCompatibleConfigOptions(
    ConfigDefinition & conf
)
```

Insert config entries for backwards-compatibility (e.g. 

**Parameters**: 

  * **conf** is the config to modify 


so that the config system will tolerate old values that are no longer accepted)


### function Load

```cpp
bool Load(
    std::optional< fs::path > fname =std::nullopt,
    bool isRelay =false
)
```


### function LoadString

```cpp
bool LoadString(
    std::string_view ini,
    bool isRelay =false
)
```


### function generateBaseClientConfig

```cpp
std::string generateBaseClientConfig()
```


### function generateBaseRouterConfig

```cpp
std::string generateBaseRouterConfig()
```


### function Save

```cpp
void Save()
```


### function Override

```cpp
void Override(
    std::string section,
    std::string key,
    std::string value
)
```


### function AddDefault

```cpp
void AddDefault(
    std::string section,
    std::string key,
    std::string value
)
```


### function EmbeddedConfig

```cpp
static std::shared_ptr< Config > EmbeddedConfig()
```

create a config with the default parameters for an embedded lokinet 

## Public Attributes Documentation

### variable router

```cpp
RouterConfig router;
```


### variable network

```cpp
NetworkConfig network;
```


### variable paths

```cpp
PeerSelectionConfig paths;
```


### variable connect

```cpp
ConnectConfig connect;
```


### variable dns

```cpp
DnsConfig dns;
```


### variable links

```cpp
LinksConfig links;
```


### variable api

```cpp
ApiConfig api;
```


### variable lokid

```cpp
LokidConfig lokid;
```


### variable bootstrap

```cpp
BootstrapConfig bootstrap;
```


### variable logging

```cpp
LoggingConfig logging;
```


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

Updated on 2023-02-01 at 20:39:32 +0000