Mon Mar 30 19:39:32 2020 UTC ()
Deal with libpcap on NetBSD


(joerg)
diff -r1.10 -r1.11 pkgsrc/net/p5-Net-Pcap/distinfo
diff -r0 -r1.1 pkgsrc/net/p5-Net-Pcap/patches/patch-stubs.inc

cvs diff -r1.10 -r1.11 pkgsrc/net/p5-Net-Pcap/distinfo (expand / switch to unified diff)

--- pkgsrc/net/p5-Net-Pcap/distinfo 2016/08/01 12:34:11 1.10
+++ pkgsrc/net/p5-Net-Pcap/distinfo 2020/03/30 19:39:32 1.11
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1$NetBSD: distinfo,v 1.10 2016/08/01 12:34:11 mef Exp $ 1$NetBSD: distinfo,v 1.11 2020/03/30 19:39:32 joerg Exp $
2 2
3SHA1 (Net-Pcap-0.18.tar.gz) = 9e53643cbe93e497af8c24cebe02bd7934194854 3SHA1 (Net-Pcap-0.18.tar.gz) = 9e53643cbe93e497af8c24cebe02bd7934194854
4RMD160 (Net-Pcap-0.18.tar.gz) = 1959ae0cc70fdd8b4cdb2d9028123fd83338c8d5 4RMD160 (Net-Pcap-0.18.tar.gz) = 1959ae0cc70fdd8b4cdb2d9028123fd83338c8d5
5SHA512 (Net-Pcap-0.18.tar.gz) = 63cc216345eb65b1e76efa657623c9d444d20f4b54ab0c75e787483baaa4f1de7e3a9294967aa7eccbdca04c60b089194dd7e0d19838f899b332c5881a8c7f6d 5SHA512 (Net-Pcap-0.18.tar.gz) = 63cc216345eb65b1e76efa657623c9d444d20f4b54ab0c75e787483baaa4f1de7e3a9294967aa7eccbdca04c60b089194dd7e0d19838f899b332c5881a8c7f6d
6Size (Net-Pcap-0.18.tar.gz) = 94207 bytes 6Size (Net-Pcap-0.18.tar.gz) = 94207 bytes
7SHA1 (patch-Makefile.PL) = e8944761324b1a86323b96906953175f751bacac 7SHA1 (patch-Makefile.PL) = e8944761324b1a86323b96906953175f751bacac
 8SHA1 (patch-stubs.inc) = 24cc81ee1a4d66d35349a85b01e181cfb1f478d0

File Added: pkgsrc/net/p5-Net-Pcap/patches/patch-stubs.inc
$NetBSD: patch-stubs.inc,v 1.1 2020/03/30 19:39:32 joerg Exp $

pcap_open no longer exists in NetBSD, so don't redefine pcap_rmtauth.
pcap_setsampling still has a prototype, but no implementation.

--- stubs.inc.orig	2020-03-29 03:00:42.548466448 +0000
+++ stubs.inc
@@ -354,11 +354,13 @@ int pcap_parsesrcstr(const char *source,
 #ifdef _MSC_VER
 #pragma message( "Warning: the function pcap_open() is not available" )
 #endif
+#ifndef HAVE_PCAP_OPEN_DEAD
 struct pcap_rmtauth {
     int type;
     char *username;
     char *password;
 };
+#endif
 
 pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err);
 pcap_t * pcap_open(const char *source, int snaplen, int flags, int read_timeout, struct pcap_rmtauth *auth, char *err) {
@@ -516,10 +518,12 @@ HANDLE pcap_getevent(pcap_t *p) {
 #ifdef _MSC_VER
 #pragma message( "Warning: the function pcap_setsampling() is not available" )
 #endif
+#ifndef PCAP_SAMP_NOSAMP
 struct pcap_samp {
     int method;
     int value;
 };
+#endif
 
 struct pcap_samp *pcap_setsampling(pcap_t *p);
 struct pcap_samp *pcap_setsampling(pcap_t *p) {