|
Teonet library
0.4.7
|
#include <string.h>#include <stdlib.h>#include <unistd.h>#include <libgen.h>#include <sys/stat.h>#include <confuse.h>#include "config/conf.h"#include "config/config.h"#include "utils/utils.h"Macros | |
| #define | save_conf_back() |
Functions | |
| void | set_defaults (teonet_cfg *teo_cfg) |
| Set default configuration parameters. More... | |
| void | ksnet_configInit (teonet_cfg *teo_cfg, void *ke) |
| Get configuration parameters. More... | |
| void | read_config (teonet_cfg *conf, int port_param) |
| Read configuration parameters from file. More... | |
| char * | uconfigFileName (char *buf, const int BUF_SIZE, const int type, const int port, const char *network) |
| Create unique port configuration file name. More... | |
Variables | |
| const char * | localhost |
| KSNet mesh core module. More... | |
| const char * | null_str |
Created on April 11, 2015, 6:10 AM
Teonet configuration parameters module
| #define save_conf_back | ( | ) |
Referenced by read_config().
| void ksnet_configInit | ( | teonet_cfg * | teo_cfg, |
| void * | ke | ||
| ) |
Get configuration parameters.
References ke, teonet_cfg::ke, and set_defaults().
Referenced by ksnetEvMgrInitPort().
| void read_config | ( | teonet_cfg * | conf, |
| int | port_param | ||
| ) |
Read configuration parameters from file.
| conf | |
| port_param |
References teonet_cfg::auth_secret, teonet_cfg::block_cli_input_f, teonet_cfg::color_output_disable_f, teonet_cfg::crypt_f, teonet_cfg::dflag, teonet_cfg::extended_l0_log_f, teonet_cfg::filter, free(), getDataPath(), teonet_cfg::host_name, teonet_cfg::hot_keys_f, KSN_BUFFER_SIZE, KSN_BUFFER_SM_SIZE, ksnet_formatMessage(), ksnet_getSysConfigDir(), teonet_cfg::l0_allow_f, teonet_cfg::l0_public_ipv4, teonet_cfg::l0_public_ipv6, teonet_cfg::l0_tcp_ip_remote, teonet_cfg::l0_tcp_port, teonet_cfg::log_disable_f, teonet_cfg::log_priority, teonet_cfg::logging_f, teonet_cfg::net_key, teonet_cfg::network, teonet_cfg::no_multi_thread_f, teonet_cfg::pn, teonet_cfg::port, teonet_cfg::port_inc_f, teonet_cfg::pp, teonet_cfg::r_host_addr, teonet_cfg::r_port, teonet_cfg::r_tcp_f, teonet_cfg::r_tcp_port, save_conf_back, teonet_cfg::send_ack_event_f, teonet_cfg::send_all_logs_f, teonet_cfg::show_connect_f, teonet_cfg::show_debug_f, teonet_cfg::show_debug_vv_f, teonet_cfg::show_debug_vvv_f, teonet_cfg::show_peers_f, teonet_cfg::show_tr_udp_f, teonet_cfg::sig_segv_f, teonet_cfg::statsd_ip, teonet_cfg::statsd_peers_f, teonet_cfg::statsd_port, teonet_cfg::tcp_allow_f, teonet_cfg::tcp_port, teonet_cfg::vpn_connect_f, teonet_cfg::vpn_dev_hwaddr, teonet_cfg::vpn_dev_name, teonet_cfg::vpn_ip, teonet_cfg::vpn_ip_net, and teonet_cfg::vpn_mtu.
Referenced by ksnetEvMgrInitPort(), ksnMultiInit(), and teoMultiAddNet().
| void set_defaults | ( | teonet_cfg * | teo_cfg | ) |
Set default configuration parameters.
References teonet_cfg::app_name, teonet_cfg::auth_secret, teonet_cfg::block_cli_input_f, teonet_cfg::color_output_disable_f, teonet_cfg::crypt_f, DEBUG, teonet_cfg::extended_l0_log_f, teonet_cfg::filter, free(), getRandomHostName(), teonet_cfg::host_name, KSN_BUFFER_SM_SIZE, KSN_MAX_HOST_NAME, KSNET_CRYPT, KSNET_PORT_DEFAULT, teonet_cfg::l0_allow_f, teonet_cfg::l0_public_ipv4, teonet_cfg::l0_public_ipv6, teonet_cfg::l0_tcp_ip_remote, teonet_cfg::l0_tcp_port, teonet_cfg::log_disable_f, teonet_cfg::log_prefix, teonet_cfg::log_priority, teonet_cfg::logging_f, teonet_cfg::net_key, teonet_cfg::network, teonet_cfg::no_multi_thread_f, teonet_cfg::port, teonet_cfg::port_inc_f, teonet_cfg::r_host_addr, teonet_cfg::r_host_addr_opt, teonet_cfg::r_host_name, teonet_cfg::r_port, teonet_cfg::r_tcp_f, teonet_cfg::r_tcp_port, teonet_cfg::send_ack_event_f, teonet_cfg::show_connect_f, teonet_cfg::show_debug_f, teonet_cfg::show_debug_vv_f, teonet_cfg::show_debug_vvv_f, teonet_cfg::show_peers_f, teonet_cfg::show_tr_udp_f, teonet_cfg::sig_segv_f, teonet_cfg::statsd_peers_f, teonet_cfg::tcp_allow_f, teonet_cfg::tcp_port, teonet_cfg::vpn_connect_f, teonet_cfg::vpn_dev_hwaddr, teonet_cfg::vpn_dev_name, teonet_cfg::vpn_ip, teonet_cfg::vpn_ip_net, and teonet_cfg::vpn_mtu.
Referenced by ksnet_configInit().
| char* uconfigFileName | ( | char * | buf, |
| const int | BUF_SIZE, | ||
| const int | type, | ||
| const int | port, | ||
| const char * | network | ||
| ) |
Create unique port configuration file name.
| buf | Buffer to create file name |
| BUF_SIZE | Size of buffer |
| type | Configuration file type: 0 - system; 1 - local |
| port | Port number |
| network | Network name |
References free(), getDataPath(), ksnet_formatMessage(), and ksnet_getSysConfigDir().
| const char* localhost |
| const char * null_str |
Referenced by event_cb(), and ksnetArpShowStr().