Discussion:
pypcap-1.1 compilation problems
(too old to reply)
Fredrik Pettai
2010-02-14 11:32:16 UTC
Permalink
Hi,

Does anybody with knowledge of libpcap in NetBSD know how to solve the
compilation errors with wip/pypcap ?
At first, I thought it was a problem with the NetBSD included pcap
headers/library, but then I run it with pkgsrc bundled libpcap version
I still get the same errors (and 3 out of 5 tests fail).

-bash-4.1$ cc -pthread -fno-strict-aliasing -DNDEBUG -O2 -
DHAVE_DB_185_H -fPIC -I/usr/pkg/include/pcap -I/usr/pkg/include -I/usr/
include -I/usr/pkg/include/python2.6 -c pcap.c -o build/
temp.netbsd-5.0_STABLE-i386-2.6/pcap.o
pcap.c: In function '__pyx_f_4pcap_4pcap_dispatch':
pcap.c:1039: warning: passing argument 3 of 'pcap_dispatch' from
incompatible pointer type
pcap.c: In function '__pyx_f_4pcap_4pcap_loop':
pcap.c:1142: warning: passing argument 3 of 'pcap_ex_next' from
incompatible pointer type
pcap.c: In function '__pyx_f_4pcap_4pcap___next__':
pcap.c:1338: warning: passing argument 3 of 'pcap_ex_next' from
incompatible pointer type

Thanks,
/P

(please don't forget to CC me then replying, since I'm not subscribed
to tech-net)


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Fredrik Pettai
2010-02-17 13:07:14 UTC
Permalink
Post by Fredrik Pettai
Hi,
Does anybody with knowledge of libpcap in NetBSD know how to solve the
compilation errors with wip/pypcap ?
At first, I thought it was a problem with the NetBSD included pcap
headers/library, but then I run it with pkgsrc bundled libpcap version
I still get the same errors (and 3 out of 5 tests fail).
Hi again,

Some more info regarding this. This was with python26 on NetBSD
5.0_STABLE. Later I also tried python25 on NetBSD 4.0.1_PATCH which
gave me the same results as below the "/////...".
Strangly, with python24 on NetBSD 4.0.1_PATCH, all tests work fine.
(So this might be a python related problem and maybe not libpcap, as I
suspected from the beginning.)

-bash-3.2$ make test
/usr/pkg/bin/python2.4 test.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK

//////////////////////////////////////////////////////////////////////////////

-bash-4.0$ make test
/usr/pkg/bin/python2.6 test.py
EEE..
======================================================================
ERROR: test_pcap_dispatch (__main__.PcapTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test.py", line 37, in test_pcap_dispatch
p.dispatch(-1, __bad_handler)
File "pcap.pyx", line 288, in pcap.pcap.dispatch
callback -- function with (timestamp, pkt, *args) prototype
TypeError: exceptions must be strings, classes, or instances, not type

======================================================================
ERROR: test_pcap_errors (__main__.PcapTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test.py", line 19, in test_pcap_errors
print p.stats()
File "pcap.pyx", line 325, in pcap.pcap.stats
raise KeyboardInterrupt
TypeError: exceptions must be strings, classes, or instances, not type

======================================================================
ERROR: test_pcap_iter (__main__.PcapTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test.py", line 9, in test_pcap_iter
l = [ (x[0], len(x[1])) for x in pcap.pcap('test.pcap') ]
File "pcap.pyx", line 346, in pcap.pcap.__next__
cdef pcap_pkthdr *hdr
TypeError: exceptions must be strings, classes, or instances, not type

----------------------------------------------------------------------
Ran 5 tests in 0.002s

FAILED (errors=3)
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/wip/pypcap/work/pypcap-1.1


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...