man: add ifpps.8 man page

Finally I found some time and started writing man pages. This is a
first one in a series of man pages for all tools.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: also capture if NIC is currently down

There is actually no reason why netsniff-ng should fail if the NIC is
down at startup. We still can setup everything and already capture at
the time it goes up. This might be useful when replugging cables on
servers, for instance.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: man page updates for bpfc, curvetun

These are the writings so far. For sure they are not yet finished, so
I will push updates for both of them as soon as possible, but for now
this is a first version people can start to read.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: finish bpfc man page

This patch adds BPF architecture and instruction description with
supported Linux extensions. Also, essential bpfc examples are given.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: start netsniff-ng.8 man page

Not yet finished, but it already contains some useful example
descriptions and notes for tuning. More to come very soon.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: netsniff-ng: finish usage examples and add filter examples

The usage examples are good so far. Most of the things one needs
to know. Also, add a short howto on how to use bpfc filtering or
pcap-like high-level filters.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: netsniff-ng: add description paragraph and some options

This patch continues on the netsniff-ng man page. It adds a program
description and documents some options, not yet all. More to come.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: finish netsniff-ng man page

Fill in the rest of the gaps for this man page.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: ifpps: add bugs section

Add a section of known bugs/todos for bpfc.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trafgen: do not care if device is running yet

E.g. when executing trafgen on tap devices, trafgen will complain
that it is not up and running although it was brought up. Remove
this usability restriction and let the kernel decide if it may
send the packets or not.

Reported-by: Aimal Khan <aimal.khan98@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
pcap_io: introduce init_once helper that is called with priviledges

When using netsniff-ng with dropping priviledges, we have to introduce
another pcap helper function that is called once before we drop the
priviledges. In this function we have to invoke the disc I/O scheduler
policy, because it needs priviledges. Otherwise netsniff-ng will fail
with "Failed to set io prio for pid" on startup, since we're not root
anymore.

Reported-by: Doug Burks <doug.burks@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: netsniff-ng: Fix a typo

Replace 'networkoing' by 'networking'.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
man: netsniff-ng: Fix typo of 'privileges'

Replace 'priviledges' by 'privileges'.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
man: netsniff-ng: Do some wordsmithing

Fix wording and phrasing in some of the usage examples.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen: parser: fix regression on last pkt element

Jon Schipp reported that a arbitrary packet config
such as ...

{
 "MyPacket",
 "MyPacket",
 "MyPacket",
 "MyPacket",
 "MyPacket",
 "MyPacket",
 "MyPacket",
 "MyPacket",
}

... doesn't work anymore, although it used to work. This
regression was introduced by commit f9591eebe40c ("trafgen:
lexer/parser: fix cpu() selection and whitespacing").

Reported-by: Jon Schipp <jonschipp@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: mlock: only lock current and future pages when root

When we're still root, we tell the kernel to lock/protect all current
and future pages in memory so that they will not be swapped out in
case the system uses up too much. Now when we do xzmalloc_aligned(),
it calls internally posix_memalign() that can call mmap(2), thus we
will get an EAGAIN as errno, since we're not root anymore and since
we wanted to touch sth. that belongs to root. Nasty. Fix this up by
only protecting these pages when we do not use -u/-g.

Reported-by: Doug Burks <doug.burks@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
man: netsniff-ng: include known bug from docs

Add the known bug from Documentation/KnownIssues into the man page
so that at some point in time, we can remove this document and
maintain that stuff within the man page.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
docs: move some of them to the root directory

Lets move CodingStyle, SubmittingPatches, and Sponsors into the
root directory of netsniff-ng and remove the Documentation folder.
Some of those files are quite bloated, and most of these things
should be in the man-pages anyway. They should be the only big
sources of documentation, nothing else.

The rest is currently put here: http://pub.netsniff-ng.org/docs/

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
docs: readme: add steps to verify a Git release

We should only put the things here that are interesting for users,
thus, add steps to verify a release from the Workflow document.

 [1] http://pub.netsniff-ng.org/docs/Workflow

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
build: currently do not copy docs to shared docs

Maybe in short term future, before the next release, we will think
about putting the README file for users into DOCDIRE, since the
rest is not really interesting for users, but probably only for
developers.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>