… | |
… | |
65 | { |
65 | { |
66 | memset (this, 0, sizeof (*this)); |
66 | memset (this, 0, sizeof (*this)); |
67 | |
67 | |
68 | rekey = DEFAULT_REKEY; |
68 | rekey = DEFAULT_REKEY; |
69 | keepalive = DEFAULT_KEEPALIVE; |
69 | keepalive = DEFAULT_KEEPALIVE; |
|
|
70 | llevel = L_INFO; |
70 | |
71 | |
71 | default_node.port = DEFAULT_PORT; |
72 | default_node.port = DEFAULT_PORT; |
72 | default_node.connectmode = conf_node::C_ALWAYS; |
73 | default_node.connectmode = conf_node::C_ALWAYS; |
73 | default_node.compress = true; |
74 | default_node.compress = true; |
74 | } |
75 | } |
… | |
… | |
162 | if (!strcmp (var, "loglevel")) |
163 | if (!strcmp (var, "loglevel")) |
163 | { |
164 | { |
164 | loglevel l = string_to_loglevel (val); |
165 | loglevel l = string_to_loglevel (val); |
165 | |
166 | |
166 | if (l != L_NONE) |
167 | if (l != L_NONE) |
167 | set_loglevel (l); |
168 | llevel = l; |
168 | else |
169 | else |
169 | slog (L_WARN, "'%s': %s, at '%s' line %d", val, UNKNOWN_LOGLEVEL, fname, line); |
170 | slog (L_WARN, "'%s': %s, at '%s' line %d", val, UNKNOWN_LOGLEVEL, fname, line); |
170 | } |
171 | } |
171 | |
172 | |
172 | // per config |
173 | // per config |
… | |
… | |
250 | free (node->hostname); |
251 | free (node->hostname); |
251 | node->hostname = strdup (val); |
252 | node->hostname = strdup (val); |
252 | } |
253 | } |
253 | |
254 | |
254 | /* node-specific, defaultable */ |
255 | /* node-specific, defaultable */ |
255 | else if (!strcmp (var, "port")) |
256 | else if (!strcmp (var, "udp-port")) |
|
|
257 | node->port = atoi (val); |
|
|
258 | else if (!strcmp (var, "port")) //deprecated |
256 | node->port = atoi (val); |
259 | node->port = atoi (val); |
257 | else if (!strcmp (var, "router-priority")) |
260 | else if (!strcmp (var, "router-priority")) |
258 | node->routerprio = atoi (val); |
261 | node->routerprio = atoi (val); |
259 | else if (!strcmp (var, "connect")) |
262 | else if (!strcmp (var, "connect")) |
260 | { |
263 | { |
… | |
… | |
262 | node->connectmode = conf_node::C_ONDEMAND; |
265 | node->connectmode = conf_node::C_ONDEMAND; |
263 | else if (!strcmp (val, "never")) |
266 | else if (!strcmp (val, "never")) |
264 | node->connectmode = conf_node::C_NEVER; |
267 | node->connectmode = conf_node::C_NEVER; |
265 | else if (!strcmp (val, "always")) |
268 | else if (!strcmp (val, "always")) |
266 | node->connectmode = conf_node::C_ALWAYS; |
269 | node->connectmode = conf_node::C_ALWAYS; |
|
|
270 | else if (!strcmp (val, "disabled")) |
|
|
271 | node->connectmode = conf_node::C_DISABLED; |
267 | else |
272 | else |
268 | slog (L_WARN, |
273 | slog (L_WARN, |
269 | _("illegal value for 'connectmode', use one of 'ondemand', 'never' or 'always', at '%s' line %d"), |
274 | _("illegal value for 'connectmode', use one of 'ondemand', 'never', 'always' or 'disabled', at '%s' line %d"), |
270 | var, fname, lineno); |
275 | var, fname, lineno); |
271 | } |
276 | } |
|
|
277 | else if (!strcmp (var, "inherit-tos")) |
|
|
278 | { |
|
|
279 | if (!strcmp (val, "yes")) |
|
|
280 | node->inherit_tos = true; |
|
|
281 | else if (!strcmp (val, "no")) |
|
|
282 | node->inherit_tos = false; |
|
|
283 | else |
|
|
284 | slog (L_WARN, |
|
|
285 | _("illegal value for 'compress', only 'yes' or 'no' allowed, at '%s' line %d"), |
|
|
286 | var, fname, lineno); |
|
|
287 | } |
|
|
288 | |
272 | else if (!strcmp (var, "compress")) |
289 | else if (!strcmp (var, "compress")) |
273 | { |
290 | { |
274 | if (!strcmp (val, "yes")) |
291 | if (!strcmp (val, "yes")) |
275 | node->compress = true; |
292 | node->compress = true; |
276 | else if (!strcmp (val, "no")) |
293 | else if (!strcmp (val, "no")) |