Skip to content
Snippets Groups Projects
Commit 770123a0 authored by Kamil Zulewski's avatar Kamil Zulewski
Browse files

Limiting length of Wi-Fi BH link chains

Reading max_node_bh_hops config option
parent cadbccc7
No related branches found
No related tags found
No related merge requests found
...@@ -632,6 +632,7 @@ static int cntlr_config_get_base(struct controller_config *c, ...@@ -632,6 +632,7 @@ static int cntlr_config_get_base(struct controller_config *c,
CNTLR_DEFAULT_PCP, CNTLR_DEFAULT_PCP,
CNTLR_ENABLE_TS, CNTLR_ENABLE_TS,
CNTLR_PROFILE, CNTLR_PROFILE,
CNTRL_MAX_NODE_BH_HOPS,
NUM_CNTLR_ATTRS NUM_CNTLR_ATTRS
}; };
...@@ -648,6 +649,7 @@ static int cntlr_config_get_base(struct controller_config *c, ...@@ -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_DEFAULT_PCP] = { .name = "default_pcp", .type = UCI_TYPE_STRING },
[CNTLR_ENABLE_TS] = { .name = "enable_ts", .type = UCI_TYPE_STRING }, [CNTLR_ENABLE_TS] = { .name = "enable_ts", .type = UCI_TYPE_STRING },
[CNTLR_PROFILE] = { .name = "profile", .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]; struct uci_option *tb[NUM_CNTLR_ATTRS];
...@@ -734,6 +736,13 @@ static int cntlr_config_get_base(struct controller_config *c, ...@@ -734,6 +736,13 @@ static int cntlr_config_get_base(struct controller_config *c,
c->enable_ts = !!atoi(val); 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; return 0;
} }
......
...@@ -167,6 +167,7 @@ struct controller_config { ...@@ -167,6 +167,7 @@ struct controller_config {
unsigned int default_pcp; unsigned int default_pcp;
int map_profile; int map_profile;
bool enable_ts; bool enable_ts;
unsigned int max_node_bh_hops;
#if (EASYMESH_VERSION > 2) #if (EASYMESH_VERSION > 2)
char *dpp_uri_file; char *dpp_uri_file;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment