- if(get_config_string(lookup_config(config_tree, "Mode"), &mode)) {
- if(!strcasecmp(mode, "router"))
- routing_mode = RMODE_ROUTER;
- else if(!strcasecmp(mode, "switch"))
- routing_mode = RMODE_SWITCH;
- else if(!strcasecmp(mode, "hub"))
- routing_mode = RMODE_HUB;
- else {
- logger(LOG_ERR, "Invalid routing mode!");
- return false;
- }
- free(mode);
- }
-
- if(get_config_string(lookup_config(config_tree, "Forwarding"), &mode)) {
- if(!strcasecmp(mode, "off"))
- forwarding_mode = FMODE_OFF;
- else if(!strcasecmp(mode, "internal"))
- forwarding_mode = FMODE_INTERNAL;
- else if(!strcasecmp(mode, "kernel"))
- forwarding_mode = FMODE_KERNEL;
- else {
- logger(LOG_ERR, "Invalid forwarding mode!");
- return false;
- }
- free(mode);