summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2015-07-24 20:28:45 -0400
committerChris Severance2015-07-24 20:28:45 -0400
commitca5ad50cee4bd776cd50b083a41db223d7f9d009 (patch)
treead529a2c5e9e390b9b3eb668e8e9d3c654ecfe00
downloadaur-ca5ad50cee4bd776cd50b083a41db223d7f9d009.tar.gz
Initial import
-rw-r--r--.SRCINFO20
-rw-r--r--LICENSE20
-rw-r--r--PKGBUILD58
-rw-r--r--tcpslice-1.2a3-time.patch71
-rw-r--r--tcpslice-CVS.20010207-bpf.patch12
5 files changed, 181 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b0f12a86b39a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = tcpslice
+ pkgdesc = A tool for extracting portions of packet-trace files generated using tcpdump's -w flag.
+ pkgver = 1.2a3
+ pkgrel = 1
+ url = http://www.tcpdump.org/
+ arch = i686
+ arch = x86_64
+ license = BSD
+ depends = libpcap
+ source = ftp://ftp.ee.lbl.gov/tcpslice-1.2a3.tar.gz
+ source = tcpslice-CVS.20010207-bpf.patch
+ source = tcpslice-1.2a3-time.patch
+ source = LICENSE
+ sha256sums = 4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840
+ sha256sums = 51f10963a0e84bdaddce76cdcf52a833a348eaea1073c614c6a6c478967e058e
+ sha256sums = 8a4b60b0833e297958a166c28911259ad314ca5b0a2e0e3d8cb7d96a69914923
+ sha256sums = 6f4b64754b831217eee983f787d3b278ae7e73e4563c52bfe69cf7b07566f588
+
+pkgname = tcpslice
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..a7eba7d131fd
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+License: BSD
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ 3. The names of the authors may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..defca3b2242d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor : xav <xav at ethertricks dot net>
+
+set -u
+pkgname='tcpslice'
+pkgver='1.2a3'
+pkgrel='1'
+pkgdesc="A tool for extracting portions of packet-trace files generated using tcpdump's -w flag."
+arch=('i686' 'x86_64')
+url='http://www.tcpdump.org/'
+license=('BSD')
+depends=('libpcap')
+source=("ftp://ftp.ee.lbl.gov/${pkgname}-${pkgver}.tar.gz"
+ 'tcpslice-CVS.20010207-bpf.patch'
+ 'tcpslice-1.2a3-time.patch'
+ 'LICENSE')
+sha256sums=('4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840'
+ '51f10963a0e84bdaddce76cdcf52a833a348eaea1073c614c6a6c478967e058e'
+ '8a4b60b0833e297958a166c28911259ad314ca5b0a2e0e3d8cb7d96a69914923'
+ '6f4b64754b831217eee983f787d3b278ae7e73e4563c52bfe69cf7b07566f588')
+
+prepare() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ chmod 644 *.c *.h
+
+ patch < "${srcdir}/tcpslice-CVS.20010207-bpf.patch"
+ patch < "${srcdir}/tcpslice-1.2a3-time.patch"
+ sed -i -e 's/f301-\*)/f301-\* \| x86_64-\*)/' 'config.sub'
+
+ ./configure --sbindir='/usr/bin'
+ sed -i -e 's:^#include <stdio.h>$:&\n#include <stdlib.h>:g' 'util.c'
+ set +u
+}
+
+build() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make -s # -j $(nproc) # too small to need this
+ set +u
+}
+
+package() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ install -Dpm755 'tcpslice' "${pkgdir}/usr/bin/tcpslice"
+ install -Dpm544 'tcpslice.1' "${pkgdir}/usr/share/man/man1/tcpslice.1"
+
+ install -Dpm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+
+ # Ensure there are no forbidden paths (git-aurcheck)
+ ! grep -alqr "/sbin" "${pkgdir}" || echo "${}"
+ ! grep -alqr "/usr/tmp" "${pkgdir}" || echo "${}"
+ ! test -d "${pkgdir}/usr/sbin" || echo "${}"
+ set +u
+}
+
+set +u
diff --git a/tcpslice-1.2a3-time.patch b/tcpslice-1.2a3-time.patch
new file mode 100644
index 000000000000..c59448d23627
--- /dev/null
+++ b/tcpslice-1.2a3-time.patch
@@ -0,0 +1,71 @@
+--- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200
++++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200
+@@ -53,7 +53,7 @@
+ /* Size of a packet header in bytes; easier than typing the sizeof() all
+ * the time ...
+ */
+-#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr ))
++#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr ))
+
+ extern int snaplen;
+
+@@ -111,16 +111,24 @@
+ static void
+ extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr )
+ {
+- memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr));
++ struct pcap_sf_pkthdr hdri;
++
++ memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr));
+
+ if ( pcap_is_swapped( p ) )
+ {
+- hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec);
+- hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec);
+- hdr->len = SWAPLONG(hdr->len);
+- hdr->caplen = SWAPLONG(hdr->caplen);
++ hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec);
++ hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec);
++ hdr->len = SWAPLONG(hdri.len);
++ hdr->caplen = SWAPLONG(hdri.caplen);
++ }
++ else
++ {
++ hdr->ts.tv_sec = hdri.ts.tv_sec;
++ hdr->ts.tv_usec = hdri.ts.tv_usec;
++ hdr->len = hdri.len;
++ hdr->caplen = hdri.caplen;
+ }
+-
+ /*
+ * From bpf/libpcap/savefile.c:
+ *
+--- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100
++++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200
+@@ -20,6 +20,26 @@
+ */
+
+
++#include <time.h>
++/* #include <net/bpf.h> */
++
++/*
++ * This is a timeval as stored in disk in a dumpfile.
++ * It has to use the same types everywhere, independent of the actual
++ * `struct timeval'
++ */
++
++struct pcap_timeval {
++ bpf_int32 tv_sec; /* seconds */
++ bpf_int32 tv_usec; /* microseconds */
++};
++
++struct pcap_sf_pkthdr {
++ struct pcap_timeval ts; /* time stamp */
++ bpf_u_int32 caplen; /* length of portion present */
++ bpf_u_int32 len; /* length this packet (off wire) */
++};
++
+ time_t gwtm2secs( struct tm *tm );
+
+ int sf_find_end( struct pcap *p, struct timeval *first_timestamp,
diff --git a/tcpslice-CVS.20010207-bpf.patch b/tcpslice-CVS.20010207-bpf.patch
new file mode 100644
index 000000000000..8aaad3b20a52
--- /dev/null
+++ b/tcpslice-CVS.20010207-bpf.patch
@@ -0,0 +1,12 @@
+diff -ur tcpdump-3.8.1/tcpslice/tcpslice.c tcpdump-3.8.1.new/tcpslice/tcpslice.c
+--- tcpslice/tcpslice.c 2004-01-15 17:35:53.000000000 +0100
++++ tcpslice/tcpslice.c 2004-01-15 16:12:57.000000000 +0100
+@@ -35,7 +35,7 @@
+ #include <sys/file.h>
+ #include <sys/stat.h>
+
+-#include <net/bpf.h>
++/* #include <net/bpf.h> */
+
+ #include <ctype.h>
+ #ifdef HAVE_FCNTL_H