gluon-mesh-batman-adv: fix c indentation

This commit is contained in:
Jan-Niklas Burfeind 2023-01-03 15:59:11 +01:00
parent e43d4290a1
commit 44c12e87ec
3 changed files with 16 additions and 16 deletions

View File

@ -68,7 +68,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
char mac1[18]; char mac1[18];
opts = batadv_container_of(query_opts, struct neigh_netlink_opts, opts = batadv_container_of(query_opts, struct neigh_netlink_opts,
query_opts); query_opts);
if (!genlmsg_valid_hdr(nlh, 0)) if (!genlmsg_valid_hdr(nlh, 0))
return NL_OK; return NL_OK;
@ -79,11 +79,11 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
return NL_OK; return NL_OK;
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), 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; return NL_OK;
if (batadv_genl_missing_attrs(attrs, parse_orig_list_mandatory, 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; return NL_OK;
orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);

View File

@ -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, 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)); 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 /* 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; size_t i;
for (i = 0; i < lower.gl_pathc; i++) { for (i = 0; i < lower.gl_pathc; i++) {
mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1, mesh_add_subif(lower.gl_pathv[i] + pattern_len - 1,
wireless, tunnel, other); wireless, tunnel, other);
} }
globfree(&lower); globfree(&lower);

View File

@ -57,7 +57,7 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
char addr[18]; char addr[18];
opts = batadv_container_of(query_opts, struct gw_netlink_opts, opts = batadv_container_of(query_opts, struct gw_netlink_opts,
query_opts); query_opts);
if (!genlmsg_valid_hdr(nlh, 0)) if (!genlmsg_valid_hdr(nlh, 0))
return NL_OK; return NL_OK;
@ -68,11 +68,11 @@ static int parse_gw_list_netlink_cb(struct nl_msg *msg, void *arg)
return NL_OK; return NL_OK;
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), 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; return NL_OK;
if (batadv_genl_missing_attrs(attrs, gateways_mandatory, if (batadv_genl_missing_attrs(attrs, gateways_mandatory,
BATADV_ARRAY_SIZE(gateways_mandatory))) BATADV_ARRAY_SIZE(gateways_mandatory)))
return NL_OK; return NL_OK;
if (!attrs[BATADV_ATTR_FLAG_BEST]) 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, batadv_genl_query("bat0", BATADV_CMD_GET_GATEWAYS,
parse_gw_list_netlink_cb, NLM_F_DUMP, parse_gw_list_netlink_cb, NLM_F_DUMP,
&opts.query_opts); &opts.query_opts);
} }
static inline bool ethtool_ioctl(int fd, struct ifreq *ifr, void *data) { 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_rx", mgmt_rx);
json_object_object_add(ret, "mgmt_tx", mgmt_tx); json_object_object_add(ret, "mgmt_tx", mgmt_tx);
out: out:
free(stats); free(stats);
free(strings); free(strings);
close(fd); close(fd);
@ -241,7 +241,7 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
uint32_t flags, lastseen; uint32_t flags, lastseen;
opts = batadv_container_of(query_opts, struct clients_netlink_opts, opts = batadv_container_of(query_opts, struct clients_netlink_opts,
query_opts); query_opts);
if (!genlmsg_valid_hdr(nlh, 0)) if (!genlmsg_valid_hdr(nlh, 0))
return NL_OK; return NL_OK;
@ -252,11 +252,11 @@ static int parse_clients_list_netlink_cb(struct nl_msg *msg, void *arg)
return NL_OK; return NL_OK;
if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), 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; return NL_OK;
if (batadv_genl_missing_attrs(attrs, clients_mandatory, if (batadv_genl_missing_attrs(attrs, clients_mandatory,
BATADV_ARRAY_SIZE(clients_mandatory))) BATADV_ARRAY_SIZE(clients_mandatory)))
return NL_OK; return NL_OK;
flags = nla_get_u32(attrs[BATADV_ATTR_TT_FLAGS]); 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, batadv_genl_query("bat0", BATADV_CMD_GET_TRANSTABLE_LOCAL,
parse_clients_list_netlink_cb, NLM_F_DUMP, parse_clients_list_netlink_cb, NLM_F_DUMP,
&opts.query_opts); &opts.query_opts);
struct json_object *ret = json_object_new_object(); struct json_object *ret = json_object_new_object();