import pcaprub-msf, the Metasploit fork of ruby-pcap, needed by the soon

to be imported Metasploit framework:

This goal of this project is to provide a consistent interface to LBL's
libpcap packet capture library. This project was created because the
currently available ruby-pcap library is poorly designed and has been
unmaintained since 2000. This does not provide packet processing
functionality, it simply provides the interface for capturing packets.
This version has been forked by the Metasploit project.

ok jasper@
This commit is contained in:
stephan 2010-12-23 10:29:52 +00:00
parent a9f7da2307
commit 69c9f53e99
5 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# $OpenBSD: Makefile,v 1.1.1.1 2010/12/23 10:29:52 stephan Exp $
COMMENT = Ruby interface to LBL pcap library (Metasploit fork)
DISTNAME = pcaprub-msf-r7343
PKGNAME = pcaprub-msf-7343
CATEGORIES = net
EXTRACT_SUFX = .tgz
MAINTAINER = Stephan A. Rickauer <stephan@openbsd.org>
HOMEPAGE = http://www.metasploit.com/redmine/projects/framework/repository/show/external/pcaprub
MASTER_SITES = http://distfiles.nl/
# LGPL v2.1
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
WRKDIST = ${WRKDIR}/pcaprub-msf
WANTLIB = pcap
MODULES = lang/ruby
NO_REGRESS = yes
CONFIGURE_STYLE = ruby extconf
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (pcaprub-msf-r7343.tgz) = AHRTtmUB87ZN5fwmkpmezw==
RMD160 (pcaprub-msf-r7343.tgz) = 35rfLU9M5HXEA+D7crxfHu2oOEA=
SHA1 (pcaprub-msf-r7343.tgz) = e56luSJZ73EcMwm98y2O2/70qx8=
SHA256 (pcaprub-msf-r7343.tgz) = nzETD9fBWQc6wRi1znZV5hc6/3SgrWSZ56dJPtaEWrc=
SIZE (pcaprub-msf-r7343.tgz) = 13416

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-pcaprub_c,v 1.1.1.1 2010/12/23 10:29:52 stephan Exp $
--- pcaprub.c.orig Tue Dec 14 11:58:51 2010
+++ pcaprub.c Tue Dec 14 12:02:43 2010
@@ -314,6 +314,7 @@ static VALUE
rbpcap_dump(VALUE self, VALUE caplen, VALUE pktlen, VALUE packet)
{
rbpcap_t *rbp;
+ struct timeval tv;
struct pcap_pkthdr pcap_hdr;
if(TYPE(packet) != T_STRING)
@@ -325,7 +326,9 @@ rbpcap_dump(VALUE self, VALUE caplen, VALUE pktlen, VA
Data_Get_Struct(self, rbpcap_t, rbp);
- gettimeofday(&pcap_hdr.ts, NULL);
+ gettimeofday(&tv, NULL);
+ pcap_hdr.ts.tv_sec = tv.tv_sec;
+ pcap_hdr.ts.tv_usec = tv.tv_usec;
pcap_hdr.caplen = NUM2UINT(caplen);
pcap_hdr.len = NUM2UINT(pktlen);
@@ -489,10 +492,6 @@ Init_pcaprub()
rb_define_const(rb_cPcap, "DLT_PPP_BSDOS", INT2NUM(DLT_PPP_BSDOS));
rb_define_const(rb_cPcap, "DLT_IEEE802_11", INT2NUM(DLT_IEEE802_11));
rb_define_const(rb_cPcap, "DLT_IEEE802_11_RADIO", INT2NUM(DLT_IEEE802_11_RADIO));
- rb_define_const(rb_cPcap, "DLT_IEEE802_11_RADIO_AVS", INT2NUM(DLT_IEEE802_11_RADIO_AVS));
- rb_define_const(rb_cPcap, "DLT_LINUX_SLL", INT2NUM(DLT_LINUX_SLL));
- rb_define_const(rb_cPcap, "DLT_PRISM_HEADER", INT2NUM(DLT_PRISM_HEADER));
- rb_define_const(rb_cPcap, "DLT_AIRONET_HEADER", INT2NUM(DLT_AIRONET_HEADER));
rb_define_singleton_method(rb_cPcap, "new", rbpcap_new_s, 0);

View File

@ -0,0 +1,7 @@
This goal of this project is to provide a consistent interface to LBL's
libpcap packet capture library. This project was created because the
currently available ruby-pcap library is poorly designed and has been
unmaintained since 2000. This does not provide packet processing
functionality, it simply provides the interface for capturing packets.
This version has been forked by the Metasploit project.

View File

@ -0,0 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2010/12/23 10:29:52 stephan Exp $
@conflict ruby-pcap-*
lib/ruby/site_ruby/${MODRUBY_LIBREV}/${MODRUBY_ARCH}/pcaprub.so