bpf: ldi,ldxi: allow for '#' prefix in numbers

For consistency, allow for '#' prefix in numbers, which we currently
do not do. So keep old mode as compatibility to not break current
programs, and add new one with '#' prefix.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: Reuse device bitrate for screen_header()

Instead of issuing another call to device_bitrate(), reuse the the value
acquired in screen_update() and pass it to screen_header().

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: show percentage of theoretical line-rate

Also show the percentage of the (theoretical) line rate, not just the
current rate.

Suggested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: make display of line rate percentage optional

In order to not to clutter the display too much, make the display of the
percentage of the theoretical line rate dependent on a command line
option.

Suggested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: man: add -P option

Add a man page entry for the new -P option.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: zsh: add -P option

Add an entry for autocompletion support.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
bpfc: add gnu as style %-register prefix

Let a and x register also be addressed as %x and %a.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: correct calculation of line rate percentage

The line rate is given in Mbit rather than MiB (in which {rx,tx}_bytes
were converted). Correct the calculation by converting {rx,tx}_bytes to
Mbit:

  (n bytes * 8 bits per byte) / 1000^2 = (n bytes) / 125000

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen: combine likely conditions

Combine multiple likely conditions into one.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
doc: authors: moved Tobias one up

Nothing changes in that regard, Tobias and myself are both maintaining
and continue to do so on one and the same level. Tobias does an awesome
job, so this should be credited to him right here!

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
doc: readme: give note about what tools are still experimental

We still have to get curvetun and mausezahn in line with the rest
of the landscape, as they are not ready and in a quality we wish
they would be. Therefore, mark and document them as experiemental
for now until they are fixed up.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trafgen: remove inner loop

Get rid of inner loop in fast path. This simplifies code and readability.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: Display pcap I/O method in verbose mode

If a user accidentially specifies more than one of --mm/--sg/--clrw, the
option specified last will be used - as expected from standard command
line tools. In order to still prevent users from being confused by this,
explicitely display the pcap I/O method used in verbose mode.

In order for the output to be more user-friendly, actually write out the
method names in const char *pcap_ops_group_to_str, which isn't used
anywhere else anyway.

Suggested-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: add option that omits CSV header

Adds option -o|--omit-header which does not print the CSV header
e.g. when the user does not need it.

Signed-off-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: man: document new option to omit CSV header

Manual page entry for option -c|--omit-header.

Signed-off-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
ifpps: man: grammar and typo edits

Removed, word "be", which was seen twice and removed unnecessary comma.

Signed-off-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: modify mmap option in usage to be grammatically correct

Incorrect usage of "i.e." leads one to believe that replaying is
possible only.

Signed-off-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: zsh: Add -o option

Add the -o/--omit-header option to ZSH autocompletion.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: min: minor: Keep options sorted alphabetically

Keep the options sorted alphabetically, argument options first.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
ifpps: Mark omit_header parameter to screen_main() as unused

Otherwise we get a warning when compiling with "-W -Wall".

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>