Repository : ssh://git@diktynna/batctl
On branch : master
commit 3c5bf8901a3e89876a68644ae08396fd80580844 Author: Sven Eckelmann sven@narfation.org Date: Fri May 14 16:23:03 2021 +0200
batctl: Add bla_backbone_json command
Signed-off-by: Sven Eckelmann sven@narfation.org
3c5bf8901a3e89876a68644ae08396fd80580844 Makefile | 1 + README.rst | 31 +++++++++++++++++++++++++++++++ bla_backbone_json.c | 20 ++++++++++++++++++++ man/batctl.8 | 3 +++ 4 files changed, 55 insertions(+)
diff --git a/Makefile b/Makefile index cee4f0c..944e985 100755 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ $(eval $(call add_command,aggregation,y)) $(eval $(call add_command,ap_isolation,y)) $(eval $(call add_command,backbonetable,y)) $(eval $(call add_command,bisect_iv,$(CONFIG_BATCTL_BISECT))) +$(eval $(call add_command,bla_backbone_json,y)) $(eval $(call add_command,bonding,y)) $(eval $(call add_command,bridge_loop_avoidance,y)) $(eval $(call add_command,claimtable,y)) diff --git a/README.rst b/README.rst index 3d191f5..cd708c3 100644 --- a/README.rst +++ b/README.rst @@ -706,6 +706,37 @@ JSON netlink query helper =========================
+batctl bla_backbone_json +------------------------ + +Query batman-adv for the entries in the known backbones table of +bridge loop avoidance. + +Usage:: + + batctl meshif <netdev> bla_backbone_json|bbj + +Example:: + + $ batctl meshif bat0 bla_backbone_json | json_pp + [ + { + "bla_backbone": "02:ba:de:af:fe:01", + "bla_crc": 0, + "bla_own": true, + "bla_vid": -1, + "last_seen_msecs": 920 + }, + { + "bla_backbone": "02:ba:de:af:fe:01", + "bla_crc": 33755, + "bla_own": true, + "bla_vid": -1, + "last_seen_msecs": 44 + } + ] + + Advanced Analytics ==================
diff --git a/bla_backbone_json.c b/bla_backbone_json.c new file mode 100644 index 0000000..5d50a9b --- /dev/null +++ b/bla_backbone_json.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) B.A.T.M.A.N. contributors: + * + * Sven Eckelmann <sven@narfation.org + * + * License-Filename: LICENSES/preferred/GPL-2.0 + */ + +#include "main.h" + +#include "genl_json.h" + +static struct json_query_data batctl_json_query_bla_backbone = { + .nlm_flags = NLM_F_DUMP, + .cmd = BATADV_CMD_GET_BLA_BACKBONE, +}; + +COMMAND_NAMED(JSON_MIF, bla_backbone_json, "bbj", handle_json_query, + COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, + &batctl_json_query_bla_backbone, ""); diff --git a/man/batctl.8 b/man/batctl.8 index ce78fca..b4fef27 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -305,6 +305,9 @@ the freeform debug tables or the native netlink messages.
.RS 7 List of available JSON queries: +.RS 10 +- bla_backbone_json|bbj +.RE .RE .br .IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"