… | |
… | |
36 | #include <openssl/err.h> |
36 | #include <openssl/err.h> |
37 | #include <openssl/pem.h> |
37 | #include <openssl/pem.h> |
38 | #include <openssl/rsa.h> |
38 | #include <openssl/rsa.h> |
39 | #include <openssl/rand.h> |
39 | #include <openssl/rand.h> |
40 | #include <openssl/bn.h> |
40 | #include <openssl/bn.h> |
41 | |
|
|
42 | #include "gettext.h" |
|
|
43 | |
41 | |
44 | #include "conf.h" |
42 | #include "conf.h" |
45 | #include "slog.h" |
43 | #include "slog.h" |
46 | #include "util.h" |
44 | #include "util.h" |
47 | |
45 | |
… | |
… | |
322 | free (script_node_up), script_node_up = strdup (val); |
320 | free (script_node_up), script_node_up = strdup (val); |
323 | else if (!strcmp (var, "node-down")) |
321 | else if (!strcmp (var, "node-down")) |
324 | free (script_node_down), script_node_down = strdup (val); |
322 | free (script_node_down), script_node_down = strdup (val); |
325 | else if (!strcmp (var, "pid-file")) |
323 | else if (!strcmp (var, "pid-file")) |
326 | free (pidfilename), pidfilename = strdup (val); |
324 | free (pidfilename), pidfilename = strdup (val); |
327 | #if ENABLE_DNS |
|
|
328 | else if (!strcmp (var, "dns-forw-host")) |
325 | else if (!strcmp (var, "dns-forw-host")) |
|
|
326 | { |
|
|
327 | #if ENABLE_DNS |
329 | free (dns_forw_host), dns_forw_host = strdup (val); |
328 | free (dns_forw_host), dns_forw_host = strdup (val); |
|
|
329 | #endif |
|
|
330 | } |
330 | else if (!strcmp (var, "dns-forw-port")) |
331 | else if (!strcmp (var, "dns-forw-port")) |
|
|
332 | { |
|
|
333 | #if ENABLE_DNS |
331 | dns_forw_port = atoi (val); |
334 | dns_forw_port = atoi (val); |
332 | #endif |
335 | #endif |
|
|
336 | } |
333 | else if (!strcmp (var, "http-proxy-host")) |
337 | else if (!strcmp (var, "http-proxy-host")) |
334 | { |
338 | { |
335 | #if ENABLE_HTTP_PROXY |
339 | #if ENABLE_HTTP_PROXY |
336 | free (proxy_host), proxy_host = strdup (val); |
340 | free (proxy_host), proxy_host = strdup (val); |
337 | #endif |
341 | #endif |
… | |
… | |
356 | /* node-specific, defaultable */ |
360 | /* node-specific, defaultable */ |
357 | else if (!strcmp (var, "udp-port")) |
361 | else if (!strcmp (var, "udp-port")) |
358 | node->udp_port = atoi (val); |
362 | node->udp_port = atoi (val); |
359 | else if (!strcmp (var, "tcp-port")) |
363 | else if (!strcmp (var, "tcp-port")) |
360 | node->tcp_port = atoi (val); |
364 | node->tcp_port = atoi (val); |
361 | #if ENABLE_DNS |
|
|
362 | else if (!strcmp (var, "dns-hostname")) |
365 | else if (!strcmp (var, "dns-hostname")) |
|
|
366 | { |
|
|
367 | #if ENABLE_DNS |
363 | free (node->dns_hostname), node->dns_hostname = strdup (val); |
368 | free (node->dns_hostname), node->dns_hostname = strdup (val); |
|
|
369 | #endif |
|
|
370 | } |
364 | else if (!strcmp (var, "dns-port")) |
371 | else if (!strcmp (var, "dns-port")) |
|
|
372 | { |
|
|
373 | #if ENABLE_DNS |
365 | node->dns_port = atoi (val); |
374 | node->dns_port = atoi (val); |
|
|
375 | #endif |
|
|
376 | } |
366 | else if (!strcmp (var, "dns-domain")) |
377 | else if (!strcmp (var, "dns-domain")) |
|
|
378 | { |
|
|
379 | #if ENABLE_DNS |
367 | free (node->domain), node->domain = strdup (val); |
380 | free (node->domain), node->domain = strdup (val); |
368 | #endif |
381 | #endif |
|
|
382 | } |
369 | else if (!strcmp (var, "router-priority")) |
383 | else if (!strcmp (var, "router-priority")) |
370 | node->routerprio = atoi (val); |
384 | node->routerprio = atoi (val); |
371 | else if (!strcmp (var, "max-retry")) |
385 | else if (!strcmp (var, "max-retry")) |
372 | node->max_retry = atoi (val); |
386 | node->max_retry = atoi (val); |
373 | else if (!strcmp (var, "connect")) |
387 | else if (!strcmp (var, "connect")) |