trafshow: fix build on NetBSD-current

pcap.h now provides a pcap_init() function conflicting with a static
function of the same name here.
This commit is contained in:
wiz 2023-09-09 13:27:28 +00:00
parent d3cb203e77
commit 559c69225d
2 changed files with 31 additions and 3 deletions

View File

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.15 2021/10/26 11:07:04 nia Exp $
$NetBSD: distinfo,v 1.16 2023/09/09 13:27:28 wiz Exp $
BLAKE2s (trafshow-5.2.3.tgz) = 4557dbce8084fdc6f9f0c8aa515550302dd0590357dc8c9540cd1ee77077d17d
SHA512 (trafshow-5.2.3.tgz) = 9ea57c319cb177de2d29eaf2a09c06f0bd7efcfc3e50d5fa5cc18f193c6dfc0109d4388ccbaee7bf2db37b5418fc0f4b6ce47a5558b652ecf9e891a813ef8540
Size (trafshow-5.2.3.tgz) = 142615 bytes
SHA1 (patch-ai) = 6cfa14ad753bfd2b85e0e8c8cd8d8c25a697d6dd
SHA1 (patch-trafshow.c) = bc010ec59e7208a92bd2d212f2de044178c2c70a
SHA1 (patch-trafshow.c) = e5b0be132749752da4884c17016a64b896613bd5

View File

@ -1,6 +1,7 @@
$NetBSD: patch-trafshow.c,v 1.1 2013/02/06 20:32:17 jperkin Exp $
$NetBSD: patch-trafshow.c,v 1.2 2023/09/09 13:27:28 wiz Exp $
* Avoid buffering on Solaris.
* Rename pcap_init() to avoid conflict with the one in pcap.h.
--- trafshow.c.orig 2006-03-14 07:58:07.000000000 +0000
+++ trafshow.c
@ -14,6 +15,33 @@ $NetBSD: patch-trafshow.c,v 1.1 2013/02/06 20:32:17 jperkin Exp $
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@@ -58,7 +61,7 @@ char copyright[] = "Copyright (c) 1993-2
static void vers();
static void usage();
static pcap_if_t *pcap_matchdev(pcap_if_t *dp, const char *name);
-static int pcap_init(PCAP_HANDLER **ph_list, pcap_if_t *dp);
+static int trafshow_pcap_init(PCAP_HANDLER **ph_list, pcap_if_t *dp);
static void *pcap_feed(void *arg); /* PCAP_HANDLER *ph */
#ifdef HAVE_PCAP_GET_SELECTABLE_FD
static void *pcap_feed2(void *arg); /* PCAP_HANDLER *ph */
@@ -172,7 +175,7 @@ main(argc, argv)
}
/* initialize list of pcap handlers */
- if ((op = pcap_init(&ph_list, dev_list)) < 1) {
+ if ((op = trafshow_pcap_init(&ph_list, dev_list)) < 1) {
fprintf(stderr, "No packet capture device available (no permission?)\n");
exit(1);
}
@@ -298,7 +301,7 @@ pcap_matchdev(dp, name)
}
static int
-pcap_init(ph_list, dp)
+trafshow_pcap_init(ph_list, dp)
PCAP_HANDLER **ph_list;
pcap_if_t *dp;
{
@@ -543,6 +546,9 @@ pcap_feed2(arg)
PCAP_HANDLER *ph, *ph_list = (PCAP_HANDLER *)arg;
int npkt = -1, ndev, op;