irq: break out from xutils and save + restore

Break out IRQ functionality from xutils, simplify it, and
save + restore IRQ affinity list.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
netsniff-ng: v3: fix packet accounting on --num

We need to carry frame_count through multiple calls of walk function
to account correctly for --num <pkts>. Also, move socket stats printing
into rx ring, since it belongs there.

Todo: the kernel socket seems to have a different count that what we
see. This needs to be fixed one way or the other. Not yet sure what's
causing this.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
iosched: break out io scheduling functions from xutils

Break this stuff out, for better maintainability and readability.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xutils: break out string handling and locking

Break out all string handling functions and lockme stuff in order
to further eliminate the big code blob in xutils, so that it can
be easier maintained.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
cpus: break out cpu related functions from xutils

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xutils: remove unused declaration

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
corking: break out udp/tcp cork functions

No, it's not about whine bottles ... move udp and tcp cork functions
out of xutils.c, so that we can further let it shrink.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
cpusched: remove useless header comment

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
trie: remove useless header comment

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
corking: use bool instead of int

We have a boolen condition, so use bool instead of doing stupid
things with ints.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
rnd: break out prng from xutils

We only need it in curvetun, this makes it easier to maintain.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xio: refactor fopencookie related functions

Again, we move them out of xio to shrink it down.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xio: add ioexact operations

Break this out so that we only need to have sigint non-static where
it is really needed.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xio: rename xio to ioops and reduce its includes

Rename xio to ioops (io-ops) and boil its include files down to a
minimum.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
irq: rename device_bind_irq_to_cpu to device_set_irq_affinity

This is more appropriate and consistent with other device irq
functions.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xutils: break out promisc mode functions

Put them separately for the sake of maintanence.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
xutils: move device management functions out of xutils

Move those functions out so that they can be more easily maintained
in its separate file.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
privs: move drop_privileges out of xutils

Again, also to be able to maintain this more easily.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
proc: move out process specific management functions

Move them out of xutils, so that we can maintain them separately.
Also simplify things a bit.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
sock: add socket management functions

Remove them from xutils, and add them to socket management.

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