diff options
author | erwin <erwin@FreeBSD.org> | 2006-07-20 20:21:37 +0800 |
---|---|---|
committer | erwin <erwin@FreeBSD.org> | 2006-07-20 20:21:37 +0800 |
commit | 3eca8b2a0a9aea277d1871e82351801ee61d7529 (patch) | |
tree | ff2ac1b13d3a2b8802130c54dcf344a2dc76aa85 /net/py-pypcap | |
parent | b934be064bef648b227259869b2c639af139ecca (diff) | |
download | freebsd-ports-gnome-3eca8b2a0a9aea277d1871e82351801ee61d7529.tar.gz freebsd-ports-gnome-3eca8b2a0a9aea277d1871e82351801ee61d7529.tar.zst freebsd-ports-gnome-3eca8b2a0a9aea277d1871e82351801ee61d7529.zip |
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/Makefile | 24 | ||||
-rw-r--r-- | net/py-pypcap/distinfo | 3 | ||||
-rw-r--r-- | net/py-pypcap/files/patch-pcap.pyx | 36 | ||||
-rw-r--r-- | net/py-pypcap/pkg-descr | 3 | ||||
-rw-r--r-- | net/py-pypcap/pkg-plist | 1 |
5 files changed, 67 insertions, 0 deletions
diff --git a/net/py-pypcap/Makefile b/net/py-pypcap/Makefile new file mode 100644 index 000000000000..9680eb18ae31 --- /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 000000000000..15ab79512d0e --- /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 000000000000..369a5bc52249 --- /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 000000000000..dcde5aa718a5 --- /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 000000000000..9b4444c719b2 --- /dev/null +++ b/net/py-pypcap/pkg-plist @@ -0,0 +1 @@ +lib/python2.4/site-packages/pcap.so |