From 06c3f075423fd1aa533f722fb12cf671972b22d26484d98ee37539dc8af92a78 Mon Sep 17 00:00:00 2001 From: Martin Hauke Date: Wed, 5 Jul 2023 14:36:49 +0000 Subject: [PATCH] Accepting request 1096380 from home:mnhauke - Update to version 3.7 Changes since 2.0: general * added support for trace files with nanosecond resolution. * updated manual pages. * use in-memory trace files when sending packets in loop. * fixed integer overflow in stats output. * added static code analysis in Makefile (make check). * reformatted source files for C17 standard. * added initial python testing framework for Linux systems. bittwist (generator): * 30% speed up when sending large pcap file. * fixed linerate throttling. * updated -p option to send packets at set packets per second (pps). * added -t option to set inter-packet gap (this was previously -p option). * removed speed (-m) flag; use -p/-r to shape throughput. * updated linerate (-r) flag to use token bucket algorithm. bittwiste (editor) * added -G option to set fixed or random inter-packet gap in microseconds. * added support for CIDR notation when modifying IPv4/IPv6 addressA. * added support for random MAC address. * added option to edit IPv6 next header. * added random number support for id, ttl, proto, next header, hop limit. * added option to set uniformly distributed random number (mersenne twister). for tcp/udp source/destination port and OBS-URL: https://build.opensuse.org/request/show/1096380 OBS-URL: https://build.opensuse.org/package/show/network:utilities/bittwist?expand=0&rev=5 --- bittwist-linux-2.0.tar.gz | 3 -- bittwist-linux-3.7.tar.gz | 3 ++ bittwist-makefile.diff | 77 ++++++++++++++++++++++----------------- bittwist.changes | 52 ++++++++++++++++++++++++++ bittwist.spec | 26 ++++++------- 5 files changed, 111 insertions(+), 50 deletions(-) delete mode 100644 bittwist-linux-2.0.tar.gz create mode 100644 bittwist-linux-3.7.tar.gz diff --git a/bittwist-linux-2.0.tar.gz b/bittwist-linux-2.0.tar.gz deleted file mode 100644 index 052ecfc..0000000 --- a/bittwist-linux-2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b98123d2bcb9bec59dc5e610c0c5b5749ef2ed83418956c3ddef3cf5824ea45 -size 40331 diff --git a/bittwist-linux-3.7.tar.gz b/bittwist-linux-3.7.tar.gz new file mode 100644 index 0000000..9f54bf0 --- /dev/null +++ b/bittwist-linux-3.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af6ed5415db03d2e9f9e7ee830133f674fa6a443747c8c8b5dc7027ae6c364cc +size 76592 diff --git a/bittwist-makefile.diff b/bittwist-makefile.diff index 3a69a44..f873e30 100644 --- a/bittwist-makefile.diff +++ b/bittwist-makefile.diff @@ -1,37 +1,46 @@ diff --git a/Makefile b/Makefile -index e681d85..f121fe3 100644 +index 70cf633..f23bb45 100644 --- a/Makefile +++ b/Makefile -@@ -19,22 +19,22 @@ INSTALL_DATA = ${INSTALL} -m 644 - all: bittwist bittwiste - - bittwist: -- $(CC) $(CFLAGS) $(SRC)/bittwist.c -o $(SRC)/bittwist -I/usr/local/include -L/usr/local/lib -lpcap -+ $(CC) $(CFLAGS) $(SRC)/bittwist.c -o $(SRC)/bittwist `pcap-config --libs --cflags` - - bittwiste: -- $(CC) $(CFLAGS) $(SRC)/bittwiste.c -o $(SRC)/bittwiste -I/usr/local/include -L/usr/local/lib -lpcap -+ $(CC) $(CFLAGS) $(SRC)/bittwiste.c -o $(SRC)/bittwiste `pcap-config --libs --cflags` - - clean: - rm -f $(SRC)/bittwist $(SRC)/bittwiste - - install: -- mkdir -p $(bindir) -- chmod 755 $(bindir) -- $(INSTALL_PROGRAM) $(SRC)/bittwist $(SRC)/bittwiste $(bindir) -- mkdir -p $(mandir) -- chmod 755 $(mandir) -- $(INSTALL_DATA) $(DOC)/bittwist.1 $(DOC)/bittwiste.1 $(mandir) -+ mkdir -p $(DESTDIR)$(bindir) -+ chmod 755 $(DESTDIR)$(bindir) -+ $(INSTALL_PROGRAM) $(SRC)/bittwist $(SRC)/bittwiste $(DESTDIR)$(bindir) -+ mkdir -p $(DESTDIR)$(mandir) -+ chmod 755 $(DESTDIR)$(mandir) -+ $(INSTALL_DATA) $(DOC)/bittwist.1 $(DOC)/bittwiste.1 $(DESTDIR)$(mandir) - - uninstall: -- rm -f $(bindir)/bittwist $(bindir)/bittwiste -- rm -f $(mandir)/bittwist.1 $(mandir)/bittwiste.1 -+ rm -f $(bindir)/bittwist $(DESTDIR)$(bindir)/bittwiste -+ rm -f $(mandir)/bittwist.1 $(DESTDIR)$(mandir)/bittwiste.1 +@@ -51,10 +51,10 @@ INSTALL_DATA = ${INSTALL} -m 644 + all: bittwist bittwiste + + bittwist: +- $(CC) $(CFLAGS) $(SRC)/bittwist.c $(SRC)/token_bucket.c -o $(SRC)/bittwist -I/usr/local/include -L/usr/local/lib -lpcap ++ $(CC) $(CFLAGS) $(SRC)/bittwist.c $(SRC)/token_bucket.c -o $(SRC)/bittwist `pcap-config --libs --cflags` + + bittwiste: +- $(CC) $(CFLAGS) $(SRC)/bittwiste.c $(SRC)/tinymt/tinymt64.c $(SRC)/template_pcap.c -o $(SRC)/bittwiste -I $(SRC)/tinymt -I/usr/local/include -L/usr/local/lib -lpcap ++ $(CC) $(CFLAGS) $(SRC)/bittwiste.c $(SRC)/tinymt/tinymt64.c $(SRC)/template_pcap.c -o $(SRC)/bittwiste -I $(SRC)/tinymt `pcap-config --libs --cflags` + + clean: + rm -f $(SRC)/bittwist $(SRC)/bittwiste +@@ -66,18 +66,18 @@ format: + $(CLANG_FORMAT) -i src/def.h src/token_bucket.h src/token_bucket.c src/template_pcap.h src/template_pcap.c src/bittwist.h src/bittwist.c src/bittwiste.h src/bittwiste.c + + install: +- mkdir -p $(bindir) +- chmod 755 $(bindir) +- $(INSTALL_PROGRAM) $(SRC)/bittwist $(SRC)/bittwiste $(bindir) +- mkdir -p $(mandir) +- chmod 755 $(mandir) +- $(INSTALL_DATA) $(DOC)/bittwist.1 $(DOC)/bittwiste.1 $(mandir) ++ mkdir -p $(DESTDIR)$(bindir) ++ chmod 755 $(DESTDIR)$(bindir) ++ $(INSTALL_PROGRAM) $(SRC)/bittwist $(SRC)/bittwiste $(DESTDIR)$(bindir) ++ mkdir -p $(DESTDIR)$(mandir) ++ chmod 755 $(DESTDIR)$(mandir) ++ $(INSTALL_DATA) $(DOC)/bittwist.1 $(DOC)/bittwiste.1 $(DESTDIR)$(mandir) + + uninstall: +- @rm -vf $(wildcard $(bindir)/bittwist) +- @rm -vf $(wildcard $(bindir)/bittwiste) +- @rm -vf $(wildcard $(mandir)/bittwist.1) +- @rm -vf $(wildcard $(mandir)/bittwiste.1) ++ @rm -vf $(wildcard $(DESTDIR)$(bindir)/bittwist) ++ @rm -vf $(wildcard $(DESTDIR)$(bindir)/bittwiste) ++ @rm -vf $(wildcard $(DESTDIR)$(mandir)/bittwist.1) ++ @rm -vf $(wildcard $(DESTDIR)$(mandir)/bittwiste.1) + @rm -vf $(wildcard $(old_bindir)/bittwist) + @rm -vf $(wildcard $(old_bindir)/bittwiste) + @rm -vf $(wildcard $(old_mandir)/bittwist.1) diff --git a/bittwist.changes b/bittwist.changes index 42fdd6e..24769a7 100644 --- a/bittwist.changes +++ b/bittwist.changes @@ -1,3 +1,55 @@ +------------------------------------------------------------------- +Sun Jul 2 11:53:58 UTC 2023 - Martin Hauke + +- Update to version 3.7 + Changes since 2.0: + general + * added support for trace files with nanosecond resolution. + * updated manual pages. + * use in-memory trace files when sending packets in loop. + * fixed integer overflow in stats output. + * added static code analysis in Makefile (make check). + * reformatted source files for C17 standard. + * added initial python testing framework for Linux systems. + bittwist (generator): + * 30% speed up when sending large pcap file. + * fixed linerate throttling. + * updated -p option to send packets at set packets per second + (pps). + * added -t option to set inter-packet gap (this was previously + -p option). + * removed speed (-m) flag; use -p/-r to shape throughput. + * updated linerate (-r) flag to use token bucket algorithm. + bittwiste (editor) + * added -G option to set fixed or random inter-packet gap in + microseconds. + * added support for CIDR notation when modifying IPv4/IPv6 + addressA. + * added support for random MAC address. + * added option to edit IPv6 next header. + * added random number support for id, ttl, proto, next header, + hop limit. + * added option to set uniformly distributed random number + (mersenne twister). for tcp/udp source/destination port and + tcp sequence/acknowledgment number. + * added -N flag to duplicate packets from trace file, e.g. + -N 100000 to repeat packets from trace file for 100,000 times + * added ip6tcp and ip6udp templates. + * updated -I flag to allow loading trace file from built-in + templates. + * options to edit IPv4/IPv6 packets to allow testing of + classification/queuing. features of switches/routers, e.g. + + -T ip -e 3 to indicate congestion to the end hosts + + -T ip6 -c 16 to classify packet for operation and management + of the network + + -T ip6 -f 0xfffff to set custom flow label + * added support for IPv6 packets. + * improved cksum(). + * expanded test cases. +- Update patch: + * bittwist-makefile.diff +- Update URL + ------------------------------------------------------------------- Fri May 26 10:39:30 UTC 2017 - jengelh@inai.de diff --git a/bittwist.spec b/bittwist.spec index dc26d0d..09569bd 100644 --- a/bittwist.spec +++ b/bittwist.spec @@ -1,7 +1,8 @@ # # spec file for package bittwist # -# Copyright (c) 2016, Martin Hauke +# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2016-2023, Martin Hauke # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,21 +13,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: bittwist -Version: 2.0 +Version: 3.7 Release: 0 Summary: A libpcap-based Ethernet packet generator -License: GPL-2.0 +License: GPL-2.0-only Group: Productivity/Networking/Diagnostic -Url: http://bittwist.sourceforge.net/ +#Git-Clone: https://github.com/ayeowch/bittwist.git +URL: https://bittwist.sourceforge.io Source: http://downloads.sourceforge.net/%{name}/Linux/Bit-Twist%%20%{version}/%{name}-linux-%{version}.tar.gz Patch0: bittwist-makefile.diff BuildRequires: libpcap-devel -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Bit-Twist is a libpcap-based Ethernet packet generator complementing @@ -41,21 +42,20 @@ problems. %prep %setup -q -n %{name}-linux-%{version} %patch0 -p1 -perl -i -pe 's/\r\n/\n/gs' AUTHORS BUGS CHANGES COPYING README VERSION %build export CFLAGS="%{optflags}" -make %{?_smp_mflags} +%make_build %install -%make_install +%make_install prefix=/usr %files -%defattr(-,root,root) -%doc AUTHORS BUGS CHANGES COPYING README VERSION +%license COPYING +%doc AUTHORS BUGS CHANGES README.md VERSION %{_bindir}/bittwist %{_bindir}/bittwiste -%{_mandir}/man1/bittwist.1%{ext_man} -%{_mandir}/man1/bittwiste.1%{ext_man} +%{_mandir}/man1/bittwist.1%{?ext_man} +%{_mandir}/man1/bittwiste.1%{?ext_man} %changelog