exported / pypcap

Automatically exported from code.google.com/p/pypcap
Other
0 stars 0 forks source link

how to use pcap module #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i use pcap and dpkt module to capture http packets and analysis it,but i don't 
known how to use the pcap module.
1. what is setfilter()  return 
2. how to set a BPF argument
3. what is pcap.pcap() return,is it iterateble
4.is there document about how to use pypcap module

code:
>>> import dpkt, pcap
>>> pc = pcap.pcap()
>>> pc.setfilter(‘icmp’)
>>> for ts, pkt in pc:
…     print `dpkt.ethernet.Ethernet(pkt)`
…

Original issue reported on code.google.com by hmyb...@gmail.com on 18 Mar 2011 at 12:58