1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

make node id optional

git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@91 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
Steffen Vogel 2014-06-25 17:50:31 +00:00
parent 6f3652d7c1
commit 5fc9b5adc6

View file

@ -164,6 +164,8 @@ int config_parse_path(config_setting_t *cfg,
int config_parse_node(config_setting_t *cfg,
struct node **nodes, struct interface **interfaces)
{
static int id;
const char *type_str = NULL;
const char *remote_str = NULL;
const char *local_str = NULL;
@ -182,9 +184,6 @@ int config_parse_node(config_setting_t *cfg,
if (!node->name)
cerror(cfg, "Missing node name");
if (!config_setting_lookup_int(cfg, "id", &node->id))
cerror(cfg, "Missing id for node '%s'", node->name);
if (!config_setting_lookup_string(cfg, "type", &type_str))
cerror(cfg, "Missing type for node '%s'", node->name);
@ -211,6 +210,9 @@ int config_parse_node(config_setting_t *cfg,
config_parse_netem(cfg_netem, node->netem);
}
if (!config_setting_lookup_int(cfg, "id", &node->id))
node->id = id++;
/* Determine outgoing interface */
int index = if_getegress(&node->remote);
struct interface *i = if_lookup_index(index, *interfaces);