Skip to content

Instantly share code, notes, and snippets.

@jhaubrich
Created October 18, 2012 14:40
Show Gist options
  • Save jhaubrich/3912295 to your computer and use it in GitHub Desktop.
Save jhaubrich/3912295 to your computer and use it in GitHub Desktop.
./read_feed.py --enable-agclog -i test/example_seqn_bad.pcap
INFO: Tool started at 2012-10-18 14:35:49.714750U.
Please do not close this window
Process frame_retriever:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/Users/jhau/Dropbox/src/pcaptools/pcap_parser/frameRetriever.py", line 121, in GFIN_getFrames
fd.loop(GFIN_queueWaasFrames, frame_info_q)
File "pcap.pyx", line 323, in pcap.pcap.loop
AttributeError: queue instance has no __call__ method
Traceback (most recent call last):
File "./read_feed.py", line 183, in <module>
main()
File "./read_feed.py", line 102, in main
while (frame_retriever.is_alive() or frame_info_q.qsize() > 0):
File "/Users/jhau/Dropbox/src/pcaptools/pcap_parser/queue.py", line 42, in qsize
return self.q.qsize()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/queues.py", line 143, in qsize
return self._maxsize - self._sem._semlock._get_value()
NotImplementedError
^C
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
Process run:
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
func(*targs, **kargs)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 295, in _exit_function
self.run()
p.join()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 145, in join
self._target(*self._args, **self._kwargs)
File "/Users/jhau/Dropbox/src/pcaptools/pcap_parser/workers/workerObj.py", line 70, in worker_run
sleep(1)
res = self._popen.wait(timeout)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 148, in wait
KeyboardInterrupt
return self.poll(0)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 133, in poll
pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 295, in _exit_function
p.join()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 145, in join
res = self._popen.wait(timeout)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 148, in wait
return self.poll(0)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/forking.py", line 133, in poll
pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
@amattheisen
Copy link

Jesse, use ipython to inspect your pcap module. Does yours look like this:

In [1]: import pcap

In [2]: pcap??
Type: module
Base Class: <type 'module'>
String Form:<module 'pcap' from '/usr/lib/python2.7/dist-packages/pcap.so'>
Namespace: Interactive
File: /usr/lib/python2.7/dist-packages/pcap.so
Docstring:
packet capture library

This module provides a high level interface to packet capture systems.
All packets on the network, even those destined for other hosts, are
accessible through this mechanism.

In [3]: pcap.pcap??
Type: type
Base Class: <type 'type'>
String Form:<type 'pcap.pcap'>
Namespace: Interactive
File: /usr/lib/python2.7/dist-packages/pcap.so
Docstring:
pcap(name=None, snaplen=65535, promisc=True, immediate=False) -> packet capture object

Open a handle to a packet capture descriptor.

Keyword arguments:
name -- name of a network interface or dumpfile to open,
or None to open the first available up interface
snaplen -- maximum number of bytes to capture for each packet
promisc -- boolean to specify promiscuous mode sniffing
immediate -- disable buffering, if possible
dumpfile -- name of a dumpfile to open, if necessary
dumptype -- only open a dumpfile and specify its type

In [4]: pcap.pcap.loop??
Type: method_descriptor
Base Class: <type 'method_descriptor'>
String Form:<method 'loop' of 'pcap.pcap' objects>
Namespace: Interactive
Docstring:
Loop forever, processing packets with a user callback.
The loop can be exited with an exception, including KeyboardInterrupt.

Arguments:

callback -- function with (timestamp, pkt, *args) prototype
*args -- optional arguments passed to callback on execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment