mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
PPP.Interface.: fix get value of stats parameters
This commit is contained in:
parent
cfb5016c90
commit
f3c9ed9efd
3 changed files with 12 additions and 4 deletions
|
|
@ -207,9 +207,8 @@ static int ppp_read_sysfs(struct uci_section *sect, const char *name, char **val
|
|||
|
||||
dmuci_get_value_by_section_string(sect, "proto", &proto);
|
||||
if (!strcmp(proto, "pppoe")) {
|
||||
char *ifname;
|
||||
dmuci_get_value_by_section_string(sect, "ifname", &ifname);
|
||||
rc = get_net_device_sysfs(ifname, name, value);
|
||||
char *l3_device = get_l3_device(section_name(sect));
|
||||
rc = get_net_device_sysfs(l3_device, name, value);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1296,6 +1296,14 @@ char *get_device(char *interface_name)
|
|||
return dmjson_get_value(res, 1, "device");
|
||||
}
|
||||
|
||||
char *get_l3_device(char *interface_name)
|
||||
{
|
||||
json_object *res;
|
||||
|
||||
dmubus_call("network.interface", "status", UBUS_ARGS{{"interface", interface_name, String}}, 1, &res);
|
||||
return dmjson_get_value(res, 1, "l3_device");
|
||||
}
|
||||
|
||||
char *get_device_from_wifi_iface(const char *wifi_iface, const char *wifi_section)
|
||||
{
|
||||
json_object *jobj;
|
||||
|
|
|
|||
|
|
@ -289,7 +289,8 @@ char **strsplit(const char* str, const char* delim, size_t* numtokens);
|
|||
char **strsplit_by_str(const char str[], char *delim);
|
||||
char *get_macaddr_from_device(char *device_name);
|
||||
char *get_macaddr(char *ifname);
|
||||
char *get_device(char *ifname);
|
||||
char *get_device(char *interface_name);
|
||||
char *get_l3_device(char *interface_name);
|
||||
int is_elt_exit_in_str_list(char *str_list, char *elt);
|
||||
void add_elt_to_str_list(char **str_list, char *elt);
|
||||
void remove_elt_from_str_list(char **iface_list, char *ifname);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue