[Python-modules-commits] r9472 - in packages/python-dpkt/trunk/debian (5 files)
luciano at users.alioth.debian.org
luciano at users.alioth.debian.org
Wed Aug 26 03:51:39 UTC 2009
Date: Wednesday, August 26, 2009 @ 03:51:38
Author: luciano
Revision: 9472
dnet is dumbnet in Debian
Added:
packages/python-dpkt/trunk/debian/patches/01_dnet2dumbnet.dpatch
Modified:
packages/python-dpkt/trunk/debian/changelog
packages/python-dpkt/trunk/debian/control
packages/python-dpkt/trunk/debian/patches/00list
packages/python-dpkt/trunk/debian/rules
Modified: packages/python-dpkt/trunk/debian/changelog
===================================================================
--- packages/python-dpkt/trunk/debian/changelog 2009-08-25 23:51:29 UTC (rev 9471)
+++ packages/python-dpkt/trunk/debian/changelog 2009-08-26 03:51:38 UTC (rev 9472)
@@ -1,3 +1,11 @@
+python-dpkt (1.6+svn54-2) unstable; urgency=low
+
+ * Renamed the dnet calls to dumbnet.
+ * Homepage updated
+ * Description polished.
+
+ -- Luciano Bello <luciano at debian.org> Tue, 25 Aug 2009 23:23:47 -0300
+
python-dpkt (1.6+svn54-1) unstable; urgency=low
* Initial release (Closes: #538755)
@@ -2,2 +10,2 @@
- -- Luciano Bello <luciano at debian.org> Mon, 27 Jul 2009 20:53:29 -0300
+ -- Luciano Bello <luciano at debian.org> Thu, 30 Jul 2009 15:11:07 -0300
Modified: packages/python-dpkt/trunk/debian/control
===================================================================
--- packages/python-dpkt/trunk/debian/control 2009-08-25 23:51:29 UTC (rev 9471)
+++ packages/python-dpkt/trunk/debian/control 2009-08-26 03:51:38 UTC (rev 9472)
@@ -5,25 +5,25 @@
Uploaders: Luciano Bello <luciano at debian.org>, Nico Golde <nion at debian.org>
Build-Depends: debhelper (>= 5.0.38), python-all, dpatch
Build-Depends-Indep: python-support (>= 0.6.4)
-Standards-Version: 3.8.2
+Standards-Version: 3.8.3
Homepage: http://code.google.com/p/dpkt/
XS-Python-Version: all
Package: python-dpkt
Architecture: all
-Depends: ${python:Depends}, ${misc:Depends}
+Depends: ${python:Depends}, ${misc:Depends}, python-dumbnet
XB-Python-Version: ${python:Versions}
Description: Python packet creation / parsing module for basic TCP/IP protocols
Python module for fast, simple packet creation / parsing, with support for
basic protocols often related to TCP/IP protocols. This includes (but is not
limited to):
- - ethernet
- - HTTP
- - ICMP
- - UDP
- - TCP/IP (v4 and v6)
- - BGP
- - radius
- - ssl
+ - ethernet
+ - HTTP
+ - ICMP
+ - UDP
+ - TCP/IP (v4 and v6)
+ - BGP
+ - radius
+ - ssl
and many other protocols as well as support for parsing pcap files.
Modified: packages/python-dpkt/trunk/debian/patches/00list
===================================================================
--- packages/python-dpkt/trunk/debian/patches/00list 2009-08-25 23:51:29 UTC (rev 9471)
+++ packages/python-dpkt/trunk/debian/patches/00list 2009-08-26 03:51:38 UTC (rev 9472)
@@ -1 +1 @@
-# for future use
+01_dnet2dumbnet.dpatch
Added: packages/python-dpkt/trunk/debian/patches/01_dnet2dumbnet.dpatch
===================================================================
--- packages/python-dpkt/trunk/debian/patches/01_dnet2dumbnet.dpatch (rev 0)
+++ packages/python-dpkt/trunk/debian/patches/01_dnet2dumbnet.dpatch 2009-08-26 03:51:38 UTC (rev 9472)
@@ -0,0 +1,184 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_dnet2dumbnet.dpatch by Luciano Bello <luciano at debian.org>
+##
+## DP: In Debian, the dnet module is called dumbnet
+
+ at DPATCH@
+diff -urNad python-dpkt-1.6+svn54.orig~/dpkt/dpkt.py python-dpkt-1.6+svn54.orig/dpkt/dpkt.py
+--- python-dpkt-1.6+svn54.orig~/dpkt/dpkt.py 2007-08-02 19:42:59.000000000 -0300
++++ python-dpkt-1.6+svn54.orig/dpkt/dpkt.py 2009-07-30 10:52:38.000000000 -0300
+@@ -144,11 +144,11 @@
+ return '\n'.join(res)
+
+ try:
+- import dnet
++ import dumbnet
+ def in_cksum_add(s, buf):
+- return dnet.ip_cksum_add(buf, s)
++ return dumbnet.ip_cksum_add(buf, s)
+ def in_cksum_done(s):
+- return socket.ntohs(dnet.ip_cksum_carry(s))
++ return socket.ntohs(dumbnet.ip_cksum_carry(s))
+ except ImportError:
+ import array
+ def in_cksum_add(s, buf):
+diff -urNad python-dpkt-1.6+svn54.orig~/examples/dhcprequest.py python-dpkt-1.6+svn54.orig/examples/dhcprequest.py
+--- python-dpkt-1.6+svn54.orig~/examples/dhcprequest.py 2008-08-14 12:48:46.000000000 -0300
++++ python-dpkt-1.6+svn54.orig/examples/dhcprequest.py 2009-07-30 10:52:38.000000000 -0300
+@@ -1,14 +1,14 @@
+ #!/usr/bin/env python
+
+-import dnet
++import dumbnet
+ from dpkt import dhcp
+ from dpkt import udp
+ from dpkt import ip
+ from dpkt import ethernet
+
+ sysintf = 'eth0'
+-hw = dnet.eth(sysintf)
+-intf = dnet.intf()
++hw = dumbnet.eth(sysintf)
++intf = dumbnet.intf()
+
+ # build a dhcp discover packet to request an ip
+ d = dhcp.DHCP(
+@@ -34,7 +34,7 @@
+
+ # build ip packet
+ i = ip.IP(
+- dst = dnet.ip_aton('255.255.255.255'),
++ dst = dumbnet.ip_aton('255.255.255.255'),
+ src = intf.get(sysintf)['addr'].ip,
+ data = u,
+ p = ip.IP_PROTO_UDP
+@@ -43,7 +43,7 @@
+
+ # build ethernet frame
+ e = ethernet.Ethernet(
+- dst = dnet.ETH_ADDR_BROADCAST,
++ dst = dumbnet.ETH_ADDR_BROADCAST,
+ src = hw.get(),
+ data = i
+ )
+diff -urNad python-dpkt-1.6+svn54.orig~/tests/test-perf.py python-dpkt-1.6+svn54.orig/tests/test-perf.py
+--- python-dpkt-1.6+svn54.orig~/tests/test-perf.py 2006-08-13 02:28:20.000000000 -0300
++++ python-dpkt-1.6+svn54.orig/tests/test-perf.py 2009-07-30 10:52:38.000000000 -0300
+@@ -2,7 +2,7 @@
+
+ import time, sys
+
+-import dnet
++import dumbnet
+ sys.path.insert(0, '.')
+ import dpkt
+ from impacket import ImpactDecoder, ImpactPacket
+@@ -11,22 +11,22 @@
+ import xstruct
+
+ xip = xstruct.structdef('>', [
+- ('v_hl', ('B', 1), (4 << 4) | (dnet.IP_HDR_LEN >> 2)),
+- ('tos', ('B', 1), dnet.IP_TOS_DEFAULT),
+- ('len', ('H', 1), dnet.IP_HDR_LEN),
++ ('v_hl', ('B', 1), (4 << 4) | (dumbnet.IP_HDR_LEN >> 2)),
++ ('tos', ('B', 1), dumbnet.IP_TOS_DEFAULT),
++ ('len', ('H', 1), dumbnet.IP_HDR_LEN),
+ ('id', ('H', 1), 0),
+ ('off', ('H', 1), 0),
+- ('ttl', ('B', 1), dnet.IP_TTL_DEFAULT),
++ ('ttl', ('B', 1), dumbnet.IP_TTL_DEFAULT),
+ ('p', ('B', 1), 0),
+ ('sum', ('H', 1), 0),
+- ('src', ('s', dnet.IP_ADDR_LEN), dnet.IP_ADDR_ANY),
+- ('dst', ('s', dnet.IP_ADDR_LEN), dnet.IP_ADDR_ANY)
++ ('src', ('s', dumbnet.IP_ADDR_LEN), dumbnet.IP_ADDR_ANY),
++ ('dst', ('s', dumbnet.IP_ADDR_LEN), dumbnet.IP_ADDR_ANY)
+ ])
+
+ xudp = xstruct.structdef('>', [
+ ('sport', ('B', 1), 0),
+ ('dport', ('B', 1), 0),
+- ('ulen', ('H', 1), dnet.UDP_HDR_LEN),
++ ('ulen', ('H', 1), dumbnet.UDP_HDR_LEN),
+ ('sum', ('H', 1), 0)
+ ])
+
+@@ -39,27 +39,27 @@
+ scapy: 348.449269721 pps
+ xstruct: 88314.8953732 pps
+ """
+- src = dnet.addr('1.2.3.4').ip
+- dst = dnet.addr('5.6.7.8').ip
++ src = dumbnet.addr('1.2.3.4').ip
++ dst = dumbnet.addr('5.6.7.8').ip
+ data = 'hello world'
+
+ start = time.time()
+ for i in xrange(cnt):
+- dnet.ip_checksum(
+- str(dpkt.ip.IP(src=src, dst=dst, p=dnet.IP_PROTO_UDP,
+- len = dnet.IP_HDR_LEN + dnet.UDP_HDR_LEN + len(data),
++ dumbnet.ip_checksum(
++ str(dpkt.ip.IP(src=src, dst=dst, p=dumbnet.IP_PROTO_UDP,
++ len = dumbnet.IP_HDR_LEN + dumbnet.UDP_HDR_LEN + len(data),
+ data=dpkt.udp.UDP(sport=111, dport=222,
+- ulen=dnet.UDP_HDR_LEN + len(data),
++ ulen=dumbnet.UDP_HDR_LEN + len(data),
+ data=data))))
+ print 'dpkt:', cnt / (time.time() - start), 'pps'
+
+ start = time.time()
+ for i in xrange(cnt):
+- dnet.ip_checksum(str(dpkt.ip.IP(src=src, dst=dst, p=dnet.IP_PROTO_UDP,
+- len=dnet.IP_HDR_LEN + dnet.UDP_HDR_LEN +
++ dumbnet.ip_checksum(str(dpkt.ip.IP(src=src, dst=dst, p=dumbnet.IP_PROTO_UDP,
++ len=dumbnet.IP_HDR_LEN + dumbnet.UDP_HDR_LEN +
+ len(data))) +
+ str(dpkt.udp.UDP(sport=111, dport=222,
+- ulen=dnet.UDP_HDR_LEN + len(data))) +
++ ulen=dumbnet.UDP_HDR_LEN + len(data))) +
+ data)
+ print 'dpkt (manual):', cnt / (time.time() - start), 'pps'
+
+@@ -100,13 +100,13 @@
+ udp = xudp()
+ udp.sport = 111
+ udp.dport = 222
+- udp.ulen = dnet.UDP_HDR_LEN + len(data)
++ udp.ulen = dumbnet.UDP_HDR_LEN + len(data)
+ ip = xip()
+ ip.src = src
+ ip.dst = dst
+- ip.p = dnet.IP_PROTO_UDP
+- ip.len = dnet.IP_HDR_LEN + udp.ulen
+- dnet.ip_checksum(str(ip) + str(udp) + data)
++ ip.p = dumbnet.IP_PROTO_UDP
++ ip.len = dumbnet.IP_HDR_LEN + udp.ulen
++ dumbnet.ip_checksum(str(ip) + str(udp) + data)
+ print 'xstruct:', cnt / (time.time() - start), 'pps'
+
+ def compare_parse(cnt):
+@@ -142,9 +142,9 @@
+
+ start = time.time()
+ for i in xrange(cnt):
+- ip = xip(s[:dnet.IP_HDR_LEN])
+- udp = xudp(s[dnet.IP_HDR_LEN:dnet.IP_HDR_LEN + dnet.UDP_HDR_LEN])
+- data = s[dnet.IP_HDR_LEN + dnet.UDP_HDR_LEN:]
++ ip = xip(s[:dumbnet.IP_HDR_LEN])
++ udp = xudp(s[dumbnet.IP_HDR_LEN:dumbnet.IP_HDR_LEN + dumbnet.UDP_HDR_LEN])
++ data = s[dumbnet.IP_HDR_LEN + dumbnet.UDP_HDR_LEN:]
+ print 'xstruct:', cnt / (time.time() - start), 'pps'
+
+ def compare_checksum(cnt):
+@@ -156,8 +156,8 @@
+
+ start = time.time()
+ for i in range(cnt):
+- dnet.ip_cksum_carry(dnet.ip_cksum_add(s, 0))
+- print 'dnet.ip_cksum_add/carry:', cnt / (time.time() - start), 'pps'
++ dumbnet.ip_cksum_carry(dumbnet.ip_cksum_add(s, 0))
++ print 'dumbnet.ip_cksum_add/carry:', cnt / (time.time() - start), 'pps'
+
+ def main():
+ import psyco
Property changes on: packages/python-dpkt/trunk/debian/patches/01_dnet2dumbnet.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Modified: packages/python-dpkt/trunk/debian/rules
===================================================================
--- packages/python-dpkt/trunk/debian/rules 2009-08-25 23:51:29 UTC (rev 9471)
+++ packages/python-dpkt/trunk/debian/rules 2009-08-26 03:51:38 UTC (rev 9472)
@@ -11,6 +11,8 @@
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
+PREFIX := debian/$(PACKAGE)/usr
+
build: patch-stamp
clean: unpatch
@@ -32,7 +34,7 @@
dh_installdirs
for python in $(PYVERS); do \
- $$python setup.py install --root=debian/python-dpkt; \
+ $$python setup.py install --no-compile --install-lib=$(PREFIX)/share/python-support/$(PACKAGE); \
done
# Build architecture-dependent files here.
More information about the Python-modules-commits
mailing list