diff --git a/src/config.c b/src/config.c index 1b0d72348feeaa03b6892aa9e8be393f4d4e69e7..ebc756c4fe5f7cca6df098b684e2152d0da6dd58 100644 --- a/src/config.c +++ b/src/config.c @@ -632,6 +632,7 @@ static int cntlr_config_get_base(struct controller_config *c, CNTLR_DEFAULT_PCP, CNTLR_ENABLE_TS, CNTLR_PROFILE, + CNTRL_MAX_NODE_BH_HOPS, NUM_CNTLR_ATTRS }; @@ -648,6 +649,7 @@ static int cntlr_config_get_base(struct controller_config *c, [CNTLR_DEFAULT_PCP] = { .name = "default_pcp", .type = UCI_TYPE_STRING }, [CNTLR_ENABLE_TS] = { .name = "enable_ts", .type = UCI_TYPE_STRING }, [CNTLR_PROFILE] = { .name = "profile", .type = UCI_TYPE_STRING }, + [CNTRL_MAX_NODE_BH_HOPS] = { .name = "max_node_bh_hops", .type = UCI_TYPE_STRING }, }; struct uci_option *tb[NUM_CNTLR_ATTRS]; @@ -734,6 +736,13 @@ static int cntlr_config_get_base(struct controller_config *c, c->enable_ts = !!atoi(val); } + if (tb[CNTRL_MAX_NODE_BH_HOPS]) { + const char *val = tb[CNTRL_MAX_NODE_BH_HOPS]->v.string; + const int max_hops = atoi(val); + + c->max_node_bh_hops = (max_hops > 0) ? max_hops : 0; + } + return 0; } diff --git a/src/config.h b/src/config.h index c057daa2e79e9d28b49cb5fb68777a26cff4937b..a7e8b85aaa3df725f43b9e557edc4081792fcac8 100644 --- a/src/config.h +++ b/src/config.h @@ -167,6 +167,7 @@ struct controller_config { unsigned int default_pcp; int map_profile; bool enable_ts; + unsigned int max_node_bh_hops; #if (EASYMESH_VERSION > 2) char *dpp_uri_file; #endif