Comments (14)
what version of libpcap do you have installed? it looks like a missing
pcap-int.h
header file.
can you show me the output for these commands?
cat config.h
and in python:
>>> import cPickle
>>> cPickle.loads(open('config.pkl').read())
Original comment by dugsong
on 11 Mar 2007 at 4:23
from pypcap.
thank you for your kind and quick comment, dugsong :0
i `v installed libpcap version 0.9.5.
there is no pcap-int.h in this version.
config.pkl
there `s no config.h or config.pkl too.
i have to go back libpcap version with pcap-int.h?
for example libpcap version 0.7.1.
Original comment by [email protected]
on 11 Mar 2007 at 6:54
from pypcap.
sorry dugsong,
i brought compiled binary version libpcap from sunfreeware.
but there "IS" definetely pcap-int.h in libpcap 0.9.5 source from tcpdump.org.
i`m lazy.very soory for that.
Original comment by [email protected]
on 11 Mar 2007 at 7:04
from pypcap.
only after in the source directory do "gmake" ,cconfig.h or config.pkl came
into view.
[07:16:04 sandy@gagemel pypcap-1.1]$ more config.h
#define HAVE_PCAP_SETNONBLOCK 1
#define HAVE_PCAP_FILE 1
#define HAVE_PCAP_INT_H 1
#define HAVE_PCAP_COMPILE_NOPCAP 1
[07:16:20 sandy@gagemel pypcap-1.1]$ python
Python 2.5 (r25:51908, Sep 20 2006, 03:11:51)
[GCC 3.4.6] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
>>> cPickle.loads(open('config.pkl').read())
{'libraries': ['pcap'], 'library_dirs': ['/usr/local/lib'], 'include_dirs':
['/usr/local/include']}
>>>
Original comment by [email protected]
on 11 Mar 2007 at 7:20
from pypcap.
and finally got pcap.so.only after " do gmake",everything goes
well.interesting.:)
[07:36:46 sandy@gagemel pypcap-1.1]$ sudo python setup.py install
Password:
running install
running build
running build_ext
building 'pcap' extension
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-I/usr/local/include/python2.5 -c pcap_ex.c -o
build/temp.solaris-2.10-i86pc-2.5/pcap_ex.o
creating build/lib.solaris-2.10-i86pc-2.5
gcc -shared build/temp.solaris-2.10-i86pc-2.5/pcap.o
build/temp.solaris-2.10-i86pc-2.5/pcap_ex.o -o
build/lib.solaris-2.10-i86pc-2.5/pcap.so
running install_lib
copying build/lib.solaris-2.10-i86pc-2.5/pcap.so ->
/usr/local/lib/python2.5/site-packages
running install_egg_info
Writing /usr/local/lib/python2.5/site-packages/pcap-1.1-py2.5.egg-info
[07:36:51 sandy@gagemel pypcap-1.1]$
Original comment by [email protected]
on 11 Mar 2007 at 7:39
from pypcap.
** final comment.
i`v copied pcap-int.h file from libpcap 0.9.5 source to /usr/local/include .
because gmake install only copied pcap.h,pcap-bpf.h,pcap-namedb.h.
[07:03:09 sandy@gagemel libpcap-0.9.5]$ sudo gmake install
Password:
[ -d /usr/local/lib ] || \
(mkdir -p /usr/local/lib; chmod 755 /usr/local/lib)
/opt/csw/bin/ginstall -c -m 644 libpcap.a /usr/local/lib/libpcap.a
ranlib /usr/local/lib/libpcap.a
[ -d /usr/local/include ] || \
(mkdir -p /usr/local/include; chmod 755 /usr/local/include)
/opt/csw/bin/ginstall -c -m 644 ./pcap.h /usr/local/include/pcap.h
/opt/csw/bin/ginstall -c -m 644 ./pcap-bpf.h \
/usr/local/include/pcap-bpf.h
/opt/csw/bin/ginstall -c -m 644 ./pcap-namedb.h \
/usr/local/include/pcap-namedb.h
[ -d /usr/local/man/man3 ] || \
(mkdir -p /usr/local/man/man3; chmod 755 /usr/local/man/man3)
/opt/csw/bin/ginstall -c -m 644 ./pcap.3 \
/usr/local/man/man3/pcap.3
Original comment by [email protected]
on 11 Mar 2007 at 7:55
from pypcap.
ㅠㅠ . maybe there are some problems in compiled pcap.so.
[09:43:31 sandy@gagemel ~]$ python scapy.py
scapy.py:3689: Warning: 'with' will become a reserved keyword in Python 2.6
scapy.py:3691: Warning: 'with' will become a reserved keyword in Python 2.6
ERROR: did not find pcap module
[09:43:40 sandy@gagemel ~]$ python
Python 2.5 (r25:51908, Sep 20 2006, 03:11:51)
[GCC 3.4.6] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> help()
Welcome to Python 2.5! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
help> modules pcap
Here is a list of matching modules. Enter any module name to get more help.
pcap
help> pcap
problem in pcap - <type 'exceptions.ImportError'>: ld.so.1: python: 치명적:
재할당 오
류: 파일 /usr/local/lib/python2.5/site-packages/pcap.so: 기호 bpf_filter:
참조 기호가
없습니다.
Original comment by [email protected]
on 11 Mar 2007 at 9:54
from pypcap.
[09:34:43 sandy@gagemel Numeric-24.2]$ python
Python 2.5 (r25:51908, Sep 20 2006, 03:11:51)
[GCC 3.4.6] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import pcap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: ld.so.1: python: 치명적: 재할당 오류: 파일
/usr/local/lib/python2.5/site-packages/pcap.so: 기호 bpf_filter: 참조
기호가 없습니다.
>>>
Original comment by [email protected]
on 11 Mar 2007 at 9:57
from pypcap.
dugsong!!
in my ubuntu box, there is same error.
so using Pyrex, fixed pcap.pyx.
pyrexc pcap.pyx
python setup.py build.
after that, nothing wrong happen.everything goes well.
but back to solaris box, that fix doesn`t work.
Original comment by [email protected]
on 11 Mar 2007 at 1:52
from pypcap.
using Pyrex, fix pcap.pyx.
this is last solution.maybe.
on my solaris box , this fix worked.
thanks, dugsong.
Original comment by [email protected]
on 11 Mar 2007 at 2:06
from pypcap.
yes, you have to 'make' or 'gmake' in order for 'python setup.py config' to be
executed. i should probably change this. :-(
the missing pcap-int.h in comment #6 can be worked around by modifying
CONFIG_ARGS in
the Makefile to point to your libpcap build directory, instead of using an
installed
version.
the missing bpf_filter symbol in comment #7 and #8 i don't understand - and i
don't
understand how regenerating the pcap.c source using pyrex in comment #9 and #10
would
have fixed it. but if it works, that's great! :-)
can you mail me your regenerated pcap.c file so i can compare? also, what
version of
Pyrex are you using? i don't have access to a Solaris 10 x86 box right now, so i
cannot reproduce this easily.
thank you!
Original comment by dugsong
on 11 Mar 2007 at 8:59
from pypcap.
i`m very sorry about symbol error in comment #7 and #8.
that was my ld setting error.i used /usr/ccs/bin/ld in error situation.
whem i use gnu ld , erorr message has gone. :)
Original comment by [email protected]
on 11 Mar 2007 at 10:27
from pypcap.
well working pcap module.
[22:28:40 sandy@gagemel xchat-2.8.0]$ python
Python 2.5 (r25:51908, Sep 20 2006, 03:11:51)
[GCC 3.4.6] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> help()
Welcome to Python 2.5! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
help> modules pcap
Here is a list of matching modules. Enter any module name to get more help.
pcap
help> pcap
Help on module pcap:
NAME
pcap - packet capture library
FILE
/usr/local/lib/python2.5/site-packages/pcap.so
DESCRIPTION
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.
CLASSES
__builtin__.object
bpf
pcap
class bpf(__builtin__.object)
| bpf(filter, dlt=DLT_RAW) -> BPF filter object
|
| Methods defined here:
|
| __init__(...)
| x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
| filter(...)
| Return boolean match for buf against our filter.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object at 0xcf4a3700>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
class pcap(__builtin__.object)
| pcap(name=None, snaplen=65535, promisc=True, immediate=False) -> packet
capture object
|
help>
Original comment by [email protected]
on 11 Mar 2007 at 10:32
from pypcap.
great!
i upgraded to Pyrex-0.9.5.1a and regenerated pcap.c for the package, and added
a note
to the README about the build. sorry for any confusion.
the fix is in svn, and i'll cut a new version later, after some additional
changes go
in...
Original comment by dugsong
on 12 Mar 2007 at 2:37
- Changed state: Fixed
from pypcap.
Related Issues (20)
- Pypcap on Mac OS X and Python 2.7 HOT 1
- "couldn't find pcap build or installation directory" HOT 5
- Move pypcap to github HOT 1
- [deleted issue]
- AttributeError: 'pcap.pcap' object has no attribute 'inject' HOT 3
- comilation commands
- immediate = True is ignored
- pypcap depends from pcap-int.h which is internal pcap stuff and shouldn't be included (breaking build on some systems)
- error: no suitable device found HOT 1
- 在64位的Win7上用不了,你有这个二进制安装文件吗?
- error mingw-32 make on windows
- Can't install: AttributeError: 'NoneType' object has no attribute 'rfind' HOT 6
- Stop pypcap from capturing and writing network traffic to a file HOT 1
- loop() will exist and lost packet, even if cnt=0
- command 'arm-linux-gnueabihf-gcc' failed with exit status 4
- 'NoneType' object has no attribute 'rfind' HOT 2
- undefinded refrences. for python.h function
- Consolidate pypcap forks HOT 2
- about docs
- How to set buffer size in pypcap
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypcap.