summaryrefslogtreecommitdiffstats
path: root/net/py-pypcap
diff options
context:
space:
mode:
authorerwin <erwin@FreeBSD.org>2006-07-20 12:21:37 +0000
committererwin <erwin@FreeBSD.org>2006-07-20 12:21:37 +0000
commit3eca8b2a0a9aea277d1871e82351801ee61d7529 (patch)
treeff2ac1b13d3a2b8802130c54dcf344a2dc76aa85 /net/py-pypcap
parentb934be064bef648b227259869b2c639af139ecca (diff)
downloadFreeBSD-ports-3eca8b2a0a9aea277d1871e82351801ee61d7529.zip
FreeBSD-ports-3eca8b2a0a9aea277d1871e82351801ee61d7529.tar.gz
A simplified object-oriented Python extension module for libpcap
WWW: http://monkey.org/~dugsong/pypcap/ PR: ports/100601 Submitted by: George V. Neville-Neil
Diffstat (limited to 'net/py-pypcap')
-rw-r--r--net/py-pypcap/Makefile24
-rw-r--r--net/py-pypcap/distinfo3
-rw-r--r--net/py-pypcap/files/patch-pcap.pyx36
-rw-r--r--net/py-pypcap/pkg-descr3
-rw-r--r--net/py-pypcap/pkg-plist1
5 files changed, 67 insertions, 0 deletions
diff --git a/net/py-pypcap/Makefile b/net/py-pypcap/Makefile
new file mode 100644
index 0000000..9680eb1
--- /dev/null
+++ b/net/py-pypcap/Makefile
@@ -0,0 +1,24 @@
+# New ports collection makefile for: py-pypcap
+# Date created: 15 Jul 2006
+# Whom: George V. Neville-Neil
+#
+# $FreeBSD$
+#
+
+PORTNAME= pypcap
+PORTVERSION= 1.1
+CATEGORIES= net python
+MASTER_SITES= http://monkey.org/~dugsong/pypcap/
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= gnn@freebsd.org
+COMMENT= Simplified object-oriented Python extension module for libpcap
+
+BUILD_DEPENDS= pyrexc:${PORTSDIR}/devel/pyrex
+
+USE_PYTHON= yes
+USE_PYTHON_PREFIX= yes
+
+post-patch:
+ ${RM} ${WRKDIR}/${PORTNAME}-${PORTVERSION}/pcap.c
+.include <bsd.port.mk>
diff --git a/net/py-pypcap/distinfo b/net/py-pypcap/distinfo
new file mode 100644
index 0000000..15ab795
--- /dev/null
+++ b/net/py-pypcap/distinfo
@@ -0,0 +1,3 @@
+MD5 (pypcap-1.1.tar.gz) = 034c3cbbfa81aa19e8f685b767c65764
+SHA256 (pypcap-1.1.tar.gz) = 087677295c795f543fad2c286df1807d55876e85d04f7292335cd149f4d8d47f
+SIZE (pypcap-1.1.tar.gz) = 22951
diff --git a/net/py-pypcap/files/patch-pcap.pyx b/net/py-pypcap/files/patch-pcap.pyx
new file mode 100644
index 0000000..369a5bc
--- /dev/null
+++ b/net/py-pypcap/files/patch-pcap.pyx
@@ -0,0 +1,36 @@
+*** pcap.pyx Mon Oct 17 08:00:11 2005
+--- /Users/gnn/src/pypcap-1.1.new/pcap.pyx Fri Jun 23 18:22:03 2006
+***************
+*** 61,66 ****
+--- 64,70 ----
+ int pcap_stats(pcap_t *p, pcap_stat *ps)
+ char *pcap_geterr(pcap_t *p)
+ void pcap_close(pcap_t *p)
++ int pcap_inject(pcap_t *p, char *buf, int size)
+ int bpf_filter(bpf_insn *insns, char *buf, int len, int caplen)
+
+ cdef extern from "pcap_ex.h":
+***************
+*** 313,318 ****
+--- 318,338 ----
+ elif n == -2:
+ break
+
++ def inject(self, packet, len):
++ """Inject a packet onto an interface.
++ May or may not work depending on platform.
++
++ Arguments:
++
++ packet -- a pointer to the packet in memory
++ """
++ cdef int n
++ n = pcap_inject(self.__pcap, packet, len)
++ if (n < 0):
++ raise OSError, pcap_geterr(self.__pcap)
++
++ return n
++
+ def geterr(self):
+ """Return the last error message associated with this handle."""
+ return pcap_geterr(self.__pcap)
diff --git a/net/py-pypcap/pkg-descr b/net/py-pypcap/pkg-descr
new file mode 100644
index 0000000..dcde5aa
--- /dev/null
+++ b/net/py-pypcap/pkg-descr
@@ -0,0 +1,3 @@
+A simplified object-oriented Python extension module for libpcap
+
+WWW: http://monkey.org/~dugsong/pypcap/
diff --git a/net/py-pypcap/pkg-plist b/net/py-pypcap/pkg-plist
new file mode 100644
index 0000000..9b4444c
--- /dev/null
+++ b/net/py-pypcap/pkg-plist
@@ -0,0 +1 @@
+lib/python2.4/site-packages/pcap.so
OpenPOWER on IntegriCloud