diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-02-13 23:00:48 +0100 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-02-13 23:00:55 +0100 |
commit | c1b92ea1d4f508c72b1ffe8e08eb766ac39c7018 (patch) | |
tree | 205246f6f4b6ceb2880d221362482729b8523cc1 | |
parent | 67f87a772e27158784e2770162ee0f48f1b21649 (diff) | |
download | tcpdump-c1b92ea1d4f508c72b1ffe8e08eb766ac39c7018.tar.gz |
Add and use tstr[]
Update the output of some tests accordingly.
-rw-r--r-- | print-cfm.c | 4 | ||||
-rw-r--r-- | print-eigrp.c | 4 | ||||
-rw-r--r-- | print-ldp.c | 6 | ||||
-rw-r--r-- | print-lmp.c | 4 | ||||
-rw-r--r-- | print-lspping.c | 4 | ||||
-rw-r--r-- | print-lwapp.c | 11 | ||||
-rw-r--r-- | print-slow.c | 11 | ||||
-rw-r--r-- | tests/eigrp-tlv-oobr.out | 3 | ||||
-rw-r--r-- | tests/lmpv1_busyloop.out | 3 | ||||
-rw-r--r-- | tests/wb-oobr.out | 9 |
10 files changed, 33 insertions, 26 deletions
diff --git a/print-cfm.c b/print-cfm.c index d553b6b7..050a99a3 100644 --- a/print-cfm.c +++ b/print-cfm.c @@ -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); } diff --git a/print-eigrp.c b/print-eigrp.c index 9e0a7669..022c9355 100644 --- a/print-eigrp.c +++ b/print-eigrp.c @@ -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); } diff --git a/print-ldp.c b/print-ldp.c index 2803aa33..1e1f1b67 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -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; } diff --git a/print-lmp.c b/print-lmp.c index bb7d9ae2..6e3f9810 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -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: diff --git a/print-lspping.c b/print-lspping.c index d6ace13b..bb32b3e3 100644 --- a/print-lspping.c +++ b/print-lspping.c @@ -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; } /* diff --git a/print-lwapp.c b/print-lwapp.c index fac11356..15e2022c 100644 --- a/print-lwapp.c +++ b/print-lwapp.c @@ -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); } /* diff --git a/print-slow.c b/print-slow.c index b88c083a..976c5766 100644 --- a/print-slow.c +++ b/print-slow.c @@ -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); } diff --git a/tests/eigrp-tlv-oobr.out b/tests/eigrp-tlv-oobr.out index 029bb5aa..bee5817a 100644 --- a/tests/eigrp-tlv-oobr.out +++ b/tests/eigrp-tlv-oobr.out @@ -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] diff --git a/tests/lmpv1_busyloop.out b/tests/lmpv1_busyloop.out index b85b0e88..dc22b427 100644 --- a/tests/lmpv1_busyloop.out +++ b/tests/lmpv1_busyloop.out @@ -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] diff --git a/tests/wb-oobr.out b/tests/wb-oobr.out index 9f00e37d..255e4f70 100644 --- a/tests/wb-oobr.out +++ b/tests/wb-oobr.out @@ -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] |