forked from netsniff-ng/netsniff-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
96 lines (72 loc) · 3.63 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Currently only operating systems running on Linux kernels with
CONFIG_PACKET_MMAP enabled. This feature can be found even back to the days of
2.4 kernels. Most operating systems ship pre-compiled kernels that have this
config option enabled and even the latest kernel versions got rid of this
option and have this functionality already built-in. However, we recommend a
kernel >= 2.6.31, because the TX_RING is officially integrated since then.
netsniff-ng has been successfully tested on x86 and x86_64. Please drop
us a short mail, if it runs successfully on hardware other than that.
What libraries / tools are required?
- glibc (all)
- cmake (all)
- libpthread (curvetun, netsniff-ng, flowtop)
- libncurses (ifpps, flowtop)
- libGeoIP and its database (ashunt, flowtop)
- flex, bison (bpfc, trafgen)
- libnacl (curvetun)
- libnetfilter-conntrack (flowtop)
- liburcu (flowtop)
- libcli (trafgen)
- libnl (netsniff-ng, trafgen)
What additional tools are recommended?
- ntpd, tlsdate or equivalent (curvetun)
It is common, that these libraries are shipped as distribution packages
for an easy installation. We try to keep this as minimal as possible.
For downloading the latest GeoIP database, you can use the script that
is located at scripts/geoip-database-update.
The installation process done by cmake is fairly simple:
$ cd netsniff-ng/src/
$ mkdir build
$ cd build
$ cmake ..
$ make
# make install
Man pages are generated out of the corresponding source files by cmake.
They are written in POD format as a C header comment within those files.
For this, you need the tool pod2man which is distributed with Perl and
should therefore be available on most systems.
To uninstall, simply remove all files refered in install_manifest.txt
For bpfc, we also have a Vim syntax highlighting file. Have a look at
scripts/bpf.vim for installation instructions.
In order to build curvetun, libnacl must be built first. A helper script
called build_nacl.sh is there to facilitate this process. If you want to
build NaCl in the directory ~/nacl, the script should be called this way:
$ cd src/curvetun
$ ./build_nacl.sh ~/nacl
This gives an initial output such as "Building NaCl for arch amd64 on host
fuuubar (grab a coffee, this takes a while) ...". If the automatically
detected architecture (such as amd64) is not the one you intend to compile
for, then edit the (cc="gcc") variable within the build_nacl.sh script to
your cross compiler.
If NaCl already has been built on the target, it is quicker to use nacl_path.sh
this way:
$ cd src/curvetun
$ ./nacl_path.sh ~/nacl/build/include/x86 ~/nacl/build/lib/x86
When done, netsniff-ng build infrastructure will read nacl_path.cmake to get
the needed paths to NaCl.
For using TUN/TAP devices as a user, e.g. create a file called
src/50-tuntap.rules in /etc/udev/rules.d/ with:
KERNEL=="tun", NAME="net/%k", GROUP="netdev", MODE="0660", OPTIONS+="ignore_remove"
and restart the udev daemon. Add yourself to the "netdev" group.
NOTES
If you are a package distribution maintainer, have a look at the patch set under
contrib/patches which makes packaging a little easier for you.
The following warnings can be seen when compiling bpfc with flex 2.5.35 and
bison 2.4.1:
- redundant redeclaration of ‘isatty’
- cannot optimize loop, the loop counter may overflow
Those two warnings occur on generated C code produced by flex and bison
and there is no possibility on our side to fix them.
Similar to that, gcc will throw a warning on strchr(3) which is a false
positive (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513) from glibc:
- warning: logical ‘&&’ with non-zero constant will always evaluate as true