[packages/tcpflow] - up to 1.5.0; use debian complete tarball

arekm arekm at pld-linux.org
Tue Sep 18 13:00:34 CEST 2018


commit 6d21e29fbac3e26bcc71a73ee7c3e2d758231731
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Sep 18 13:00:26 2018 +0200

    - up to 1.5.0; use debian complete tarball

 0001-tcpflow-b-0-now-works.patch                   | 87 ----------------------
 ...ebian-package-of-libhttp-parser-instead-o.patch | 22 +++---
 packing-struct-tcphdr-to-improve-portability.patch | 23 ------
 tcpflow.spec                                       | 17 ++---
 4 files changed, 19 insertions(+), 130 deletions(-)
---
diff --git a/tcpflow.spec b/tcpflow.spec
index 7f132fe..fda7212 100644
--- a/tcpflow.spec
+++ b/tcpflow.spec
@@ -5,15 +5,13 @@
 Summary:	TCP Flow Recorder
 Summary(pl.UTF-8):	Program zapisujący ruch TCP
 Name:		tcpflow
-Version:	1.4.5
-Release:	4
+Version:	1.5.0
+Release:	1
 License:	GPL v3
 Group:		Applications/Networking
-Source0:	http://www.digitalcorpora.org/downloads/tcpflow/%{name}-%{version}.tar.gz
-# Source0-md5:	5978b112a899f2099e98cef6d9a0ece9
+Source0:	http://ftp.debian.org/debian/pool/main/t/tcpflow/%{name}_%{version}+repack1.orig.tar.gz
+# Source0-md5:	73859cd7b5f10ac7d7299c4bdb35d13b
 Patch0:		0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
-Patch1:		0001-tcpflow-b-0-now-works.patch
-Patch2:		packing-struct-tcphdr-to-improve-portability.patch
 URL:		https://github.com/simsong/tcpflow
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -25,6 +23,7 @@ BuildRequires:	expat-devel
 BuildRequires:	fontconfig-devel
 BuildRequires:	freetype-devel
 BuildRequires:	http-parser-devel
+BuildRequires:	libcap-ng-devel
 BuildRequires:	libmd-devel
 BuildRequires:	libpcap-devel
 #BuildRequires:	libregex-devel
@@ -49,10 +48,8 @@ protokołu - tworząc dwa pliki z danymi na każde przechwycone
 połączenie.
 
 %prep
-%setup -q
+%setup -q -n %{name}
 %patch0 -p1
-%patch1 -p1
-%patch2 -p1
 
 %build
 %{__aclocal} -I m4
@@ -75,6 +72,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog NEWS README TODO.txt
+%doc AUTHORS ChangeLog NEWS README.md TODO.txt
 %attr(755,root,root) %{_bindir}/tcpflow
 %{_mandir}/man1/tcpflow.1*
