You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/config.hpp

51 lines
1016 B
C++

#ifndef LLARP_CONFIG_HPP
#define LLARP_CONFIG_HPP
#include <functional>
#include <string>
#include <utility>
#include <vector>
7 years ago
namespace llarp
{
struct Config
{
using section_t = std::vector< std::pair< std::string, std::string > >;
7 years ago
section_t router;
section_t network;
section_t netdb;
6 years ago
section_t dns;
section_t iwp_links;
section_t connect;
6 years ago
section_t services;
6 years ago
section_t system;
section_t metrics;
section_t api;
section_t lokid;
section_t bootstrap;
5 years ago
section_t logging;
7 years ago
bool
Load(const char *fname);
using Visitor = std::function< void(const char *section, const char *key,
const char *val) >;
void
visit(const Visitor &visitor);
};
6 years ago
7 years ago
} // namespace llarp
7 years ago
6 years ago
void
llarp_generic_ensure_config(std::ofstream &f, std::string basepath);
void
llarp_ensure_router_config(std::ofstream &f, std::string basepath);
6 years ago
bool
llarp_ensure_client_config(std::ofstream &f, std::string basepath);
7 years ago
#endif