diff options
author | Yannick Gicquel <yannick.gicquel@iot.bzh> | 2016-09-28 10:08:29 +0200 |
---|---|---|
committer | Yannick Gicquel <yannick.gicquel@iot.bzh> | 2016-10-11 17:09:07 +0200 |
commit | 83aa130c7dd80c396b8752ad010f2ee6b1bdaac3 (patch) | |
tree | 0fcbfa99527fc3b71ae18b2690f2be219d500ed9 /router.c | |
parent | 1d150864f72a103aebed4a43381ce109a414cfe2 (diff) |
router: get routing group from classmap
Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh>
Diffstat (limited to 'router.c')
-rw-r--r-- | router.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -328,11 +328,7 @@ bool agl_router_apply_node_priority_effect (struct userdata *u, agl_node *node, pa_assert_se (router = u->router); pa_assert_se (nodeset = u->nodeset); - /* do we have a routing group associated with this node ? It may have a custom effect */ - if (node->direction == agl_input) - rtg = pa_hashmap_get (router->rtgroups.input, agl_node_type_str (node->type)); - else - rtg = pa_hashmap_get (router->rtgroups.output, agl_node_type_str (node->type)); + rtg = agl_router_get_rtgroup_from_class(u, node->type, 0, node->direction); /* now let us compare priorities, and apply effect if needed */ /* "new" case */ @@ -382,14 +378,14 @@ void agl_router_register_node (struct userdata *u, agl_node *node) /* we try to discover node routing group from the configuration, "Phone" for instance, * see defaults in "config.c. Otherwise we just say NULL, a.k.a. default */ + rtg = agl_router_get_rtgroup_from_class(u, node->type, 0, node->direction); + if (node->direction == agl_input) { - rtg = pa_hashmap_get (router->rtgroups.input, agl_node_type_str (node->type)); if (rtg) implement_default_route (u, node, rtg->node, agl_utils_new_stamp ()); else implement_default_route (u, node, NULL, agl_utils_new_stamp ()); } else { - rtg = pa_hashmap_get (router->rtgroups.output, agl_node_type_str (node->type)); if (rtg) implement_default_route (u, rtg->node, node, agl_utils_new_stamp ()); else |