… | |
… | |
252 | return 0; /* no tokens on this line */ |
252 | return 0; /* no tokens on this line */ |
253 | |
253 | |
254 | if (var[0] == '#') |
254 | if (var[0] == '#') |
255 | return 0; /* comment: ignore */ |
255 | return 0; /* comment: ignore */ |
256 | |
256 | |
|
|
257 | if (!strcmp (var, "global")) |
|
|
258 | { |
|
|
259 | node = &conf.default_node; |
|
|
260 | return 0; |
|
|
261 | } |
|
|
262 | |
257 | char *val = strtok (NULL, "\t\n\r ="); |
263 | char *val = strtok (NULL, "\t\n\r ="); |
258 | |
264 | |
259 | if (!val || val[0] == '#') |
265 | if (!val || val[0] == '#') |
260 | return _("no value given for variable, ignored"); |
266 | return _("no value given for variable, ignored"); |
261 | |
267 | |
… | |
… | |
280 | loglevel l = string_to_loglevel (val); |
286 | loglevel l = string_to_loglevel (val); |
281 | |
287 | |
282 | if (l == L_NONE) |
288 | if (l == L_NONE) |
283 | return _("unknown loglevel, ignored"); |
289 | return _("unknown loglevel, ignored"); |
284 | } |
290 | } |
|
|
291 | else if (!strcmp (var, "serial")) |
|
|
292 | strncpy (conf.serial, val, sizeof (conf.serial)); |
285 | else if (!strcmp (var, "ip-proto")) |
293 | else if (!strcmp (var, "ip-proto")) |
286 | conf.ip_proto = atoi (val); |
294 | conf.ip_proto = atoi (val); |
287 | else if (!strcmp (var, "icmp-type")) |
295 | else if (!strcmp (var, "icmp-type")) |
288 | { |
296 | { |
289 | #if ENABLE_ICMP |
297 | #if ENABLE_ICMP |
… | |
… | |
305 | conf.change_gid = atoi (val); |
313 | conf.change_gid = atoi (val); |
306 | else if (!strcmp (var, "chroot")) |
314 | else if (!strcmp (var, "chroot")) |
307 | free (conf.change_root), conf.change_root = strdup (val); |
315 | free (conf.change_root), conf.change_root = strdup (val); |
308 | |
316 | |
309 | // per node |
317 | // per node |
310 | else if (!strcmp (var, "global")) |
|
|
311 | node = &conf.default_node; |
|
|
312 | else if (!strcmp (var, "node")) |
318 | else if (!strcmp (var, "node")) |
313 | { |
319 | { |
314 | node = conf.find_node (val); |
320 | node = conf.find_node (val); |
315 | |
321 | |
316 | if (!node) |
322 | if (!node) |
… | |
… | |
458 | } |
464 | } |
459 | else if (!strcmp (var, "inherit-tos")) |
465 | else if (!strcmp (var, "inherit-tos")) |
460 | parse_bool (node->inherit_tos, "inherit-tos", true, false); |
466 | parse_bool (node->inherit_tos, "inherit-tos", true, false); |
461 | else if (!strcmp (var, "compress")) |
467 | else if (!strcmp (var, "compress")) |
462 | parse_bool (node->compress, "compress", true, false); |
468 | parse_bool (node->compress, "compress", true, false); |
|
|
469 | else if (!strcmp (var, "low-power")) |
|
|
470 | parse_bool (node->low_power, "low-power", true, false); |
463 | // all these bool options really really cost a lot of executable size! |
471 | // all these bool options really really cost a lot of executable size! |
464 | else if (!strcmp (var, "enable-tcp")) |
472 | else if (!strcmp (var, "enable-tcp")) |
465 | { |
473 | { |
466 | #if ENABLE_TCP |
474 | #if ENABLE_TCP |
467 | u8 v; parse_bool (v, "enable-tcp" , PROT_TCPv4, 0); node->protocols = (node->protocols & ~PROT_TCPv4) | v; |
475 | u8 v; parse_bool (v, "enable-tcp" , PROT_TCPv4, 0); node->protocols = (node->protocols & ~PROT_TCPv4) | v; |