生成pcap文件结合packeth发送报文,生成Pcap的代码如下。
<pre> port = 9600 #Custom Foo Protocol Packet message = ('01 01 00 08' #Foo Base Header '01 02 00 00' #Foo Message (31 Bytes) '00 00 12 30' '00 00 12 31' '00 00 12 32' '00 00 12 33' '00 00 12 34' 'D7 CD EF' #Foo flags '00 00 12 35') """----------------------------------------------------------------""" """ Do not edit below this line unless you know what you are doing """ """----------------------------------------------------------------"""