- if(get_config_string(lookup_config(config_tree, "Mode"), &rmode)) {
- if(!strcasecmp(rmode, "router"))
- routing_mode = RMODE_ROUTER;
- else if(!strcasecmp(rmode, "switch"))
- routing_mode = RMODE_SWITCH;
- else if(!strcasecmp(rmode, "hub"))
- routing_mode = RMODE_HUB;
- else {
- logger(DEBUG_ALWAYS, LOG_ERR, "Invalid routing mode!");
- return false;
- }
- free(rmode);
- }
-
- if(get_config_string(lookup_config(config_tree, "Forwarding"), &fmode)) {
- if(!strcasecmp(fmode, "off"))
- forwarding_mode = FMODE_OFF;
- else if(!strcasecmp(fmode, "internal"))
- forwarding_mode = FMODE_INTERNAL;
- else if(!strcasecmp(fmode, "kernel"))
- forwarding_mode = FMODE_KERNEL;
- else {
- logger(DEBUG_ALWAYS, LOG_ERR, "Invalid forwarding mode!");
- return false;
- }
- free(fmode);
- }
-
- choice = true;
- get_config_bool(lookup_config(config_tree, "PMTUDiscovery"), &choice);
- if(choice)
- myself->options |= OPTION_PMTU_DISCOVERY;
-
- choice = true;
- get_config_bool(lookup_config(config_tree, "ClampMSS"), &choice);
- if(choice)
- myself->options |= OPTION_CLAMP_MSS;
-
- get_config_bool(lookup_config(config_tree, "PriorityInheritance"), &priorityinheritance);
- get_config_bool(lookup_config(config_tree, "DecrementTTL"), &decrement_ttl);
- if(get_config_string(lookup_config(config_tree, "Broadcast"), &bmode)) {
- if(!strcasecmp(bmode, "no"))
- broadcast_mode = BMODE_NONE;
- else if(!strcasecmp(bmode, "yes") || !strcasecmp(bmode, "mst"))
- broadcast_mode = BMODE_MST;
- else if(!strcasecmp(bmode, "direct"))
- broadcast_mode = BMODE_DIRECT;
- else {
- logger(DEBUG_ALWAYS, LOG_ERR, "Invalid broadcast mode!");
- return false;
- }
- free(bmode);