Skip to content
Nikos Filippakis edited this page Jul 30, 2017 · 12 revisions

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-1.7-go

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.

echo "deb http://packages.wand.net.nz trusty main" | sudo tee -a /etc/apt/sources.list
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 2.0-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.

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