summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-07-04 14:29:04 +0200
committerYannick Gicquel <yannick.gicquel@iot.bzh>2016-10-11 17:09:07 +0200
commitf259ec53101a3754cd2da24a369ea48bb1947e62 (patch)
tree76a42068003af728c71ec1d253eeb869189c9c97 /config.c
parentacb229813f5845e8b38bea56870211319887f3b4 (diff)
Finalize basic configuration logic
Configuration-related structures and values are now applied everywhere. Change-Id: I5c665a649b8c7c52dd18d214cee6c484f491b584 Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'config.c')
-rw-r--r--config.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.c b/config.c
index 1a74f23..26d725e 100644
--- a/config.c
+++ b/config.c
@@ -20,6 +20,7 @@
*
*/
#include "config.h"
+#include "zone.h"
const char *agl_config_file_get_path (const char *dir, const char *file, char *buf, size_t len)
{
@@ -117,5 +118,23 @@ bool use_default_configuration (struct userdata *u)
typemap_def *t;
prior_def *p;
+ pa_assert (u);
+
+ for (z = zones; z->name; z++)
+ agl_zoneset_add_zone (u, z->name, (uint32_t)(z - zones));
+
+ for (r = rtgroups; r->name; r++)
+ agl_router_create_rtgroup (u, r->type, r->name, r->accept, r->compare);
+
+ for (c = classmap; c->rtgroup; c++)
+ agl_router_assign_class_to_rtgroup (u, c->class, c->zone,
+ c->type, c->rtgroup);
+
+ for (t = typemap; t->id; t++)
+ agl_nodeset_add_role (u, t->id, t->type, NULL);
+
+ for (p = priormap; p->class; p++)
+ agl_router_assign_class_priority (u, p->class, p->priority);
+
return true;
}