]> The Tcpdump Group git mirrors - tcpdump/commitdiff
RT6: Update some printings for coherency
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Sep 2020 13:49:09 +0000 (15:49 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 10 Sep 2020 15:19:52 +0000 (17:19 +0200)
s/srcrt/RT6/
In upper case (like 'IP6'), via a nd_print_protocol_caps() call.

Before: srcrt (len=48, type=0, segleft=48 [|rt6]
After:  RT6 (len=48, type=0, segleft=48 [|rt6]

rt6 choosen because it's in file name (print-rt6.c), function name
(rt6_print) and set in ndo->ndo_protocol ("rt6").

Moreover:
Print the protocol name even if the packet is truncated at the beginning.
Use nd_print_trunc().

print-rt6.c
tests/hoobr_rt6_print.out
tests/ipv6-routing-header.out
tests/ipv6-rthdr-oobr.out
tests/ipv6-srh-ext-header.out
tests/ipv6-srh-insert-cksum.out
tests/ipv6-srh-ipproto-ether-ev.out
tests/ipv6-srh-ipproto-ether-v.out

index 980d675faa308dfbb14d243fdf44818fc1fe4ba8..a83ea379498ab969079d05c53270221dfd680332 100644 (file)
@@ -45,12 +45,14 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_)
        const u_char *p;
 
        ndo->ndo_protocol = "rt6";
+
+       nd_print_protocol_caps(ndo);
        dp = (const struct ip6_rthdr *)bp;
 
        ND_TCHECK_1(dp->ip6r_segleft);
 
        len = GET_U_1(dp->ip6r_len);
-       ND_PRINT("srcrt (len=%u", len); /*)*/
+       ND_PRINT(" (len=%u", len);      /*)*/
        type = GET_U_1(dp->ip6r_type);
        ND_PRINT(", type=%u", type);
        ND_PRINT(", segleft=%u", GET_U_1(dp->ip6r_segleft));
@@ -106,6 +108,6 @@ rt6_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_)
        }
 
  trunc:
-       ND_PRINT("[|srcrt]");
+       nd_print_trunc(ndo);
        return -1;
 }
index 4a62bba2dcdb95518dbe680f802ce3f6b8e62b22..e0e2a6e11d98231a94d01cf35a8aeca4e46e341b 100644 (file)
@@ -1,3 +1,3 @@
     1  05:27:12.808464432 unknown ip 3
     2  05:27:12.808464432 unknown ip 3
