Repository : ssh://git@diktynna/batctl
On branch : master
commit 48c0811f000b20ccd0d24b2ac3d41a73152cb2f5 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
48c0811f000b20ccd0d24b2ac3d41a73152cb2f5 Makefile | 1 + README.rst | 50 +++++++++++++++++++++++++++++++++++ man/batctl.8 | 3 +++ gateways_json.c => mcast_flags_json.c | 8 +++--- 4 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index a304c18..a091920 100755 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ $(eval $(call add_command,interface,y)) $(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,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 e40f07e..d1faa9e 100644 --- a/README.rst +++ b/README.rst @@ -917,6 +917,56 @@ Example:: ]
+batctl mcast_flags_json +----------------------- + +Query batman-adv for entries multicast optimization table. + +Usage:: + + batctl meshif <netdev> mcast_flags_json|mfj + +Example:: + + $ batctl meshif bat0 mcast_flags_json | json_pp + [ + { + "mcast_flags": { + "all_unsnoopables": true, + "raw": 1, + "want_all_ipv4": false, + "want_all_ipv6": false, + "want_no_rtr_ipv4": false, + "want_no_rtr_ipv6": false + }, + "orig_address": "9e:58:32:59:54:c3" + }, + { + "mcast_flags": { + "all_unsnoopables": true, + "raw": 1, + "want_all_ipv4": false, + "want_all_ipv6": false, + "want_no_rtr_ipv4": false, + "want_no_rtr_ipv6": false + }, + "orig_address": "32:12:17:0a:21:63" + }, + { + "mcast_flags": { + "all_unsnoopables": true, + "raw": 1, + "want_all_ipv4": false, + "want_all_ipv6": false, + "want_no_rtr_ipv4": false, + "want_no_rtr_ipv6": false + }, + "orig_address": "1a:34:8c:c4:fe:13" + }, + [...] + ] + + Advanced Analytics ==================
diff --git a/man/batctl.8 b/man/batctl.8 index 818fc45..9f28b3e 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -323,6 +323,9 @@ List of available JSON queries: .RS 10 - hardifs_json|hj .RE +.RS 10 +- mcast_flags_json|mfj +.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/gateways_json.c b/mcast_flags_json.c similarity index 58% copy from gateways_json.c copy to mcast_flags_json.c index 3ab75da..28f53f5 100644 --- a/gateways_json.c +++ b/mcast_flags_json.c @@ -10,11 +10,11 @@
#include "genl_json.h"
-static struct json_query_data batctl_json_query_gateways = { +static struct json_query_data batctl_json_query_mcast_flags = { .nlm_flags = NLM_F_DUMP, - .cmd = BATADV_CMD_GET_GATEWAYS, + .cmd = BATADV_CMD_GET_MCAST_FLAGS, };
-COMMAND_NAMED(JSON_MIF, gateways_json, "gwj", handle_json_query, +COMMAND_NAMED(JSON_MIF, mcast_flags_json, "mfj", handle_json_query, COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, - &batctl_json_query_gateways, ""); + &batctl_json_query_mcast_flags, "");