Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
conf.h
Go to the documentation of this file.
1 
11 #ifndef CONF_H
12 #define CONF_H
13 
14 #define KSN_BUFFER_DB_SIZE 2048
15 #define KSN_BUFFER_SIZE 1024
16 #define KSN_BUFFER_SM_SIZE 256
17 #define KSN_BUFFER_64_SIZE 64
18 #define KSN_BUFFER_32_SIZE 32
19 
20 #define KSN_MAX_HOST_NAME 31
21 #define NUMBER_TRY_PORTS 1000
22 
23 //#ifndef RELEASE_KSNET
24 #define DEBUG_KSNET 1
25 //#endif
26 
27 #define KSNET_EVENT_MGR_TIMER 0.25
28 #define KSNET_PORT_DEFAULT "9000"
29 #define KSNET_CRYPT 1
30 
31 // Modules enable
32 #define M_ENAMBE_CQUE 1
33 #define M_ENAMBE_STREAM 1
34 #define M_ENAMBE_PBLKF 1
35 #define M_ENAMBE_VPN 1
36 #define M_ENAMBE_TCP 1
37 #define M_ENAMBE_L0s 1
38 #define M_ENAMBE_TCP_P 1
39 #define M_ENAMBE_TUN 1
40 #define M_ENAMBE_TERM 1
41 #define M_ENAMBE_ASYNC 1
42 #define M_ENAMBE_METRIC 1
43 #define M_ENAMBE_LOGGING_SERVER 1
44 #define M_ENAMBE_LOGGING_CLIENT 1
45 #define M_ENAMBE_LOG_READER 1
46 
47 // TRUE & FALSE define
48 #define TRUE 1
49 #define FALSE 0
50 
51 typedef struct teonet_cfg {
52 
53  void *ke;
54 
55  // Flags
57  show_debug_f,
60  show_peers_f,
61  hot_keys_f,
62  crypt_f,
66  sig_segv_f,
68  logging_f,
74 
75  // Daemon mode flags
76  int dflag,
77  kflag;
78 
79  // Network
83 
84  // Application name
88 
89  // Application parameters
90  int app_argc;
91  char **app_argv;
92 
93  // Host name & port
94  long port;
95  int port_inc_f;
97 
98  // TCP Proxy
100  long tcp_port;
101 
102  // L0 Server
105  long l0_tcp_port;
106 
107  // Display log filter
109 
110  // R-Host
113  long r_port;
114  long r_tcp_port;
115  int r_tcp_f;
116 
117  //public ips
120 
121  // VPN
125  long vpn_ip_net;
126  long vpn_mtu;
127 
128  // Terminal
129 // char t_username[KSN_BUFFER_SM_SIZE/2]; ///< User name to login to terminal
130 // char t_password[KSN_BUFFER_SM_SIZE/2]; ///< Password to login to terminal
131 
132  // Syslog options
135  // StatsD address
139 
140  // Helpers
141  int pp;
144 
145 } teonet_cfg;
146 
147 #ifdef __cplusplus
148 extern "C" {
149 #endif
150 
151 void ksnet_addHWAddrConfig(teonet_cfg *conf, char *hwaddr);
152 void read_config(teonet_cfg *conf, int port_param);
153 void ksnet_configInit(teonet_cfg *teo_cfg, void *ke);
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif /* CONF_H */
char net_key[KSN_BUFFER_SM_SIZE/2]
Network key.
Definition: conf.h:81
int kflag
Kill application in Daemon mode.
Definition: conf.h:76
char r_host_addr_opt[KSN_BUFFER_SM_SIZE/2]
Remote host internet address or dns name derived from options.
Definition: conf.h:111
int vpn_connect_f
Start VPN flag.
Definition: conf.h:56
char app_prompt[KSN_BUFFER_SM_SIZE/2]
Application prompt.
Definition: conf.h:85
int hot_keys_f
Show hotkeys when press h.
Definition: conf.h:56
void * ke
Poiner to ksnetEventManager.
Definition: conf.h:53
char l0_tcp_ip_remote[KSN_BUFFER_SM_SIZE/2]
L0 Server remote IP address (send clients to connect to server)
Definition: conf.h:104
int show_debug_vvv_f
Show debug vvv messages.
Definition: conf.h:56
int port_inc_f
Increment host port if busy.
Definition: conf.h:95
int show_peers_f
Show peers at start up.
Definition: conf.h:56
struct teonet_cfg teonet_cfg
int color_output_disable_f
Disable color output flag.
Definition: conf.h:56
int show_debug_vv_f
Show debug vv messages.
Definition: conf.h:56
long log_priority
Syslog priority.
Definition: conf.h:133
char host_name[KSN_MAX_HOST_NAME]
This host name.
Definition: conf.h:96
int r_tcp_f
Connect to TCP Proxy R-Host.
Definition: conf.h:115
void ksnet_addHWAddrConfig(teonet_cfg *conf, char *hwaddr)
#define KSN_BUFFER_SM_SIZE
Size of small buffer for string.
Definition: conf.h:16
#define KSN_MAX_HOST_NAME
Definition: conf.h:20
long statsd_port
Definition: conf.h:137
int logging_f
Start logging server.
Definition: conf.h:56
char app_name[KSN_BUFFER_SM_SIZE/2]
Application name.
Definition: conf.h:86
char vpn_dev_hwaddr[KSN_MAX_HOST_NAME]
VPN Interface MAC address.
Definition: conf.h:123
int dflag
Start application in Daemon mode.
Definition: conf.h:76
int extended_l0_log_f
Extended L0 log output flag.
Definition: conf.h:56
char vpn_dev_name[KSN_MAX_HOST_NAME]
VPN Interface device name.
Definition: conf.h:122
char l0_public_ipv4[KSN_BUFFER_SM_SIZE/2]
L0 Server public IPv4 address (send clients to connect to server)
Definition: conf.h:118
int sig_segv_f
SIGSEGV processing.
Definition: conf.h:56
Definition: conf.h:51
char filter[KSN_BUFFER_SM_SIZE/2]
Display log filter.
Definition: conf.h:108
long port
This host port number.
Definition: conf.h:94
int log_disable_f
Disable send log to logging server.
Definition: conf.h:56
int pp
Definition: conf.h:141
char log_prefix[KSN_BUFFER_SM_SIZE]
Definition: conf.h:134
char vpn_ip[KSN_BUFFER_SM_SIZE/2]
VPN Interface IP.
Definition: conf.h:124
int tcp_allow_f
Allow TCP Proxy connections to this host.
Definition: conf.h:99
long r_port
Remote host port.
Definition: conf.h:113
int app_argc
Number of requered application parameters.
Definition: conf.h:90
int crypt_f
Encrypt/Decrypt packets.
Definition: conf.h:56
char r_host_name[KSN_MAX_HOST_NAME]
Remote host name (if connected)
Definition: conf.h:143
char l0_public_ipv6[KSN_BUFFER_SM_SIZE/2]
L0 Server public IPv6 address (send clients to connect to server)
Definition: conf.h:119
#define ke
void ksnet_configInit(teonet_cfg *teo_cfg, void *ke)
Get configuration parameters.
Definition: conf.c:31
int block_cli_input_f
Block teonet CLI input (for using in GUI application)
Definition: conf.h:56
int no_multi_thread_f
Don't try multi thread mode in async calls.
Definition: conf.h:56
char r_host_addr[KSN_BUFFER_SM_SIZE/2]
Remote host internet address.
Definition: conf.h:112
long vpn_mtu
VPN Interface MTU.
Definition: conf.h:126
char pn[KSN_BUFFER_SM_SIZE]
Definition: conf.h:142
int statsd_peers_f
Definition: conf.h:138
char ** app_argv
Array of application parameters.
Definition: conf.h:91
int show_debug_f
Show debug messages.
Definition: conf.h:56
int l0_allow_f
Allow L0 Server and l0 client connections to this host.
Definition: conf.h:103
long r_tcp_port
Remote host tcp port.
Definition: conf.h:114
int show_connect_f
Show connection message.
Definition: conf.h:56
char app_description[KSN_BUFFER_SM_SIZE/2]
Application description.
Definition: conf.h:87
long l0_tcp_port
L0 Server TCP port number.
Definition: conf.h:105
void read_config(teonet_cfg *conf, int port_param)
Read configuration parameters from file.
Definition: conf.c:145
char network[KSN_BUFFER_SM_SIZE/2]
Network.
Definition: conf.h:80
char statsd_ip[KSN_BUFFER_SM_SIZE/2]
Definition: conf.h:136
int show_tr_udp_f
Show TR-UDP statistic at start up.
Definition: conf.h:56
int send_all_logs_f
Send all logs to logging server (by default only ###)
Definition: conf.h:56
long tcp_port
TCP Proxy port number.
Definition: conf.h:100
char auth_secret[KSN_BUFFER_SM_SIZE/2]
Auth secret.
Definition: conf.h:82
long vpn_ip_net
VPN Interface network mask.
Definition: conf.h:125
int send_ack_event_f
Send TR-UDP ACK event (EV_K_RECEIVED_ACK) to the teonet event loop.
Definition: conf.h:56