batctl: Add JSON debug commands
v3 cover batctl: Add JSON debug commands
Following JSON debug commands will be added: originators_json, neighbors_json, translocal_json, transglobal_json.
This patches reffering to following patches:
[1] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/SAQYUZQ7I7H7VWHFPVLBUDYCFX7HNWLO/
[2] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/IV2OFJ2KJX52K4ARZ5MIWZ2A42WOKJRO/
[3] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/EYQBFU5O7E3KKRG2YVPLRGHHN3OFIPYP/
[4] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/WKIBP64G27O23MBAPHECSKNJMUESWFAG/
[5] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/Y3XXIYCJWME4CQNWRBIRYJ6ZOL4MI2FT/
[6] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/LYMU5ZA3I6YVHHRZVY3RJJR4KDHF76QI/
[7] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/STECUTMMJGHBJSEHLMDWFOA4VDDDTACS/
[8] https://lists.open-mesh.org/mailman3/hyperkitty/list/[email protected]/thread/W6XWJURD5G577ZPK6WO4XTNTKX5C65Y3/
Alexander Sarmanow (4):
batctl: originators_json: Add originators_json command
batctl: neighbors_json: Add neighbors_json command
batctl: transglobal_json: Add transglobal_json command
batctl: translocal_json: Add translocal_json command
Makefile | 4 +++ README.rst | 60 +++++++++++++++++++++++++++++++++ man/batctl.8 | 12 +++++++ neighbors_json.c | 82 ++++++++++++++++++++++++++++++++++++++++++++ originators_json.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++ transglobal_json.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ translocal_json.c | 81 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 404 insertions(+) create mode 100644 neighbors_json.c create mode 100644 originators_json.c create mode 100644 transglobal_json.c create mode 100644 translocal_json.c
Signature · 1 line
2.25.1
PATCH v3 1/4 batctl: originators_json: Add originators_json command
This is the JSON analogue of the originators table. By using the netlink_query_common function to query the available netlink attributes.
--- Makefile | 1 + README.rst | 15 +++++++++ man/batctl.8 | 3 ++ originators_json.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 originators_json.c
Makefile +1 -0
@@ -62,6 +62,7 @@ $(eval $(call add_command,neighbors,y)) $(eval $(call add_command,network_coding,y)) $(eval $(call add_command,orig_interval,y)) $(eval $(call add_command,originators,y)) +$(eval $(call add_command,originators_json,y)) $(eval $(call add_command,ping,y)) $(eval $(call add_command,routing_algo,y)) $(eval $(call add_command,statistics,y))
README.rst +15 -0
@@ -356,6 +356,21 @@ Example:: fe:f0:00:00:01:01 0.510s (255) fe:f0:00:00:01:01 [ eth0]: fe:f1:00:00:01:01 (240) fe:f0:00:00:01:01 (255) +batctl originators_json +======================= + +Check the Originators JSON (it's a JSON analogue of the Originators table) + +Usage:: + + batctl originators_json|oj + +Example:: + + $ batctl originators_json + [{"hard_ifindex":7,"orig_address":"fe:fe:00:00:01:01","best":true,"last_seen_msecs":700,"neigh_address":"fe:fe:00:00:02:01","tq":119},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:03:01","best":true,"last_seen_msecs":1040,"neigh_address":"fe:fe:00:00:02:01","tq":116},{"hard_ifindex":7,"orig_address":"fe:fe:00:00:04:01","best":true,"last_seen_msecs":700,"neigh_address":"fe:fe:00:00:02:01","tq":119},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:05:01","best":true,"last_seen_msecs":270,"neigh_address":"fe:fe:00:00:02:01","tq":140},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:06:01","best":true,"last_seen_msecs":770,"neigh_address":"fe:fe:00:00:02:01","tq":91}] + + batctl interface ================
man/batctl.8 +3 -0
@@ -303,6 +303,9 @@ seen by each individual node. .RS 7 List of debug JSONs: +.RS 10 +\- originators_json|oj +.RE .RE .br .IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
originators_json.c new file +84 -0
84 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 2/4 batctl: neighbors_json: Add neighbors_json command
In reply to Alexander SarmanowThis is the JSON analogue of the neighbors table. By using the netlink_query_common function to query the available netlink attributes.
--- Makefile | 1 + README.rst | 15 +++++++++ man/batctl.8 | 3 ++ neighbors_json.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100644 neighbors_json.c
Makefile +1 -0
@@ -59,6 +59,7 @@ $(eval $(call add_command,multicast_fanout,y)) $(eval $(call add_command,multicast_forceflood,y)) $(eval $(call add_command,multicast_mode,y)) $(eval $(call add_command,neighbors,y)) +$(eval $(call add_command,neighbors_json,y)) $(eval $(call add_command,network_coding,y)) $(eval $(call add_command,orig_interval,y)) $(eval $(call add_command,originators,y))
README.rst +15 -0
@@ -371,6 +371,21 @@ Example:: [{"hard_ifindex":7,"orig_address":"fe:fe:00:00:01:01","best":true,"last_seen_msecs":700,"neigh_address":"fe:fe:00:00:02:01","tq":119},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:03:01","best":true,"last_seen_msecs":1040,"neigh_address":"fe:fe:00:00:02:01","tq":116},{"hard_ifindex":7,"orig_address":"fe:fe:00:00:04:01","best":true,"last_seen_msecs":700,"neigh_address":"fe:fe:00:00:02:01","tq":119},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:05:01","best":true,"last_seen_msecs":270,"neigh_address":"fe:fe:00:00:02:01","tq":140},{"hard_ifindex":2,"orig_address":"fe:fe:00:00:06:01","best":true,"last_seen_msecs":770,"neigh_address":"fe:fe:00:00:02:01","tq":91}] +batctl neighbors_json +===================== + +display the Neighbors JSON (analogue of the neighbors table) + +Usage:: + + batctl neighbors_json + +Example:: + + $ batctl neighbors_json|nj + [{"hard_ifindex":2,"last_seen_msecs":650,"neigh_address":"fe:fe:00:00:01:01"},{"hard_ifindex":2,"last_seen_msecs":650,"neigh_address":"fe:fe:00:00:01:02"}] + + batctl interface ================
man/batctl.8 +3 -0
@@ -304,6 +304,9 @@ seen by each individual node. .RS 7 List of debug JSONs: .RS 10 +\- neighbors_json|nj +.RE +.RS 10 \- originators_json|oj .RE .RE
neighbors_json.c new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 3/4 batctl: transglobal_json: Add transglobal_json command
In reply to Alexander SarmanowThis is the JSON analogue of the transglobal table. By using the netlink_query_common function to query the available netlink attributes.
--- Makefile | 1 + README.rst | 15 +++++++++ man/batctl.8 | 3 ++ transglobal_json.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 transglobal_json.c
Makefile +1 -0
@@ -72,6 +72,7 @@ $(eval $(call add_command,throughput_override,y)) $(eval $(call add_command,throughputmeter,y)) $(eval $(call add_command,traceroute,y)) $(eval $(call add_command,transglobal,y)) +$(eval $(call add_command,transglobal_json,y)) $(eval $(call add_command,translate,y)) $(eval $(call add_command,translocal,y))
README.rst +15 -0
@@ -687,6 +687,21 @@ Flags that mean: If any of the flags is not enabled, a '.' will substitute its symbol. +batctl transglobal_json +======================= + +display the global translation JSON (analogue of the transglobal table) + +Usage:: + + batctl transglobal_json|tgj + +Example:: + + $ batctl translglobal_json + [{"orig_address":"fe:fe:00:00:01:01","tt_address":"33:33:00:00:00:01","tt_ttvn":3,"last_ttvn":3,"crc32":1916279217,"tt_vid":0,"tt_flags":0,"best":true},{"orig_address":"fe:fe:00:00:01:02","tt_address":"33:33:00:00:00:02","tt_ttvn":3,"last_ttvn":3,"crc32":1916279217,"tt_vid":0,"tt_flags":0}] + + batctl dat_cache =================
man/batctl.8 +3 -0
@@ -309,6 +309,9 @@ List of debug JSONs: .RS 10 \- originators_json|oj .RE +.RS 10 +\- transglobal_json|tgj +.RE .RE .br .IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
transglobal_json.c new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v3 4/4 batctl: translocal_json: Add translocal_json command
In reply to Alexander SarmanowThis is the JSON analogue of the translocal table. By using the netlink_query_common function to query the available netlink attributes.
--- Makefile | 1 + README.rst | 15 +++++++++ man/batctl.8 | 3 ++ translocal_json.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 translocal_json.c
Makefile +1 -0
@@ -75,6 +75,7 @@ $(eval $(call add_command,transglobal,y)) $(eval $(call add_command,transglobal_json,y)) $(eval $(call add_command,translate,y)) $(eval $(call add_command,translocal,y)) +$(eval $(call add_command,translocal_json,y)) MANPAGE = man/batctl.8
README.rst +15 -0
@@ -651,6 +651,21 @@ W/Wireless: If any of the flags is not enabled, a '.' will substitute its symbol. +batctl translocal_json +====================== + +display the local translation JSON (analogue of the translocal table) + +Usage:: + + batctl translocal_json|tlj + +Example:: + + $ batctl translocal_json + [{"tt_address":"33:33:00:00:00:01","crc32":2147984693,"tt_vid":0,"tt_flags":256},{"tt_address":"33:33:00:00:00:01","crc32":2147984693,"tt_vid":0,"tt_flags":256},{"tt_address":"11:11:00:00:00:03","crc32":2147984693,"tt_vid":0,"tt_flags":256}] + + batctl transglobal ==================
man/batctl.8 +3 -0
@@ -310,6 +310,9 @@ List of debug JSONs: \- originators_json|oj .RE .RS 10 +\- translocal_json|tlj +.RE +.RS 10 \- transglobal_json|tgj .RE .RE
translocal_json.c new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 2 lines · On Thursday, 13 May 2021 16:28:08 CEST Alexander Sarmanow wrote:
Following JSON debug commands will be added:
originators_json,neighbors_json,translocal_json,transglobal_json.
Seems like this patchset is full of duplicated code which would have belonged as shared code in an earlier patch.
At the same time, a lot of functionality (batadv genl query commands) is missing - even stuff which was present in an earlier version of the patchset.
Kind regards,
Sven