pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/tcptrace



Module Name:    pkgsrc
Committed By:   vins
Date:           Sat Dec 13 16:42:04 UTC 2025

Modified Files:
        pkgsrc/net/tcptrace: Makefile PLIST distinfo
        pkgsrc/net/tcptrace/patches: patch-aa patch-tcpdump.c patch-trace.c
Added Files:
        pkgsrc/net/tcptrace/patches: patch-compress.c patch-configure.in
            patch-mod__http.c patch-tcptrace.c patch-tcptrace.h

Log Message:
net/tcptrace: fix build

* Fix build with gcc14.
* Fix linking with libpcap.
* Fix some other warnings.
* Some cosmetic changes.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 pkgsrc/net/tcptrace/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/tcptrace/PLIST
cvs rdiff -u -r1.13 -r1.14 pkgsrc/net/tcptrace/distinfo
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/tcptrace/patches/patch-aa
cvs rdiff -u -r0 -r1.1 pkgsrc/net/tcptrace/patches/patch-compress.c \
    pkgsrc/net/tcptrace/patches/patch-configure.in \
    pkgsrc/net/tcptrace/patches/patch-mod__http.c \
    pkgsrc/net/tcptrace/patches/patch-tcptrace.c \
    pkgsrc/net/tcptrace/patches/patch-tcptrace.h
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/tcptrace/patches/patch-tcpdump.c \
    pkgsrc/net/tcptrace/patches/patch-trace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/tcptrace/Makefile
diff -u pkgsrc/net/tcptrace/Makefile:1.36 pkgsrc/net/tcptrace/Makefile:1.37
--- pkgsrc/net/tcptrace/Makefile:1.36   Thu Dec 28 22:44:22 2023
+++ pkgsrc/net/tcptrace/Makefile        Sat Dec 13 16:42:03 2025
@@ -1,32 +1,51 @@
-# $NetBSD: Makefile,v 1.36 2023/12/28 22:44:22 zafer Exp $
+# $NetBSD: Makefile,v 1.37 2025/12/13 16:42:03 vins Exp $
 
 DISTNAME=      tcptrace-6.6.7
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    net
-MASTER_SITES=  #
+MASTER_SITES=  https://distfiles.macports.org/tcptrace/
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=      https://github.com/blitz/tcptrace
+HOMEPAGE=      https://sourceforge.net/projects/open-tcptrace/
 COMMENT=       TCP dump file analysis tool
+LICENSE=       gnu-gpl-v2
 
 GNU_CONFIGURE=         yes
 
-USE_TOOLS+=    bison flex
+USE_TOOLS+=            bison flex
 
 BUILD_TARGET=          tcptrace
 
-DOCFILES=              COPYRIGHT FAQ README README.tput_graphs
+PKGDOCS=               COPYRIGHT FAQ README README.tput_graphs README.tline_graphs
 
-LDFLAGS.SunOS+=                -lm
+LIBS+=                 -lpcap -lm
+LIBS.SunOS+=           -lnsl -lsocket
 
-INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1 share/doc/tcptrace
+SUBST_CLASSES+=                pkgsrc
+SUBST_STAGE.pkgsrc=    pre-configure
+SUBST_FILES.pkgsrc=    Makefile.in
+SUBST_VARS.pkgsrc+=    HOST PREFIX PKGMANDIR USER
+SUBST_MESSAGE.pkgsrc=  Replacing pkgsrc placeholders
+
+SUBST_CLASSES+=                hacks
+SUBST_STAGE.hacks=     pre-configure
+SUBST_FILES.hacks=     erf.c gcache.c ipv6.c netscout.c \
+                       print.c trace.c tcpdump.c tcptrace.c
+SUBST_SED.hacks=       -e 's|memcpy|_memcpy|g'
+
+MAKE_FLAGS+=           LDLIBS=${LIBS:M*:Q}
+
+AUTO_MKDIRS=           yes
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/tcptrace ${DESTDIR}${PREFIX}/bin
-       ${INSTALL_DATA} ${WRKSRC}/tcptrace.man ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/tcptrace.1
-.for f in ${DOCFILES}
-       ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/share/doc/tcptrace
-.endfor
+       ${INSTALL_PROGRAM} ${WRKSRC}/tcptrace           \
+               ${DESTDIR}${PREFIX}/bin
+       ${INSTALL_DATA} ${WRKSRC}/tcptrace.man          \
+               ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/tcptrace.1
+       ${INSTALL_DATA}  ${PKGDOCS:S|^|${WRKSRC}/|}     \
+               ${DESTDIR}${PREFIX}/share/doc/tcptrace
+       ${INSTALL_DATA} ${WRKSRC}/dot_tcptracerc        \
+               ${DESTDIR}${PREFIX}/share/examples/tcptracerc
 
 .include "../../archivers/bzip2/buildlink3.mk"
 .include "../../net/libpcap/buildlink3.mk"

Index: pkgsrc/net/tcptrace/PLIST
diff -u pkgsrc/net/tcptrace/PLIST:1.3 pkgsrc/net/tcptrace/PLIST:1.4
--- pkgsrc/net/tcptrace/PLIST:1.3       Sun Jun 14 18:09:44 2009
+++ pkgsrc/net/tcptrace/PLIST   Sat Dec 13 16:42:03 2025
@@ -1,7 +1,10 @@
-@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:09:44 joerg Exp $
+@comment $NetBSD: PLIST,v 1.4 2025/12/13 16:42:03 vins Exp $
 bin/tcptrace
 man/man1/tcptrace.1
 share/doc/tcptrace/COPYRIGHT
 share/doc/tcptrace/FAQ
 share/doc/tcptrace/README
+share/doc/tcptrace/README.tline_graphs
 share/doc/tcptrace/README.tput_graphs
+share/examples/tcptracerc
+@pkgdir share/examples/tcptrace

Index: pkgsrc/net/tcptrace/distinfo
diff -u pkgsrc/net/tcptrace/distinfo:1.13 pkgsrc/net/tcptrace/distinfo:1.14
--- pkgsrc/net/tcptrace/distinfo:1.13   Tue Oct 26 11:07:01 2021
+++ pkgsrc/net/tcptrace/distinfo        Sat Dec 13 16:42:03 2025
@@ -1,11 +1,16 @@
-$NetBSD: distinfo,v 1.13 2021/10/26 11:07:01 nia Exp $
+$NetBSD: distinfo,v 1.14 2025/12/13 16:42:03 vins Exp $
 
 BLAKE2s (tcptrace-6.6.7.tar.gz) = 615e4a864916ac7e85d2ccb8357294cb1ca81b029672892aeeab7fa0a34bba88
 SHA512 (tcptrace-6.6.7.tar.gz) = 3638770c342aea6c71aa556e758ed22e1fd44730f6c652cf82d3861eb1c31b186952c660071bd1df45020b80eaf9dd090a4ff58c979cc907eb8154dcb7b9b432
 Size (tcptrace-6.6.7.tar.gz) = 3773308 bytes
-SHA1 (patch-aa) = a17e39cd2a944c3f439849feeb0eb0b957cd97b2
+SHA1 (patch-aa) = 60d1de91eacf9a2006368fffae152268b20ec3ff
+SHA1 (patch-compress.c) = 81fb7c635ca78478f66ce0a14844f78bfd7e204f
+SHA1 (patch-configure.in) = 209029266083437ccd826c9f06ce907454ab329e
 SHA1 (patch-filt__parser.y) = ac7c510d6bf231496e9c6b459c7a97d98531dbaf
 SHA1 (patch-filter.c) = 3058ee8b08ceca99b38ae772b51d26df91de6d9c
 SHA1 (patch-filter.h) = 6e8170f63938e4e3b2c8c97ea9361d707af2f8bb
-SHA1 (patch-tcpdump.c) = 4079d257814d966aca2c290fc131bef82ad15fe2
-SHA1 (patch-trace.c) = 9a373fb586526301804cac283abda8031a15df0d
+SHA1 (patch-mod__http.c) = 932685c3356a099c80a0ef2767db92c0b0c5262a
+SHA1 (patch-tcpdump.c) = e59b49887f72aeb8fa344fe930c31e9cee721147
+SHA1 (patch-tcptrace.c) = 91f3ee82bbd76bb511f2b0a105fa57d0178b88e5
+SHA1 (patch-tcptrace.h) = 3c13947e31f25fbd1b4ea3f7728b3684f578fd16
+SHA1 (patch-trace.c) = e130a52c0dbc788825b3023e45e96dab83d11e81

Index: pkgsrc/net/tcptrace/patches/patch-aa
diff -u pkgsrc/net/tcptrace/patches/patch-aa:1.9 pkgsrc/net/tcptrace/patches/patch-aa:1.10
--- pkgsrc/net/tcptrace/patches/patch-aa:1.9    Wed Dec  7 15:18:51 2011
+++ pkgsrc/net/tcptrace/patches/patch-aa        Sat Dec 13 16:42:03 2025
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.9 2011/12/07 15:18:51 joerg Exp $
+$NetBSD: patch-aa,v 1.10 2025/12/13 16:42:03 vins Exp $
 
 --- Makefile.in.orig   2004-03-04 20:33:56.000000000 +0000
 +++ Makefile.in
@@ -25,8 +25,8 @@ $NetBSD: patch-aa,v 1.9 2011/12/07 15:18
  # Pathname of directory to install the binary
 -BINDIR = /usr/local/bin
 -MANDIR = /usr/local/man/
-+BINDIR = ${PREFIX}/bin
-+MANDIR = ${PREFIX}/man
++BINDIR = @PREFIX@/bin
++MANDIR = @PREFIX@/@PKGMANDIR@
  
  
  ################################################################## 
@@ -44,7 +44,7 @@ $NetBSD: patch-aa,v 1.9 2011/12/07 15:18
  version.o: ${CFILES} Makefile
        ${CC} ${CFLAGS} -o version.o -c $(srcdir)/version.c \
 -      -DBUILT_USER="\"`whoami`\"" -DBUILT_HOST="\"`hostname`\"" -DBUILT_DATE="\"`date`\""
-+      -DBUILT_USER="\"${USER}\"" -DBUILT_HOST="\"${HOST}\"" -DBUILT_DATE="\"`date`\""
++      -DBUILT_USER="\"@USER@\"" -DBUILT_HOST="\"@HOST@\"" -DBUILT_DATE="\"`date`\""
  
  #
  # special rules for scanner/parser

Index: pkgsrc/net/tcptrace/patches/patch-tcpdump.c
diff -u pkgsrc/net/tcptrace/patches/patch-tcpdump.c:1.1 pkgsrc/net/tcptrace/patches/patch-tcpdump.c:1.2
--- pkgsrc/net/tcptrace/patches/patch-tcpdump.c:1.1     Tue Jan 20 00:04:58 2015
+++ pkgsrc/net/tcptrace/patches/patch-tcpdump.c Sat Dec 13 16:42:03 2025
@@ -1,8 +1,27 @@
-$NetBSD: patch-tcpdump.c,v 1.1 2015/01/20 00:04:58 enami Exp $
+$NetBSD: patch-tcpdump.c,v 1.2 2025/12/13 16:42:03 vins Exp $
 
 --- tcpdump.c.orig     2004-10-07 20:07:30.000000000 +0000
 +++ tcpdump.c
