1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

A simplified object-oriented Python extension module for libpcap

WWW: http://monkey.org/~dugsong/pypcap/

PR:		ports/100601
Submitted by:	George V. Neville-Neil
This commit is contained in:
Erwin Lansing 2006-07-20 12:21:37 +00:00
parent 64a723fd86
commit 63911b85d2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=168314
6 changed files with 68 additions and 0 deletions

View File

@ -591,6 +591,7 @@
SUBDIR += py-mp-random
SUBDIR += py-pcap
SUBDIR += py-pcapy
SUBDIR += py-pypcap
SUBDIR += py-radix
SUBDIR += py-rrdpipe
SUBDIR += py-rrdtool_lgpl

24
net/py-pypcap/Makefile Normal file
View File

@ -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>

3
net/py-pypcap/distinfo Normal file
View File

@ -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

View File

@ -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)

3
net/py-pypcap/pkg-descr Normal file
View File

@ -0,0 +1,3 @@
A simplified object-oriented Python extension module for libpcap
WWW: http://monkey.org/~dugsong/pypcap/

1
net/py-pypcap/pkg-plist Normal file
View File

@ -0,0 +1 @@
lib/python2.4/site-packages/pcap.so