Commit 44dcfe82 authored by Stephen Hemminger's avatar Stephen Hemminger

Change formatting of u32 back to default

Don't break scripts that depend on previous offset/value format.
Introduce a new -pretty flag for decoding, and (*gasp*) document
the formatting arguments.
parent 7dec1bf8
......@@ -34,16 +34,28 @@ priority filtertype
.B flowid
flow-id
.B tc [-s | -d ] qdisc show [ dev
.B tc
.RI "[ " FORMAT " ]"
.B qdisc show [ dev
DEV
.B ]
.P
.B tc [-s | -d ] class show dev
.B tc
.RI "[ " FORMAT " ]"
.B class show dev
DEV
.P
.B tc filter show dev
DEV
.ti -8
.IR FORMAT " := {"
\fB\-s\fR[\fItatistics\fR] |
\fB\-d\fR[\fIetails\fR] |
\fB\-r\fR[\fIaw\fR] |
\fB\-p\fR[\fIretty\fR] |
\fB\i\fR[\fIec\fR] }
.SH DESCRIPTION
.B Tc
is used to configure Traffic Control in the Linux kernel. Traffic Control consists
......@@ -326,6 +338,29 @@ link
Only available for qdiscs and performs a replace where the node
must exist already.
.SH FORMAT
The show command has additional formatting options:
.TP
.BR "\-s" , " \-stats", " \-statistics"
output more statistics about packet usage.
.TP
.BR "\-d", " \-details"
output more detailed information about rates and cell sizes.
.TP
.BR "\-r", " \-raw"
output raw hex values for handles.
.TP
.BR "\-p", " \-pretty"
decode filter offset and mask values to equivalent filter commands based on TCP/IP.
.TP
.BR "\-iec"
print rates in IEC units (ie. 1K = 1024).
.SH HISTORY
.B tc
......
......@@ -25,6 +25,8 @@
#include "utils.h"
#include "tc_util.h"
extern int show_pretty;
static void explain(void)
{
fprintf(stderr, "Usage: ... u32 [ match SELECTOR ... ] [ link HTID ]"
......@@ -793,7 +795,7 @@ static void show_key(FILE *f, const struct tc_u32_key *key)
{
char abuf[256];
if (show_raw)
if (!show_pretty)
goto raw;
switch (key->off) {
......
......@@ -33,6 +33,8 @@
int show_stats = 0;
int show_details = 0;
int show_raw = 0;
int show_pretty = 0;
int resolve_hosts = 0;
int use_iec = 0;
int force = 0;
......@@ -182,7 +184,7 @@ static void usage(void)
fprintf(stderr, "Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n"
" tc [-force] -batch file\n"
"where OBJECT := { qdisc | class | filter | action | monitor }\n"
" OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -b[atch] [file] }\n");
" OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [file] }\n");
}
static int do_cmd(int argc, char **argv)
......@@ -273,6 +275,8 @@ int main(int argc, char **argv)
++show_details;
} else if (matches(argv[1], "-raw") == 0) {
++show_raw;
} else if (matches(argv[1], "-pretty") == 0) {
++show_pretty;
} else if (matches(argv[1], "-Version") == 0) {
printf("tc utility, iproute2-ss%s\n", SNAPSHOT);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment