]> The Tcpdump Group git mirrors - tcpdump/commitdiff
LDP: Add missing fields of the Common Session Parameters TLV and a fix
authorHannes Gredler <[email protected]>
Mon, 14 Aug 2023 08:16:28 +0000 (08:16 +0000)
committerfxlb <[email protected]>
Mon, 14 Aug 2023 18:06:33 +0000 (18:06 +0000)
Fix correct offset for the A&D bits.

Add a LDP Common Session Parameters TLV test file.

print-ldp.c
tests/TESTLIST
tests/ldp-common-session.out [new file with mode: 0644]
tests/ldp-common-session.pcap [new file with mode: 0644]

index 0e0194a933867cb93ed5c33b72e72ec471623f36..642feb241cb670eb946e63dd941b15e73516d1e7 100644 (file)
@@ -328,11 +328,17 @@ ldp_tlv_print(netdissect_options *ndo,
        break;
 
     case LDP_TLV_COMMON_SESSION:
-       TLV_TCHECK(8);
+       TLV_TCHECK(14);
        ND_PRINT("\n\t      Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]",
               GET_BE_U_2(tptr), GET_BE_U_2(tptr + 2),
-              (GET_BE_U_2(tptr + 6)&0x8000) ? "On Demand" : "Unsolicited",
-              (GET_BE_U_2(tptr + 6)&0x4000) ? "Enabled" : "Disabled"
+              (GET_BE_U_2(tptr + 4)&0x8000) ? "On Demand" : "Unsolicited",
+              (GET_BE_U_2(tptr + 4)&0x4000) ? "Enabled" : "Disabled"
+              );
+       ND_PRINT("\n\t      Path Vector Limit %u, Max-PDU length: %u, Receiver Label-Space-ID %s:%u",
+              GET_U_1(tptr+5),
+              GET_BE_U_2(tptr+6),
+              GET_IPADDR_STRING(tptr+8),
+              GET_BE_U_2(tptr+12)
               );
        break;
 
index 2ee9ec677b3cbd335872f9a6842fdf87c8a655c9..452af88a87d47febe3997a6b5603f5f1cee29e8a 100644 (file)
@@ -115,6 +115,7 @@ lmp         lmp.pcap                lmp.out -T lmp
 
 # MPLS tests
 mpls-ldp-hello mpls-ldp-hello.pcap     mpls-ldp-hello.out -v
+ldp-common-session ldp-common-session.pcap ldp-common-session.out -v
 ldp_infloop    ldp-infinite-loop.pcap  ldp_infloop.out
 lspping-fec-ldp    lspping-fec-ldp.pcap lspping-fec-ldp.out
 lspping-fec-ldp-v  lspping-fec-ldp.pcap lspping-fec-ldp-v.out -v
diff --git a/tests/ldp-common-session.out b/tests/ldp-common-session.out
new file mode 100644 (file)
index 0000000..2668191
--- /dev/null
@@ -0,0 +1,323 @@
+    1  12:23:59.828062 IP (tos 0xc0, ttl 255, id 1498, offset 0, flags [none], proto TCP (6), length 72)
+    192.168.0.2.58320 > 192.168.0.1.646: Flags [P.], cksum 0x3986 (correct), seq 96201:96233, ack 83737, win 2990, length 32
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 28
+         Notification Message (0x0001), length: 18, Message ID: 0xfffffff9, Flags: [ignore if unknown]
+           Status TLV (0x0300), length: 10, Flags: [ignore and don't forward if unknown]
+             Status: 0x0a, Flags: [Fatal error and don't forward]
+    2  12:23:59.828114 IP (tos 0xc0, ttl 255, id 1499, offset 0, flags [none], proto TCP (6), length 40)
+    192.168.0.2.58320 > 192.168.0.1.646: Flags [F.], cksum 0x7d76 (correct), seq 32, ack 1, win 2990, length 0
+    3  12:24:00.018513 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.1.3.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 172.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000038, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 172.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+    4  12:24:05.058942 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.1.3.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 172.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000038, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 172.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+    5  12:24:08.049677 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.0.0.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000000, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 192.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+    6  12:24:10.017949 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.1.3.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 172.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000038, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 172.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+    7  12:24:11.046122 IP (tos 0x0, ttl 255, id 1505, offset 0, flags [none], proto TCP (6), length 48)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [S], cksum 0x6df9 (correct), seq 110236, win 65535, options [mss 1420,nop,wscale 5], length 0
+    8  12:24:11.046149 IP (tos 0xc0, ttl 255, id 1506, offset 0, flags [none], proto TCP (6), length 81)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0x68c1 (correct), seq 110237:110278, ack 87765, win 3025, length 41
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 37
+         Initialization Message (0x0200), length: 27, Message ID: 0x00000001, Flags: [ignore if unknown]
+           Common Session Parameters TLV (0x0500), length: 14, Flags: [ignore and don't forward if unknown]
+             Version: 1, Keepalive: 30s, Flags: [Downstream Unsolicited, Loop Detection Enabled]
+             Path Vector Limit 32, Max-PDU length: 0, Receiver Label-Space-ID 192.168.0.1:0
+           Unknown TLV (0x050b), length: 1, Flags: [continue processing and don't forward if unknown]
+             0x0000:  80
+    9  12:24:11.052281 IP (tos 0xc0, ttl 255, id 1507, offset 0, flags [none], proto TCP (6), length 58)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0x73a6 (correct), seq 41:59, ack 60, win 3023, length 18
+   10  12:24:11.103231 IP (tos 0xc0, ttl 255, id 1508, offset 0, flags [none], proto TCP (6), length 387)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0x46c6 (correct), seq 59:406, ack 60, win 3023, length 347
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 56
+         Address Message (0x0300), length: 46, Message ID: 0x00000003, Flags: [ignore if unknown]
+           Address List TLV (0x0101), length: 38, Flags: [ignore and don't forward if unknown]
+             Address Family: IPv4, addresses 26.0.0.2 12.0.0.2 23.0.0.2 192.168.0.2 192.168.1.2 192.168.2.2 192.168.3.2 192.168.4.2 192.168.5.2
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 68
+         Address Message (0x0300), length: 58, Message ID: 0x00000004, Flags: [ignore if unknown]
+           Address List TLV (0x0101), length: 50, Flags: [ignore and don't forward if unknown]
+             Address Family: IPv6, addresses fe80::7850:c6ff:fec0:0 fe80::7850:c6ff:fec0:1 fe80::7850:c6ff:fec0:3
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 211
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000005, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.0.2/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 3
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  01
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000006, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.1.2/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 3
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  01
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000007, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.2.2/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 3
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  01
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000008, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.3.2/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 3
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  01
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000009, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.4.2/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 3
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  01
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+   11  12:24:11.929655 IP (tos 0xc0, ttl 255, id 1509, offset 0, flags [none], proto TCP (6), length 40)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [.], cksum 0x34ab (correct), ack 168, win 3020, length 0
+   12  12:24:11.929679 IP (tos 0xc0, ttl 255, id 1510, offset 0, flags [none], proto TCP (6), length 300)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0xbffe (correct), seq 406:666, ack 813, win 3000, length 260
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 48
+         Label Release Message (0x0403), length: 38, Message ID: 0x0000000a, Flags: [ignore if unknown]
+         0x0000:  0100 0008 0200 0120 c0a8 0002 0200 0004
+         0x0010:  0000 4e62 0300 000a 0000 000b 0000 000f
+         0x0020:  0400
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 48
+         Label Release Message (0x0403), length: 38, Message ID: 0x0000000b, Flags: [ignore if unknown]
+         0x0000:  0100 0008 0200 0120 c0a8 0102 0200 0004
+         0x0010:  0000 4e62 0300 000a 0000 000b 0000 0010
+         0x0020:  0400
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 48
+         Label Release Message (0x0403), length: 38, Message ID: 0x0000000c, Flags: [ignore if unknown]
+         0x0000:  0100 0008 0200 0120 c0a8 0202 0200 0004
+         0x0010:  0000 4e62 0300 000a 0000 000b 0000 0011
+         0x0020:  0400
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 48
+         Label Release Message (0x0403), length: 38, Message ID: 0x0000000d, Flags: [ignore if unknown]
+         0x0000:  0100 0008 0200 0120 c0a8 0302 0200 0004
+         0x0010:  0000 4e62 0300 000a 0000 000b 0000 0012
+         0x0020:  0400
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 48
+         Label Release Message (0x0403), length: 38, Message ID: 0x0000000e, Flags: [ignore if unknown]
+         0x0000:  0100 0008 0200 0120 c0a8 0402 0200 0004
+         0x0010:  0000 4e62 0300 000a 0000 000b 0000 0013
+         0x0020:  0400
+   13  12:24:12.831754 IP (tos 0xc0, ttl 255, id 1520, offset 0, flags [none], proto TCP (6), length 415)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0xef2a (correct), seq 666:1041, ack 813, win 3000, length 375
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 371
+         Label Mapping Message (0x0400), length: 41, Message ID: 0x0000000f, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.0.1/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20065
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  02
+           Path Vector TLV (0x0104), length: 8, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0001 c0a8 0002
+         Label Mapping Message (0x0400), length: 41, Message ID: 0x00000010, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.1.1/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20065
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  02
+           Path Vector TLV (0x0104), length: 8, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0001 c0a8 0002
+         Label Mapping Message (0x0400), length: 41, Message ID: 0x00000011, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.2.1/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20065
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  02
+           Path Vector TLV (0x0104), length: 8, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0001 c0a8 0002
+         Label Mapping Message (0x0400), length: 41, Message ID: 0x00000012, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.3.1/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20065
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  02
+           Path Vector TLV (0x0104), length: 8, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0001 c0a8 0002
+         Label Mapping Message (0x0400), length: 41, Message ID: 0x00000013, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.4.1/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20065
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  02
+           Path Vector TLV (0x0104), length: 8, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0001 c0a8 0002
+         Label Withdraw Message (0x0402), length: 24, Message ID: 0x00000014, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.0.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+         Label Withdraw Message (0x0402), length: 24, Message ID: 0x00000015, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.1.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+         Label Withdraw Message (0x0402), length: 24, Message ID: 0x00000016, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.2.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+         Label Withdraw Message (0x0402), length: 24, Message ID: 0x00000017, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.3.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+         Label Withdraw Message (0x0402), length: 24, Message ID: 0x00000018, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.4.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+   14  12:24:13.028465 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.0.0.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000000, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 192.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+   15  12:24:13.058561 IP (tos 0xc0, ttl 255, id 1524, offset 0, flags [none], proto TCP (6), length 40)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [.], cksum 0x2e0b (correct), ack 1263, win 2986, length 0
+   16  12:24:13.833287 IP (tos 0xc0, ttl 255, id 1530, offset 0, flags [none], proto TCP (6), length 255)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0x7e4f (correct), seq 1041:1256, ack 1263, win 2986, length 215
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 211
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x00000019, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.0.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  00
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x0000001a, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.1.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  00
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x0000001b, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.2.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  00
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x0000001c, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.3.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  00
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+         Label Mapping Message (0x0400), length: 37, Message ID: 0x0000001d, Flags: [ignore if unknown]
+           FEC TLV (0x0100), length: 8, Flags: [ignore and don't forward if unknown]
+             Prefix FEC (0x02): IPv4 prefix 192.168.4.3/32
+           Generic Label TLV (0x0200), length: 4, Flags: [ignore and don't forward if unknown]
+             Label: 20066
+           Hop Count TLV (0x0103), length: 1, Flags: [ignore and don't forward if unknown]
+             0x0000:  00
+           Path Vector TLV (0x0104), length: 4, Flags: [ignore and don't forward if unknown]
+             0x0000:  c0a8 0002
+   17  12:24:15.036359 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.1.3.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 172.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000038, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 172.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+   18  12:24:18.042950 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.0.0.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000000, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 192.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+   19  12:24:20.052540 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.1.3.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 172.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000038, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 172.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
+   20  12:24:21.030795 IP (tos 0xc0, ttl 255, id 1534, offset 0, flags [none], proto TCP (6), length 58)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [P.], cksum 0x6a3d (correct), seq 1256:1274, ack 1263, win 2986, length 18
+   21  12:24:21.087477 IP (tos 0xc0, ttl 255, id 1535, offset 0, flags [none], proto TCP (6), length 40)
+    192.168.0.2.58321 > 192.168.0.1.646: Flags [.], cksum 0x2d11 (correct), ack 1281, win 2985, length 0
+   22  12:24:23.011577 IP (tos 0xc0, ttl 1, id 0, offset 0, flags [none], proto UDP (17), length 70)
+    12.0.0.2.646 > 224.0.0.2.646: 
+       LDP, Label-Space-ID: 192.168.0.2:0, pdu-length: 38
+         Hello Message (0x0100), length: 28, Message ID: 0x00000000, Flags: [ignore if unknown]
+           Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown]
+             Hold Time: 15s, Flags: [Link Hello]
+           IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown]
+             IPv4 Transport Address: 192.168.0.2
+           Unknown TLV (0x0701), length: 4, Flags: [continue processing and don't forward if unknown]
+             0x0000:  4000 0000
diff --git a/tests/ldp-common-session.pcap b/tests/ldp-common-session.pcap
new file mode 100644 (file)
index 0000000..848bd91
Binary files /dev/null and b/tests/ldp-common-session.pcap differ