B#11253: Align RMONStats Status

This commit is contained in:
Vivek Kumar Dutta 2023-06-19 10:37:23 +05:30
parent 47df6f71b1
commit 83218feb15
No known key found for this signature in database
GPG key ID: 65C818099F37097D

View file

@ -1544,10 +1544,19 @@ static int set_EthernetRMONStats_Enable(char *refparam, struct dmctx *ctx, void
static int get_EthernetRMONStats_Status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *ifname = NULL;
char *ifname = NULL, *status = NULL;
dmuci_get_value_by_section_string((((struct eth_rmon_args *)data)->sections)->config_section, "ifname", &ifname);
return get_net_device_status(ifname, value);
get_net_device_status(ifname, &status);
if (strncmp(status, "Up", 2) == 0) {
*value = "Enabled";
} else if (strncmp(status, "Down", 4) == 0) {
*value = "Disabled";
} else {
*value = "Error";
}
return 0;
}
/*#Device.Ethernet.RMONStats.{i}.Alias!UCI:dmmap_eth_rmon/ethport,@i-1/eth_rmon_alias*/