[PATCH] iptables/extensions/libipt_icmp.c: Add numeric values to the output of iptables -p icmp -h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  I think the addition of numeric types/codes to the output of 
    iptables -p icmp -h
would make it clearer, in particular when referring to other texts.
 
--- extensions/libipt_icmp.c.orig       2010-10-21 04:43:27.000000000 +0300
+++ extensions/libipt_icmp.c    2010-10-21 14:31:15.000000000 +0300
@@ -81,7 +81,7 @@
 print_icmptypes(void)
 {
        unsigned int i;
-       printf("Valid ICMP Types:");
+       printf("Valid, numeric values and named, ICMP Types and codes:");
 
        for (i = 0; i < ARRAY_SIZE(icmp_codes); ++i) {
                if (i && icmp_codes[i].type == icmp_codes[i-1].type) {
@@ -90,10 +90,12 @@
                                == icmp_codes[i-1].code_max))
                                printf(" (%s)", icmp_codes[i].name);
                        else
-                               printf("\n   %s", icmp_codes[i].name);
+                               printf("\n%5s%2u%2s%s", "", icmp_codes[i].code_min,
+                                                       "", icmp_codes[i].name);
                }
                else
-                       printf("\n%s", icmp_codes[i].name);
+                       printf("\n%2s%3u%2s%s", "", icmp_codes[i].type,
+                                               "", icmp_codes[i].name);
        }
        printf("\n");
 } 		 	   		  --
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux