• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1% Bundle Protocol tests
2
3############
4############
5+ Bundle Protocol (BP) 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
11from scapy.contrib.ltp import LTPex
12
13pkt = 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=7,\
14        SessionOriginator=2,
15        SessionNumber=113,
16        HeaderExtensions=[
17            LTPex(ExTag=1, ExData=b"\x00"),
18        ],
19        DATA_ClientServiceID=1,
20        DATA_PayloadOffset=0,
21        LTP_Payload=[
22            BP(ProcFlags=415)/\
23            BPBLOCK(ProcFlags=10, load="data")
24        ])
25
26pkt = Ether(raw(pkt))
27assert LTP in pkt
28bp = pkt[LTP].LTP_Payload[0]
29assert BP in bp
30assert BPBLOCK in bp
31assert bp.load == b"data"
32
33bp.mysummary()
34