Repository : ssh://git@diktynna/batctl
On branch : master
commit 6f63d1fcb66e852de756fabfddda339f757e980f Author: Sven Eckelmann sven@narfation.org Date: Fri May 14 16:23:03 2021 +0200
batctl: Add dat_cache_json command
Signed-off-by: Sven Eckelmann sven@narfation.org
6f63d1fcb66e852de756fabfddda339f757e980f Makefile | 1 + README.rst | 29 +++++++++++++++++++++++++++++ bla_claim_json.c => dat_cache_json.c | 8 ++++---- man/batctl.8 | 3 +++ 4 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index 6c57055..0c91b66 100755 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ $(eval $(call add_command,bonding,y)) $(eval $(call add_command,bridge_loop_avoidance,y)) $(eval $(call add_command,claimtable,y)) $(eval $(call add_command,dat_cache,y)) +$(eval $(call add_command,dat_cache_json,y)) $(eval $(call add_command,distributed_arp_table,y)) $(eval $(call add_command,elp_interval,y)) $(eval $(call add_command,event,y)) diff --git a/README.rst b/README.rst index 4129ddd..a4c7ab1 100644 --- a/README.rst +++ b/README.rst @@ -777,6 +777,35 @@ Example:: ]
+batctl dat_cache_json +--------------------- + +Query batman-adv for the entries in cache of the distributed arp table. + +Usage:: + + batctl meshif <netdev> dat_cache_json|dcj + +Example:: + + $ batctl meshif bat0 dat_cache_json | json_pp + [ + { + "dat_cache_hwaddress": "10:8e:e0:62:dc:e8", + "dat_cache_ip4address": "10.204.32.109", + "dat_cache_vid": -1, + "last_seen_msecs": 165752 + }, + { + "dat_cache_hwaddress": "02:ba:7a:df:06:01", + "dat_cache_ip4address": "10.204.32.7", + "dat_cache_vid": -1, + "last_seen_msecs": 364 + }, + [...] + ] + + Advanced Analytics ==================
diff --git a/bla_claim_json.c b/dat_cache_json.c similarity index 60% copy from bla_claim_json.c copy to dat_cache_json.c index 4ff3fff..4dcefd0 100644 --- a/bla_claim_json.c +++ b/dat_cache_json.c @@ -10,11 +10,11 @@
#include "genl_json.h"
-static struct json_query_data batctl_json_query_bla_claim = { +static struct json_query_data batctl_json_query_dat_cache = { .nlm_flags = NLM_F_DUMP, - .cmd = BATADV_CMD_GET_BLA_CLAIM, + .cmd = BATADV_CMD_GET_DAT_CACHE, };
-COMMAND_NAMED(JSON_MIF, bla_claim_json, "clj", handle_json_query, +COMMAND_NAMED(JSON_MIF, dat_cache_json, "dcj", handle_json_query, COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, - &batctl_json_query_bla_claim, ""); + &batctl_json_query_dat_cache, ""); diff --git a/man/batctl.8 b/man/batctl.8 index 1ee8933..dafd1bd 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -311,6 +311,9 @@ List of available JSON queries: .RS 10 - bla_claim_json|clj .RE +.RS 10 +- dat_cache_json|dcj +.RE .RE .br .IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"