mirror of
https://github.com/Telecominfraproject/ols-ucentral-client.git
synced 2026-01-27 02:21:38 +00:00
Merge pull request #9 from Telecominfraproject/feat/igmp_global_querier_filtering
plat: Parse new fields from config message
This commit is contained in:
@@ -388,6 +388,8 @@ struct plat_unit_system_cfg {
|
||||
struct plat_unit {
|
||||
struct plat_unit_poe_cfg poe;
|
||||
struct plat_unit_system_cfg system;
|
||||
bool mc_flood_control;
|
||||
bool querier_enable;
|
||||
};
|
||||
|
||||
enum plat_stp_mode {
|
||||
|
||||
@@ -4398,6 +4398,11 @@ static int config_unit_apply(struct plat_cfg *cfg)
|
||||
gnma_poe_power_mgmt_mode_t mgmt_mode;
|
||||
int ret;
|
||||
|
||||
if (cfg->unit.mc_flood_control || cfg->unit.querier_enable) {
|
||||
UC_LOG_ERR("'unknown-multicast-flood-control' and 'querier-enable' global configs are not supported\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
__poe_power_mgmt_str2num(cfg->unit.poe.power_mgmt, &mgmt_mode);
|
||||
|
||||
if (cfg->unit.poe.is_power_mgmt_set &&
|
||||
|
||||
@@ -1979,8 +1979,10 @@ skip_health_parse:
|
||||
static int cfg_unit_parse(cJSON *unit, struct plat_cfg *cfg)
|
||||
{
|
||||
cJSON *usage_threshold;
|
||||
cJSON *flood_control;
|
||||
cJSON *power_mgmt;
|
||||
cJSON *password;
|
||||
cJSON *querier;
|
||||
cJSON *poe;
|
||||
|
||||
if ((poe = cJSON_GetObjectItemCaseSensitive(unit, "poe"))) {
|
||||
@@ -2005,6 +2007,12 @@ static int cfg_unit_parse(cJSON *unit, struct plat_cfg *cfg)
|
||||
cfg->unit.system.password_changed = true;
|
||||
}
|
||||
|
||||
if ((flood_control = cJSON_GetObjectItemCaseSensitive(unit, "unknown-multicast-flood-control")))
|
||||
cfg->unit.mc_flood_control = cJSON_IsTrue(flood_control);
|
||||
|
||||
if ((querier = cJSON_GetObjectItemCaseSensitive(unit, "querier-enable")))
|
||||
cfg->unit.querier_enable = cJSON_IsTrue(querier);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user