-    3  05:27:12.808464432 IP6 3030:3030:3030:3030:3030:3030:3030:3030 > 3030:3030:3030:3030:3030:3030:3030:3030: [|srcrt]
+    3  05:27:12.808464432 IP6 3030:3030:3030:3030:3030:3030:3030:3030 > 3030:3030:3030:3030:3030:3030:3030:3030: RT6 [|rt6]
index dc57aef537f69b356ee8bba6f5adc305b5ae24f0..d9b26a972b26ee0d1f92d33a6f03788b630698f4 100644 (file)
@@ -1,4 +1,4 @@
-    1  16:51:31.766766 IP6 (hlim 4, next-header Routing (43) payload length: 32) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: srcrt (len=2, type=0, segleft=1, rsv=0x0, [0]2200::210:2:0:0:4) [icmp6 sum ok] ICMP6, echo request, id 0, seq 0
-    2  16:51:32.803243 IP6 (hlim 5, next-header Routing (43) payload length: 48) 2200::244:212:3fff:feae:22f7 > 2200::211:2:0:0:2: srcrt (len=4, type=0, segleft=2, rsv=0x0, [0]2200::210:2:0:0:4, [1]2200::240:2:0:0:4) [icmp6 sum ok] ICMP6, echo request, id 0, seq 0
-    3  16:51:33.575585 IP6 (hlim 4, next-header Routing (43) payload length: 32) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: srcrt (len=2, type=0, segleft=1, rsv=0x0, [0]2200::210:2:0:0:4) 5645 > 5642: [udp sum ok] UDP, length 0
-    4  16:51:34.608086 IP6 (hlim 5, next-header Routing (43) payload length: 48) 2200::244:212:3fff:feae:22f7 > 2200::211:2:0:0:2: srcrt (len=4, type=0, segleft=2, rsv=0x0, [0]2200::210:2:0:0:4, [1]2200::240:2:0:0:4) 5645 > 5642: [udp sum ok] UDP, length 0
+    1  16:51:31.766766 IP6 (hlim 4, next-header Routing (43) payload length: 32) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: RT6 (len=2, type=0, segleft=1, rsv=0x0, [0]2200::210:2:0:0:4) [icmp6 sum ok] ICMP6, echo request, id 0, seq 0
+    2  16:51:32.803243 IP6 (hlim 5, next-header Routing (43) payload length: 48) 2200::244:212:3fff:feae:22f7 > 2200::211:2:0:0:2: RT6 (len=4, type=0, segleft=2, rsv=0x0, [0]2200::210:2:0:0:4, [1]2200::240:2:0:0:4) [icmp6 sum ok] ICMP6, echo request, id 0, seq 0
+    3  16:51:33.575585 IP6 (hlim 4, next-header Routing (43) payload length: 32) 2200::244:212:3fff:feae:22f7 > 2200::240:2:0:0:4: RT6 (len=2, type=0, segleft=1, rsv=0x0, [0]2200::210:2:0:0:4) 5645 > 5642: [udp sum ok] UDP, length 0
+    4  16:51:34.608086 IP6 (hlim 5, next-header Routing (43) payload length: 48) 2200::244:212:3fff:feae:22f7 > 2200::211:2:0:0:2: RT6 (len=4, type=0, segleft=2, rsv=0x0, [0]2200::210:2:0:0:4, [1]2200::240:2:0:0:4) 5645 > 5642: [udp sum ok] UDP, length 0
index 65a78c9705b4360c1a290fea7c23e218e26067a7..00e8cdf1012dae9e27d662983aa2f2b3e988b609 100644 (file)
@@ -1 +1 @@
-    1  05:27:12.808464432 IP6 3030:3030:3030:3030:3030:3030:3030:3030 > 3030:3030:3030:3030:3030:3030:3030:3030: srcrt (len=48, type=0, segleft=48 [|rt6]
+    1  05:27:12.808464432 IP6 3030:3030:3030:3030:3030:3030:3030:3030 > 3030:3030:3030:3030:3030:3030:3030:3030: RT6 (len=48, type=0, segleft=48 [|rt6]
index 1e3fb033333497ff13f37c44bdd0466d77a48f44..dc64a65529dc804d244f1d61c6eceee4b6afe7bc 100644 (file)
@@ -1 +1 @@
-    1  16:29:31.085223 IP6 (flowlabel 0x889ad, hlim 64, next-header Routing (43) payload length: 144) a:b:c:12::1 > a:b:c:2::f1:0: srcrt (len=4, type=4, segleft=1, last-entry=1, flags=0x0, tag=0, [0]a:b:c:3::d6, [1]a:b:c:2::f1:0) IP6 (flowlabel 0x889ad, hlim 64, next-header ICMPv6 (58) payload length: 64) a:b:c:12::1 > b2::2: [icmp6 sum ok] ICMP6, echo request, id 1774, seq 1
+    1  16:29:31.085223 IP6 (flowlabel 0x889ad, hlim 64, next-header Routing (43) payload length: 144) a:b:c:12::1 > a:b:c:2::f1:0: RT6 (len=4, type=4, segleft=1, last-entry=1, flags=0x0, tag=0, [0]a:b:c:3::d6, [1]a:b:c:2::f1:0) IP6 (flowlabel 0x889ad, hlim 64, next-header ICMPv6 (58) payload length: 64) a:b:c:12::1 > b2::2: [icmp6 sum ok] ICMP6, echo request, id 1774, seq 1
index 1815c6612f0eeb4e8e59e8156a33ecf51ddf4560..f16c8a3a95922a57314a9ecd78709f3da97febcc 100644 (file)
@@ -1 +1 @@
-    1  17:59:40.591932 IP6 (flowlabel 0x8f8b8, hlim 64, next-header Routing (43) payload length: 1088) 12::1 > 2::f1:0: srcrt (len=6, type=4, segleft=2, last-entry=2, flags=0x0, tag=0, [0]b2::2, [1]3::d6, [2]2::f1:0) 57745 > 5001: [udp sum ok] UDP, length 1024
+    1  17:59:40.591932 IP6 (flowlabel 0x8f8b8, hlim 64, next-header Routing (43) payload length: 1088) 12::1 > 2::f1:0: RT6 (len=6, type=4, segleft=2, last-entry=2, flags=0x0, tag=0, [0]b2::2, [1]3::d6, [2]2::f1:0) 57745 > 5001: [udp sum ok] UDP, length 1024
index 96a99bc7e5337b6c447af3ca32ca0ae0ba4ae9da..36dedcfa886889b500178e49bdd12754f73bc6f9 100644 (file)
@@ -1 +1 @@
-    1  15:07:04.802036 be:f5:06:09:44:74 > d6:67:19:4e:0f:4f, ethertype IPv6 (0x86dd), length 196: (flowlabel 0xde027, hlim 63, next-header Routing (43) payload length: 142) a::1 > c::2: srcrt (len=2, type=4, segleft=0, last-entry=0, flags=0x0, tag=0, [0]c::2) ae:64:42:3b:5b:9a > 1e:1d:df:cd:54:7a, ethertype IPv6 (0x86dd), length 118: (flowlabel 0xde027, hlim 64, next-header ICMPv6 (58) payload length: 64) a::2 > e::2: [icmp6 sum ok] ICMP6, echo request, id 18516, seq 1339
+    1  15:07:04.802036 be:f5:06:09:44:74 > d6:67:19:4e:0f:4f, ethertype IPv6 (0x86dd), length 196: (flowlabel 0xde027, hlim 63, next-header Routing (43) payload length: 142) a::1 > c::2: RT6 (len=2, type=4, segleft=0, last-entry=0, flags=0x0, tag=0, [0]c::2) ae:64:42:3b:5b:9a > 1e:1d:df:cd:54:7a, ethertype IPv6 (0x86dd), length 118: (flowlabel 0xde027, hlim 64, next-header ICMPv6 (58) payload length: 64) a::2 > e::2: [icmp6 sum ok] ICMP6, echo request, id 18516, seq 1339
index 8c8b21788c3f6637bacf7620228f3398a5ec66ba..2d6664e64c69f1cde76676522cd332f4bfa29f07 100644 (file)
@@ -1 +1 @@
-    1  15:07:04.802036 IP6 (flowlabel 0xde027, hlim 63, next-header Routing (43) payload length: 142) a::1 > c::2: srcrt (len=2, type=4, segleft=0, last-entry=0, flags=0x0, tag=0, [0]c::2) IP6 (flowlabel 0xde027, hlim 64, next-header ICMPv6 (58) payload length: 64) a::2 > e::2: [icmp6 sum ok] ICMP6, echo request, id 18516, seq 1339
+    1  15:07:04.802036 IP6 (flowlabel 0xde027, hlim 63, next-header Routing (43) payload length: 142) a::1 > c::2: RT6 (len=2, type=4, segleft=0, last-entry=0, flags=0x0, tag=0, [0]c::2) IP6 (flowlabel 0xde027, hlim 64, next-header ICMPv6 (58) payload length: 64) a::2 > e::2: [icmp6 sum ok] ICMP6, echo request, id 18516, seq 1339