Merge pull request #9 from Telecominfraproject/feat/igmp_global_querier_filtering

plat: Parse new fields from config message
This commit is contained in:
Olexandr, Mazur
2024-04-02 13:00:06 +03:00
committed by GitHub
3 changed files with 15 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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 &&

View File

@@ -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;
}