gluon-mesh-batman-adv: fix c indentation
This commit is contained in:
parent
e43d4290a1
commit
44c12e87ec
@ -68,7 +68,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
char mac1[18];
|
||||
|
||||
opts = batadv_container_of(query_opts, struct neigh_netlink_opts,
|
||||
query_opts);
|
||||
query_opts);
|
||||
|
||||
if (!genlmsg_valid_hdr(nlh, 0))
|
||||
return NL_OK;
|
||||
@ -79,11 +79,11 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
return NL_OK;
|
||||
|
||||
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
return NL_OK;
|
||||
|
||||
if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory,
|
||||
BATADV_ARRAY_SIZE(parse_orig_list_mandatory)))
|
||||
BATADV_ARRAY_SIZE(parse_orig_list_mandatory)))
|
||||
return NL_OK;
|
||||
|
||||
orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);
|
||||
|
@ -106,7 +106,7 @@ static bool interface_file_exists(const char *ifname, const char *name) {
|
||||
}
|
||||
|
||||
static void mesh_add_subif(const char *ifname, struct json_object *wireless,
|
||||
struct json_object *tunnel, struct json_object *other) {
|
||||
struct json_object *tunnel, struct json_object *other) {
|
||||
struct json_object *address = gluonutil_wrap_and_free_string(gluonutil_get_interface_address(ifname));
|
||||
|
||||
/* In case of VLAN and bridge interfaces, we want the lower interface
|
||||
@ -144,7 +144,7 @@ static struct json_object * get_mesh_subifs(const char *ifname) {
|
||||
size_t i;
|
||||
for (i = 0; i < lower.gl_pathc; i++) {
|
||||
mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1,
|
||||
wireless, tunnel, other);
|
||||
wireless, tunnel, other);
|
||||
}
|
||||
|
||||
globfree(&lower);
|
||||
|
@ -57,7 +57,7 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
char addr[18];
|
||||
|
||||
opts = batadv_container_of(query_opts, struct gw_netlink_opts,
|
||||
query_opts);
|
||||
query_opts);
|
||||
|
||||
if (!genlmsg_valid_hdr(nlh, 0))
|
||||
return NL_OK;
|
||||
@ -68,11 +68,11 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
return NL_OK;
|
||||
|
||||
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
return NL_OK;
|
||||
|
||||
if (batadv_genl_missing_attrs(attrs, gateways_mandatory,
|
||||
BATADV_ARRAY_SIZE(gateways_mandatory)))
|
||||
BATADV_ARRAY_SIZE(gateways_mandatory)))
|
||||
return NL_OK;
|
||||
|
||||
if (!attrs[BATADV_ATTR_FLAG_BEST])
|
||||
@ -105,8 +105,8 @@ static void add_gateway(struct json_object *obj) {
|
||||
};
|
||||
|
||||
batadv_genl_query("bat0", BATADV_CMD_GET_GATEWAYS,
|
||||
parse_gw_list_netlink_cb, NLM_F_DUMP,
|
||||
&opts.query_opts);
|
||||
parse_gw_list_netlink_cb, NLM_F_DUMP,
|
||||
&opts.query_opts);
|
||||
}
|
||||
|
||||
static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) {
|
||||
@ -214,7 +214,7 @@ static struct json_object * get_traffic(void) {
|
||||
json_object_object_add(ret, "mgmt_rx", mgmt_rx);
|
||||
json_object_object_add(ret, "mgmt_tx", mgmt_tx);
|
||||
|
||||
out:
|
||||
out:
|
||||
free(stats);
|
||||
free(strings);
|
||||
close(fd);
|
||||
@ -241,7 +241,7 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
uint32_t flags, lastseen;
|
||||
|
||||
opts = batadv_container_of(query_opts, struct clients_netlink_opts,
|
||||
query_opts);
|
||||
query_opts);
|
||||
|
||||
if (!genlmsg_valid_hdr(nlh, 0))
|
||||
return NL_OK;
|
||||
@ -252,11 +252,11 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
|
||||
return NL_OK;
|
||||
|
||||
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
genlmsg_len(ghdr), batadv_genl_policy))
|
||||
return NL_OK;
|
||||
|
||||
if (batadv_genl_missing_attrs(attrs, clients_mandatory,
|
||||
BATADV_ARRAY_SIZE(clients_mandatory)))
|
||||
BATADV_ARRAY_SIZE(clients_mandatory)))
|
||||
return NL_OK;
|
||||
|
||||
flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]);
|
||||
@ -282,8 +282,8 @@ static struct json_object * get_clients(void) {
|
||||
};
|
||||
|
||||
batadv_genl_query("bat0", BATADV_CMD_GET_TRANSTABLE_LOCAL,
|
||||
parse_clients_list_netlink_cb, NLM_F_DUMP,
|
||||
&opts.query_opts);
|
||||
parse_clients_list_netlink_cb, NLM_F_DUMP,
|
||||
&opts.query_opts);
|
||||
|
||||
struct json_object *ret = json_object_new_object();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user