To improve the usability better use case-insensitive pattern-matching
in ifstat, nstat and ss tools.
Signed-off-by: Anton Danilov <littlesmilingcloud@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
.B rtacct
are simple tools to monitor kernel snmp counters and network interface statistics.
+.B nstat
+can filter kernel snmp counters by name with one or several specified wildcards. Wildcards are case-insensitive and can include special symbols
+.B ?
+and
+.B *
+.
+
.SH OPTIONS
.B \-h, \-\-help
Print help
return 1;
for (i = 0; i < npatterns; i++) {
- if (!fnmatch(patterns[i], id, 0))
+ if (!fnmatch(patterns[i], id, FNM_CASEFOLD))
return 1;
}
return 0;
return 1;
for (i = 0; i < npatterns; i++) {
- if (!fnmatch(patterns[i], id, 0))
+ if (!fnmatch(patterns[i], id, FNM_CASEFOLD))
return 1;
}
return 0;
return 1;
if (addr == NULL)
addr = "";
- return !fnmatch(pattern, addr, 0);
+ return !fnmatch(pattern, addr, FNM_CASEFOLD);
}
static int run_ssfilter(struct ssfilter *f, struct sockstat *s)