netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] [TC/U32] Restore old output of u32
@ 2008-04-20 14:45 jamal
  2008-05-09 22:51 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: jamal @ 2008-04-20 14:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Patrick McHardy, netdev

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]


This is a repeat of the first one i sent already..

cheers,
jamal

[-- Attachment #2: 0001-TC-U32-Restore-old-output-of-u32.txt --]
[-- Type: text/plain, Size: 1597 bytes --]

[PATCH 1/3] [TC/U32] Restore old output of u32
My scripts broke because of the new change that beautifies output.
Restore old output as default and have user enter -cooked if they
want beautified output...

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
 include/utils.h |    1 +
 tc/f_u32.c      |    2 +-
 tc/tc.c         |    3 +++
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 5daed6b..3a7312c 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -13,6 +13,7 @@ extern int preferred_family;
 extern int show_stats;
 extern int show_details;
 extern int show_raw;
+extern int show_cooked;
 extern int resolve_hosts;
 extern int oneline;
 extern int timestamp;
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 7e4d56c..db492fe 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -793,7 +793,7 @@ static void show_key(FILE *f, const struct tc_u32_key *key)
 {
 	char abuf[256];
 
-	if (show_raw)
+	if (!show_cooked)
 		goto raw;
 
 	switch (key->off) {
diff --git a/tc/tc.c b/tc/tc.c
index 6126c71..06058fb 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -33,6 +33,7 @@
 int show_stats = 0;
 int show_details = 0;
 int show_raw = 0;
+int show_cooked = 0;
 int resolve_hosts = 0;
 int use_iec = 0;
 int force = 0;
@@ -273,6 +274,8 @@ int main(int argc, char **argv)
 			++show_details;
 		} else if (matches(argv[1], "-raw") == 0) {
 			++show_raw;
+		} else if (matches(argv[1], "-cooked") == 0) {
+			++show_cooked;
 		} else if (matches(argv[1], "-Version") == 0) {
 			printf("tc utility, iproute2-ss%s\n", SNAPSHOT);
 			return 0;
-- 
1.4.4.1.gaed4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] [TC/U32] Restore old output of u32
  2008-04-20 14:45 [PATCH 1/3] [TC/U32] Restore old output of u32 jamal
@ 2008-05-09 22:51 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2008-05-09 22:51 UTC (permalink / raw)
  To: hadi; +Cc: Patrick McHardy, netdev

On Sun, 20 Apr 2008 10:45:44 -0400
jamal <hadi@cyberus.ca> wrote:

> 
> This is a repeat of the first one i sent already..
> 
> cheers,
> jamal

I applied these but I changed "-cooked" to "-pretty", just
personal taste, cooked sounds too cute and leftover unix geeky.

Also, added documentation to the tc.8 man page for this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-09 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-20 14:45 [PATCH 1/3] [TC/U32] Restore old output of u32 jamal
2008-05-09 22:51 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).