From 2a4dc098e0c5cbda62fa4182f06bdbade1c4eb4c Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sun, 19 Feb 2012 14:29:43 +0100 Subject: [PATCH] contrib: removed deprecated, unmaintained and rather unrelated stuff --- contrib/bench/trafgen_mz.pdf | Bin 11255 -> 0 bytes contrib/bench/trafgen_mz.txt | 14 - contrib/debian/changelog | 62 ---- contrib/debian/compat | 1 - contrib/debian/control | 29 -- contrib/debian/copyright | 17 - contrib/debian/docs | 14 - contrib/debian/rules | 50 --- contrib/debian/source/format | 1 - contrib/debian/source/include-binaries | 1 - contrib/debian/watch | 3 - contrib/misc/denyhosts.pl | 37 -- contrib/misc/pcapfs.c | 538 ---------------------------- contrib/patches/trafgen-multithreaded.patch | 389 -------------------- 14 files changed, 1156 deletions(-) delete mode 100644 contrib/bench/trafgen_mz.pdf delete mode 100644 contrib/bench/trafgen_mz.txt delete mode 100644 contrib/debian/changelog delete mode 100644 contrib/debian/compat delete mode 100644 contrib/debian/control delete mode 100644 contrib/debian/copyright delete mode 100644 contrib/debian/docs delete mode 100755 contrib/debian/rules delete mode 100644 contrib/debian/source/format delete mode 100644 contrib/debian/source/include-binaries delete mode 100644 contrib/debian/watch delete mode 100755 contrib/misc/denyhosts.pl delete mode 100644 contrib/misc/pcapfs.c delete mode 100644 contrib/patches/trafgen-multithreaded.patch diff --git a/contrib/bench/trafgen_mz.pdf b/contrib/bench/trafgen_mz.pdf deleted file mode 100644 index f0e2fb67c3b9d034c158d98e3100af02691bb65b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcwPel00001 literal 11255 zcwUuy1yo$i(r$nRf(8k}!{8QR1|1~0ySokUI=DLoCqQrs?hq^xBxrDV2@>2jI6O%1 zIrrR~|Go9US+n;{e^p(*`>XD*y;c>4oRA1Th=CP}qGqq`8i^SI1lZ`CBXM&B7^RG? zO`xU#mIp`y2><{vikMkKjqD$OEg?`NAtM7DLn9;}9wY~-y%EF;$t879qsN+%9lhyX z^$;Owz4=K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zi%;})5fOX&1w}$P%l>`aY)6NNd6BQlNQ7?IQR-WDI@_l%{d7Ofao-P%Ibn+{O|{7# z%r#Y?Sa8LL2p(mDcz8g zLuB%`*NK9SZ~X9j2QtM3la(K!o8-5oii>{p4(quWg-Y}xUEGT5g*Ib`zw}CEM=E}s4T`WMki!s4pDJbgjhTLEf;}UnOV95sDFz9k20Fy zLQ9B=1AygkMSX?hTl2?(HP0kHx=Y+xV&1Y-LuQ7sOISehB|Tbo!K0f4^{eg}ic zL^lT$_*e7s@gCdsOw6pmQ`-<*F(We*Q|K=`U?>h7kUIA#Z12>0uTqIU-|t13p)=T6kQ!2o(7fQ^~$&+CDHF!OKOf9O1{7nTQ8Y!8&MF*5^LAAH5Z&H`X! zX9qBIJYp;lb{}vS4gf1V$M5#z_0Wfv>ERd524LlQ=+6NLFtaiNI3AqK&i*f*2YZi~ zw)Q`$XZ>F=|A+(sSCk7|KO9GoEHeJZBE8r@R*oU$VFlPcmO^L(e)(MC_rg=MQMNXF zJjehX|GhH)$0Cg1gGrhhJ{o$g(@^-k)WY$xF5{mD{#mdo_^>k{eMM~mF|)S;fEYkP z1|Wdi6biNFWMupWn%F~ZP0b7(7;NlKXnt=bIeQyJM+2k(pKkvcpXHAk2tpqAnT^SB z+mEyPS0Ty2JGs~!86!PxO;#k}-yZ-QD=RZAz!>lw0|D8X9vJ*3vHlkZ1aUC`fjywC zf9e4_{tE*ES=gBWTaO9I0{R1E`V-?|27>>@nE%vc=lBx?KT`A`7zhXi|B11I+5f=6 z|C}4t9`bOy*#BZ$(ag>0k-tZd6>MxC*2KT7bRUlc0Eqc7&K;l-d+0C5AMCM#ktisH IWkrzw4 traffic generator -Machine 2: -> measurement with ifpps, http://netsniff-ng.org - diff --git a/contrib/debian/changelog b/contrib/debian/changelog deleted file mode 100644 index 25381d4c..00000000 --- a/contrib/debian/changelog +++ /dev/null @@ -1,62 +0,0 @@ -netsniff-ng (0.5.5.0-2) unstable; urgency=low - - * Upload to unstable - * debian/control: - + Added armhf support, closes wishlist bug. Closes: #604540 - + Excluded non-linux systems in architectures - + Added Kartik as Uploader - - -- Daniel Borkmann Mon, 07 Feb 2011 16:26:17 +0200 - -netsniff-ng (0.5.5.0-1) unstable; urgency=low - - * New upstream release - * debian/control: - + Updated to new standards version 3.9.1 - + Updated description - * debian/watch: - + Updated URL to public directory of netsniff-ngs website - * Switch to dpkg-source 3.0 (quilt) format - - -- Daniel Borkmann Sun, 10 Oct 2010 12:57:11 +0200 - -netsniff-ng (0.5.4.2-1) unstable; urgency=low - - * Another minor upstream release with fixes within the ring traversal - method (packet look-ahead on the receive ring) and some basic BPF - filter check. - * Changed installation path from /sbin into /usr/sbin - * debian/control: - + Updated to new standards version 3.8.4 - + Added ${misc:Depends} in order to fix the 'debhelper-but-no-misc-depends' - warning - - -- Daniel Borkmann Sun, 14 Feb 2010 13:58:40 +0200 - -netsniff-ng (0.5.4.1-1) unstable; urgency=medium - - * New (minor) upstream release with security fix in netsniff-ng.c: - A memset with a 4 Byte length overhead on 32-Bit systems could - run into a possible buffer overflow. Relevant sections have been fixed. - * debian/control: - + Changed architecture, because netsniff-ng is not written for - non-linux archs as kfreebsd-* - - -- Daniel Borkmann Sat, 02 Jan 2010 11:18:03 +0200 - -netsniff-ng (0.5.4.0-1) unstable; urgency=low - - * New upstream release - * debian/control: - + Corrected package description - * debian/watchfile: - + Changed URL to watch for, because the googlecode site denies access, - mirrored tarball archive at htwk-leipzig.de - - -- Daniel Borkmann Fri, 01 Jan 2010 19:07:23 +0200 - -netsniff-ng (0.5.3.1-1) unstable; urgency=low - - * Initial release for Debian, closes ITP bug. Closes: #561528 - - -- Daniel Borkmann Thu, 17 Dec 2009 22:55:51 +0200 diff --git a/contrib/debian/compat b/contrib/debian/compat deleted file mode 100644 index 7f8f011e..00000000 --- a/contrib/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/contrib/debian/control b/contrib/debian/control deleted file mode 100644 index 03488752..00000000 --- a/contrib/debian/control +++ /dev/null @@ -1,29 +0,0 @@ -Source: netsniff-ng -Section: net -Priority: optional -Maintainer: Daniel Borkmann -Uploaders: Kartik Mistry -Standards-Version: 3.9.1 -Build-Depends: debhelper (>= 7), cmake, flex, bison, libgeoip-dev, - libnetfilter-conntrack-dev, liburcu-dev, libncurses5-dev, -Homepage: http://www.netsniff-ng.org/ - -Package: netsniff-ng -Architecture: linux-any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: the packet sniffing beast (toolkit) - netsniff-ng is a free, performant Linux networking toolkit. - . - The gain of performance is reached by zero-copy mechanisms, so that on packet - reception and transmission the kernel does not need to copy packets from - kernel space to user space and vice versa. - . - The netsniff-ng toolkit consists of the following utilities: - . - * netsniff-ng, a zero-copy analyzer, pcap capturer and replayer - * trafgen, a high-performance zero-copy network traffic generator - * bpfc, a Berkeley Packet Filter compiler supporting Linux extensions - * ifpps, a top-like kernel networking and system statistics tool - * flowtop, a top-like netfilter connection tracking tool - * curvetun, a lightweight multiuser IP tunnel based on elliptic curve crypto - * ashunt, an Autonomous System (AS) trace route and ISP testing utility diff --git a/contrib/debian/copyright b/contrib/debian/copyright deleted file mode 100644 index 41f7e8c5..00000000 --- a/contrib/debian/copyright +++ /dev/null @@ -1,17 +0,0 @@ -Format-Specification: http://dep.debian.net/deps/dep5/ -Source: http://pub.netsniff-ng.org/netsniff-ng/ - -Files: * -Copyright: (C) 2009-2012 Daniel Borkmann and Emmanuel Roullit -License: GPL-2 - You can redistribute this software and/or modify it under the terms of - the GNU General Public License as published by the Free Software - Foundation; version 2 dated June, 1991. - . - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - . - On Debian systems, the complete text of the GNU General Public License - can be found in /usr/share/common-licenses/GPL-2 file. diff --git a/contrib/debian/docs b/contrib/debian/docs deleted file mode 100644 index 70000e57..00000000 --- a/contrib/debian/docs +++ /dev/null @@ -1,14 +0,0 @@ -AUTHORS -CHANGELOG -CODING -COPYING -HACKING -INSTALL -MAINTAINER -MIRRORS -README -README.curvetun -REPORTING-BUGS -THANKS -TODO -VERSION diff --git a/contrib/debian/rules b/contrib/debian/rules deleted file mode 100755 index a1e643c2..00000000 --- a/contrib/debian/rules +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/make -f -# -# debian/rules for netsniff-ng -# by Daniel Borkmann - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -build: build-stamp -build-stamp: - dh_testdir - cd src; $(MAKE) DESTDIR=$(CURDIR)/debian/netsniff-ng all - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - cd src; $(MAKE) clean - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - cd src; $(MAKE) install DESTDIR=$(CURDIR)/debian/netsniff-ng - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples - dh_installchangelogs - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-arch binary-indep -.PHONY: build clean binary-indep binary-arch binary install diff --git a/contrib/debian/source/format b/contrib/debian/source/format deleted file mode 100644 index 163aaf8d..00000000 --- a/contrib/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/contrib/debian/source/include-binaries b/contrib/debian/source/include-binaries deleted file mode 100644 index 915e89b9..00000000 --- a/contrib/debian/source/include-binaries +++ /dev/null @@ -1 +0,0 @@ -src/logo.png diff --git a/contrib/debian/watch b/contrib/debian/watch deleted file mode 100644 index 4b089a55..00000000 --- a/contrib/debian/watch +++ /dev/null @@ -1,3 +0,0 @@ -version=3 -opts=dversionmangle=s/~// \ - http://www.netsniff-ng.org/pub/netsniff-ng/netsniff-ng-(.*)\.tar\.gz diff --git a/contrib/misc/denyhosts.pl b/contrib/misc/denyhosts.pl deleted file mode 100755 index 790f655d..00000000 --- a/contrib/misc/denyhosts.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/perl - -# -# A tiny Perl hack that makes a country statistic of your /etc/hosts.deny -# Copyright 2011 Daniel Borkmann -# Subject to the GNU GPL, version 2. -# Debian Dep: libgeo-ip-perl -# - -use warnings; -use strict; -use Geo::IP; - -my %ht; -my $db = Geo::IP->new(GEOIP_MEMORY_CACHE); -open IN, "<", "/etc/hosts.deny" or die $!; -while () { - my $country; - next if (/^\s*#/); - next if (/^\s+$/); - if (/^\s*\S+:\s*([0-9\.]+)\s*$/) { - $country = $db->country_name_by_addr($1); - if (defined($country)) { - $ht{$country}++; - } - } elsif (/^\s*\S+:\s*(\S+)\s*$/) { - $country = $db->country_name_by_name($1); - if (defined($country)) { - $ht{$country}++; - } - } -} -close IN; -foreach (keys(%ht)) { - print "$_: $ht{$_}\n"; -} - diff --git a/contrib/misc/pcapfs.c b/contrib/misc/pcapfs.c deleted file mode 100644 index 94fc29d6..00000000 --- a/contrib/misc/pcapfs.c +++ /dev/null @@ -1,538 +0,0 @@ -/* - * A read/write filesystem for (large) Pcap files - * By Daniel Borkmann, - * GPL, version 2.0 - * - * gcc -Wall `pkg-config fuse --cflags --libs` pcapfs.c -o pcapfs - * - * Usage: - * pcapfs - * hexdump -C /0.hex - * ls -la /0.hex - * vim /0.hex - * hit escape and type: - * :%!xxd to switch into hex mode - * when done hit escape and type: - * :%!xxd -r to exit from hex mode - * fusermount -u - */ - -#define _FILE_OFFSET_BITS 64 -#define FUSE_USE_VERSION 26 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TCPDUMP_MAGIC 0xa1b2c3d4 -#define PCAP_VERSION_MAJOR 2 -#define PCAP_VERSION_MINOR 4 - -struct pcap_filehdr { - uint32_t magic; - uint16_t version_major; - uint16_t version_minor; - int32_t thiszone; - uint32_t sigfigs; - uint32_t snaplen; - uint32_t linktype; -}; - -struct pcap_timeval { - int32_t tv_sec; - int32_t tv_usec; -}; - -struct pcap_pkthdr { - struct pcap_timeval ts; - uint32_t caplen; - uint32_t len; -}; - -enum { - PCAP_NONE, - PCAP_ROOT, - PCAP_FILE, -}; - -struct pcap_fnode { - struct pcap_pkthdr meta; - off_t data; - int dirty; - uint8_t *cowbuff; - size_t cowlen; -}; - -static int pcap_fd; - -static char *pcap_disc = NULL; - -static struct pcap_fnode *table = NULL; - -static size_t table_len = 0, table_next = 0; - -static sig_atomic_t flushing = 0, rwing = 0; - -static void pcapfs_flush_dirty_nodes_to_disc(void); - -static void *xmalloc(size_t len) -{ - void *ptr = malloc(len); - if (!ptr) { - syslog(LOG_ERR, "no mem left! panic!\n"); - exit(1); - } - return ptr; -} - -static void *xrealloc(void *ptr, size_t nlen) -{ - void *nptr = realloc(ptr, nlen); - if (!nptr) { - syslog(LOG_ERR, "no mem left! panic!\n"); - exit(1); - } - return nptr; -} - -static int pcapfs_file_type(const char *path, size_t *node) -{ - int ret; - if (strcmp(path, "/") == 0) - return PCAP_ROOT; - ret = sscanf(path, "/%zu.hex", node); - if (ret <= 0) - return PCAP_NONE; - if (*node >= table_next) - return PCAP_NONE; - return PCAP_FILE; -} - -static int pcapfs_getattr(const char *path, struct stat *stbuf) -{ - size_t node; - stbuf->st_uid = getuid(); - stbuf->st_gid = getgid(); - switch (pcapfs_file_type(path, &node)) { - case PCAP_ROOT: - stbuf->st_mode = S_IFDIR | 0755; - stbuf->st_nlink = 2; - stbuf->st_atime = stbuf->st_mtime = time(NULL); - break; - case PCAP_FILE: - stbuf->st_mode = S_IFREG | 0644; - stbuf->st_nlink = 1; - if (table[node].dirty) - stbuf->st_size = table[node].cowlen; - else - stbuf->st_size = table[node].meta.caplen; - stbuf->st_atime = stbuf->st_mtime = table[node].meta.ts.tv_sec; - break; - case PCAP_NONE: - default: - return -ENOENT; - } - return 0; -} - -static int pcapfs_open(const char *path, struct fuse_file_info *fi) -{ - size_t node; - (void) fi; - if (pcapfs_file_type(path, &node) != PCAP_NONE) - return 0; - return -ENOENT; -} - -static int pcapfs_read(const char *path, char *buff, size_t size, - off_t offset, struct fuse_file_info *fi) -{ - size_t node; - ssize_t ret = 0; - (void) fi; - if (pcapfs_file_type(path, &node) != PCAP_FILE) - return -EINVAL; - while (flushing) - sleep(0); - rwing = 1; - if (!table[node].dirty) { - if (offset >= table[node].meta.caplen) - goto out; - if (size > table[node].meta.caplen - offset) - size = table[node].meta.caplen - offset; - lseek(pcap_fd, table[node].data + offset, SEEK_SET); - ret = read(pcap_fd, buff, size); - } else { - if (offset >= table[node].cowlen) - goto out; - if (size > table[node].cowlen - offset) - size = table[node].cowlen - offset; - memcpy(buff, table[node].cowbuff + offset, size); - ret = size; - } -out: - rwing = 0; - return ret; -} - -static int pcapfs_truncate(const char *path, off_t size) -{ - size_t node; - if (pcapfs_file_type(path, &node) != PCAP_FILE) - return -EINVAL; - return size; -} - -static int pcapfs_write(const char *path, const char *buff, size_t size, - off_t offset, struct fuse_file_info *fi) -{ - size_t node; - ssize_t ret; - (void) fi; - if (pcapfs_file_type(path, &node) != PCAP_FILE) - return -EINVAL; - while (flushing) - sleep(0); - rwing = 1; - if (!table[node].dirty) { - table[node].dirty = 1; - table[node].cowlen = table[node].meta.caplen; - table[node].cowbuff = xmalloc(table[node].cowlen); - lseek(pcap_fd, table[node].data, SEEK_SET); - ret = read(pcap_fd, table[node].cowbuff, table[node].cowlen); - if (ret != table[node].cowlen) { - syslog(LOG_ERR, "error writing into cow buff of" - " %s!\n", path); - table[node].dirty = 0; - table[node].cowlen = 0; - free(table[node].cowbuff); - table[node].cowbuff = NULL; - rwing = 0; - return -EIO; - } - } - if (table[node].cowlen < size + offset) { - table[node].cowlen = size + offset; - table[node].cowbuff = xrealloc(table[node].cowbuff, - table[node].cowlen); - memset(table[node].cowbuff + table[node].meta.caplen, - 0, table[node].cowlen - table[node].meta.caplen); - } - if (table[node].cowlen > size + offset) { - table[node].cowlen = size + offset; - table[node].cowbuff = xrealloc(table[node].cowbuff, - table[node].cowlen); - } - memcpy(table[node].cowbuff + offset, buff, size); - rwing = 0; - return size; -} - -static int pcapfs_readdir(const char *path, void *buff, - fuse_fill_dir_t filler, - off_t offset, struct fuse_file_info *fi) -{ - size_t i; - size_t node; - char tmp[256]; - (void) fi; - (void) offset; - if (pcapfs_file_type(path, &node) != PCAP_ROOT) - return -ENOENT; - filler(buff, ".", NULL, 0); - filler(buff, "..", NULL, 0); - for (i = 0; i < table_next; ++i) { - memset(tmp, 0, sizeof(tmp)); - snprintf(tmp, sizeof(tmp), "%zu.hex", i); - tmp[sizeof(tmp) - 1] = 0; - filler(buff, tmp, NULL, 0); - } - return 0; -} - -static struct fuse_operations pcapfs_ops = { - .open = pcapfs_open, - .read = pcapfs_read, - .write = pcapfs_write, - .getattr = pcapfs_getattr, - .readdir = pcapfs_readdir, - .truncate = pcapfs_truncate, -}; - -static void pcapfs_build_cache(void) -{ - ssize_t ret; -#define INIT_SLOTS 1024 - table = xmalloc(sizeof(*table) * INIT_SLOTS); - table_len = INIT_SLOTS; - table_next = 0; - posix_fadvise(pcap_fd, 0, 0, POSIX_FADV_SEQUENTIAL); - while (1) { - ret = read(pcap_fd, &table[table_next].meta, - sizeof(table[table_next].meta)); - if (ret == 0) - break; - if (ret != sizeof(table[table_next].meta)) - goto die; - if (table[table_next].meta.caplen == 0 || - table[table_next].meta.len == 0) - goto die; - table[table_next].data = lseek(pcap_fd, 0, SEEK_CUR); - table[table_next].dirty = 0; - table[table_next].cowbuff = NULL; - table[table_next].cowlen = 0; - ret = lseek(pcap_fd, table[table_next].meta.caplen, SEEK_CUR); - if (ret < 0) - goto die; - table_next++; - if (table_next == table_len) { - table_len = (size_t) table_len * 3 / 2; - table = xrealloc(table, table_len); - } - } - lseek(pcap_fd, 0, SEEK_SET); - posix_fadvise(pcap_fd, 0, 0, POSIX_FADV_RANDOM); - return; -die: - syslog(LOG_ERR, "error parsing the pcap file! corrupted?!\n"); - exit(1); -} - -static inline void pcapfs_destroy_cache(void) -{ - free(table); - table = NULL; - table_len = 0; - table_next = 0; -} - -static void ____pcapfs_flush_dirty_nodes_to_disc_dirty(size_t i) -{ - ssize_t ret; - if ((table[i].meta.caplen == table[i].meta.len) || - (table[i].meta.caplen < table[i].meta.len && - table[i].cowlen > table[i].meta.len)) - table[i].meta.len = table[i].cowlen; - table[i].meta.caplen = table[i].cowlen; - ret = write(pcap_fd, &table[i].meta, sizeof(table[i].meta)); - if (ret != sizeof(table[i].meta)) - syslog(LOG_ERR, "disc flush meta error at node %zu," - "continuing\n", i + 1); - ret = write(pcap_fd, table[i].cowbuff, table[i].cowlen); - if (ret != table[i].cowlen) - syslog(LOG_ERR, "disc flush error at dirty node %zu," - "continuing\n", i); - table[i].cowlen = 0; - free(table[i].cowbuff); - table[i].cowbuff = NULL; - table[i].dirty = 0; - table[i].data = lseek(pcap_fd, 0, SEEK_CUR) - table[i].meta.caplen; -} - -static void -____pcapfs_flush_dirty_nodes_to_disc_clean(size_t i, int pcap_fd2, - off_t offshift) -{ - ssize_t ret; - uint8_t *tmp; - lseek(pcap_fd2, table[i].data - offshift, SEEK_SET); - ret = write(pcap_fd, &table[i].meta, sizeof(table[i].meta)); - if (ret != sizeof(table[i].meta)) - syslog(LOG_ERR, "disc flush meta error at node %zu," - "continuing\n", i + 1); - /* we cannot do a sendfile backwards :-( but chunks here are smaller */ - tmp = xmalloc(table[i].meta.caplen); - ret = read(pcap_fd2, tmp, table[i].meta.caplen); - if (ret != table[i].meta.caplen) - syslog(LOG_ERR, "disc flush error (%s) at clean node %zu read," - "continuing\n", strerror(errno), i); - ret = write(pcap_fd, tmp, table[i].meta.caplen); - if (ret != table[i].meta.caplen) - syslog(LOG_ERR, "disc flush error (%s) at clean node %zu write," - "continuing\n", strerror(errno), i); - table[i].data = lseek(pcap_fd, 0, SEEK_CUR) - table[i].meta.caplen; - free(tmp); -} - -static void __pcapfs_flush_dirty_nodes_to_disc(size_t i_dirty, int pcap_fd2, - size_t *count, off_t offshift) -{ - size_t i; - for (i = i_dirty; i < table_next; ++i) { - if (table[i].dirty) { - ____pcapfs_flush_dirty_nodes_to_disc_dirty(i); - (*count)++; - } else { - ____pcapfs_flush_dirty_nodes_to_disc_clean(i, pcap_fd2, - offshift); - } - } -} - -static void pcapfs_flush_dirty_nodes_to_disc(void) -{ - size_t i, count = 0; - ssize_t ret; - while (rwing) - sleep(0); - flushing = 1; - posix_fadvise(pcap_fd, 0, 0, POSIX_FADV_SEQUENTIAL); - for (i = 0; i < table_next; ++i) { - if (!table[i].dirty) - continue; - if (table[i].dirty && - table[i].cowlen == table[i].meta.caplen) { - lseek(pcap_fd, table[i].data, SEEK_SET); - ret = write(pcap_fd, table[i].cowbuff, - table[i].cowlen); - if (ret != table[i].cowlen) - syslog(LOG_ERR, "disc flush error at node " - "%zu, continuing\n", i); - table[i].dirty = 0; - table[i].cowlen = 0; - free(table[i].cowbuff); - table[i].cowbuff = NULL; - count++; - } else if (table[i].dirty) { - int pcap_fd2; - size_t ii; - char *tmpfile = "/tmp/pcapfs.fubar"; - off_t offshift = table[i].data; - size_t to_copy, chunk_size, chunk_blocks, chunk_rest; - struct stat ost; - fstat(pcap_fd, &ost); - pcap_fd2 = open(tmpfile, O_RDWR | O_CREAT | O_TRUNC, - S_IRUSR | S_IWUSR); - if (pcap_fd2 < 0) { - syslog(LOG_ERR, "error creating temp file!\n"); - break; - } - posix_fadvise(pcap_fd2, 0, 0, POSIX_FADV_SEQUENTIAL); - to_copy = ost.st_size - table[i].data; - chunk_size = ost.st_blksize; - chunk_blocks = (size_t) (to_copy / chunk_size); - chunk_rest = to_copy % chunk_size; - lseek(pcap_fd, table[i].data, SEEK_SET); - for (ii = 0; ii < chunk_blocks; ++ii) { - ret = sendfile(pcap_fd2, pcap_fd, NULL, - chunk_size); - if (ret != chunk_size) - syslog(LOG_ERR, "error (%s) while " - "splicing!\n", strerror(errno)); - } - ret = sendfile(pcap_fd2, pcap_fd, NULL, chunk_rest); - if (ret != chunk_rest) - syslog(LOG_ERR, "error while tee'ing!\n"); - lseek(pcap_fd2, 0, SEEK_SET); - lseek(pcap_fd, table[i].data - - sizeof(struct pcap_pkthdr), SEEK_SET); - ftruncate(pcap_fd, table[i].data - - sizeof(struct pcap_pkthdr)); - __pcapfs_flush_dirty_nodes_to_disc(i, pcap_fd2, &count, - offshift); - close(pcap_fd2); - unlink(tmpfile); - break; - } - } - fsync(pcap_fd); - posix_fadvise(pcap_fd, 0, 0, POSIX_FADV_RANDOM); - flushing = 0; - syslog(LOG_INFO, "%zu dirty marked node(s) flushed\n", count); -} - -static void pcapfs_check_superblock(void) -{ - ssize_t ret; - struct pcap_filehdr hdr; - ret = read(pcap_fd, &hdr, sizeof(hdr)); - if (ret != sizeof(hdr)) - goto die; - if (hdr.magic != TCPDUMP_MAGIC) - goto die; - if (hdr.version_major != PCAP_VERSION_MAJOR) - goto die; - if (hdr.version_minor != PCAP_VERSION_MINOR) - goto die; - return; -die: - fprintf(stderr, "this isn't a pcap file!\n"); - exit(1); -} - -static inline void pcapfs_lock_disc(void) -{ - int ret = flock(pcap_fd, LOCK_EX); - if (ret < 0) { - syslog(LOG_ERR, "cannot lock pcap disc!\n"); - exit(1); - } -} - -static inline void pcapfs_unlock_disc(void) -{ - flock(pcap_fd, LOCK_UN); -} - -static inline void pcapfs_init_disc(void) -{ - pcap_fd = open(pcap_disc, O_RDWR | O_APPEND); - if (pcap_fd < 0) { - syslog(LOG_ERR, "cannot open pcap disc!\n"); - exit(1); - } -} - -static inline void pcapfs_halt_disc(void) -{ - close(pcap_fd); -} - -static void pcapfs_cleanup(void) -{ - pcapfs_flush_dirty_nodes_to_disc(); - pcapfs_destroy_cache(); - pcapfs_unlock_disc(); - pcapfs_halt_disc(); - syslog(LOG_INFO, "unmounted\n"); - closelog(); -} - -static void pcapfs_init(void) -{ - openlog("pcapfs", LOG_PID | LOG_CONS | LOG_NDELAY, LOG_DAEMON); - pcapfs_init_disc(); - pcapfs_lock_disc(); - pcapfs_check_superblock(); - pcapfs_build_cache(); - syslog(LOG_INFO, "mounted\n"); -} - -int main(int argc, char **argv) -{ - int i, ret; - struct fuse_args args = FUSE_ARGS_INIT(0, NULL); - if (argc < 3) { - fprintf(stderr, "usage: pcapfs \n"); - exit(1); - } - for (i = 0; i < argc - 1; i++) - fuse_opt_add_arg(&args, argv[i]); - pcap_disc = argv[argc - 1]; - pcapfs_init(); - ret = fuse_main(args.argc, args.argv, &pcapfs_ops, NULL); - pcapfs_cleanup(); - return ret; -} diff --git a/contrib/patches/trafgen-multithreaded.patch b/contrib/patches/trafgen-multithreaded.patch deleted file mode 100644 index bfcb88f1..00000000 --- a/contrib/patches/trafgen-multithreaded.patch +++ /dev/null @@ -1,389 +0,0 @@ -diff --git a/src/trafgen.c b/src/trafgen.c -index 2980cff..04b30d0 100644 ---- a/src/trafgen.c -+++ b/src/trafgen.c -@@ -20,6 +20,7 @@ - * Chapter 'The Stairs of Cirith Ungol'. - */ - -+#define _GNU_SOURCE - #include - #include - #include -@@ -35,6 +36,7 @@ - #include - #include - #include -+#include - #include - - #include "xmalloc.h" -@@ -88,7 +90,7 @@ struct stats { - }; - - struct mode { -- struct stats stats; -+ struct stats stats; /* for: tgap */ - char *device; - int cpu; - int rand; -@@ -101,10 +103,25 @@ struct mode { - #define CPU_UNKNOWN -1 - #define CPU_NOTOUCH -2 - -+struct worker_struct { -+ pthread_t trid; -+ unsigned int cpu; -+ int sock; -+ struct itimerval itimer; -+ unsigned long interval; -+ struct pktconf *cfg; -+ struct mode *mode; -+ struct stats stats; -+}; -+ - sig_atomic_t sigint = 0; - - static const char *short_options = "d:c:n:t:vJhS:HQb:B:rk:"; - -+static struct worker_struct *threadpool; -+ -+static unsigned int cpus __read_mostly = 0; -+ - static struct option long_options[] = { - {"dev", required_argument, 0, 'd'}, - {"conf", required_argument, 0, 'c'}, -@@ -124,8 +141,7 @@ static struct option long_options[] = { - }; - - static struct itimerval itimer; --static int sock; --static unsigned long interval = TX_KERNEL_PULL_INT; -+static unsigned long interval __read_mostly = TX_KERNEL_PULL_INT; - - static inline uint8_t lcrand(uint8_t val) - { -@@ -147,12 +163,16 @@ static void signal_handler(int number) - - static void timer_elapsed(int number) - { -+ int i; - itimer.it_interval.tv_sec = 0; - itimer.it_interval.tv_usec = interval; - itimer.it_value.tv_sec = 0; - itimer.it_value.tv_usec = interval; - -- pull_and_flush_tx_ring(sock); -+ for (i = 0; i < cpus; ++i) { -+ pull_and_flush_tx_ring(threadpool[i].sock); -+ } -+ - setitimer(ITIMER_REAL, &itimer, NULL); - } - -@@ -235,7 +255,7 @@ static void version(void) - */ - static void tx_tgap_or_die(struct mode *mode, struct pktconf *cfg) - { -- int ifindex, mtu, ret; -+ int ifindex, mtu, ret, sock; - size_t l, c, r; - struct sockaddr_ll s_addr; - unsigned long num = 1; -@@ -323,7 +343,7 @@ static void tx_tgap_or_die(struct mode *mode, struct pktconf *cfg) - printf("\r%lu bytes outgoing\n", mode->stats.tx_bytes); - } - --static void tx_fire_or_die(struct mode *mode, struct pktconf *cfg) -+static void *tx_fire_or_die(void *tr_self) - { - int irq, ifindex, mtu; - unsigned int size, it = 0; -@@ -334,59 +354,68 @@ static void tx_fire_or_die(struct mode *mode, struct pktconf *cfg) - struct frame_map *hdr; - struct counter *cnt; - struct randomizer *rnd; -+ struct worker_struct *tr = tr_self; - -- if (!mode || !cfg) -+ if (!tr->mode || !tr->cfg) - panic("Panic over invalid args for TX trigger!\n"); -- if (cfg->len == 0) -+ if (tr->cfg->len == 0) - panic("Panic over invalid args for TX trigger!\n"); -- if (!device_up_and_running(mode->device)) -+ if (!device_up_and_running(tr->mode->device)) - panic("Device not up and running!\n"); - -- mtu = device_mtu(mode->device); -- for (l = 0; l < cfg->len; ++l) { -+ mtu = device_mtu(tr->mode->device); -+ for (l = 0; l < tr->cfg->len; ++l) { - /* eth src + eth dst + type == 14, fcs added by driver */ -- if (cfg->pkts[l].plen > mtu + 14) -+ if (tr->cfg->pkts[l].plen > mtu + 14) - panic("Device MTU < than your packet size!\n"); -- if (cfg->pkts[l].plen <= 14) -+ if (tr->cfg->pkts[l].plen <= 14) - panic("Device packet size too short!\n"); - } - - set_memcpy(); -- sock = pf_socket(); -+ tr->sock = pf_socket(); - - memset(&tx_ring, 0, sizeof(tx_ring)); - -- ifindex = device_ifindex(mode->device); -- size = ring_size(mode->device, mode->reserve_size); -+ ifindex = device_ifindex(tr->mode->device); -+ size = ring_size(tr->mode->device, tr->mode->reserve_size); - -- set_packet_loss_discard(sock); -- setup_tx_ring_layout(sock, &tx_ring, size, mode->jumbo_support); -- create_tx_ring(sock, &tx_ring); -- mmap_tx_ring(sock, &tx_ring); -+ set_packet_loss_discard(tr->sock); -+ setup_tx_ring_layout(tr->sock, &tx_ring, size, tr->mode->jumbo_support); -+ create_tx_ring(tr->sock, &tx_ring); -+ mmap_tx_ring(tr->sock, &tx_ring); - alloc_tx_ring_frames(&tx_ring); -- bind_tx_ring(sock, &tx_ring, ifindex); -+ bind_tx_ring(tr->sock, &tx_ring, ifindex); - mt_init_by_seed_time(); - -- if (mode->cpu >= 0 && ifindex > 0) { -- irq = device_irq_number(mode->device); -- device_bind_irq_to_cpu(mode->cpu, irq); -- printf("IRQ: %s:%d > CPU%d\n", mode->device, irq, -- mode->cpu); -+ if (tr->cpu == 0 && ifindex > 0) { -+ irq = device_irq_number(tr->mode->device); -+ device_bind_irq_to_cpu(tr->cpu, irq); -+ printf("IRQ: %s:%d > CPU%d\n", tr->mode->device, irq, -+ tr->cpu); - } - -- if (mode->kpull) -- interval = mode->kpull; -- if (cfg->num > 0) -- num = cfg->num; -+ assert(cpus > 0); -+ if (tr->cpu == 0 && tr->mode->kpull) -+ interval = tr->mode->kpull; -+ if (tr->cfg->num > 0) { -+ num = tr->cfg->num / cpus; -+ if (tr->cfg->num % cpus > 0 && tr->cpu == 0) { -+ num += tr->cfg->num % cpus; -+ } -+ } - -- printf("MD: FIRE %s %luus\n\n", mode->rand ? "RND" : "RR", interval); -- printf("Running! Hang up with ^C!\n\n"); -+ if (tr->cpu == 0) { -+ printf("MD: FIRE %s %luus\n\n", tr->mode->rand ? -+ "RND" : "RR", interval); -+ printf("Running! Hang up with ^C!\n\n"); - -- itimer.it_interval.tv_sec = 0; -- itimer.it_interval.tv_usec = interval; -- itimer.it_value.tv_sec = 0; -- itimer.it_value.tv_usec = interval; -- setitimer(ITIMER_REAL, &itimer, NULL); -+ itimer.it_interval.tv_sec = 0; -+ itimer.it_interval.tv_usec = interval; -+ itimer.it_value.tv_sec = 0; -+ itimer.it_value.tv_usec = interval; -+ setitimer(ITIMER_REAL, &itimer, NULL); -+ } - - l = 0; - while (likely(sigint == 0) && likely(num > 0)) { -@@ -398,53 +427,56 @@ static void tx_fire_or_die(struct mode *mode, struct pktconf *cfg) - out = ((uint8_t *) hdr) + TPACKET_HDRLEN - - sizeof(struct sockaddr_ll); - -- hdr->tp_h.tp_snaplen = cfg->pkts[l].plen; -- hdr->tp_h.tp_len = cfg->pkts[l].plen; -+ hdr->tp_h.tp_snaplen = tr->cfg->pkts[l].plen; -+ hdr->tp_h.tp_len = tr->cfg->pkts[l].plen; - -- for (c = 0; c < cfg->pkts[l].clen; ++c) { -- cnt = &(cfg->pkts[l].cnt[c]); -+ for (c = 0; c < tr->cfg->pkts[l].clen; ++c) { -+ cnt = &(tr->cfg->pkts[l].cnt[c]); - cnt->val -= cnt->min; - cnt->val = (cnt->val + cnt->inc) % - (cnt->max - cnt->min + 1); - cnt->val += cnt->min; -- cfg->pkts[l].payload[cnt->off] = cnt->val; -+ tr->cfg->pkts[l].payload[cnt->off] = cnt->val; - } - -- for (r = 0; r < cfg->pkts[l].rlen; ++r) { -- rnd = &(cfg->pkts[l].rnd[r]); -+ for (r = 0; r < tr->cfg->pkts[l].rlen; ++r) { -+ rnd = &(tr->cfg->pkts[l].rnd[r]); - rnd->val = lcrand(rnd->val); -- cfg->pkts[l].payload[rnd->off] = rnd->val; -+ tr->cfg->pkts[l].payload[rnd->off] = rnd->val; - } - -- __memcpy(out, cfg->pkts[l].payload, cfg->pkts[l].plen); -- mode->stats.tx_bytes += cfg->pkts[l].plen; -- mode->stats.tx_packets++; -+ __memcpy(out, tr->cfg->pkts[l].payload, -+ tr->cfg->pkts[l].plen); -+ tr->stats.tx_bytes += tr->cfg->pkts[l].plen; -+ tr->stats.tx_packets++; - -- if (mode->rand) -- l = mt_rand_int32() % cfg->len; -+ if (tr->mode->rand) -+ l = mt_rand_int32() % tr->cfg->len; - else { - l++; -- if (l >= cfg->len) -+ if (l >= tr->cfg->len) - l = 0; - } - - kernel_may_pull_from_tx(&hdr->tp_h); - next_slot(&it, &tx_ring); - -- if (cfg->num > 0) -+ if (tr->cfg->num > 0) - num--; - if (unlikely(sigint == 1)) - break; - } - } - -- destroy_tx_ring(sock, &tx_ring); -- close(sock); -+ destroy_tx_ring(tr->sock, &tx_ring); -+ close(tr->sock); - - fflush(stdout); - printf("\n"); -- printf("\r%lu frames outgoing\n", mode->stats.tx_packets); -- printf("\r%lu bytes outgoing\n", mode->stats.tx_bytes); -+ printf("\r%lu frames outgoing on CPU%d\n", tr->stats.tx_packets, tr->cpu); -+ printf("\r%lu bytes outgoing on CPU%d\n", tr->stats.tx_bytes, tr->cpu); -+ fflush(stdout); -+ pthread_exit(0); - } - - #define TYPE_NUM 0 -@@ -659,6 +691,75 @@ static void cleanup_cfg(struct pktconf *cfg) - xfree(cfg->pkts); - } - -+static struct pktconf *clone_cfg(struct pktconf *orig) -+{ -+ int i; -+ struct pktconf *ret = xzmalloc(sizeof(*ret)); -+ ret->num = orig->num; -+ ret->gap = orig->gap; -+ ret->len = orig->len; -+ ret->pkts = xzmalloc(sizeof(struct packet) * orig->len); -+ for (i = 0; i < ret->len; ++i) { -+ ret->pkts[i].plen = orig->pkts[i].plen; -+ ret->pkts[i].clen = orig->pkts[i].clen; -+ ret->pkts[i].rlen = orig->pkts[i].rlen; -+ ret->pkts[i].payload = xzmalloc(ret->pkts[i].plen); -+ if (orig->pkts[i].clen > 0) { -+ ret->pkts[i].cnt = xzmalloc(sizeof(struct counter) * -+ orig->pkts[i].clen); -+ memcpy(ret->pkts[i].cnt, orig->pkts[i].cnt, -+ sizeof(struct counter) * orig->pkts[i].clen); -+ } -+ if (orig->pkts[i].rlen > 0) { -+ ret->pkts[i].rnd = xzmalloc(sizeof(struct randomizer) * -+ orig->pkts[i].rlen); -+ memcpy(ret->pkts[i].rnd, orig->pkts[i].rnd, -+ sizeof(struct randomizer) * orig->pkts[i].rlen); -+ } -+ } -+ return ret; -+} -+ -+static void thread_spawn_or_panic(unsigned int cpus, struct mode *mode, -+ struct pktconf *cfg) -+{ -+ int i, ret; -+ cpu_set_t cpuset; -+ -+ for (i = 0; i < cpus; ++i) { -+ CPU_ZERO(&cpuset); -+ threadpool[i].cpu = i % cpus; -+ CPU_SET(threadpool[i].cpu, &cpuset); -+ threadpool[i].interval = TX_KERNEL_PULL_INT; -+ threadpool[i].cfg = clone_cfg(cfg); -+ threadpool[i].mode = mode; -+ threadpool[i].sock = 0; -+ -+ ret = pthread_create(&threadpool[i].trid, NULL, -+ tx_fire_or_die, &threadpool[i]); -+ if (ret < 0) -+ panic("Thread creation failed!\n"); -+ ret = pthread_setaffinity_np(threadpool[i].trid, -+ sizeof(cpuset), &cpuset); -+ if (ret < 0) -+ panic("Thread CPU migration failed!\n"); -+ pthread_detach(threadpool[i].trid); -+ info("Thread on CPU%d up and running!\n", threadpool[i].cpu); -+ } -+ sleep(1); -+} -+ -+static void thread_finish(unsigned int cpus) -+{ -+ int i; -+ for (i = 0; i < cpus; ++i) { -+ while (pthread_join(threadpool[i].trid, NULL) < 0) -+ ; -+ barrier(); -+ cleanup_cfg(threadpool[i].cfg); -+ } -+} -+ - static int main_loop(struct mode *mode, char *confname, unsigned long pkts, - unsigned long gap) - { -@@ -667,12 +768,20 @@ static int main_loop(struct mode *mode, char *confname, unsigned long pkts, - .gap = gap, - .len = 0, - }; -+ cpus = get_number_cpus_online(); - - parse_conf_or_die(confname, &cfg); - if (gap > 0) - tx_tgap_or_die(mode, &cfg); -- else -- tx_fire_or_die(mode, &cfg); -+ else { -+ threadpool = xzmalloc(sizeof(*threadpool) * cpus); -+ thread_spawn_or_panic(cpus, mode, &cfg); -+ while (!sigint) -+ sleep(1); -+ thread_finish(cpus); -+ barrier(); -+ xfree(threadpool); -+ } - cleanup_cfg(&cfg); - - return 0; -diff --git a/src/trafgen/Makefile b/src/trafgen/Makefile -index ef1f1c6..151365a 100644 ---- a/src/trafgen/Makefile -+++ b/src/trafgen/Makefile -@@ -7,7 +7,7 @@ include ../definitions.mk - - INCLUDE = -I.. - CFLAGS += --LIBS = -+LIBS = -lpthread - - core-objs = trafgen.o - lib-objs = xmalloc.o \ -- 2.11.4.GIT