diff --git a/server/Makefile b/server/Makefile index bbb2b7bee..05024afc4 100644 --- a/server/Makefile +++ b/server/Makefile @@ -5,7 +5,7 @@ SRCS = server.c send.c receive.c random.c node.c path.c utils.c msg.c cfg.c if.c all: $(TARGETS) # Dependencies for individual binaries -server: node.o msg.o utils.o path.o cfg.o if.o tc.c +server: node.o msg.o utils.o path.o cfg.o if.o tc.o send: node.o msg.o utils.o receive: node.o msg.o utils.o random: node.o msg.o utils.o diff --git a/server/etc/loopback.conf b/server/etc/loopback.conf index 1e8da4c47..7c78427d4 100644 --- a/server/etc/loopback.conf +++ b/server/etc/loopback.conf @@ -1,23 +1,16 @@ -# A simple example configuration for loopback testing - -name = "server"; # The name of this node - -affinity = 0x02; # Mask of cores the server should run on -priority = 50; # Scheduler priority for the server +# This is an example for a minimal configuration +# +# All messages will be sent back to the origin. nodes = { node = { - id = 1, # Device ID - type = "opal", # server, workstation, opal, rtds or dsp - local = "127.0.0.1:10201", # Local ip:port, use '*' for random port + local = "*:10201", # Local ip:port, use '*' for random port remote = "127.0.0.1:10200" } }; paths = ( { - enabled = true, # Enable this path - reverse = false, # Setup a path in the reverse direction too in = "node", # Name of the node we listen to (see above) out = "node" # And we loop back to the origin } diff --git a/server/include/cfg.h b/server/include/cfg.h index 343399451..4d9764fd9 100644 --- a/server/include/cfg.h +++ b/server/include/cfg.h @@ -24,12 +24,6 @@ struct settings { int priority; /** Core affinity of this task */ int affinity; - /** Protocol version of UDP packages */ - int protocol; - /** User for the server process */ - int uid; - /** Group for the server process */ - int gid; /** A libconfig object pointing to the root of the config file */ config_setting_t *cfg; diff --git a/server/src/cfg.c b/server/src/cfg.c index bfd0d9961..36d17946d 100644 --- a/server/src/cfg.c +++ b/server/src/cfg.c @@ -21,6 +21,8 @@ int config_parse(const char *filename, config_t *cfg, struct settings *set, struct node **nodes, struct path **paths, struct interface **interfaces) { + config_set_auto_convert(cfg, 1); + if (!config_read_file(cfg, filename)) { error("Failed to parse configuration: %s in %s:%d", config_error_text(cfg), @@ -67,7 +69,6 @@ int config_parse_global(config_setting_t *cfg, struct settings *set) config_setting_lookup_int(cfg, "affinity", &set->affinity); config_setting_lookup_int(cfg, "priority", &set->priority); - config_setting_lookup_int(cfg, "protocol", &set->protocol); set->cfg = cfg; @@ -229,7 +230,7 @@ int config_parse_netem(config_setting_t *cfg, struct netem *em) if (config_setting_lookup_int(cfg, "corrupt", &em->corrupt)) em->valid |= TC_NETEM_CORRUPT; - // TODO: check values + /** @todo Check netem config values */ return 0; }