karpierz / libpcap

Python binding for the libpcap C library.
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

Support for Mac OSX x64 #11

Closed emrainey closed 2 years ago

emrainey commented 2 years ago

Added some logic to load libpcap on Mac. I only have a x64 system so I left the exception for 32bit versions. I installed libpcap through homebrew. After the fixes I was able to:

$ python3
Python 3.9.9 (main, Dec  8 2021, 04:23:48)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import libpcap
>>> errbuf = bytes(libpcap.PCAP_BUF_SIZE)
>>> libpcap.config(LIBPCAP='/usr/local/opt/libpcap/lib/libpcap.dylib')
>>> libpcap.init(libpcap.PCAP_CHAR_ENC_UTF_8, errbuf)
0
>>>
emrainey commented 2 years ago

Any chance this could get merged @karpierz ?

karpierz commented 2 years ago

@emrainey Sorry for delay and many thanks for your patch :). I am still on vacation, but after return I will finish another related patches/suggestions.