From ea15012be8ebf637b14fdf55b0de237f42f9e4a5 Mon Sep 17 00:00:00 2001 From: adrianp Date: Wed, 3 Jan 2007 15:02:51 +0000 Subject: Update to 1.0.5 _lots_ of changes In brief: # Revision 1.0.0.7 2005/08/10 20:01:56 pbi # - changed Ether.mysummary() (P. Lalet) # - Update of Sebek protocols (P. Lalet) # Revision 1.0.0.21 2005/09/06 17:05:19 pbi # - new logging/warning facility using the logging module # Revision 1.0.0.24 2005/09/08 14:13:36 pbi # - added RandIP() # Revision 1.0.0.33 2005/09/24 14:29:30 pbi # - completed PrismHeader layer # Revision 1.0.4.98 2006/10/06 16:31:41 pbi # - added additionnal DHCP Options (ticket #11) # Revision 1.0.4.84 2006/09/23 06:52:46 pbi # - improved import_hexcap() to handle more hexdump outputs --- net/scapy/Makefile | 30 ++++++++++++----- net/scapy/PLIST | 4 ++- net/scapy/distinfo | 10 +++--- net/scapy/files/ethertypes | 37 +++++++++++++++++++++ net/scapy/options.mk | 28 ++++++++++++++++ net/scapy/patches/patch-aa | 80 +++++++++++----------------------------------- 6 files changed, 114 insertions(+), 75 deletions(-) create mode 100644 net/scapy/files/ethertypes create mode 100644 net/scapy/options.mk (limited to 'net/scapy') diff --git a/net/scapy/Makefile b/net/scapy/Makefile index e52eb651e03..a9b90354e10 100644 --- a/net/scapy/Makefile +++ b/net/scapy/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2006/03/04 21:30:24 jlam Exp $ +# $NetBSD: Makefile,v 1.4 2007/01/03 15:02:51 adrianp Exp $ # -DISTNAME= scapy-1.0.0 -PKGREVISION= 1 +DISTNAME= scapy-1.0.5 CATEGORIES= net MASTER_SITES= http://www.secdev.org/projects/scapy/files/ @@ -10,14 +9,29 @@ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://www.secdev.org/projects/scapy/ COMMENT= Interactive packet manipulation program -NO_BUILD= yes -PYTHON_VERSIONS_ACCEPTED= 23 24 -PYTHON_PATCH_SCRIPTS= scapy.py -MANCOMPRESSED= yes +NO_BUILD= yes +PYTHON_VERSIONS_ACCEPTED= 24 +PYTHON_PATCH_SCRIPTS= scapy.py + +.include "options.mk" + +CONF_FILES= ${PREFIX}/share/examples/scapy/ethertypes \ + ${PKG_SYSCONFDIR}/ethertypes + +SUBST_CLASSES+= config +SUBST_STAGE.config= post-patch +SUBST_FILES.config= scapy.py +SUBST_SED.config= -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" +SUBST_MESSAGE.config= Fixing paths. + +post-extract: + ${CP} ${FILESDIR}/ethertypes ${WRKSRC} do-install: + ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/scapy + ${INSTALL_DATA} ${WRKSRC}/ethertypes ${PREFIX}/share/examples/scapy/ ${INSTALL_SCRIPT} ${WRKSRC}/scapy.py ${PREFIX}/bin/scapy - ${INSTALL_MAN} ${WRKSRC}/scapy.1.gz ${PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/scapy.1 ${PREFIX}/${PKGMANDIR}/man1 .include "../../lang/python/application.mk" .include "../../net/py-libpcap/buildlink3.mk" diff --git a/net/scapy/PLIST b/net/scapy/PLIST index 829fdfcc136..ef65f6e9700 100644 --- a/net/scapy/PLIST +++ b/net/scapy/PLIST @@ -1,3 +1,5 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2005/08/10 13:54:58 drochner Exp $ +@comment $NetBSD: PLIST,v 1.2 2007/01/03 15:02:51 adrianp Exp $ bin/scapy man/man1/scapy.1 +share/examples/scapy/ethertypes +@dirrm share/examples/scapy diff --git a/net/scapy/distinfo b/net/scapy/distinfo index 59b5676d751..189ef629b81 100644 --- a/net/scapy/distinfo +++ b/net/scapy/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.1.1.1 2005/08/10 13:54:58 drochner Exp $ +$NetBSD: distinfo,v 1.2 2007/01/03 15:02:51 adrianp Exp $ -SHA1 (scapy-1.0.0.tar.gz) = f851c3bda22cb52727509cf3a7a699578dabe940 -RMD160 (scapy-1.0.0.tar.gz) = 53ed9f326f42e6979410a149e63468921e0b9bae -Size (scapy-1.0.0.tar.gz) = 90189 bytes -SHA1 (patch-aa) = cb202d1a32d670c78a39c2059371ac1443c8b9a3 +SHA1 (scapy-1.0.5.tar.gz) = 58ab1ef469d48a84fe987a3a91d6e40a59bb687d +RMD160 (scapy-1.0.5.tar.gz) = 33bbc31385ca098b1361d8233f17222fa460836f +Size (scapy-1.0.5.tar.gz) = 144746 bytes +SHA1 (patch-aa) = 0f8acd2bd009c3bde32ce4a412023ed291995193 diff --git a/net/scapy/files/ethertypes b/net/scapy/files/ethertypes new file mode 100644 index 00000000000..5e700f66398 --- /dev/null +++ b/net/scapy/files/ethertypes @@ -0,0 +1,37 @@ +# +# Ethernet frame types +# This file describes some of the various Ethernet +# protocol types that are used on Ethernet networks. +# +# This list could be found on: +# http://www.iana.org/assignments/ethernet-numbers +# +# ... #Comment +# +IPv4 0800 ip ip4 # Internet IP (IPv4) +X25 0805 +ARP 0806 ether-arp # +FR_ARP 0808 # Frame Relay ARP [RFC1701] +BPQ 08FF # G8BPQ AX.25 Ethernet Packet +DEC 6000 # DEC Assigned proto +DNA_DL 6001 # DEC DNA Dump/Load +DNA_RC 6002 # DEC DNA Remote Console +DNA_RT 6003 # DEC DNA Routing +LAT 6004 # DEC LAT +DIAG 6005 # DEC Diagnostics +CUST 6006 # DEC Customer use +SCA 6007 # DEC Systems Comms Arch +TEB 6558 # Trans Ether Bridging [RFC1701] +RAW_FR 6559 # Raw Frame Relay [RFC1701] +AARP 80F3 # Appletalk AARP +ATALK 809B # Appletalk +802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame +IPX 8137 # Novell IPX +NetBEUI 8191 # NetBEUI +IPv6 86DD ip6 # IP version 6 +PPP 880B # PPP +ATMMPOA 884C # MultiProtocol over ATM +PPP_DISC 8863 # PPPoE discovery messages +PPP_SES 8864 # PPPoE session messages +ATMFATE 8884 # Frame-based ATM Transport over Ethernet +LOOP 9000 loopback # loop proto diff --git a/net/scapy/options.mk b/net/scapy/options.mk new file mode 100644 index 00000000000..bcf61ff055c --- /dev/null +++ b/net/scapy/options.mk @@ -0,0 +1,28 @@ +# $NetBSD: options.mk,v 1.1 2007/01/03 15:02:51 adrianp Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.scapy + +PKG_SUPPORTED_OPTIONS= scapy-crypto gnuplot scapy-pyx + +.include "../../mk/bsd.options.mk" + +### +### Add in crypto support for WEP operations +### +.if !empty(PKG_OPTIONS:Mscapy-crypto) +. include "../../security/py-amkCrypto/buildlink3.mk" +.endif + +### +### Add in gnuplot support for plotting +### +.if !empty(PKG_OPTIONS:Mgnuplot) +DEPENDS+= ${PYPKGPREFIX}-gnuplot-[0-9]*:../../graphics/py-gnuplot +.endif + +### +### Add in TeX support for psdump() and/or pdfdump() +### +.if !empty(PKG_OPTIONS:Mscapy-pyx) +DEPENDS+= ${PYPKGPREFIX}-X-[0-9]*:../../textproc/py-X +.endif diff --git a/net/scapy/patches/patch-aa b/net/scapy/patches/patch-aa index e1711136c66..25b513de440 100644 --- a/net/scapy/patches/patch-aa +++ b/net/scapy/patches/patch-aa @@ -1,23 +1,25 @@ -$NetBSD: patch-aa,v 1.1.1.1 2005/08/10 13:54:58 drochner Exp $ +$NetBSD: patch-aa,v 1.2 2007/01/03 15:02:51 adrianp Exp $ ---- scapy.py.orig 2005-08-09 20:30:34.000000000 +0200 +--- scapy.py.orig 2006-10-19 16:58:09.000000000 +0100 +++ scapy.py -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#!/usr/pkg/bin/python2.3 - - ############################################################################# - ## ## -@@ -888,7 +888,7 @@ except ImportError: - - +@@ -1829,6 +1829,7 @@ except ImportError: LINUX=sys.platform.startswith("linux") --OPENBSD=sys.platform.startswith("openbsd") -+OPENBSD=sys.platform.startswith("openbsd") or sys.platform.startswith("netbsd") - - if LINUX: - DNET=PCAP=0 -@@ -1357,8 +1357,8 @@ if PCAP: + OPENBSD=sys.platform.startswith("openbsd") + FREEBSD=sys.platform.startswith("freebsd") ++NETBSD=sys.platform.startswith("netbsd") + DARWIN=sys.platform.startswith("darwin") + BIG_ENDIAN= struct.pack("H",1) == "\x00\x01" + X86_64 = (os.uname()[4] == 'x86_64') +@@ -2006,7 +2007,7 @@ except IOError: + + ETHER_TYPES={} + try: +- f=open("/etc/ethertypes") ++ f=open("@PKG_SYSCONFDIR@/ethertypes") + for l in f: + try: + if l[0] in ["#","\n"]: +@@ -2446,8 +2447,8 @@ if PCAP: def get_working_if(): try: return pcap.lookupdev() @@ -28,47 +30,3 @@ $NetBSD: patch-aa,v 1.1.1.1 2005/08/10 13:54:58 drochner Exp $ def attach_filter(s, filter): warning("attach_filter() should not be called in PCAP mode") -@@ -6298,9 +6298,10 @@ class L3dnetSocket(SuperSocket): - warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll)) - cls = Ether - -- pkt = None -- while pkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -- pkt = self.ins.next()[1] -+ trypkt = None -+ while trypkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -+ trypkt = self.ins.next() -+ pkt = trypkt[1] - - try: - pkt = cls(pkt) -@@ -6342,9 +6343,11 @@ class L2dnetSocket(SuperSocket): - warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll)) - cls = Ether - -- pkt = None -- while pkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -- pkt = self.ins.next()[1] -+ trypkt = None -+ while trypkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -+ trypkt = self.ins.next() -+ pkt = trypkt[1] -+ - try: - pkt = cls(pkt) - except: -@@ -6399,9 +6402,11 @@ class L2pcapListenSocket(SuperSocket): - warning("Unable to guess datalink type (interface=%s linktype=%i). Using Ethernet" % (self.iface, ll)) - cls = Ether - -- pkt = None -- while pkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -- pkt = self.ins.next()[1] -+ trypkt = None -+ while trypkt is None: ## This fix a probable bug in libpcap/wrapper, that returns None while there is no read timeout -+ trypkt = self.ins.next() -+ pkt = trypkt[1] -+ - try: - pkt = cls(pkt) - except: -- cgit v1.2.3