Adapt bbf to compile on vanilla OpenWrt

This commit is contained in:
Amin Ben Ramdhane 2019-10-01 14:19:41 +01:00
parent 515995f98d
commit b3bae9df19
6 changed files with 8 additions and 7 deletions

View file

@ -196,7 +196,7 @@ int get_atm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *ins
return 0;
}
inline int ubus_atm_stats(json_object *res, char **value, char *stat_mod, void *data)
static inline int ubus_atm_stats(json_object *res, char **value, char *stat_mod, void *data)
{
dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct atm_args *)data)->ifname, String}}, 1, &res);
DM_ASSERT(res, *value = "");

View file

@ -806,7 +806,7 @@ int set_br_port_tpid(char *refparam, struct dmctx *ctx, void *data, char *instan
/**************************************************************************
* GET STAT
***************************************************************************/
inline int get_bridge_port_statistics(void *data, char *stat_mod, char **value)
static inline int get_bridge_port_statistics(void *data, char *stat_mod, char **value)
{
json_object *res;
dmuci_get_value_by_section_string(((struct bridging_port_args *)data)->bridge_port_sec, "ifname", value);

View file

@ -769,7 +769,7 @@ int get_EthernetInterface_EEECapability(char *refparam, struct dmctx *ctx, void
return 0;
}
inline int get_ubus_ethernet_interface_stats(json_object *res, char **value, char *stat_mod, void *data)
static inline int get_ubus_ethernet_interface_stats(json_object *res, char **value, char *stat_mod, void *data)
{
dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct eth_port_args *)data)->ifname, String}}, 1, &res);
DM_ASSERT(res, *value = "0");
@ -1036,7 +1036,7 @@ int get_EthernetLink_MACAddress(char *refparam, struct dmctx *ctx, void *data, c
return 0;
}
inline int get_ubus_ethernet_link_stats(json_object *res, char **value, char *stat_mod, void *data)
static inline int get_ubus_ethernet_link_stats(json_object *res, char **value, char *stat_mod, void *data)
{
char *device;
dmuci_get_value_by_section_string(((struct dm_args *)data)->section, "device", &device);
@ -1365,7 +1365,7 @@ int set_EthernetVLANTermination_TPID(char *refparam, struct dmctx *ctx, void *da
return 0;
}
inline int get_ubus_ethernet_vlan_termination_stats(json_object *res, char **value, char *stat_mod, void *data)
static inline int get_ubus_ethernet_vlan_termination_stats(json_object *res, char **value, char *stat_mod, void *data)
{
char *ifname;
dmuci_get_value_by_section_string(((struct dm_args *)data)->section, "ifname", &ifname);

View file

@ -243,7 +243,7 @@ int set_ppp_password(char *refparam, struct dmctx *ctx, void *data, char *instan
return 0;
}
inline int ubus_get_wan_stats(void *data, char *instance, json_object *res, char **value, char *stat_mod)
static inline int ubus_get_wan_stats(void *data, char *instance, json_object *res, char **value, char *stat_mod)
{
char *ifname, *proto;
dmuci_get_value_by_section_string(((struct uci_section *)data), "ifname", &ifname);

View file

@ -95,7 +95,7 @@ int get_ptm_lower_layer(char *refparam, struct dmctx *ctx, void *data, char *ins
return 0;
}
inline int ubus_ptm_stats(json_object *res, char **value, char *stat_mod, void *data)
static inline int ubus_ptm_stats(json_object *res, char **value, char *stat_mod, void *data)
{
dmubus_call("network.device", "status", UBUS_ARGS{{"name", ((struct ptm_args *)data)->ifname, String}}, 1, &res);

View file

@ -18,6 +18,7 @@
#include <libubus.h>
#include <libubox/blobmsg_json.h>
#include <json-c/json.h>
#include <json-c/bits.h>
#include <stdio.h>
#include "dmubus.h"
#include "dmmem.h"