]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add and use tstr[]
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 13 Feb 2018 22:00:48 +0000 (23:00 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 13 Feb 2018 22:00:55 +0000 (23:00 +0100)
Update the output of some tests accordingly.

print-cfm.c
print-eigrp.c
print-ldp.c
print-lmp.c
print-lspping.c
print-lwapp.c
print-slow.c
tests/eigrp-tlv-oobr.out
tests/lmpv1_busyloop.out
tests/wb-oobr.out

index d553b6b71a4a3f20ed22d2b937f4b5f7a62261a2..050a99a366f41a7b269967f2c4230a28059deba5 100644 (file)
@@ -31,6 +31,8 @@
 #include "oui.h"
 #include "af.h"
 
+static const char tstr[] = " [|cfm]";
+
 struct cfm_common_header_t {
     nd_uint8_t mdlevel_version;
     nd_uint8_t opcode;
@@ -764,5 +766,5 @@ tooshort:
     return;
 
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
index 9e0a76696afb439a667e1611f83ba23becbfc406..022c93553a7220d926ab5d85ad6d3cb79b0f4272 100644 (file)
@@ -35,6 +35,8 @@
 #include "extract.h"
 #include "addrtoname.h"
 
+static const char tstr[] = " [|eigrp]";
+
 struct eigrp_common_header {
     nd_uint8_t  version;
     nd_uint8_t  opcode;
@@ -521,5 +523,5 @@ eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
     }
     return;
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
index 2803aa33afb7732ea41df80d478201062e7b0c77..1e1f1b679e073ff17011aed3bf7d077f1a4e7225 100644 (file)
@@ -29,6 +29,8 @@
 #include "l2vpn.h"
 #include "af.h"
 
+static const char tstr[] = " [|ldp]";
+
 /*
  * ldp common header
  *
@@ -534,7 +536,7 @@ ldp_tlv_print(netdissect_options *ndo,
     return(tlv_len+4); /* Type & Length fields not included */
 
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
     return 0;
 
 badtlv:
@@ -686,7 +688,7 @@ ldp_pdu_print(netdissect_options *ndo,
     }
     return pdu_len+4;
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
     return 0;
 }
 
index bb7d9ae2aae3022a727b2dba55811410018887b3..6e3f9810fffe5d7b657714e0fca03228a357abef 100644 (file)
@@ -31,6 +31,8 @@
 #include "addrtoname.h"
 #include "gmpls.h"
 
+static const char tstr[] = " [|lmp]";
+
 /*
  * LMP common header
  *
@@ -1131,7 +1133,7 @@ lmp_print(netdissect_options *ndo,
     }
     return;
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
 /*
  * Local Variables:
index d6ace13b6dc48e44099e955761b3c058872d26c6..bb32b3e3835dfbc7a9a380d73e8d17c543df20a7 100644 (file)
@@ -30,6 +30,8 @@
 #include "l2vpn.h"
 #include "oui.h"
 
+static const char tstr[] = " [|lspping]";
+
 /*
  * LSPPING common header
  *
@@ -1085,7 +1087,7 @@ tooshort:
     ND_PRINT("\n\t\t packet is too short");
     return;
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
     return;
 }
 /*
index fac11356e9806e123c9d91dd492aa5f7a3c392e3..15e2022ce8e06975bdbca73b59e2baf52b81c94f 100644 (file)
@@ -29,6 +29,9 @@
 #include "extract.h"
 #include "addrtoname.h"
 
+static const char control_tstr[] = " [|lwapp_control]";
+static const char data_tstr[] = " [|lwapp_data]";
+
 /*
  * LWAPP transport (common) header
  *      0                   1                   2                   3
@@ -291,8 +294,8 @@ lwapp_control_print(netdissect_options *ndo,
     }
     return;
 
- trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+trunc:
+    ND_PRINT("%s", control_tstr);
 }
 
 void
@@ -359,8 +362,8 @@ lwapp_data_print(netdissect_options *ndo,
 
     return;
 
- trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+trunc:
+    ND_PRINT("%s", data_tstr);
 }
 
 /*
index b88c083a4345ad5c17553912aaa8df8b8a72238f..976c576639b632965320d18dd62eab27eadf75da 100644 (file)
@@ -31,6 +31,8 @@
 #include "addrtoname.h"
 #include "oui.h"
 
+static const char tstr[] = " [|slow]";
+
 #define        SLOW_PROTO_LACP                     1
 #define        SLOW_PROTO_MARKER                   2
 #define SLOW_PROTO_OAM                      3
@@ -338,10 +340,7 @@ tooshort:
     return;
 
 trunc:
-    if (!ndo->ndo_vflag)
-        ND_PRINT(" (packet exceeded snapshot)");
-    else
-        ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
 
 static void
@@ -483,7 +482,7 @@ tooshort:
     return;
 
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
 
 static void
@@ -750,5 +749,5 @@ tooshort:
     return;
 
 trunc:
-    ND_PRINT("\n\t\t packet exceeded snapshot");
+    ND_PRINT("%s", tstr);
 }
index 029bb5aa19903c14c1d5351166bc7ba3192a5278..bee5817a3cc0170ca530ed7071334166b07c9d0b 100644 (file)
@@ -4132,5 +4132,4 @@ c2:02:73:fe:00:00 > 01:00:5e:00:00:0a, ethertype IPv4 (0x0800), length 65535: (t
          Software Version TLV (0x0004), length: 4 (too short, < 8)
          Software Version TLV (0x0004), length: 4 (too short, < 8)
          Software Version TLV (0x0004), length: 4 (too short, < 8)
-         Software Version TLV (0x0004), length: 4 (too short, < 8)
-                packet exceeded snapshot
+         Software Version TLV (0x0004), length: 4 (too short, < 8) [|eigrp]
index b85b0e88fa2490376b8059d20e7a005518d114b7..dc22b4271821ae7f00e3548fefd772a6efcc4a39 100644 (file)
@@ -38,5 +38,4 @@
            0x01d0:  0200 0200 0002 0002 0000 0200 0200 0002
            0x01e0:  0002 0000 0200 0200 0002 0002 0000 0200
            0x01f0:  0200 0002 0002 0000 0200 0200 0002 0002
-         Unknown Object (0), Class-Type: Unknown (0) Flags: [non-negotiable], length: 512
-                packet exceeded snapshot
+         Unknown Object (0), Class-Type: Unknown (0) Flags: [non-negotiable], length: 512 [|lmp]
index 9f00e37d50a2b908aa8757ce7f48d67f88c8fdad..255e4f704402c5ad251a696b66b0fba2f1fe2f95 100644 (file)
@@ -1,18 +1,15 @@
 MPLS (label 197376, exp 7, [S], ttl 48)
        IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->7754)!)
-    48.4.4.4.4400 > 127.0.0.1.3503: 
-                packet exceeded snapshot
+    48.4.4.4.4400 > 127.0.0.1.3503:  [|lspping]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->699d)!)
     48.48.48.48.3503 > 48.48.48.48.4567: * wb-prep:[|wb]
 MPLS (label 197376, exp 7, [S], ttl 48)
        IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->699d)!)
-    48.48.48.48.4400 > 48.48.48.48.3503: 
-                packet exceeded snapshot
+    48.48.48.48.4400 > 48.48.48.48.3503:  [|lspping]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->c624)!)
     48.48.0.1.3503 > 48.4.4.4.4567: * wb-prep:[|wb]
 MPLS (label 197376, exp 7, [S], ttl 48)
        IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->7754)!)
-    48.4.4.4.4400 > 127.0.0.1.3503: 
-                packet exceeded snapshot
+    48.4.4.4.4400 > 127.0.0.1.3503:  [|lspping]
 IP (tos 0x30, ttl 48, id 12336, offset 0, flags [none], proto UDP (17), length 12336, bad cksum 3030 (->c624)!)
     48.48.0.1.3503 > 48.4.4.4.4567: * wb-prep:[|wb]