Update scapy to 2.0.1 from new maintainer Jonathan Armani with a little

help from me. The IPv6 features provided by scapy6 are integrated (still
some problems with them, but working well enough) so pkgpath/conflict
markers are set to replace an existing scapy6 installation.

ok wcmaier@ "if it works go for it" claudio@
This commit is contained in:
sthen 2009-10-01 16:28:49 +00:00
parent 038308739a
commit f1f2f30877
7 changed files with 215 additions and 86 deletions

View File

@ -1,13 +1,15 @@
# $OpenBSD: Makefile,v 1.9 2009/03/28 16:23:54 naddy Exp $
# $OpenBSD: Makefile,v 1.10 2009/10/01 16:28:49 sthen Exp $
COMMENT= powerful interactive packet manipulation in python
DISTNAME= scapy-1.1.1
PKGNAME= ${DISTNAME}p3
CATEGORIES= net
MODPY_EGG_VERSION= 2.0.1
DISTNAME= scapy-${MODPY_EGG_VERSION}
CATEGORIES= net
HOMEPAGE= http://secdev.org/projects/scapy/
MAINTAINER= Jonathan Armani <dbd@asystant.net>
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
@ -19,27 +21,27 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ethertypes
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MODULES= lang/python
RUN_DEPENDS= :py-libdnet-*:net/libdnet,-python \
:py-libpcap-*:net/py-libpcap \
:py-crypto-*:security/py-crypto \
:py-gnuplot-*:math/py-gnuplot
REGRESS_DEPENDS=${RUN_DEPENDS}
PKG_ARCH= *
NO_REGRESS= Yes
do-build:
perl -p -i -e "s,^(\#\S+ \S+ )python\$$,#!${MODPY_BIN}," \
${WRKSRC}/*.py
post-extract:
gunzip ${WRKSRC}/doc/scapy.1.gz
pre-configure:
perl -p -i -e "s,/etc/ethertypes,${SYSCONFDIR}/ethertypes,g" \
${WRKSRC}/*.py
${WRKSRC}/scapy/data.py
do-install:
${INSTALL_DATA_DIR} ${WRKINST}${MODPY_SITEPKG}
${INSTALL_SCRIPT} ${WRKSRC}/scapy.py ${WRKINST}${MODPY_SITEPKG}
ln -s ${MODPY_SITEPKG}/scapy.py ${PREFIX}/bin/scapy
${INSTALL_MAN} ${WRKBUILD}/scapy.1 ${PREFIX}/man/man1
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/scapy
${INSTALL_DATA} ${DISTDIR}/ethertypes ${PREFIX}/share/examples/scapy
do-regress:
ln -fs ${MODPY_BIN} ${WRKDIR}/bin/python
cd ${WRKSRC}/test; PATH=${WRKDIR}/bin:${PATH} ${WRKSRC}/test/run_tests
.include <bsd.port.mk>

View File

@ -1,10 +1,10 @@
MD5 (ethertypes) = lL/96PdaG4+JH7eAv+Fcog==
MD5 (scapy-1.1.1.tar.gz) = iscgob6kMEeXxxPvHtBj8Q==
MD5 (scapy-2.0.1.tar.gz) = 6vCbzocsg1E1qMZjJ/kgyw==
RMD160 (ethertypes) = KWuI/tkRslOYtfZXzWu1yR5y4og=
RMD160 (scapy-1.1.1.tar.gz) = IL2x6lmgX0UqUV5DjiMOHYW4EBY=
RMD160 (scapy-2.0.1.tar.gz) = pK8hN0WK1P+lc+2BMDUG/c7vvJU=
SHA1 (ethertypes) = btD+JEZmaHbXe4lx/Y7fSVqcC+M=
SHA1 (scapy-1.1.1.tar.gz) = hw2o5uKoeGsDoAVfwswdExfzCOQ=
SHA1 (scapy-2.0.1.tar.gz) = /OtOYPvqDyzo7SWJV6XsobqgWsU=
SHA256 (ethertypes) = 4UAHHkYt+Kq597Y6OWW/IGeX7Lz/M0o+xJQlbe/jXcs=
SHA256 (scapy-1.1.1.tar.gz) = KhG6BfNLKXivOt1iOmQeA0DTkyK0yivSa6rnQ8eN6VY=
SHA256 (scapy-2.0.1.tar.gz) = RXVYi8VXM76nsslL9s8b0M+mbBaeLC0C9bBaitfqq8E=
SIZE (ethertypes) = 1317
SIZE (scapy-1.1.1.tar.gz) = 147401
SIZE (scapy-2.0.1.tar.gz) = 864953

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-scapy_1,v 1.1 2007/05/08 12:47:06 aanriot Exp $
--- scapy.1.orig Tue May 8 10:55:07 2007
+++ scapy.1 Tue May 8 10:58:07 2007
$OpenBSD: patch-doc_scapy_1,v 1.1 2009/10/01 16:28:49 sthen Exp $
--- doc/scapy.1.orig Tue May 8 10:55:07 2007
+++ doc/scapy.1 Tue May 8 10:58:07 2007
@@ -66,7 +66,7 @@ Just run \fBscapy\fP and try the following commands in
.LP
Test the robustness of a network stack with invalid packets:

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-scapy_arch_unix_py,v 1.1 2009/10/01 16:28:49 sthen Exp $
--- scapy/arch/unix.py.orig Tue Sep 29 20:25:02 2009
+++ scapy/arch/unix.py Tue Sep 29 20:26:50 2009
@@ -61,7 +61,10 @@ def read_routes():
else:
rt = l.split()
dest,gw,flg = rt[:3]
- netif = rt[5+mtu_present+prio_present]
+ if 'L' in rt[4+mtu_present+prio_present]:
+ netif = rt[6+mtu_present+prio_present]
+ else:
+ netif = rt[5+mtu_present+prio_present]
if flg.find("Lc") >= 0:
continue
if dest == "default":

View File

@ -1,61 +0,0 @@
$OpenBSD: patch-scapy_py,v 1.2 2008/06/12 12:46:05 wcmaier Exp $
--- scapy.py.orig Mon Apr 9 08:17:35 2007
+++ scapy.py Wed Jun 11 08:02:10 2008
@@ -1131,6 +1131,7 @@ if not LINUX:
else:
f=os.popen("netstat -rn") # -f inet
ok = 0
+ prio_present = False
mtu_present = False
routes = []
for l in f.readlines():
@@ -1141,7 +1142,9 @@ if not LINUX:
continue
if l.find("Destination") >= 0:
ok = 1
- if l.find("Mtu") >= 0:
+ if l.find("Prio") >= 0:
+ prio_present = True
+ elif l.find("Mtu") >= 0:
mtu_present = True
continue
if ok == 0:
@@ -1151,8 +1154,10 @@ if not LINUX:
if SOLARIS:
dest,mask,gw,netif,mxfrg,rtt,ref,flg = l.split()[:8]
else:
- if mtu_present:
- dest,gw,flg,ref,use,mtu,netif = l.split()[:7]
+ if prio_present:
+ dest,gw,flg,ref,use,mtu,prio,netif = l.split()[:8]
+ elif mtu_present:
+ dest,gw,flg,ref,use,mtu,netif = l.split(None, 6)[:7]
else:
dest,gw,flg,ref,use,netif = l.split()[:6]
if flg.find("Lc") >= 0:
@@ -1172,6 +1177,8 @@ if not LINUX:
dest, = struct.unpack("I",inet_aton(dest))
if not "G" in flg:
gw = '0.0.0.0'
+ if 'L' in netif:
+ _,netif = netif.split()
ifaddr = get_if_addr(netif)
routes.append((dest,netmask,gw,netif,ifaddr))
f.close()
@@ -9847,7 +9854,8 @@ class PcapWriter:
"""
if self.header_done == 0:
- if self.linktype == None:
+ linktype = self.linktype
+ if linktype == None:
if isinstance(pkt,Packet):
linktype = LLNumTypes.get(pkt.__class__,1)
else:
@@ -12190,4 +12198,5 @@ def read_config_file(configfile):
if __name__ == "__main__":
interact()
else:
- read_config_file(DEFAULT_CONFIG_FILE)
+ if DEFAULT_CONFIG_FILE:
+ read_config_file(DEFAULT_CONFIG_FILE)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-setup_py,v 1.1 2009/10/01 16:28:49 sthen Exp $
--- setup.py.orig Sun Sep 27 21:47:56 2009
+++ setup.py Sun Sep 27 21:52:29 2009
@@ -40,7 +40,7 @@ setup(
version = '2.0.1',
packages=['scapy','scapy/arch', 'scapy/layers','scapy/asn1','scapy/tools','scapy/modules'],
scripts = ['bin/scapy','bin/UTscapy'],
- data_files = [('share/man/man1', ["doc/scapy.1.gz"])],
+ data_files = [('man/man1', ["doc/scapy.1"])],
# Metadata
author = 'Philippe BIONDI',

View File

@ -1,6 +1,167 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2006/04/19 17:36:58 alek Exp $
@comment $OpenBSD: PLIST,v 1.2 2009/10/01 16:28:49 sthen Exp $
@conflict scapy6-*
@pkgpath net/scapy6
bin/UTscapy
bin/scapy
lib/python${MODPY_VERSION}/site-packages/scapy.py
lib/python${MODPY_VERSION}/site-packages/scapy/
lib/python${MODPY_VERSION}/site-packages/scapy-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
lib/python${MODPY_VERSION}/site-packages/scapy/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/all.py
lib/python${MODPY_VERSION}/site-packages/scapy/all.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/ansmachine.py
lib/python${MODPY_VERSION}/site-packages/scapy/ansmachine.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/
lib/python${MODPY_VERSION}/site-packages/scapy/arch/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/bsd.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/bsd.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/linux.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/linux.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/pcapdnet.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/pcapdnet.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/solaris.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/solaris.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/arch/unix.py
lib/python${MODPY_VERSION}/site-packages/scapy/arch/unix.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/as_resolvers.py
lib/python${MODPY_VERSION}/site-packages/scapy/as_resolvers.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/asn1.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/asn1.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/ber.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/ber.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/mib.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1/mib.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1fields.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1fields.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/asn1packet.py
lib/python${MODPY_VERSION}/site-packages/scapy/asn1packet.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/automaton.py
lib/python${MODPY_VERSION}/site-packages/scapy/automaton.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/autorun.py
lib/python${MODPY_VERSION}/site-packages/scapy/autorun.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/base_classes.py
lib/python${MODPY_VERSION}/site-packages/scapy/base_classes.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/config.py
lib/python${MODPY_VERSION}/site-packages/scapy/config.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/dadict.py
lib/python${MODPY_VERSION}/site-packages/scapy/dadict.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/data.py
lib/python${MODPY_VERSION}/site-packages/scapy/data.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/error.py
lib/python${MODPY_VERSION}/site-packages/scapy/error.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/fields.py
lib/python${MODPY_VERSION}/site-packages/scapy/fields.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/
lib/python${MODPY_VERSION}/site-packages/scapy/layers/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/all.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/all.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/bluetooth.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/bluetooth.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dhcp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dhcp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dhcp6.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dhcp6.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dns.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dns.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dot11.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/dot11.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/gprs.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/gprs.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/hsrp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/hsrp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/inet.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/inet.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/inet6.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/inet6.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ir.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ir.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/isakmp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/isakmp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/l2.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/l2.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/l2tp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/l2tp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/llmnr.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/llmnr.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/mgcp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/mgcp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/mobileip.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/mobileip.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/netbios.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/netbios.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/netflow.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/netflow.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ntp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ntp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/pflog.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/pflog.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ppp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/ppp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/radius.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/radius.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/rip.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/rip.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/rtp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/rtp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/sebek.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/sebek.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/skinny.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/skinny.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/smb.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/smb.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/snmp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/snmp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/tftp.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/tftp.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/layers/x509.py
lib/python${MODPY_VERSION}/site-packages/scapy/layers/x509.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/main.py
lib/python${MODPY_VERSION}/site-packages/scapy/main.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/
lib/python${MODPY_VERSION}/site-packages/scapy/modules/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/geoip.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/geoip.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/nmap.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/nmap.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/p0f.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/p0f.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/queso.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/queso.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/modules/voip.py
lib/python${MODPY_VERSION}/site-packages/scapy/modules/voip.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/packet.py
lib/python${MODPY_VERSION}/site-packages/scapy/packet.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/plist.py
lib/python${MODPY_VERSION}/site-packages/scapy/plist.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/route.py
lib/python${MODPY_VERSION}/site-packages/scapy/route.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/route6.py
lib/python${MODPY_VERSION}/site-packages/scapy/route6.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/sendrecv.py
lib/python${MODPY_VERSION}/site-packages/scapy/sendrecv.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/supersocket.py
lib/python${MODPY_VERSION}/site-packages/scapy/supersocket.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/themes.py
lib/python${MODPY_VERSION}/site-packages/scapy/themes.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/tools/
lib/python${MODPY_VERSION}/site-packages/scapy/tools/UTscapy.py
lib/python${MODPY_VERSION}/site-packages/scapy/tools/UTscapy.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/tools/__init__.py
lib/python${MODPY_VERSION}/site-packages/scapy/tools/__init__.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/tools/check_asdis.py
lib/python${MODPY_VERSION}/site-packages/scapy/tools/check_asdis.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/utils.py
lib/python${MODPY_VERSION}/site-packages/scapy/utils.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/utils6.py
lib/python${MODPY_VERSION}/site-packages/scapy/utils6.pyc
lib/python${MODPY_VERSION}/site-packages/scapy/volatile.py
lib/python${MODPY_VERSION}/site-packages/scapy/volatile.pyc
@man man/man1/scapy.1
share/examples/scapy/
share/examples/scapy/ethertypes