voidread_from_pcapfile(char*filename){structpcap_pkthdrheader;// The header that pcap gives usu_char *packet;// The actual packet//open the pcap filepcap_t*handle;charerrbuf[PCAP_ERRBUF_SIZE];//not sure what to do with this, oh wellhandle =pcap_open_offline(filename, errbuf);//call ...
pcap.pcap = C.pcap_open_offline(C.CString(filename), errbuf)ifpcap.pcap ==nil{returnnil, errors.New(C.GoString(errbuf)) }return&pcap,nil} 开发者ID:jasonish,项目名称:dumpy,代码行数:9,代码来源:pcap.go 示例2: OpenOffline // OpenOffline opens a file and returns its contents as a *Ha...
i +=1hdr, body = r.next()# make sure file closesdeldumper# check that the dumper wrote a legal pcap# file with same packer datar = pcapy.open_offline(TestPcapy._96PINGS) r2 = pcapy.open_offline('tmp.pcap') h1, b1 = r.next() h2, b2 = r2.next()whileh1isnotNoneandh2isnot...