1 % ProfinetIO layer test campaign 2 3 + Syntax check 4 = Import the ProfinetIO layer 5 from scapy.contrib.pnio import * 6 7 8 + Check DCE/RPC layer 9 10 = ProfinetIO default values 11 raw(ProfinetIO()) == b'\x00\x00' 12 13 = ProfinetIO overloads Ethertype 14 p = Ether() / ProfinetIO() 15 p.type == 0x8892 16 17 = ProfinetIO overloads UDP dport 18 p = UDP() / ProfinetIO() 19 p.dport == 0x8892 20 21 = Ether guesses ProfinetIO as payload class 22 p = Ether(hex_bytes('ffffffffffff00000000000088920102')) 23 p.payload.__class__ == ProfinetIO and p.frameID == 0x0102 24 25 = UDP guesses ProfinetIO as payload class 26 p = UDP(hex_bytes('12348892000a00000102')) 27 p.payload.__class__ == ProfinetIO and p.frameID == 0x0102 28 29 = ProfinetIO guess payload to PNIORealTime 30 p = UDP(hex_bytes('12348892000c000080020102')) 31 p.payload.payload.__class__.__name__ == 'PNIORealTime' and p.frameID == 0x8002 32 33