Repository : ssh://git@diktynna/batctl
On branch : master
commit 8d6165cc0cf8956ece6deabb96741e9342000509 Author: Sven Eckelmann sven@narfation.org Date: Fri May 14 16:23:03 2021 +0200
batctl: Add mcast_flags_json command
Signed-off-by: Sven Eckelmann sven@narfation.org
8d6165cc0cf8956ece6deabb96741e9342000509 Makefile | 1 + README.rst | 71 ++++++++++++++++++++++++++++++++++++++++++++ man/batctl.8 | 3 ++ hardif_json.c => mesh_json.c | 8 ++--- 4 files changed, 79 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index a091920..478e767 100755 --- a/Makefile +++ b/Makefile @@ -62,6 +62,7 @@ $(eval $(call add_command,isolation_mark,y)) $(eval $(call add_command,loglevel,y)) $(eval $(call add_command,mcast_flags,y)) $(eval $(call add_command,mcast_flags_json,y)) +$(eval $(call add_command,mesh_json,y)) $(eval $(call add_command,multicast_fanout,y)) $(eval $(call add_command,multicast_forceflood,y)) $(eval $(call add_command,multicast_mode,y)) diff --git a/README.rst b/README.rst index d1faa9e..674c574 100644 --- a/README.rst +++ b/README.rst @@ -967,6 +967,77 @@ Example:: ]
+batctl mesh_json +---------------- + +Get the current configuration of the batman-adv mesh interface and its global +state. + +The ``hard_ifindex``/``hard_ifname`` only refers to the primary interface. +More interfaces might be attached to theis interface. They can for +example be queried using:: + + ip -json link show master bat0 + +It also doesn't show all batman-adv interfaces on the system. Such +information must be queried using:: + + ip -json link show type batadv + + +Usage:: + + batctl meshif <netdev> mesh_json|mj + +Example:: + + $ batctl meshif bat0 mesh_json | json_pp + { + "aggregated_ogms_enabled": true, + "algo_name": "BATMAN_IV", + "ap_isolation_enabled": false, + "bla_crc": 44249, + "bonding_enabled": false, + "bridge_loop_avoidance_enabled": true, + "distributed_arp_table_enabled": true, + "fragmentation_enabled": true, + "gw_bandwidth_down": 100, + "gw_bandwidth_up": 20, + "gw_mode": "client", + "gw_sel_class": 20, + "hard_address": "02:ba:de:af:fe:01", + "hard_ifindex": 3, + "hard_ifname": "enp0s1", + "hop_penalty": 30, + "isolation_mark": 0, + "isolation_mask": 0, + "mcast_flags": { + "all_unsnoopables": false, + "raw": 24, + "want_all_ipv4": false, + "want_all_ipv6": false, + "want_no_rtr_ipv4": true, + "want_no_rtr_ipv6": true + }, + "mcast_flags_priv": { + "bridged": false, + "querier_ipv4_exists": false, + "querier_ipv4_shadowing": false, + "querier_ipv6_exists": false, + "querier_ipv6_shadowing": false, + "raw": 0 + }, + "mesh_address": "3e:dc:94:68:80:e8", + "mesh_ifindex": 9, + "mesh_ifname": "bat0", + "multicast_fanout": 16, + "multicast_forceflood_enabled": false, + "orig_interval": 5000, + "tt_ttvn": 2, + "version": "2021.0-15-gc84e5217" + } + + Advanced Analytics ==================
diff --git a/man/batctl.8 b/man/batctl.8 index 9f28b3e..915bde0 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -326,6 +326,9 @@ List of available JSON queries: .RS 10 - mcast_flags_json|mfj .RE +.RS 10 +- mesh_json|mj +.RE .RE .br .IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat-host_name\fP|\fBhost_name\fP|\fBIP_address\fP" diff --git a/hardif_json.c b/mesh_json.c similarity index 60% copy from hardif_json.c copy to mesh_json.c index 61fdc2f..47bba11 100644 --- a/hardif_json.c +++ b/mesh_json.c @@ -10,11 +10,11 @@
#include "genl_json.h"
-static struct json_query_data batctl_json_query_hardif = { +static struct json_query_data batctl_json_query_mesh = { .nlm_flags = 0, - .cmd = BATADV_CMD_GET_HARDIF, + .cmd = BATADV_CMD_GET_MESH, };
-COMMAND_NAMED(JSON_HIF, hardif_json, "hj", handle_json_query, +COMMAND_NAMED(JSON_MIF, mesh_json, "mj", handle_json_query, COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, - &batctl_json_query_hardif, ""); + &batctl_json_query_mesh, "");