mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
simplified configuration
fixed small mistake in Makefile git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@125 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
parent
68eacb790a
commit
4432a7ff6b
4 changed files with 8 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue