[arch-commits] Commit in tcptrace/repos (3 files)

Felix Yan felixonmars at archlinux.org
Tue Jul 7 18:03:17 UTC 2020


    Date: Tuesday, July 7, 2020 @ 18:03:17
  Author: felixonmars
Revision: 659957

archrelease: copy trunk to community-staging-x86_64

Added:
  tcptrace/repos/community-staging-x86_64/
  tcptrace/repos/community-staging-x86_64/PKGBUILD
    (from rev 659956, tcptrace/trunk/PKGBUILD)
  tcptrace/repos/community-staging-x86_64/tcptrace-6.6.7_no_pcap_offline_read.patch
    (from rev 659956, tcptrace/trunk/tcptrace-6.6.7_no_pcap_offline_read.patch)

-------------------------------------------+
 PKGBUILD                                  |   43 ++++++++++++++++++++++++++++
 tcptrace-6.6.7_no_pcap_offline_read.patch |   38 ++++++++++++++++++++++++
 2 files changed, 81 insertions(+)

Copied: tcptrace/repos/community-staging-x86_64/PKGBUILD (from rev 659956, tcptrace/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2020-07-07 18:03:17 UTC (rev 659957)
@@ -0,0 +1,43 @@
+# Maintainer: Baptiste Jonglez <baptiste--aur at jonglez dot org>
+# Contributor: Heath Caldwell <mrbrobro at ftml dot net>
+# Contributor: Jan-Erik Rediger <badboy at archlinux dot us>
+
+pkgname=tcptrace
+pkgver=6.6.7
+pkgrel=6
+pkgdesc="A TCP dump file analysis tool"
+arch=('x86_64')
+url="http://tcptrace.org/"
+license=('GPL')
+depends=('libpcap')
+optdepends=(
+  'tcpdump: for generating dumps'
+  'gnuplot: for plotting graphs'
+  'xplot: for plotting graphs'
+)
+source=("http://tcptrace.org/download/$pkgname-$pkgver.tar.gz"
+        "${pkgname}-${pkgver}_no_pcap_offline_read.patch")
+md5sums=('68128dc1817b866475e2f048e158f5b9'
+         'a2d757088f9a1d3d6dd102d569c76926')
+
+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  patch -p1 -i "${srcdir}/${pkgname}-${pkgver}_no_pcap_offline_read.patch"
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  ./configure --prefix=/usr --mandir=/usr/share/man
+  sed -e "s|BINDIR = /usr/local/bin|BINDIR = ${pkgdir}/usr/bin|" -e "s|MANDIR = /usr/local/man/|MANDIR = ${pkgdir}/usr/share/man|" -i Makefile
+  sed -e "s|-o bin -g bin| -o root -g root|" -i Makefile
+  make
+}
+
+package(){
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  make install
+  install -Dm755 "${srcdir}/${pkgname}-${pkgver}/xpl2gpl" \
+    "${pkgdir}/usr/bin/xpl2gpl"
+}

Copied: tcptrace/repos/community-staging-x86_64/tcptrace-6.6.7_no_pcap_offline_read.patch (from rev 659956, tcptrace/trunk/tcptrace-6.6.7_no_pcap_offline_read.patch)
===================================================================
--- community-staging-x86_64/tcptrace-6.6.7_no_pcap_offline_read.patch	                        (rev 0)
+++ community-staging-x86_64/tcptrace-6.6.7_no_pcap_offline_read.patch	2020-07-07 18:03:17 UTC (rev 659957)
@@ -0,0 +1,38 @@
+diff -rpU3 -x flex_bison tcptrace-6.6.7/tcpdump.c tcptrace-6.6.7_libpcapfix/tcpdump.c
+--- tcptrace-6.6.7/tcpdump.c	2004-10-07 13:07:30.000000000 -0700
++++ tcptrace-6.6.7_libpcapfix/tcpdump.c	2017-03-02 10:00:58.923356327 -0800
+@@ -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;
+ 
+@@ -246,9 +243,12 @@ pread_tcpdump(
+     void		**pplast)
+ {
+     int ret;
++    struct pcap_pkthdr *pkt_header;
++    const u_char *pkt_data;
+ 
+     while (1) {
+-	if ((ret = pcap_offline_read(pcap,1,(pcap_handler)callback,0)) != 1) {
++	ret = pcap_next_ex(pcap, &pkt_header, &pkt_data);
++	if (ret != 1) {
+ 	    /* prob EOF */
+ 
+ 	    if (ret == -1) {
+@@ -263,6 +263,10 @@ pread_tcpdump(
+ 	    return(0);
+ 	}
+ 
++	if (callback(0, pkt_header, (char *)pkt_data)) {
++		continue;
++	}
++
+ 	/* at least one tcpdump implementation (AIX) seems to be */
+ 	/* storing NANOseconds in the usecs field of the timestamp. */
+ 	/* This confuses EVERYTHING.  Try to compensate. */


More information about the arch-commits mailing list