Merge "base: remove redudant ip_to_convert"
[yardstick.git] / vTC / build.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 akis.kourtis@iit.demokritos.gr and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 #!/bin/sh
11
12 # Jira No.137
13
14 # download and install required libraries
15 apt-get update
16 apt-get install -y git build-essential gcc libnuma-dev bison flex byacc libjson0-dev libcurl4-gnutls-dev jq dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config
17
18 # Setup for PF_RING and bridge between interfaces
19
20 # Get the source code from the bitbucket repository with OAuth2 authentication
21 rm resp.json
22 curl -X POST -u "mPkgwvJPsTFS8hYmHk:SDczcrK4cvnkMRWSEchB3ANcWbqFXqPx" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token=38uFQuhEdPvCTbhc7k >> resp.json
23 access_token=`jq -r '.access_token' resp.json`
24 git clone https://x-token-auth:${access_token}@bitbucket.org/akiskourtis/vtc.git
25 cd vtc
26 git checkout -b stable
27 #Build nDPI library
28 cd nDPI
29 NDPI_DIR=$(pwd)
30 echo $NDPI_DIR
31 NDPI_INCLUDE=$(pwd)/src/include
32 echo $NDPI_INCLUDE
33 ./autogen.sh
34 ./configure
35 make
36 make install
37
38 #Build PF_RING library
39 cd ..
40 cd PF_RING
41 make
42 #Build PF_RING examples, including the modified pfbridge, with nDPI integrated.
43 cd userland/examples/
44 sed -i 's#EXTRA_LIBS =#EXTRA_LIBS='"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c#' ./Makefile
45 sed -i 's# -Ithird-party# -Ithird-party/ -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'#' ./Makefile
46 echo $NDPI_DIR
47 make
48 cd ../..
49 cd ..
50 cd ..
51 #sudo rmmod pf_ring
52 insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=16384 enable_debug=1 quick_mode=1 enable_tx_capture=0
53 #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2