Skip to content
Lukas Rist edited this page Nov 6, 2022 · 12 revisions

Dependencies

Arch Linux (AUR)

Download and install Go 1.7 or later.
Then install following dependencies from the AUR repository:

yaourt -S libtrace libflowmanager libprotoident liblinear

Ubuntu/Debian

go-dpi requires Go 1.7 or later, so you should install that first if you don’t have it.

sudo apt-get install golang

liblinear is also needed for the machine learning module. To install it, use the following commands.

sudo apt-get install liblinear3 liblinear-dev

If the liblinear3 package is not available on your distribution, you can also use the earlier ones. Current Ubuntu/Debian distributions might require liblinear4.

Optional

Besides that, you can also install the libraries nDPI and libprotoident if you wish for go-dpi to use them. They may be installed with the following commands.

curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandio/cfg/setup/bash.deb.sh' | sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libwandder/cfg/setup/bash.deb.sh' | sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libtrace/cfg/setup/bash.deb.sh' | sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libflowmanager/cfg/setup/bash.deb.sh' | sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/wand/libprotoident/cfg/setup/bash.deb.sh' | sudo -E bash
sudo apt-get update
sudo apt-get -y --force-yes install git gcc autoconf automake libtool libpcap-dev libtrace4 libtrace4-dev libprotoident libprotoident-dev
git clone --branch 3.2-stable https://github.com/ntop/nDPI/ /tmp/nDPI
cd /tmp/nDPI && ./autogen.sh && ./configure && make && sudo make install && cd -

Please note: If you don't install any of the two libraries above, you should let go-dpi know about it, or it won't be able to build and run successfully. By editing the file modules/wrappers/wrappers_config.h, you can disable the two libraries. Simply uncomment the appropriate lines (they are annotated inside the file) by removing the // in front of them in order to disable them.

Compiling

Please note: You might have to specify the header files before building: CGO_CFLAGS="-I/usr/include/liblinear"

You are now able to install the library! Glide is also installed in order to help with the management of the dependencies.

go get github.com/mushorg/go-dpi
go get github.com/Masterminds/glide
cd "$(go env GOPATH)/src/github.com/mushorg/go-dpi"
$(go env GOPATH)/bin/glide install

You are now ready to use the library from your own project! You should be able to confirm the installation is complete by going to the go-dpi directory and running the tests.

go test . ./modules/wrappers ./modules/classifiers ./types ./utils
Clone this wiki locally