-@@ -420,7 +420,14 @@ PcapSavePacket(
+@@ -68,9 +68,6 @@ static char const GCC_UNUSED rcsid[] =
+ 
+ 
+ 
+-/* external ref, in case missing in older version */
+-extern int pcap_offline_read(void *, int, pcap_handler, u_char *);
+-
+ /* global pointer, the pcap info header */
+ static pcap_t *pcap;
+ 
+@@ -248,7 +245,7 @@ pread_tcpdump(
+     int ret;
+ 
+     while (1) {
+-      if ((ret = pcap_offline_read(pcap,1,(pcap_handler)callback,0)) != 1) {
++      if ((ret = pcap_dispatch(pcap,1,(pcap_handler)callback,0)) != 1) {
+           /* prob EOF */
+ 
+           if (ret == -1) {
+@@ -420,7 +417,14 @@ PcapSavePacket(
      void *plast)
  {
      static MFILE *f_savefile = NULL;
Index: pkgsrc/net/tcptrace/patches/patch-trace.c
diff -u pkgsrc/net/tcptrace/patches/patch-trace.c:1.1 pkgsrc/net/tcptrace/patches/patch-trace.c:1.2
--- pkgsrc/net/tcptrace/patches/patch-trace.c:1.1       Tue Jan 20 08:29:22 2015
+++ pkgsrc/net/tcptrace/patches/patch-trace.c   Sat Dec 13 16:42:03 2025
@@ -1,7 +1,55 @@
-$NetBSD: patch-trace.c,v 1.1 2015/01/20 08:29:22 enami Exp $
+$NetBSD: patch-trace.c,v 1.2 2025/12/13 16:42:03 vins Exp $
 
---- trace.c.orig       2015-01-20 08:06:47.000000000 +0000
+--- trace.c.orig       2004-11-04 22:43:51.000000000 +0000
 +++ trace.c
+@@ -2061,14 +2061,14 @@ dotrace(
+        /* Use relative sequence numbers after the first segment in either direction */
+        snprintf(buf2, sizeof(buf2), "%lu:%lu(%lu) ", (start - a2b_first_seqnum),
+                 (end - a2b_first_seqnum), (end-start));
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+        if(a2b_first_seqnum == 0 && !SYN_SET(ptcp)) // Don't use relative sequence numbers until handshake is complete.
+          a2b_first_seqnum = thisdir->min_seq;
+       }else if(dir == B2A) {
+        /* Use relative sequence numbers after the first segment in either direction */
+        snprintf(buf2, sizeof(buf2), "%lu:%lu(%lu) ", (start - b2a_first_seqnum),
+                 (end - b2a_first_seqnum), (end-start));
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+        if(b2a_first_seqnum == 0 && !SYN_SET(ptcp))
+          b2a_first_seqnum = thisdir->min_seq;
+       }
+@@ -2080,26 +2080,26 @@ dotrace(
+          snprintf(buf2, sizeof(buf2), "ack %lu ", (th_ack - b2a_first_seqnum));
+        else if(dir == B2A)
+          snprintf(buf2, sizeof(buf2), "ack %lu ", (th_ack - a2b_first_seqnum));
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+       }
+       
+       /* Advertised Window */
+        memset(&buf2, 0, sizeof(buf2));
+        snprintf(buf2, sizeof(buf2), "win %lu ", eff_win);
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+       
+       /* Retransmits */
+       if(retrans) {
+        memset(&buf2, 0, sizeof(buf2));
+        snprintf(buf2, sizeof(buf2), "R ");
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+       }
+       
+       /* Hardware Duplicates */ 
+       if(hw_dup) {
+        memset(&buf2, 0, sizeof(buf2));
+        snprintf(buf2, sizeof(buf2), "HD ");
+-       strncat(buf1, buf2, strlen(buf2));
++       strncat(buf1, buf2, sizeof(buf1) - strlen(buf1) - 1);
+       }
+       
+       /* Draw the segment ------>/<------- */
 @@ -2416,12 +2416,12 @@ dotrace(
         * bytes in this pkt.
         */

Added files:

Index: pkgsrc/net/tcptrace/patches/patch-compress.c
diff -u /dev/null pkgsrc/net/tcptrace/patches/patch-compress.c:1.1
--- /dev/null   Sat Dec 13 16:42:04 2025
+++ pkgsrc/net/tcptrace/patches/patch-compress.c        Sat Dec 13 16:42:03 2025
@@ -0,0 +1,44 @@
+$NetBSD: patch-compress.c,v 1.1 2025/12/13 16:42:03 vins Exp $
+
+--- compress.c.orig    2004-10-01 21:42:34.000000000 +0000
++++ compress.c
+@@ -61,6 +61,12 @@ static char const GCC_UNUSED rcsid[] =
+ 
+ #include "compress.h"
+ #include <sys/wait.h>
++#ifdef __linux__
++#include <stdio.h>
++#include <stdio_ext.h>
++#else
++#include <stdio.h>
++#endif
+ 
+ /*
+  * OK, this stuff is a little complicated.  Here's why:
+@@ -240,7 +246,11 @@ CompReopenFile(
+     /* erase the file buffer and reposition to the front */
+ #ifdef HAVE_FPURGE
+     /* needed for NetBSD and FreeBSD (at least) */
++# if defined(__linux__)
++    __fpurge(stdin);          /* discard input buffer */
++# else
+     fpurge(stdin);            /* discard input buffer */
++# endif
+ #else /* HAVE_FPURGE */
+     fflush(stdin);            /* discard input buffer */
+ #endif /* HAVE_FPURGE */
+@@ -598,8 +608,12 @@ PipeHelper(void)
+     // Now, we shall purge our old STDIN stream buffer, and point it to the
+     // read end of the pipe, fdpipe[0]
+     
+-#ifdef HAVE_FPURGE     
+-     fpurge(stdin); // needed for NetBSD/FreeBSD
++#ifdef HAVE_FPURGE
++# if defined(__linux__)
++    __fpurge(stdin);
++# else
++    fpurge(stdin);
++# endif
+ #else
+      fflush(stdin);
+ #endif
Index: pkgsrc/net/tcptrace/patches/patch-configure.in
diff -u /dev/null pkgsrc/net/tcptrace/patches/patch-configure.in:1.1
--- /dev/null   Sat Dec 13 16:42:04 2025
+++ pkgsrc/net/tcptrace/patches/patch-configure.in      Sat Dec 13 16:42:03 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-configure.in,v 1.1 2025/12/13 16:42:03 vins Exp $
+
+Fix AC test by including headers for strcmp(3) and exit(3).
+
+--- configure.in.orig  2002-06-21 09:56:26.000000000 +0000
++++ configure.in
+@@ -51,6 +51,8 @@ dnl If strcmp returns 0, we are on an en
+ dnl we are on a MacOSX environment that uses %qu
+ AC_TRY_RUN([
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ #define NIX "%llu"
+ 
Index: pkgsrc/net/tcptrace/patches/patch-mod__http.c
diff -u /dev/null pkgsrc/net/tcptrace/patches/patch-mod__http.c:1.1
--- /dev/null   Sat Dec 13 16:42:04 2025
+++ pkgsrc/net/tcptrace/patches/patch-mod__http.c       Sat Dec 13 16:42:03 2025
@@ -0,0 +1,13 @@
+$NetBSD: patch-mod__http.c,v 1.1 2025/12/13 16:42:03 vins Exp $
+
+--- mod_http.c.orig    2003-11-19 14:38:02.000000000 +0000
++++ mod_http.c
+@@ -919,7 +919,7 @@ static char * formatGetString(char * s) 
+     if (s[i] == '%') {
+       ascii[0] = s[i+1];
+       ascii[1] = s[i+2];
+-      buf[j++] = atoi(ascii);
++      buf[j++] = strtol(ascii, NULL, 16);
+       i = i+3;
+     } else {
+       buf[j++] = s[i];
Index: pkgsrc/net/tcptrace/patches/patch-tcptrace.c
diff -u /dev/null pkgsrc/net/tcptrace/patches/patch-tcptrace.c:1.1
--- /dev/null   Sat Dec 13 16:42:04 2025
+++ pkgsrc/net/tcptrace/patches/patch-tcptrace.c        Sat Dec 13 16:42:03 2025
@@ -0,0 +1,13 @@
+$NetBSD: patch-tcptrace.c,v 1.1 2025/12/13 16:42:03 vins Exp $
+
+--- tcptrace.c.orig    2004-10-01 21:42:34.000000000 +0000
++++ tcptrace.c
+@@ -639,7 +639,7 @@ Dump File Names\n\
+       char buf[256];          /* plenty large, but checked below with strncpy */
+       struct ext_var_op *pvop = &extended_vars[i];
+       strncpy(buf,pvop->var_optname,sizeof(buf)-10);
+-      strcat(buf,"=\"STR\"");
++      strncat(buf,"=\"STR\"", sizeof(buf));
+       fprintf(stderr,"  --%-20s %s (default: '%s')\n",
+               buf,
+               pvop->var_descr,
Index: pkgsrc/net/tcptrace/patches/patch-tcptrace.h
diff -u /dev/null pkgsrc/net/tcptrace/patches/patch-tcptrace.h:1.1
--- /dev/null   Sat Dec 13 16:42:04 2025
+++ pkgsrc/net/tcptrace/patches/patch-tcptrace.h        Sat Dec 13 16:42:03 2025
@@ -0,0 +1,13 @@
+$NetBSD: patch-tcptrace.h,v 1.1 2025/12/13 16:42:03 vins Exp $
+
+--- tcptrace.h.orig    2025-12-13 17:18:47.131561929 +0000
++++ tcptrace.h
+@@ -1115,7 +1115,7 @@ typedef int pread_f(struct timeval *, in
+ /* I've had problems with the memcpy function that gcc stuffs into the program
+    and alignment problems.  This should fix it! */
+ void *MemCpy(void *p1, void *p2, size_t n); /* in tcptrace.c */
+-#define memcpy(p1,p2,n) MemCpy(p1,p2,n)
++#define _memcpy(p1,p2,n) MemCpy(p1,p2,n)
+ #endif /* __VMS */
+ 
+ #ifdef __VMS



Home | Main Index | Thread Index | Old Index