… | |
… | |
217 | val = strtok (NULL, "\t\n\r ="); |
217 | val = strtok (NULL, "\t\n\r ="); |
218 | |
218 | |
219 | if (!val || val[0] == '#') |
219 | if (!val || val[0] == '#') |
220 | { |
220 | { |
221 | slog (L_WARN, |
221 | slog (L_WARN, |
222 | _("no value for variable `%s', at '%s' line %d"), |
222 | _("no value for variable `%s', at '%s' line %d, skipping."), |
223 | var, fname, lineno); |
223 | var, fname, lineno); |
224 | break; |
224 | continue; |
225 | } |
225 | } |
226 | |
226 | |
227 | if (!strcmp (var, "on")) |
227 | if (!strcmp (var, "on")) |
228 | { |
228 | { |
229 | if (!::thisnode |
229 | if (!::thisnode |
… | |
… | |
301 | thisnode = node; |
301 | thisnode = node; |
302 | } |
302 | } |
303 | else if (!strcmp (var, "private-key")) |
303 | else if (!strcmp (var, "private-key")) |
304 | free (prikeyfile), prikeyfile = strdup (val); |
304 | free (prikeyfile), prikeyfile = strdup (val); |
305 | else if (!strcmp (var, "ifpersist")) |
305 | else if (!strcmp (var, "ifpersist")) |
306 | { |
|
|
307 | parse_bool (ifpersist, "ifpersist", true, false); |
306 | parse_bool (ifpersist, "ifpersist", true, false); |
308 | } |
|
|
309 | else if (!strcmp (var, "ifname")) |
307 | else if (!strcmp (var, "ifname")) |
310 | free (ifname), ifname = strdup (val); |
308 | free (ifname), ifname = strdup (val); |
311 | else if (!strcmp (var, "rekey")) |
309 | else if (!strcmp (var, "rekey")) |
312 | rekey = atoi (val); |
310 | rekey = atoi (val); |
313 | else if (!strcmp (var, "keepalive")) |
311 | else if (!strcmp (var, "keepalive")) |
… | |
… | |
394 | node->connectmode = conf_node::C_ALWAYS; |
392 | node->connectmode = conf_node::C_ALWAYS; |
395 | else if (!strcmp (val, "disabled")) |
393 | else if (!strcmp (val, "disabled")) |
396 | node->connectmode = conf_node::C_DISABLED; |
394 | node->connectmode = conf_node::C_DISABLED; |
397 | else |
395 | else |
398 | slog (L_WARN, |
396 | slog (L_WARN, |
399 | _("illegal value for 'connectmode', use one of 'ondemand', 'never', 'always' or 'disabled', at '%s' line %d"), |
397 | _("illegal value for 'connectmode', use one of 'ondemand', 'never', 'always' or 'disabled', at '%s' line %d, ignoring."), |
400 | var, fname, lineno); |
398 | var, fname, lineno); |
401 | } |
399 | } |
402 | else if (!strcmp (var, "inherit-tos")) |
400 | else if (!strcmp (var, "inherit-tos")) |
403 | { |
|
|
404 | parse_bool (node->inherit_tos, "inherit-tos", true, false); |
401 | parse_bool (node->inherit_tos, "inherit-tos", true, false); |
405 | } |
|
|
406 | else if (!strcmp (var, "compress")) |
402 | else if (!strcmp (var, "compress")) |
407 | { |
|
|
408 | parse_bool (node->compress, "compress", true, false); |
403 | parse_bool (node->compress, "compress", true, false); |
409 | } |
|
|
410 | // all these bool options really really cost a lot of executable size! |
404 | // all these bool options really really cost a lot of executable size! |
411 | else if (!strcmp (var, "enable-tcp")) |
405 | else if (!strcmp (var, "enable-tcp")) |
412 | { |
406 | { |
413 | #if ENABLE_TCP |
407 | #if ENABLE_TCP |
414 | u8 v; parse_bool (v, "enable-tcp" , PROT_TCPv4, 0); node->protocols = (node->protocols & ~PROT_TCPv4) | v; |
408 | u8 v; parse_bool (v, "enable-tcp" , PROT_TCPv4, 0); node->protocols = (node->protocols & ~PROT_TCPv4) | v; |
… | |
… | |
436 | } |
430 | } |
437 | |
431 | |
438 | // unknown or misplaced |
432 | // unknown or misplaced |
439 | else |
433 | else |
440 | slog (L_WARN, |
434 | slog (L_WARN, |
441 | _("unknown or misplaced variable `%s', at '%s' line %d"), |
435 | _("unknown or misplaced variable `%s', at '%s' line %d, skipping."), |
442 | var, fname, lineno); |
436 | var, fname, lineno); |
443 | } |
437 | } |
444 | |
438 | |
445 | fclose (f); |
439 | fclose (f); |
446 | } |
440 | } |