• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1% Licklider Transmission Protocol tests
2
3############
4############
5+ Licklider Transmission Protocol (LTP) basic tests
6
7~ TODO: no pcap have been found on Internet. Check that scapy correctly decode those too
8
9= Build packets & dissect
10
11load_contrib("ltp")
12pkt = Ether(src="aa:aa:aa:aa:aa:aa", dst="bb:bb:bb:bb:bb:bb")/IP(src="192.168.0.1", dst="192.168.0.2")/UDP()/LTP(flags=8,\
13        SessionOriginator=2,
14        SessionNumber=113,
15        ReportCheckpointSerialNo=12,
16        ReportUpperBound=0,
17        ReportLowerBound=5,
18        ReportReceptionClaims=[
19            LTPReceptionClaim(ReceptionClaimOffset=1, ReceptionClaimLength=4),
20            LTPReceptionClaim(ReceptionClaimOffset=2, ReceptionClaimLength=3),
21        ],
22        HeaderExtensions=[
23            LTPex(ExTag=1, ExData=b"\x00"),
24        ],
25        TrailerExtensions=[
26            LTPex(ExTag=0, ExData=b"\x01"),
27            LTPex(ExTag=1, ExData=b"\x02"),
28        ])
29
30pkt = Ether(raw(pkt))
31assert LTP in pkt
32assert pkt[LTP].ReportLowerBound == 5
33assert pkt[LTP].ReportCheckpointSerialNo == 12
34assert pkt[LTP].ReportReceptionClaims[0].ReceptionClaimLength == 4
35assert pkt[LTP].ReportReceptionClaims[1].ReceptionClaimOffset == 2
36assert pkt[LTP].HeaderExtensions[0].ExTag == 1
37assert pkt[LTP].HeaderExtensions[0].ExData == b"\x00"
38
39s = pkt.summary()
40s
41assert s.replace("ltp_deepspace", "1113") == 'Ether / IP / UDP 192.168.0.1:1113 > 192.168.0.2:1113 / LTP 113'