lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11d977863011c6bb3d764ce59d9f5863f4f042f9.1652104101.git.petrm@nvidia.com>
Date:   Mon, 9 May 2022 15:59:58 +0200
From:   Petr Machata <petrm@...dia.com>
To:     <netdev@...r.kernel.org>
CC:     David Ahern <dsahern@...il.com>, Ido Schimmel <idosch@...dia.com>,
        "Petr Machata" <petrm@...dia.com>
Subject: [PATCH iproute2-next 05/10] ipstats: Add a third level of stats hierarchy, a "suite"

To show statistics nested under IFLA_STATS_LINK_XSTATS_SLAVE or
IFLA_STATS_LINK_XSTATS, one would use "group" to select the top-level
attribute, then "subgroup" to select the link type, which is itself a nest,
and then would lack a way to denote which attribute to select out of the
link-type nest.

To that end, add the selector level "suite", which is filtered in the
userspace.

Signed-off-by: Petr Machata <petrm@...dia.com>
Reviewed-by: Ido Schimmel <idosch@...dia.com>
---
 ip/ipstats.c        | 9 ++++++++-
 man/man8/ip-stats.8 | 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ip/ipstats.c b/ip/ipstats.c
index 5b9333e3..0e7f2b3c 100644
--- a/ip/ipstats.c
+++ b/ip/ipstats.c
@@ -34,6 +34,7 @@ struct ipstats_stat_show_attrs {
 static const char *const ipstats_levels[] = {
 	"group",
 	"subgroup",
+	"suite",
 };
 
 enum {
@@ -1024,7 +1025,7 @@ static int do_help(void)
 
 	fprintf(stderr,
 		"Usage: ip stats help\n"
-		"       ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP ] ... ] ...\n"
+		"       ip stats show [ dev DEV ] [ group GROUP [ subgroup SUBGROUP [ suite SUITE ] ... ] ... ] ...\n"
 		"       ip stats set dev DEV l3_stats { on | off }\n"
 		);
 
@@ -1048,6 +1049,8 @@ static int do_help(void)
 			continue;
 
 		for (j = 0; j < desc->nsubs; j++) {
+			size_t k;
+
 			if (j == 0)
 				fprintf(stderr, "%s SUBGROUP := {", desc->name);
 			else
@@ -1057,6 +1060,10 @@ static int do_help(void)
 
 			if (desc->subs[j]->kind != IPSTATS_STAT_DESC_KIND_GROUP)
 				continue;
+
+			for (k = 0; k < desc->subs[j]->nsubs; k++)
+				fprintf(stderr, " [ suite %s ]",
+					desc->subs[j]->subs[k]->name);
 		}
 		if (opened)
 			fprintf(stderr, " }\n");
diff --git a/man/man8/ip-stats.8 b/man/man8/ip-stats.8
index 7eaaf122..a82fe9f7 100644
--- a/man/man8/ip-stats.8
+++ b/man/man8/ip-stats.8
@@ -19,7 +19,8 @@ ip-stats \- manage and show interface statistics
 .RB "[ " group
 .IR GROUP " [ "
 .BI subgroup " SUBGROUP"
-.R " ] ... ] ..."
+.RB " [ " suite
+.IR " SUITE" " ] ... ] ... ] ..."
 
 .ti -8
 .BR "ip stats set"
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