+
+cp
+ /* Check some options */
+
+ if((cfg = get_config_val(config, config_indirectdata)))
+ if(cfg->data.val == stupid_true)
+ myself->options |= OPTION_INDIRECT;
+
+ if((cfg = get_config_val(config, config_tcponly)))
+ if(cfg->data.val == stupid_true)
+ myself->options |= OPTION_TCPONLY;
+
+ if((cfg = get_config_val(myself->config, config_indirectdata)))
+ if(cfg->data.val == stupid_true)
+ myself->options |= OPTION_INDIRECT;
+
+ if((cfg = get_config_val(myself->config, config_tcponly)))
+ if(cfg->data.val == stupid_true)
+ myself->options |= OPTION_TCPONLY;
+
+ if(myself->options & OPTION_TCPONLY)
+ myself->options |= OPTION_INDIRECT;
+
+ if((cfg = get_config_val(config, config_mode)))
+ {
+ if(!strcasecmp(cfg->data.ptr, "router"))
+ routing_mode = RMODE_ROUTER;
+ else if (!strcasecmp(cfg->data.ptr, "switch"))
+ routing_mode = RMODE_SWITCH;
+ else if (!strcasecmp(cfg->data.ptr, "hub"))
+ routing_mode = RMODE_HUB;
+ else
+ {
+ syslog(LOG_ERR, _("Invalid routing mode!"));
+ return -1;
+ }
+ }
+ else
+ routing_mode = RMODE_ROUTER;
+
+cp
+ /* Open sockets */
+