<div dir="ltr">It looks like there was some very recent reorganization of the scapy packaging on macports, see <a href="http://lists.macosforge.org/pipermail/macports-dev/2013-January/021620.html">http://lists.macosforge.org/pipermail/macports-dev/2013-January/021620.html</a><div>
<br></div><div>Did you have an updated port tree when you installed?  If not, I'd suggest uninstalling whatever port you installed, resync with "port selfupdate", then install the scapy port again.  You should see not only the libdnet port installed, but also py27-libdnet, which is the missing glue you need for interfacing with libdnet.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 9:01 AM, Kevin Holleran <span dir="ltr"><<a href="mailto:kdawg44@gmail.com" target="_blank">kdawg44@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 23, 2013 at 7:25 AM, John Evans <span dir="ltr"><<a href="mailto:john.g.evans.ne@gmail.com" target="_blank">john.g.evans.ne@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>The import "from scapy.all import *" does work for me with macports and 10.6.8  When I installed the scapy port, I did see that macports installed the py27-libdnet package as well.  </div>


<div><br></div><div><br></div><div></div></div><div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Wed, Jan 23, 2013 at 1:24 AM, Dennis Lee Bieber <span dir="ltr"><<a href="mailto:wlfraed@ix.netcom.com" target="_blank">wlfraed@ix.netcom.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Tue, 22 Jan 2013 22:43:24 -0500, Kevin Holleran <<a href="mailto:kdawg44@gmail.com" target="_blank">kdawg44@gmail.com</a>><br>



<div>declaimed the following in gmane.comp.python.general:<br>
<br>
><br>
</div><div><div>> Mac OS 10.8.2<br>
> Python v.2.7<br>
> I downloaded from the sourceforge site, then tried to install with MacPorts<br>
> when some dependencies were failing.  I then downloaded & installed<br>
> pcapy-0.10.6 when that dependency still failed.  That solved that but I<br>
> received the dnet error:<br>
><br>
>     from scapy.all import conf<br>
>   File "/Library/Python/2.7/site-packages/scapy/all.py", line 16, in<br>
> <module><br>
>     from arch import *<br>
>   File "/Library/Python/2.7/site-packages/scapy/arch/__init__.py", line 75,<br>
> in <module><br>
>     from bsd import *<br>
>   File "/Library/Python/2.7/site-packages/scapy/arch/bsd.py", line 12, in<br>
> <module><br>
>     from unix import *<br>
>   File "/Library/Python/2.7/site-packages/scapy/arch/unix.py", line 20, in<br>
> <module><br>
>     from pcapdnet import *<br>
>   File "/Library/Python/2.7/site-packages/scapy/arch/pcapdnet.py", line<br>
> 160, in <module><br>
>     import dnet<br>
> ImportError: No module named dnet<br>
><br>
> So I downloaded and compiled libdnet-1.11 with a:<br>
>  $ sudo ./configure && make<br>
><br>
> I see it compile fine & the libraries have been installed to:<br>
> /usr/local/sbin/dnet<br>
><br>
> However, python can't find it... I am not clear on how to point Python<br>
> there...<br>
><br>
</div></div>        "libdnet" is likely a shared object binary... What I /think/ you are<br>
missing is the Python library that interfaces with that binary...<br>
<br>
        Could <a href="http://pypi.python.org/pypi/dnet" target="_blank">http://pypi.python.org/pypi/dnet</a> answer the question?<br>
<div><div>--<br>
        Wulfraed                 Dennis Lee Bieber         AF6VN<br>
        <a href="mailto:wlfraed@ix.netcom.com" target="_blank">wlfraed@ix.netcom.com</a>    <a href="HTTP://wlfraed.home.netcom.com/" target="_blank">HTTP://wlfraed.home.netcom.com/</a><br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br>John Evans
</font></span></div>
<br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote><div><br></div><div><br></div><div>I downloaded scapy manually since for some reason, after using macports, it wouldn't find the package at all. </div><div><br></div><div>I am also trying to install libdnet manually as mentioned above, so after ./configure && make I go into the python directory & do a  python setup.py install, which generates a bunch of warnings & the following two errors:</div>

<div><br></div><div><div>/dnet.c:2729:4: error: assignment to cast is illegal, lvalue casts are not supported</div><div>  ((PyObject*)__pyx_v_next) = Py_None; Py_INCREF(((PyObject*)__pyx_v_next));</div><div>  ~^~~~~~~~~~~~~~~~~~~~~~~~ ~</div>

<div>./dnet.c:2741:6: error: assignment to cast is illegal, lvalue casts are not supported</div><div>    ((PyObject *)__pyx_v_next) = __pyx_3;</div><div>    ~^~~~~~~~~~~~~~~~~~~~~~~~~ ~</div><div><br></div><div><br></div>

<div>Thanks again for any help.  Need to get all this working for this mini-project and also because I am starting a SANS class that leverages scapy quite a bit...</div><span class="HOEnZb"><font color="#888888"><div><br>
</div><div>Kevin</div></font></span></div>
</div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>John Evans
</div>