- Update to version 0.6.9

* Allow to manually define CPUs for trafgen.
  * Fix make install and output netsniff-ng stats on stderr.
  * trafgen: Fix for ipv6 header generation when L3-only devices
    are present.
  * mausezahn: use getopt_long instead of getopt.
  * build: fix install dependencies in Makefile template.
  * trafgen: move cpu stats temp file to /tmp.
  * ring_tx: handle EINTR from sendto.

OBS-URL: https://build.opensuse.org/package/show/network:utilities/netsniff-ng?expand=0&rev=44
This commit is contained in:
Marcus Meissner 2025-01-10 13:29:26 +00:00 committed by Git OBS Bridge
commit 59df0dbb4b
7 changed files with 436 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
netsniff-ng-0.6.8.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:77d17d4158faf1d93c7d922a1bd7f093a8b437bd658292c830708540e10894ba
size 617820

3
netsniff-ng-0.6.9.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:027840fa3c4e11abfe4fd0fffe9909c5c4ed1428d4b9397fb6d2f5ea69325918
size 618428

View File

@ -0,0 +1,55 @@
Index: netsniff-ng-0.6.4/flowtop/Makefile
===================================================================
--- netsniff-ng-0.6.4.orig/flowtop/Makefile
+++ netsniff-ng-0.6.4/flowtop/Makefile
@@ -1,6 +1,6 @@
flowtop-libs = -lurcu \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs libnetfilter_conntrack 2> /dev/null ) \
- $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs ncurses 2> /dev/null \
+ $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs ncursesw 2> /dev/null \
|| echo '-lncurses') \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs tinfo 2> /dev/null ) \
-lpthread
@@ -30,7 +30,7 @@ flowtop-objs += geoip.o \
ioops.o
endif
-flowtop-eflags = $(shell $(PKG_CONFIG) --cflags ncurses) \
+flowtop-eflags = $(shell $(PKG_CONFIG) --cflags ncursesw) \
$(shell $(PKG_CONFIG) --cflags libnetfilter_conntrack)
flowtop-confs = tcp.conf \
Index: netsniff-ng-0.6.4/ifpps/Makefile
===================================================================
--- netsniff-ng-0.6.4.orig/ifpps/Makefile
+++ netsniff-ng-0.6.4/ifpps/Makefile
@@ -1,4 +1,4 @@
-ifpps-libs = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs ncurses 2> /dev/null \
+ifpps-libs = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs ncursesw 2> /dev/null \
|| echo '-lncurses') \
$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --libs tinfo 2> /dev/null )
@@ -14,6 +14,6 @@ ifpps-objs = xmalloc.o \
sysctl.o \
ifpps.o
-ifpps-eflags = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --cflags ncurses 2> /dev/null)
+ifpps-eflags = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKG_CONFIG) --cflags ncursesw 2> /dev/null)
ifpps-confs =
Index: netsniff-ng-0.6.4/configure
===================================================================
--- netsniff-ng-0.6.4.orig/configure
+++ netsniff-ng-0.6.4/configure
@@ -428,9 +428,9 @@ int main(void)
EOF
$CC \
- $($PKG_CONFIG --cflags ncurses 2>> config.log) \
+ $($PKG_CONFIG --cflags ncursesw 2>> config.log) \
-o $TMPDIR/ncursestest $TMPDIR/ncursestest.c \
- $($PKG_CONFIG --libs ncurses 2>> config.log \
+ $($PKG_CONFIG --libs ncursesw 2>> config.log \
|| echo '-lncurses' ) \
>> config.log 2>&1
if [ ! -x $TMPDIR/ncursestest ] ; then

248
netsniff-ng.changes Normal file
View File

@ -0,0 +1,248 @@
-------------------------------------------------------------------
Tue Jan 7 13:29:47 UTC 2025 - Martin Hauke <mardnh@gmx.de>
- Update to version 0.6.9
* Allow to manually define CPUs for trafgen.
* Fix make install and output netsniff-ng stats on stderr.
* trafgen: Fix for ipv6 header generation when L3-only devices
are present.
* mausezahn: use getopt_long instead of getopt.
* build: fix install dependencies in Makefile template.
* trafgen: move cpu stats temp file to /tmp.
* ring_tx: handle EINTR from sendto.
-------------------------------------------------------------------
Thu Feb 22 14:06:48 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %autosetup macro. Allows to eliminate the usage of deprecated
%patchN
-------------------------------------------------------------------
Wed Dec 21 16:15:37 UTC 2022 - Michael Pujos <pujos.michael@gmail.com>
- fixed build failure caused by make install failing due to make 4.4
behavior change in target ordering when parrallelism is enabled.
For this, -j1 is passed to make install to disable parrallelism
-------------------------------------------------------------------
Mon Jan 11 12:05:14 UTC 2021 - Martin Hauke <mardnh@gmx.de>
- Update to version 0.6.8
* Bugfix release
* remove "CFLAGS+=-fcommon"
-------------------------------------------------------------------
Sun Jun 7 19:32:53 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Set CFLAGS+=-fcommon
-------------------------------------------------------------------
Mon May 4 13:49:28 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Update to version 0.6.7
* trafgen: reset errno before calling sscanf in str2mac
* ifpps: fix iface stat parsing if interface name contains
uppercase characters
* mausezahn: fix display of missing argument error
* mausezahn: support -R to set packet priority
* netsniff-ng: handle various malformed packets in protocol
dissectors
-------------------------------------------------------------------
Thu Nov 7 20:01:07 UTC 2019 - Martin Hauke <mardnh@gmx.de>
- Do not longer build with support for GeoIP
GeoIP has been discontinued by Maxmind. Please see
https://support.maxmind.com/geolite-legacy-discontinuation-notice/
for details. Without the database GeoIP is useless.
-------------------------------------------------------------------
Thu May 9 19:17:57 UTC 2019 - Martin Hauke <mardnh@gmx.de>
- Update to version 0.6.6
* implement rotating capture files in netsniff-ng
* fixed '--in -' to work again with STDIN in trafgen
* fixed -t 0 option to use sendto in trafgen
* checksum calculation for ICMP and TCP in astraceroute
* fix for reading mirrors from file in astraceroute
* use GZIP_ENV instead of GZIP in build system
* fixed manpage warnings
* added error handling for mismatched address families in mausezahn.
- Update to version 0.6.5
* add DCCP support to netsniff-ng
* fix segfault in mausezahn
* add date format strings to --out in netsniff-ng
* restore handling of raw hex string passed in on command line in
mausezahn
* support ICMPv6 checksums in trafgen
* improve random mac address generation in mausezahn
* man page updates and reformatting
-------------------------------------------------------------------
Thu Nov 15 19:18:00 UTC 2018 - Cristian Rodríguez <crrodriguez@opensuse.org>
- netsniff-ng-ncursesw.patch replaces netsniff-ng-fix-ncurses.diff
choose ncurses6w and not ncurses5 for build.
-------------------------------------------------------------------
Fri Jan 5 21:54:23 UTC 2018 - mardnh@gmx.de
- Update to version 0.6.4
* DNS header generation in trafgen
* Support for dumping proto headers in trafgen
* Fixes for dinc()/ddec() to properly respect min/max range and
avoid counter corruption
* Fixes for NULL pointer dereferences and resource leaks in trafgen
* Build fixes for various compiler versions, libc implementations
and distributions
- Rebase patch:
* netsniff-ng-fix-ncurses.diff
-------------------------------------------------------------------
Thu Jun 1 20:57:59 UTC 2017 - mardnh@gmx.de
- Use ncurses5-devel instead of ncurses-devel for Tumbleweed
-------------------------------------------------------------------
Fri May 26 10:24:39 UTC 2017 - jengelh@inai.de
- Trim filler wording.
-------------------------------------------------------------------
Tue Apr 11 13:35:18 UTC 2017 - mardnh@gmx.de
- update to 0.6.3
- Allow to specify packet offsets in trafgen packet header functions.
By Vadim Kochan.
- Allow trafgen to send packets from pcap file. By Vadim Kochan.
- Support trafgen interface without IP address in packet header
functions. By Ken Wu.
- Various other improvements and cleanups in the packet header
functions of trafgen. By Vadim Kochan.
- Tab based user interface for flowtop. Introduced a tab for flow
statistics per PID. By Vadim Kochan.
- Fixed buffer overflow in device_addr2str() causing Linux cooked header
dissector to crash. Reported by @jamieparfet, fixed by Tobias Klauser.
- Fixed build due to missing GENL_ID_GENERATE if compiling against
kernel headers >= 4.10 (see issue #171).
Reported by Jaroslav Škarvada (@yarda), fixed by Tobias Klauser.
-------------------------------------------------------------------
Mon Nov 7 19:56:43 UTC 2016 - mardnh@gmx.de
- update to 0.6.2
- Many improvements to the trafgen protocol generation functions,
e.g. the ability to increment/randomize protocol fields at runtime
using dinc()/rnd(), new functions to generate IPv6, ICMPv4/v6, PFC,
and IEEE 802.3X PAUSE headers. From Vadim Kochan and Tobias Klauser.
- flowtop UI improvements. From Vadim Kochan.
- Packet counting fixes, e.g. to not account for duplicate packets
received over the loopüback interface. From Paolo Abeni.
- Allow IPv6 ranges to be specified for source and dest addresses
in mausezahn. From Tommy Beadle.
- Build system improvements, allowing to specify more options to the
configure script. See './configure --help' for details.
From Vadim Kochan and Tobias Klauser.
- Various compilation fixes, e.g. for warnings or build failure
certain systems. From Yousong Zhou and arch3y.
- Various documentation improvements and fixes. From Vadim Kochan,
Hisao Tanabe, and Tobias Klauser.
- add patch netsniff-ng-fix-ncurses.diff
fix some ncurses related issues during compile time
-------------------------------------------------------------------
Tue Mar 22 19:51:33 UTC 2016 - mardnh@gmx.de
- update to 0.6.1
- Newly added trafgen configuration language which allows to specify the
packets in a more convenient format. See trafgen(8) for more details on
the supported protocols and keywords.
- Additional runtime commands for flowtop which allow to toggle/filter
display of flows.
- Command line options to pass macro definitions to trafgen and bpfc.
- Made the build of all netsniff-ng tools reproducible (stable link order).
- Fix download of GeoIP databases so the files don't get corrupted.
-------------------------------------------------------------------
Sat Nov 7 11:35:51 UTC 2015 - mardnh@gmx.de
- update to 0.6.0
- removed patches (fixed upstream)
- netsniff-ng-pkgconfig.diff
- netsniff-ng-fix-manpage-perms.diff
-------------------------------------------------------------------
Wed Nov 4 21:36:20 UTC 2015 - mardnh@gmx.de
- update to 0.5.9
- fix source-url
- removed old patches (upstream no longer use CMake)
- netsniff-ng-optflags.patch
- netsniff-ng-cmake_pod2man_without_stderr.patch
- netsniff-pkgconfig.diff
- add patches
- netsniff-ng-pkgconfig.diff (handle libnetfilter_conntrack)
- netsniff-ng-fix-manpage-perms.diff (fix manpage permissions during install)
- now requires libnl-3 - removed all handling for different libnl versions
- build against libsodium instead of nacl
- ran speccleaner
-------------------------------------------------------------------
Thu Jun 20 09:40:09 UTC 2013 - joop.boonen@opensuse.org
- corrected BuildRequires for libnl-devel
-------------------------------------------------------------------
Sun Jun 16 12:37:18 UTC 2013 - jengelh@inai.de
- Properly search for libraries using pkgconfig
-------------------------------------------------------------------
Wed Jun 12 10:52:05 UTC 2013 - joop.boonen@opensuse.org
- update to 0.5.7
-------------------------------------------------------------------
Thu Mar 29 10:43:00 UTC 2012 - pascal.bleser@opensuse.org
- update to 0.5.6: see changelog
-------------------------------------------------------------------
Sat Sep 24 21:06:07 UTC 2011 - andreas.stieger@gmx.de
- remove dependency in licenses, not in Factory anymore
-------------------------------------------------------------------
Mon Oct 11 18:29:13 UTC 2010 - pascal.bleser@opensuse.org
- update to 0.5.5:
* the PCAP file format is supported, which enables netsniff-ng to dump, read, and replay traces to or from harddisk
* lots of new packet printing options were added, targeted for debugging and reverse engineering
* automatic NIC IRQ affinity adaption is done if netsniff-ng is bound to a specific CPU
* the possibility to manually set up ring size was added
* POSIX compatible extended regular expression based filtering of packet content was implemented
-------------------------------------------------------------------
Thu Feb 18 16:31:33 UTC 2010 - pascal.bleser@opensuse.org
- update to 0.5.4.2:
* fixes an issue where, under specific conditions, netsniff-ng's
rx_ring stops receiving packets
* basic BPF checks have been added
-------------------------------------------------------------------
Sat Jan 2 01:15:04 UTC 2010 - pascal.bleser@opensuse.org
- update to 0.5.4.1: patches merged upstream
-------------------------------------------------------------------
Fri Jan 1 22:35:02 UTC 2010 - pascal.bleser@opensuse.org
- fix segfault in buffer overflow patch
-------------------------------------------------------------------
Thu Dec 31 10:09:24 UTC 2009 - pascal.bleser@opensuse.org
- new package (0.5.4)

103
netsniff-ng.spec Normal file
View File

@ -0,0 +1,103 @@
#
# spec file for package netsniff-ng
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: netsniff-ng
Version: 0.6.9
Release: 0
Summary: Network Sniffer for Packet Inspection
License: GPL-2.0-only
Group: Productivity/Networking/Diagnostic
URL: http://netsniff-ng.org/
Source: http://pub.netsniff-ng.org/netsniff-ng/netsniff-ng-%{version}.tar.xz
Patch0: netsniff-ng-ncursesw.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: libcli-devel
BuildRequires: libnet-devel
BuildRequires: libnetfilter_conntrack-devel
BuildRequires: libnl3-devel
BuildRequires: libpcap-devel
BuildRequires: libsodium-devel
BuildRequires: libtool
BuildRequires: liburcu-devel
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: zlib-devel
BuildRequires: pkgconfig(ncursesw)
%description
netsniff-ng is a network sniffer for packet inspection. It is similar
to tcpdump, and likewise uses a memory mapped area for accessing
packets. It can be used for protocol analysis and reverse
engineering, network debugging, measurement of performance
throughput, or network statistics creation of incoming packets on
central network nodes like routers or firewalls.
The netsniff-ng toolkit consists of the following utilities:
* netsniff-ng, a zero-copy analyzer, pcap capturing and replaying tool
* trafgen, a multithreaded low-level zero-copy network packet generator
* mausezahn, high-level packet generator for HW/SW appliances with Cisco-CLI
* bpfc, a Berkeley Packet Filter compiler, Linux BPF JIT disassembler
* ifpps, a top-like kernel networking statistics tool
* flowtop, a top-like netfilter connection tracking tool
* curvetun, a curve25519-based IP tunnel
* astraceroute, an autonomous system (AS) trace route utility
%prep
%autosetup -p1
%build
export NACL_LIB=sodium
export NACL_INC_DIR=%{_includedir}/sodium
./configure --disable-geoip
%make_build ETCDIR=%{_sysconfdir} Q= STRIP=: CFLAGS="%{optflags}"
%install
# disable parrallel execution with -j1 because it cause an error with make 4.4
make -j1 install PREFIX=%{_prefix} ETCDIR=%{_sysconfdir} DESTDIR=%{buildroot}
rm -Rf %{buildroot}%{_docdir}/netsniff-ng %{buildroot}%{_datadir}/licenses/
%files
%license COPYING
%doc AUTHORS README REPORTING-BUGS
%dir %{_sysconfdir}/netsniff-ng
%config(noreplace) %{_sysconfdir}/netsniff-ng/*
%{_sbindir}/astraceroute
%{_sbindir}/bpfc
%{_sbindir}/curvetun
%{_sbindir}/flowtop
%{_sbindir}/ifpps
%{_sbindir}/mausezahn
%{_sbindir}/netsniff-ng
%{_sbindir}/trafgen
%{_mandir}/man8/astraceroute.8%{?ext_man}
%{_mandir}/man8/bpfc.8%{?ext_man}
%{_mandir}/man8/curvetun.8%{?ext_man}
%{_mandir}/man8/flowtop.8%{?ext_man}
%{_mandir}/man8/ifpps.8%{?ext_man}
%{_mandir}/man8/mausezahn.8%{?ext_man}
%{_mandir}/man8/netsniff-ng.8%{?ext_man}
%{_mandir}/man8/trafgen.8%{?ext_man}
%changelog