… | |
… | |
27 | #include <openssl/rsa.h> |
27 | #include <openssl/rsa.h> |
28 | |
28 | |
29 | #include "slog.h" |
29 | #include "slog.h" |
30 | #include "global.h" |
30 | #include "global.h" |
31 | |
31 | |
32 | #define DEFAULT_REKEY 3600 |
32 | #define DEFAULT_REKEY 3600 |
33 | #define DEFAULT_KEEPALIVE 60 // one keepalive/minute (it's just 8 bytes...) |
33 | #define DEFAULT_KEEPALIVE 60 // one keepalive/minute (it's just 8 bytes...) |
34 | #define DEFAULT_UDPPORT 655 // same as tinc, conflicts would be rare |
34 | #define DEFAULT_UDPPORT 655 // same as tinc, conflicts would be rare |
35 | #define DEFAULT_MTU 1500 // let's ether-net |
35 | #define DEFAULT_MTU 1500 // let's ether-net |
36 | #define DEFAULT_MAX_RETRY 3600 // retry at least this often |
36 | #define DEFAULT_MAX_RETRY 3600 // retry at least this often |
|
|
37 | |
|
|
38 | #define DEFAULT_DNS_TIMEOUT_FACTOR 8.F // initial retry timeout multiple |
|
|
39 | #define DEFAULT_DNS_SEND_INTERVAL .01F // minimum send interval |
|
|
40 | #define DEFAULT_DNS_OVERLAP_FACTOR .5F // RTT * LATENCY_FACTOR == sending rate |
|
|
41 | #define DEFAULT_DNS_MAX_OUTSTANDING 100 // max. number of outstanding requests |
37 | |
42 | |
38 | enum { |
43 | enum { |
39 | PROT_UDPv4 = 0x01, // udp over ipv4 |
44 | PROT_UDPv4 = 0x01, // udp over ipv4 |
40 | PROT_IPv4 = 0x02, // generic ip protocol |
45 | PROT_IPv4 = 0x02, // generic ip protocol |
41 | PROT_TCPv4 = 0x04, // tcp over ipv4 (server) |
46 | PROT_TCPv4 = 0x04, // tcp over ipv4 (server) |
… | |
… | |
107 | #endif |
112 | #endif |
108 | |
113 | |
109 | #if ENABLE_DNS |
114 | #if ENABLE_DNS |
110 | char *dns_forw_host; |
115 | char *dns_forw_host; |
111 | u16 dns_forw_port; |
116 | u16 dns_forw_port; |
|
|
117 | float dns_timeout_factor; |
|
|
118 | float dns_send_interval; |
|
|
119 | float dns_overlap_factor; |
|
|
120 | int dns_max_outstanding; |
112 | #endif |
121 | #endif |
113 | |
122 | |
114 | void init (); |
123 | void init (); |
115 | void cleanup (); |
124 | void cleanup (); |
116 | void read_config (bool need_keys); |
125 | void read_config (bool need_keys); |