diff --git a/0001-tcpflow-b-0-now-works.patch b/0001-tcpflow-b-0-now-works.patch
deleted file mode 100644
index c50c42a..0000000
--- a/0001-tcpflow-b-0-now-works.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 7c32381b6548e407fc3d0f3a63ccf1b6b12dadfd Mon Sep 17 00:00:00 2001
-From: Dima Kogan <dima at secretsauce.net>
-Date: Thu, 5 Mar 2015 15:01:07 -0800
-Subject: [PATCH] 'tcpflow -b 0' now works
-Forwarded: https://github.com/simsong/tcpflow/issues/95
-
-This creates length-0 flow files that act as binary success/failure indicators
----
- src/tcpdemux.h |  4 ++--
- src/tcpip.cpp  | 22 +++++++++++++---------
- 2 files changed, 15 insertions(+), 11 deletions(-)
-
-diff --git a/src/tcpdemux.h b/src/tcpdemux.h
-index 858c50b..09c5970 100644
---- a/src/tcpdemux.h
-+++ b/src/tcpdemux.h
-@@ -91,7 +91,7 @@ public:
-         options():console_output(false),console_output_nonewline(false),
-                   store_output(true),opt_md5(false),
-                   post_processing(false),gzip_decompress(true),
--                  max_bytes_per_flow(),
-+                  max_bytes_per_flow(-1),
-                   max_flows(0),suppress_header(0),
-                   output_strip_nonprint(true),output_hex(false),use_color(0),
-                   output_packet_index(false),max_seek(MAX_SEEK) {
-@@ -102,7 +102,7 @@ public:
-         bool    opt_md5;                // do we calculate MD5 on DFXML output?
-         bool    post_processing;        // decode headers after tcp connection closes
-         bool    gzip_decompress;
--        uint64_t max_bytes_per_flow;
-+        int64_t  max_bytes_per_flow;
-         uint32_t max_flows;
-         bool    suppress_header;
-         bool    output_strip_nonprint;
-diff --git a/src/tcpip.cpp b/src/tcpip.cpp
-index 70d9ef5..754230b 100644
---- a/src/tcpip.cpp
-+++ b/src/tcpip.cpp
-@@ -236,10 +236,12 @@ void tcpip::print_packet(const u_char *data, uint32_t length)
-     /* green, blue, read */
-     const char *color[3] = { "\033[0;32m", "\033[0;34m", "\033[0;31m" };
- 
--    if(demux.opt.max_bytes_per_flow>0){
--	if(last_byte > demux.opt.max_bytes_per_flow) return; /* too much has been printed */
--	if(length > demux.opt.max_bytes_per_flow - last_byte){
--	    length = demux.opt.max_bytes_per_flow - last_byte; /* can only output this much */
-+    if(demux.opt.max_bytes_per_flow>=0){
-+        uint64_t max_bytes_per_flow = (uint64_t)demux.opt.max_bytes_per_flow;
-+
-+	if(last_byte > max_bytes_per_flow) return; /* too much has been printed */
-+	if(length > max_bytes_per_flow - last_byte){
-+	    length = max_bytes_per_flow - last_byte; /* can only output this much */
- 	    if(length==0) return;
- 	}
-     }
-@@ -419,13 +421,15 @@ void tcpip::store_packet(const u_char *data, uint32_t length, int32_t delta,stru
-      * but remember to seek out to the actual position after the truncated write...
-      */
-     uint32_t wlength = length;		// length to write
--    if (demux.opt.max_bytes_per_flow){
--	if(offset >= demux.opt.max_bytes_per_flow){
-+    if (demux.opt.max_bytes_per_flow >= 0){
-+        uint64_t max_bytes_per_flow = (uint64_t)demux.opt.max_bytes_per_flow;
-+
-+	if(offset >= max_bytes_per_flow){
- 	    wlength = 0;
- 	} 
--	if(offset < demux.opt.max_bytes_per_flow &&  offset+length > demux.opt.max_bytes_per_flow){
-+	if(offset < max_bytes_per_flow &&  offset+length > max_bytes_per_flow){
- 	    DEBUG(2) ("packet truncated by max_bytes_per_flow on %s", flow_pathname.c_str());
--	    wlength = demux.opt.max_bytes_per_flow - offset;
-+	    wlength = max_bytes_per_flow - offset;
- 	}
-     }
- 
-@@ -434,7 +438,7 @@ void tcpip::store_packet(const u_char *data, uint32_t length, int32_t delta,stru
-      * save the return value because open_tcpfile() puts the file pointer
-      * into the structure for us.
-      */
--    if (fd < 0 && wlength>0) {
-+    if (fd < 0) {
- 	if (open_file()) {
- 	    DEBUG(1)("unable to open TCP file %s  fd=%d  wlength=%d",
-                      flow_pathname.c_str(),fd,(int)wlength);
--- 
-2.1.4
-
diff --git a/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch b/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
index 1e07ae3..51b5594 100644
--- a/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
+++ b/0001-using-the-debian-package-of-libhttp-parser-instead-o.patch
@@ -8,12 +8,12 @@ Forwarded: not needed
  src/scan_http.cpp |  2 +-
  2 files changed, 3 insertions(+), 9 deletions(-)
 
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 67a6fa4..a80fc09 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -75,18 +75,12 @@ tcpflow_SOURCES = \
- 	scan_wifiviz.cpp \
+Index: tcpflow/src/Makefile.am
+===================================================================
+--- tcpflow.orig/src/Makefile.am
++++ tcpflow/src/Makefile.am
+@@ -90,20 +90,14 @@ tcpflow_SOURCES = \
+ 	scan_netviz.cpp \
  	pcap_writer.h \
  	iptree.h \
 -	http-parser/http_parser.c \
@@ -24,6 +24,8 @@ index 67a6fa4..a80fc09 100644
 +tcpflow_LDADD = -lhttp_parser
 +
  EXTRA_DIST =\
+ 	inet_ntop.c \
+ 	inet_ntop.h \
 -	http-parser/AUTHORS \
 -	http-parser/CONTRIBUTIONS \
 -	http-parser/LICENSE-MIT \
@@ -33,10 +35,10 @@ index 67a6fa4..a80fc09 100644
  	wifipcap/README.txt \
  	wifipcap/TimeVal.cpp \
  	wifipcap/TimeVal.h \
-diff --git a/src/scan_http.cpp b/src/scan_http.cpp
-index 78abb98..2460694 100644
---- a/src/scan_http.cpp
-+++ b/src/scan_http.cpp
+Index: tcpflow/src/scan_http.cpp
+===================================================================
+--- tcpflow.orig/src/scan_http.cpp
++++ tcpflow/src/scan_http.cpp
 @@ -11,7 +11,7 @@
  #include "tcpip.h"
  #include "tcpdemux.h"
diff --git a/packing-struct-tcphdr-to-improve-portability.patch b/packing-struct-tcphdr-to-improve-portability.patch
deleted file mode 100644
index c1af8b3..0000000
--- a/packing-struct-tcphdr-to-improve-portability.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Dima Kogan <dima at secretsauce.net>
-Date: Sun, 12 Jan 2014 23:58:39 -0800
-Subject: packing struct tcphdr to improve portability
-Forwarded: https://github.com/simsong/tcpflow/issues/67
-
-I was seeing build failures on arm and sparc. These were happening because of
-unaligned loads of struct tcphdr. I now declare this structure as packed, so
-this does not happen
-
-
-Index: tcpflow/src/be13_api/bulk_extractor_i.h
-===================================================================
---- tcpflow.orig/src/be13_api/bulk_extractor_i.h
-+++ tcpflow/src/be13_api/bulk_extractor_i.h
-@@ -278,7 +278,7 @@ namespace be13 {
-     uint16_t th_win;            /* window */
-     uint16_t th_sum;            /* checksum */
-     uint16_t th_urp;            /* urgent pointer */
--};
-+} __attribute__((packed));
- /*
-  * The packet_info structure records packets after they are read from the pcap library.
-  * It preserves the original pcap information and information decoded from the MAC and
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tcpflow.git/commitdiff/6d21e29fbac3e26bcc71a73ee7c3e2d758231731



More information about the pld-cvs-commit mailing list