diff --git a/cmake_targets/tools/build_epc b/cmake_targets/tools/build_epc
new file mode 100755
index 0000000000..45b6bbf0e3
--- /dev/null
+++ b/cmake_targets/tools/build_epc
@@ -0,0 +1,304 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file build_epc
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+#
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+source $THIS_SCRIPT_PATH/build_helper
+
+function help()
+{
+ echo_error " "
+ echo_error "Usage: build_epc [OPTION]..."
+ echo_error "Build the EPC executable."
+ echo_error " "
+ echo_error "Options:"
+ echo_error "Mandatory arguments to long options are mandatory for short options too."
+ echo_error " -c, --clean Clean the build generated files (build from scratch)"
+ echo_error " -d, --debug Compile with debug informations."
+ echo_error " -h, --help Print this help."
+ echo_error " -H, --hss hostname HSS hostname (with FQDN), default is this host (hostname)."
+ echo_error " -i, --check-installed-software Check installed software packages necessary to build and run EPC (support Ubuntu 14.04)."
+ echo_error " -r, --realm realm Realm of the MME (if not specified, is extracted from this host FQDN)."
+ echo_error " -s, --transport-sctp-only Diameter use SCTP only (TCP disabled)."
+ echo_error " -S, --s6a-server MME act as a server on s6a interface (useful when HSS and MME/EPC run on the same host)."
+ echo_error " -t, --transport-tcp-only Diameter use TCP only (SCTP disabled)."
+ echo_error " -T, --transport-prefer-tcp Diameter prefer TCP."
+ echo_error " -v, --verbose Build process verbose."
+}
+
+
+
+function main()
+{
+ local -i clean=0
+ local -i verbose=0
+ local -i s6a_server=0
+ local cmake_args=" "
+ local make_args="-j $NUM_CPU"
+ local realm=""
+ local hss_fqdn=""
+ local hss_hostname=""
+ local hss_ip=""
+ local REL="Rel10"
+
+
+ until [ -z "$1" ]
+ do
+ case "$1" in
+ -c | --clean)
+ clean=1
+ echo "Clean the build generated files (build from scratch)"
+ shift;
+ ;;
+ -d | --debug)
+ cmake_args="$cmake_args -DDEBUG=1"
+ echo "Compile with debug informations"
+ shift;
+ ;;
+ -h | --help)
+ help
+ shift;
+ exit 0
+ ;;
+ -H | --hss)
+ hss_fqdn=$2
+ cmake_args="$cmake_args -DHSS_FQDN=$hss_fqdn"
+ shift 2;
+ ;;
+ -i | --check-installed-software)
+ echo "Check installed software packages necessary to build and run EPC (support Ubuntu 14.04):"
+ check_install_epc_software
+ exit 0
+ ;;
+ -r | --realm)
+ echo "Realm: $2"
+ realm=$2
+ cmake_args="$cmake_args -DREALM=$realm"
+ shift 2;
+ ;;
+ -s | --transport-sctp-only)
+ echo "Diameter use SCTP (TCP disabled), this is the default option."
+ cmake_args="$cmake_args -DTRANSPORT_option=No_TCP"
+ shift;
+ ;;
+ -S | --s6a-server)
+ echo "MME act as a server on s6a"
+ s6a_server=1
+ cmake_args="$cmake_args -DMME_S6A_IS_SERVER=1"
+ shift 1;
+ ;;
+ -t | --transport-tcp-only)
+ echo "Diameter use TCP (SCTP disabled)."
+ cmake_args="$cmake_args -DTRANSPORT_option=No_SCTP"
+ shift;
+ ;;
+ -T | --transport-prefer-tcp)
+ echo "Diameter prefer TCP (TCP, SCTP enabled)."
+ cmake_args="$cmake_args -DTRANSPORT_PREFER_TCP_option=Prefer_TCP"
+ shift;
+ ;;
+ -v | --verbose)
+ echo "Make build process verbose"
+ cmake_args="$cmake_args -DCMAKE_VERBOSE_MAKEFILE=ON"
+ make_args="VERBOSE=1 $make_args"
+ verbose=1
+ shift;
+ ;;
+ *)
+ echo "Unknown option $1"
+ help
+ exit 1
+ ;;
+ esac
+ done
+
+ # extra arguments processing
+ if [[ z$hss_fqdn = z ]]; then
+ hss_fqdn=`hostname --fqdn`
+ cmake_args="$cmake_args -DHSS_FQDN=$hss_fqdn"
+ if [[ z$realm = z ]]; then
+ realm=$hss_fqdn
+ realm=${realm#*.}
+ cmake_args="$cmake_args -DREALM=$realm"
+ fi
+ else
+ if [[ z$realm = z ]]; then
+ realm=${hss_fqdn#*.}
+ cmake_args="$cmake_args -DREALM=$realm"
+ fi
+ fi
+ hss_hostname=${hss_fqdn%%.*}
+ cmake_args="$cmake_args -DHSS_HOSTNAME=$hss_hostname"
+
+ hss_ip=`resolveip --silent $hss_hostname`
+ if [[ z$hss_ip = z ]]; then
+ hss_ip=`resolveip --silent $hss_fqdn`
+ fi
+ if [[ z$hss_ip = z ]]; then
+ echo_abort "Unable to get HSS IP addr of $hss_fqdn"
+ fi
+ cmake_args="$cmake_args -DHSS_IP=$hss_ip"
+
+ set_openair_env
+ if [[ $verbose -eq 1 ]]; then
+ cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
+ fi
+
+ # for conf files copy in this bash script
+ if [ -d /usr/lib/freeDiameter ]; then
+ export FREEDIAMETER_PREFIX=/usr
+ else
+ if [ -d /usr/local/lib/freeDiameter ]; then
+ export FREEDIAMETER_PREFIX=/usr/local
+ else
+ echo_fatal "FreeDiameter prefix not found, install freeDiameter if EPC, HSS"
+ fi
+ fi
+
+
+
+ local dbin=$OPENAIR_DIR/targets/bin
+ local dlog=$OPENAIR_DIR/cmake_targets/log
+ local dconf=$OPENAIR_DIR/targets/bin
+
+ mkdir -m 777 -p $dbin $dlog
+
+ ##############################################################################
+ # Compile userspace executable
+ ##############################################################################
+ rm -f $OPENAIR_DIR/targets/bin/mme_gw
+ cd $OPENAIR_DIR/cmake_targets/epc_build_oai
+ if [ $clean -ne 0 ]; then
+ if [[ $verbose -eq 1 ]]; then
+ echo "Cleaning EPC"
+ fi
+ rm -Rf build 2>&1
+ rm -Rf $OPENAIR_TARGETS/CMAKE/EPC/MME_GW/build 2>&1
+ rm -f /usr/local/etc/freeDiameter/mme* 2>&1
+ rm -f /usr/local/etc/freeDiameter/epc* 2>&1
+ rm -f /usr/etc/freeDiameter/mme* 2>&1
+ rm -f /usr/etc/freeDiameter/epc* 2>&1
+ rm -f $OPENAIR_DIR/targets/bin/xt_GTPU*.ko 2>&1
+ (cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH && make clean)
+ (cd $OPENAIRCN_DIR/GTPV1-U/GTPURH && make clean)
+ rm -f $OPENAIRCN_DIR/GTPV1-U/GTPUAH/Bin/* 2>&1
+ rm -f /lib/xtables/libxt_GTPU*.so 2>&1
+ mkdir -m 777 -p -v build
+ fi
+
+ ##############################################################################
+ # Compile kernel modules
+ ##############################################################################
+ # NO CMAKE FOR THAT, THIS CODE CAN DISAPEAR
+ #cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH;
+ #make
+ #if [ $? -ne 0 ]; then
+ # echo_error "Build GTPUAH module failed, exiting"
+ # return 1
+ #else
+ # $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
+ # $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
+ #fi
+
+ #cd $OPENAIRCN_DIR/GTPV1-U/GTPURH;
+ #make
+ #if [ $? -ne 0 ]; then
+ # echo_error "Build GTPURH module failed, exiting"
+ # return 1
+ #else
+ # $SUDO cp -pfv ./Bin/libxt_*.so /lib/xtables
+ # $SUDO cp -pfv ./Bin/*.ko $OPENAIR_TARGETS/bin
+ #fi
+
+
+
+ ##############################################################################
+ # Compile EPC
+ ##############################################################################
+ cd $OPENAIR_DIR/cmake_targets/epc_build_oai
+ #cd $OPENAIR_TARGETS/CMAKE/EPC/MME_GW
+ if [ ! -d ./build ]; then
+ mkdir -m 777 -p -v build
+ fi
+ cmake_file=./CMakeLists.txt
+ cp $OPENAIR_DIR/cmake_targets/epc_build_oai/CMakeLists.template $cmake_file
+ echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
+ cd ./build
+ cmake $cmake_args ..
+ #make $make_args -j $NUM_CPU
+ #make install
+ compilations \
+ epc_build_oai mme_gw \
+ mme_gw $dbin/mme_gw.$REL
+ # Only integrated mme+sgw+pgw is operational today
+ # compilations \
+ # epc_build_oai oai_sgw \
+ # oai_sgw $dbin/oai_sgw.$REL
+ compilations \
+ epc_build_oai xt_GTPUAH_lib \
+ libxt_GTPUAH_lib.so $dbin
+ compilations \
+ epc_build_oai xt_GTPURH_lib \
+ libxt_GTPURH_lib.so $dbin
+ compilations \
+ epc_build_oai xt_GTPURH \
+ CMakeFiles/xt_GTPURH/xt_GTPURH.ko $dbin
+ compilations \
+ epc_build_oai xt_GTPUAH \
+ CMakeFiles/xt_GTPUAH/xt_GTPUAH.ko $dbin
+
+ echo_info "Copying iptables libraries into system directory: /lib/xtables"
+ if [ -f $dbin/libxt_GTPURH_lib.so ] ; then
+ $SUDO rm -f /lib/xtables/libxt_GTPURH.so /lib/xtables/libxt_GTPUAH.so
+ $SUDO ln -s $dbin/libxt_GTPURH_lib.so /lib/xtables/libxt_GTPURH.so
+ $SUDO ln -s $dbin/libxt_GTPUAH_lib.so /lib/xtables/libxt_GTPUAH.so
+ else
+ echo_fatal "not installed GTP-U iptables: binaries not found"
+ fi
+ # Do EPC
+ if [ -f $OPENAIR_DIR/cmake_targets/epc_build_oai/build/mme_fd.conf ] ; then
+ cp -uv $OPENAIR_DIR/cmake_targets/epc_build_oai/build/epc*.conf $dconf
+ $SUDO cp -uv $OPENAIR_DIR/cmake_targets/epc_build_oai/build/mme_fd.conf $FREEDIAMETER_PREFIX/etc/freeDiameter
+ else
+ echo_fatal "not installed EPC config files: not found"
+ fi
+
+}
+
+
+main "$@"
+
diff --git a/cmake_targets/tools/build_helper.bash b/cmake_targets/tools/build_helper
similarity index 86%
rename from cmake_targets/tools/build_helper.bash
rename to cmake_targets/tools/build_helper
index 024894622d..dab36592e3 100755
--- a/cmake_targets/tools/build_helper.bash
+++ b/cmake_targets/tools/build_helper
@@ -26,7 +26,7 @@
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
#
################################################################################
-# file build_cmake.bash
+# file build_helper
# brief
# author Laurent Thomas
#
@@ -65,53 +65,7 @@ echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
-print_help() {
-echo_info '
-This program installs OpenAirInterface Software
-You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
-Options
--h
- This help
--c | --clean
- Erase all files made by previous compilation, installation"
---clean-kernel
- Erase previously installed features in kernel: iptables, drivers, ...
--I | --install-external-packages
- Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...
- This option will require root password
---install-optional-packages
- Install useful but not mandatory packages such as valgrind
--g | --run-with-gdb
- Add debugging symbols to compilation directives
---eNB
- Makes the eNB LTE softmodem
---UE
- Makes the UE softmodem
---EPC
- Makes the EPC
--r | --3gpp-release
- default is Rel10,
- Rel8 limits the implementation to 3GPP Release 8 version
--w | --hardware
- EXMIMO (Default), USRP, None
- Adds this RF board support (in external packages installation and in compilation)
---oaisim
- Makes the oaisim simulator
---phy_simulators
- Makes the unitary tests Layer 1 simulators
---core_simulators
- Makes the core security features unitary simulators
--s | --check
- runs a set of auto-tests based on simulators and several compilation tests
--V | --vcd
- Adds a debgging facility to the binary files: GUI with major internal synchronization events
--x | --xforms
- Adds a software oscilloscope feature to the produced binaries
---install-system-files
- Install OpenArInterface required files in Linux system
- (will ask root password)
-Typical Options for a quick startup with a COTS UE and Eurecom RF board: build_oai.bash -I -g -eNB -EPC -x --install-system-files'
-}
+
###########################
# Cleaners
@@ -141,7 +95,7 @@ clean_kernel() {
clean_all_files() {
set_openair_env
dir=$OPENAIR_DIR/cmake_targets
- rm -rf $dir/log $OPENAIR_DIR/targets/bin
+ rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
rm -rf $dir/lte_build_oai $dir/lte-simulators/build
rm -rf $dir/epc_build_oai/build $dir/epc_build_oai/CMakeLists.txt
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
@@ -184,7 +138,7 @@ make_one_cert() {
make_certs(){
fqdn=$1
- certs_dir=/usr/local/etc/freeDiameter
+ certs_dir=$FREEDIAMETER_PREFIX/freeDiameter
# certificates are stored in diameter config directory
if [ ! -d $certs_dir ]; then
echo "Creating non existing directory: $certs_dir"
@@ -244,9 +198,9 @@ install_gnutls_from_source(){
rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23
}
-install_freediameter_from_source() {
+install_1.1.5_freediameter_from_source() {
cd /tmp
- echo "Downloading freeDiameter archive"
+ echo "Downloading 1.1.5 freeDiameter archive"
rm -rf /tmp/1.1.5.tar.gz* /tmp/freeDiameter-1.1.5
wget http://www.freediameter.net/hg/freeDiameter/archive/1.1.5.tar.gz
tar xzf 1.1.5.tar.gz
@@ -262,6 +216,24 @@ install_freediameter_from_source() {
rm -rf /tmp/1.1.5.tar.gz /tmp/freeDiameter-1.1.5
}
+install_freediameter_from_source() {
+ cd /tmp
+ echo "Downloading 1.2.0 freeDiameter archive"
+ rm -rf /tmp/1.2.0.tar.gz* /tmp/freeDiameter-1.2.0
+ wget http://www.freediameter.net/hg/freeDiameter/archive/1.2.0.tar.gz
+ tar xzf 1.2.0.tar.gz
+ cd freeDiameter-1.2.0
+ patch -p1 < $OPENAIRCN_DIR/S6A/freediameter/freediameter-1.2.0.patch
+ mkdir build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../
+ echo "Compiling freeDiameter"
+ make -j4
+ #make test
+ $SUDO make install
+ rm -rf /tmp/1.2.0.tar.gz /tmp/freeDiameter-1.2.0
+}
+
check_install_usrp_uhd_driver(){
v=$(lsb_release -cs)
$SUDO apt-add-repository "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
@@ -339,6 +311,7 @@ check_install_oai_software() {
libxml2 \
libxml2-dev \
linux-headers-`uname -r` \
+ mscgen \
mysql-client \
mysql-server \
openssh-client \
@@ -456,7 +429,6 @@ set_openair_env(){
openair_path=${openair_path%/openair-cn/*}
openair_path=${openair_path%/openair[123]/*}
export OPENAIR_DIR=$openair_path
- export OPENAIR_HOME=$openair_path
export OPENAIR1_DIR=$openair_path/openair1
export OPENAIR2_DIR=$openair_path/openair2
export OPENAIR3_DIR=$openair_path/openair3
diff --git a/cmake_targets/tools/build_hss b/cmake_targets/tools/build_hss
new file mode 100755
index 0000000000..68b61c9395
--- /dev/null
+++ b/cmake_targets/tools/build_hss
@@ -0,0 +1,252 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file build_hss
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+#
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+source $THIS_SCRIPT_PATH/build_helper
+
+
+
+function help()
+{
+ echo_error " "
+ echo_error "Usage: build_hss [OPTION]..."
+ echo_error "Build the experimental HSS executable."
+ echo_error " "
+ echo_error "Options:"
+ echo_error "Mandatory arguments to long options are mandatory for short options too."
+ echo_error " -b, --s6a-bind-addr-list addr_list Optionaly, s6a server bind addresses can be specified here"
+ echo_error " -c, --clean Clean the build generated files (build from scratch)"
+ echo_error " -d, --debug Compile with debug informations."
+ echo_error " -f, --fqdn fqdn HSS Fully Qualified Domain Name (if not specified default is `hostname --fqdn`)."
+ echo_error " -h, --help Print this help."
+ echo_error " -i, --check-installed-software Check installed software packages necessary to build and run HSS (support Ubuntu 14.04)."
+ echo_error " -k, --operator-key key Operator key of the HSS (if not specified, default is 11111111111111111111111111111111, see CMakelists.txt)."
+ echo_error " -m, --connect-to-mme fqdn MME act as a S6A server, HSS as a client (reversed situation but allows MME and HSS be on the same host) ."
+ echo_error " -r, --realm realm Realm of the HSS (optional parameter)."
+ echo_error " -s, --transport-sctp-only Diameter use SCTP (TCP disabled)."
+ echo_error " -t, --transport-tcp-only Diameter use TCP (SCTP disabled)."
+ echo_error " -T, --transport-prefer-tcp Diameter prefer TCP."
+ echo_error " -v, --verbose Build process verbose."
+}
+
+
+
+function main()
+{
+ local -i clean=0
+ local -i verbose=0
+ local cmake_args=" "
+ local make_args="-j $NUM_CPU"
+ local realm=""
+ local hss_hostname=""
+ local mme_hostname=""
+ local mme_ip=""
+ local mme_fqdn=""
+
+
+ until [ -z "$1" ]; do
+ case "$1" in
+ -b | --s6a-bind-addr-list)
+ echo "S6A server bind addresses: $2"
+ cmake_args="$cmake_args -DFD_SERVER_IP_BIND_LIST=$2"
+ shift 2;
+ ;;
+ -c | --clean)
+ clean=1
+ echo "Clean the build generated files (build from scratch)"
+ shift;
+ ;;
+ -d | --debug)
+ cmake_args="$cmake_args -DDEBUG=1"
+ echo "Compile with debug informations"
+ shift;
+ ;;
+ -f | --fqdn)
+ echo "FQDN of the HSS: $2"
+ cmake_args="$cmake_args -DHSS_FQDN=$2"
+ shift 2;
+ ;;
+ -h | --help)
+ help
+ exit 0
+ ;;
+ -i | --check-installed-software)
+ echo "Check installed software packages necessary to build and run HSS (support Ubuntu 14.04):"
+ check_install_hss_software
+ exit 0
+ ;;
+ -I | --install-hss-files)
+ echo "Install HSS files: .conf files, database (if you want to reinstall database, drop it by hand before)."
+ cmake_args="$cmake_args -DINSTALL_HSS_FILES=1"
+ shift;
+ ;;
+ -k | --operator-key)
+ echo "Operator key of the HSS: $2"
+ cmake_args="$cmake_args -DOPERATOR_key=$2"
+ shift 2;
+ ;;
+ -m | --connect-to-mme)
+ mme_fqdn=$2
+ shift 2;
+ ;;
+ -r | --realm)
+ echo "Realm of the HSS: $2"
+ cmake_args="$cmake_args -DREALM=$2"
+ shift 2;
+ ;;
+ -s | --transport-sctp-only)
+ echo "Diameter use SCTP (TCP disabled), this is the default option."
+ cmake_args="$cmake_args -DTRANSPORT_option=No_TCP"
+ shift;
+ ;;
+ -t | --transport-tcp-only)
+ echo "Diameter use TCP (SCTP disabled)."
+ cmake_args="$cmake_args -DTRANSPORT_option=No_SCTP"
+ shift;
+ ;;
+ -T | --transport-prefer-tcp)
+ echo "Diameter prefer TCP (TCP, SCTP enabled)."
+ cmake_args="$cmake_args -DTRANSPORT_PREFER_TCP_option=Prefer_TCP"
+ shift;
+ ;;
+ -v | --verbose)
+ echo "Make build process verbose"
+ cmake_args="$cmake_args -DCMAKE_VERBOSE_MAKEFILE=ON"
+ make_args="VERBOSE=1 $make_args"
+ verbose=1
+ shift;
+ ;;
+ *)
+ echo "Unknown option $1"
+ help
+ exit 1
+ ;;
+ esac
+ done
+
+ # extra arguments processing
+ if [[ z$hss_fqdn = z ]]; then
+ hss_fqdn=`hostname --fqdn`
+ cmake_args="$cmake_args -DHSS_FQDN=$hss_fqdn"
+ if [[ z$realm = z ]]; then
+ realm=$hss_fqdn
+ realm=${realm#*.}
+ cmake_args="$cmake_args -DREALM=$realm"
+ fi
+ fi
+
+ if [[ z$mme_fqdn != z ]]; then
+ cmake_args="$cmake_args -DMME_FQDN=$mme_fqdn"
+ mme_hostname=${mme_fqdn%%.*}
+ cmake_args="$cmake_args -DMME_HOSTNAME=$mme_hostname"
+
+ mme_ip=`resolveip --silent $mme_hostname`
+ if [[ z$mme_ip = z ]]; then
+ mme_ip=`resolveip --silent $mme_fqdn`
+ fi
+ if [[ z$mme_ip = z ]]; then
+ echo_fatal "Unable to get MME IP addr of $mme_fqdn"
+ fi
+ cmake_args="$cmake_args -DHSS_CONNECT_TO_MME=1 -DMME_IP=$mme_ip"
+ fi
+
+ set_openair_env
+ if [[ $verbose -eq 1 ]]; then
+ cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
+ fi
+
+ if [[ z$OPENAIR_DIR = z ]]; then
+ echo_fatal "OPENAIR_DIR env variable not set, exiting"
+ fi
+
+
+ local dbin=$OPENAIR_DIR/targets/bin
+ local dlog=$OPENAIR_DIR/cmake_targets/log
+ local dconf=OPENAIR_DIR/targets/bin
+
+ mkdir -m 777 -p $dbin $dlog
+
+ # for conf files copy in this bash script
+ if [ -d /usr/lib/freeDiameter ]; then
+ export FREEDIAMETER_PREFIX=/usr
+ else
+ if [ -d /usr/local/lib/freeDiameter ]; then
+ export FREEDIAMETER_PREFIX=/usr/local
+ else
+ echo_fatal "FreeDiameter prefix not found, install freeDiameter if EPC, HSS"
+ fi
+ fi
+
+
+
+ cmake_args="$cmake_args -DOPENAIR_DIR=$OPENAIR_DIR"
+
+ rm -f $OPENAIR_DIR/targets/bin/openair-hss
+ cd $OPENAIR_DIR/cmake_targets/hss_build
+ if [ $clean -ne 0 ]; then
+ if [[ $verbose -eq 1 ]]; then
+ echo "Cleaning HSS"
+ fi
+ $SUDO rm -Rf build 2>&1
+ if [[ $verbose -eq 1 ]]; then
+ echo "Cleaning /usr/*/etc/freeDiameter"
+ fi
+ $SUDO rm -f /usr/local/etc/freeDiameter/hss* 2>&1
+ $SUDO rm -f /usr/local/etc/freeDiameter/acl.conf 2>&1
+ $SUDO rm -f /usr/etc/freeDiameter/hss* 2>&1
+ $SUDO rm -f /usr/etc/freeDiameter/acl.conf 2>&1
+ mkdir -m 777 -p -v build
+ fi
+ if [ ! -d ./build ]; then
+ mkdir -m 777 -p -v build
+ fi
+ cd ./build
+ cmake $cmake_args ..
+ make $make_args
+ make install
+
+
+ # bash doesn't like space char around = char
+ cp -uv $OPENAIR_DIR/cmake_targets/hss_build/build/hss.conf $dbin
+ $SUDO cp -uv $OPENAIR_DIR/cmake_targets/hss_build/build/hss_fd.conf $OPENAIR_DIR/cmake_targets/hss_build/build/acl.conf $FREEDIAMETER_PREFIX/etc/freeDiameter
+
+}
+
+
+main "$@"
+
diff --git a/cmake_targets/tools/check_hss_s6a_certificate b/cmake_targets/tools/check_hss_s6a_certificate
new file mode 100755
index 0000000000..e444c7f4c5
--- /dev/null
+++ b/cmake_targets/tools/check_hss_s6a_certificate
@@ -0,0 +1,104 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file check_hss_s6a_certificate
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+source $THIS_SCRIPT_PATH/build_helper
+
+
+function _create_hss_certs()
+{
+ local freediameter_path=$1
+ local fqdn=$2
+
+ cd /tmp
+ rm -rf /tmp/demoCA
+ mkdir /tmp/demoCA
+ echo 01 > /tmp/demoCA/serial
+ touch /tmp/demoCA/index.txt
+
+ echo "Creating HSS certificate for user '$fqdn'"
+ # Create a Root Certification Authority Certificate
+ openssl req -new -batch -x509 -days 3650 -nodes -newkey rsa:1024 -out hss.cacert.pem -keyout hss.cakey.pem -subj /CN=$fqdn/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
+
+ # Generate a Private Key
+ openssl genrsa -out hss.key.pem 1024
+
+ # Generate a CSR (Certificate Signing Request) that will be self-signed
+ openssl req -new -batch -out hss.csr.pem -key hss.key.pem -subj /CN=$fqdn/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
+
+ # Certification authority
+ openssl ca -cert hss.cacert.pem -keyfile hss.cakey.pem -in hss.csr.pem -out hss.cert.pem -outdir . -batch
+
+ if [ ! -d $freediameter_path/etc/freeDiameter ]; then
+ echo "Creating non existing directory: $freediameter_path/etc/freeDiameter/"
+ sudo mkdir -p $freediameter_path/etc/freeDiameter/
+ fi
+
+ sudo mv hss.cakey.pem hss.cert.pem hss.cacert.pem hss.key.pem $freediameter_path/etc/freeDiameter/
+ cd -
+}
+
+
+#$1 if freediameter path
+#$2 is fqdn
+function main() {
+ local freediameter_path=$1
+ local fqdn=$2
+ if [ -d $freediameter_path/etc/freeDiameter ]; then
+ if [ -f $freediameter_path/etc/freeDiameter/hss.cert.pem ]; then
+ full_hostname=`cat $freediameter_path/etc/freeDiameter/hss.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6`
+ if [ a$full_hostname == a$fqdn ]; then
+ echo_success "HSS S6A: Found valid certificate in $freediameter_path/etc/freeDiameter"
+ return 0
+ else
+ echo_error "Bad hss fqdn found in cert file: $full_hostname fqdn is $fqdn"
+ fi
+ fi
+ fi
+ echo_error "HSS S6A: Did not find valid certificate in $freediameter_path/etc/freeDiameter"
+ echo_warning "HSS S6A: generating new certificate in $freediameter_path/etc/freeDiameter..."
+ _create_hss_certs $freediameter_path $fqdn
+ if [ $# -lt 3 ] ; then
+ main $freediameter_path $fqdn 2
+ return $?
+ else
+ echo_error "Could not access to freeDiameter path: $freediameter_path/etc/freeDiameter"
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/cmake_targets/tools/check_mme_s6a_certificate b/cmake_targets/tools/check_mme_s6a_certificate
new file mode 100755
index 0000000000..62d0c53468
--- /dev/null
+++ b/cmake_targets/tools/check_mme_s6a_certificate
@@ -0,0 +1,103 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file check_mme_s6a_certificate
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+. $THIS_SCRIPT_PATH/build_helper
+
+
+function _create_mme_certs()
+{
+ local freediameter_path=$1
+ local fqdn=$2
+
+ cd /tmp
+ rm -rf /tmp/demoCA
+ mkdir /tmp/demoCA
+ echo 01 > /tmp/demoCA/serial
+ touch /tmp/demoCA/index.txt
+
+ echo "Creating MME certificate for user '$fqdn'"
+ # Create a Root Certification Authority Certificate
+ openssl req -new -batch -x509 -days 3650 -nodes -newkey rsa:1024 -out mme.cacert.pem -keyout mme.cakey.pem -subj /CN=$fqdn/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
+
+ # Generate a Private Key
+ openssl genrsa -out mme.key.pem 1024
+
+ # Generate a CSR (Certificate Signing Request) that will be self-signed
+ openssl req -new -batch -out mme.csr.pem -key mme.key.pem -subj /CN=$fqdn/C=FR/ST=PACA/L=Aix/O=Eurecom/OU=CM
+
+ # Certification authority
+ openssl ca -cert mme.cacert.pem -keyfile mme.cakey.pem -in mme.csr.pem -out mme.cert.pem -outdir . -batch
+
+ if [ ! -d $freediameter_path/etc/freeDiameter ]; then
+ echo "Creating non existing directory: $freediameter_path/etc/freeDiameter/"
+ sudo mkdir -p $freediameter_path/etc/freeDiameter/
+ fi
+
+ sudo mv mme.cakey.pem mme.cert.pem mme.cacert.pem mme.key.pem $freediameter_path/etc/freeDiameter/
+ cd -
+}
+
+#$1 if freediameter path
+#$2 is fqdn
+function main() {
+ local freediameter_path=$1
+ local fqdn=$2
+ if [ -d $freediameter_path/etc/freeDiameter ]; then
+ if [ -f $freediameter_path/etc/freeDiameter/mme.cert.pem ]; then
+ full_hostname=`cat $freediameter_path/etc/freeDiameter/mme.cert.pem | grep "Subject" | grep "CN" | cut -d '=' -f6`
+ if [ a$full_hostname == a$fqdn ]; then
+ echo_success "MME S6A: Found valid certificate in $freediameter_path/etc/freeDiameter"
+ return 0
+ else
+ echo_error "Bad mme fqdn found in cert file: $full_hostname fqdn is $fqdn"
+ fi
+ fi
+ fi
+ echo_error "MME S6A: Did not find valid certificate in $freediameter_path/etc/freeDiameter"
+ echo_warning "MME S6A: generating new certificate in $freediameter_path/etc/freeDiameter..."
+ _create_mme_certs $freediameter_path $fqdn
+ if [ $# -lt 3 ] ; then
+ main $freediameter_path $fqdn 2
+ return $?
+ else
+ echo_error "Could not access to freeDiameter path: $freediameter_path/etc/freeDiameter"
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/cmake_targets/tools/create_hss_database b/cmake_targets/tools/create_hss_database
new file mode 100755
index 0000000000..054be034d7
--- /dev/null
+++ b/cmake_targets/tools/create_hss_database
@@ -0,0 +1,103 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file create_hss_database
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+. $THIS_SCRIPT_PATH/build_helper
+
+
+# arg 1 is mysql user (ex: root)
+# arg 2 is mysql password (ex: linux)
+# arg 3 is hss username (ex: hssadmin)
+# arg 4 is hss password (ex: admin)
+# arg 5 is database name (ex: oai_db)
+function main()
+{
+ EXPECTED_ARGS=5
+ E_BADARGS=65
+ MYSQL=`which mysql`
+ rv=0
+ if [ $# -ne $EXPECTED_ARGS ]
+ then
+ echo_fatal "Usage: $0 dbuser dbpass hssuser hsspass databasename"
+ rv=1
+ fi
+
+ set_openair_env
+
+ # removed %
+ #Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'%' IDENTIFIED BY '$4' WITH GRANT OPTION;"
+ Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'localhost' IDENTIFIED BY '$4' WITH GRANT OPTION;"
+ Q2="FLUSH PRIVILEGES;"
+ SQL="${Q1}${Q2}"
+ $MYSQL -u $1 --password=$2 -e "$SQL"
+ if [ $? -ne 0 ]; then
+ echo_error "$3 permissions failed"
+ return 1
+ else
+ echo_success "$3 permissions succeeded"
+ fi
+
+
+ Q1="CREATE DATABASE IF NOT EXISTS ${BTICK}$5${BTICK};"
+ SQL="${Q1}"
+ $MYSQL -u $3 --password=$4 -e "$SQL"
+ if [ $? -ne 0 ]; then
+ echo_error "$5 creation failed"
+ return 1
+ else
+ echo_success "$5 creation succeeded"
+ fi
+
+
+ # test if tables have been created
+ mysql -u $3 --password=$4 -e "desc $5.users" > /dev/null 2>&1
+
+ if [ $? -eq 1 ]; then
+ $MYSQL -u $3 --password=$4 $5 < $OPENAIRCN_DIR/OPENAIRHSS/db/$5.sql
+ if [ $? -ne 0 ]; then
+ echo_error "$5 tables creation failed"
+ return 1
+ else
+ echo_success "$5 tables creation succeeded"
+ fi
+ fi
+
+ return 0
+}
+
+main "$@"
+
diff --git a/cmake_targets/tools/epc.conf.in b/cmake_targets/tools/epc.conf.in
index f4ff736428..89d8a4dea4 100755
--- a/cmake_targets/tools/epc.conf.in
+++ b/cmake_targets/tools/epc.conf.in
@@ -26,7 +26,7 @@ MME :
S6A :
{
- S6A_CONF = "@FREEDIAMETER_PATH@/../etc/freeDiameter/epc_s6a.conf";
+ S6A_CONF = "@FREEDIAMETER_PATH@/../etc/freeDiameter/mme_fd.conf";
HSS_HOSTNAME = "@HSS_HOSTNAME@";
};
diff --git a/cmake_targets/tools/epc.local.enb.conf.in b/cmake_targets/tools/epc.local.enb.conf.in
index 3ff6ed743c..4afc5851d1 100755
--- a/cmake_targets/tools/epc.local.enb.conf.in
+++ b/cmake_targets/tools/epc.local.enb.conf.in
@@ -26,7 +26,7 @@ MME :
S6A :
{
- S6A_CONF = "@FREEDIAMETER_PATH@/../etc/freeDiameter/epc_s6a.conf";
+ S6A_CONF = "@FREEDIAMETER_PATH@/../etc/freeDiameter/mme_fd.conf";
HSS_HOSTNAME = "@HSS_HOSTNAME@";
};
@@ -117,8 +117,8 @@ P-GW =
PGW_INTERFACE_NAME_FOR_S5_S8 = "none";
PGW_IPV4_ADDRESS_FOR_S5_S8 = "0.0.0.0/24";
- PGW_INTERFACE_NAME_FOR_SGI = "eth1";
- PGW_IPV4_ADDRESS_FOR_SGI = "192.168.13.82/24";
+ PGW_INTERFACE_NAME_FOR_SGI = "eth0";
+ PGW_IPV4_ADDRESS_FOR_SGI = "192.168.14.17/24";
# Option available only if GTPU in kernel configured
PGW_MASQUERADE_SGI = "yes";
};
diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
new file mode 100644
index 0000000000..bae66a3572
--- /dev/null
+++ b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
@@ -0,0 +1,90 @@
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file example_enb_exmimo_mme_hss.txt
+# brief
+# author Lionel Gauthier
+
+This example shows how to generate and launch enb, mme_gw, hss executables on the same host:
+
+################
+Configuration
+################
+freediameter 1.2.0 (not 1.1.5, 1.1.6,...) has to be installed and patched (done by check_install_oai_software() calling install_freediameter_from_source() in script build_helper)
+
+Config File:
+/etc/hosts must contain the fqdn of the MME and HSS (same since both run on the same host):
+(assuming the realm is openair4G.eur)
+127.0.0.1 localhost
+127.0.1.1 yang.openair4G.eur yang
+...
+
+################
+BUILDING, RUNNING
+################
+
+Building HSS:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets$ tools/build_hss -c --connect-to-mme yang.openair4G.eur -t -T --realm openair4G.eur
+
+Running the HSS:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets$ sudo tools/run_hss -g
+
+
+
+Building the MME-GW:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets/tools$ sudo ./build_epc -c -d -t -T --s6a-server
+
+Running the MME-GW:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets/tools$ sudo ./run_epc -l -g -K
+
+
+
+Building eNB:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets$ ./build_oai --eNB
+
+Running eNB:
+yang@yang:~/openair4G/branches/LG_PRE_RELEASE_0.3/cmake_targets$ sudo tools/run_enb_s1_exmimo -c /home/yang/openair4G/branches/LG_PRE_RELEASE_0.3/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.yang.epc.eurecom.conf -S -K
+
+
+################
+Tool:
+###############
+
+mscgen (http://www.mcternan.me.uk/mscgen/)
+We use the software to generate sequence diagrams
+with traces generated during the execution of the eNB.
+After the enb execution:
+yang@yang:...$ cd /tmp
+yang@yang:/tmp$ /home/yang/openair4G/branches/LG_PRE_RELEASE_0.3/targets/SCRIPTS/msc_gen.py
+The results are located in the current directory (/tmp in this example) in a folder. The name of the folder
+is the current date (for example: 2015-04-08_20.34.10).
+The results are input files for the mscgen tool containing events or messages and the
+corresponding generated png files.
+
+
+
diff --git a/cmake_targets/tools/exmimo2_2brxg.lime b/cmake_targets/tools/exmimo2_2brxg.lime
new file mode 100755
index 0000000000..e99c738cd0
--- /dev/null
+++ b/cmake_targets/tools/exmimo2_2brxg.lime
@@ -0,0 +1,10 @@
+# this file contains the calibration values to compute the RSSI
+# we can use three different gain stages (high, low, med) as well as a gain factor for fine tuning
+# the three lines in this file gives the total rx gain in dB for the three gain stages if the rx gain is set to 30dB
+# this is for Express MIMO2 without any additional RF frontend
+# high gain
+128 128 128 126
+# med gain
+122 123 123 120
+# low gain (byp)
+116 117 116 116
diff --git a/cmake_targets/tools/generate_asn1.bash b/cmake_targets/tools/generate_asn1
similarity index 93%
rename from cmake_targets/tools/generate_asn1.bash
rename to cmake_targets/tools/generate_asn1
index 2b04ca591f..9705838489 100755
--- a/cmake_targets/tools/generate_asn1.bash
+++ b/cmake_targets/tools/generate_asn1
@@ -1,4 +1,7 @@
+#!/bin/bash
+function main()
+{
mkdir -p $1
cd $1
shift
@@ -26,3 +29,6 @@ awk '
END {
print "#endif ";
} ' $1 > asn1_constants.h
+}
+
+main "$@"
diff --git a/cmake_targets/tools/indent_source_code b/cmake_targets/tools/indent_source_code
new file mode 100755
index 0000000000..f666e65660
--- /dev/null
+++ b/cmake_targets/tools/indent_source_code
@@ -0,0 +1,75 @@
+#!/bin/bash
+################################################################################
+# OpenAirInterface
+# Copyright(c) 1999 - 2014 Eurecom
+#
+# OpenAirInterface is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) anylater version.
+#
+#
+# OpenAirInterface is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenAirInterface.The full GNU General Public License is
+# included in this distribution in the file called "COPYING". If not,
+# see .
+#
+# Contact Information
+# OpenAirInterface Admin: openair_admin@eurecom.fr
+# OpenAirInterface Tech : openair_tech@eurecom.fr
+# OpenAirInterface Dev : openair4g-devel@eurecom.fr
+#
+# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+#
+################################################################################
+# file indent_source_code
+# brief
+# author Lionel Gauthier
+# company Eurecom
+# email: lionel.gauthier@eurecom.fr
+#
+################################
+# include helper functions
+################################
+THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
+source $THIS_SCRIPT_PATH/build_helper
+
+function main()
+{
+ local MAX_CODE_LENGTH=200
+ local INDENT_SPACES=2
+set_openair_env
+
+
+ # remove trailing white spaces
+ #find $OPENAIR_DIR/openair1 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+ #find $OPENAIR_DIR/openair2 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+ #find $OPENAIR_DIR/openair3 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+ #find $OPENAIR_DIR/openair-cn -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+ #find $OPENAIR_DIR/targets -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
+
+# Style google not available on 14.04
+
+ exit 0
+ # will use indent
+ command -v astyle >/dev/null 2>&1 || { echo >&2 "astyle required but it's not installed."; sudo apt-get install astyle; }
+ astyle --recursive --convert-tabs --indent=spaces=$INDENT_SPACES --style=kr --indent-col1-comments --max-code-length=$MAX_CODE_LENGTH \
+ $OPENAIR_DIR/openair1/*.h \
+ $OPENAIR_DIR/openair1/*.c \
+ $OPENAIR_DIR/openair2/*.h \
+ $OPENAIR_DIR/openair2/*.c \
+ $OPENAIR_DIR/openair3/*.h \
+ $OPENAIR_DIR/openair3/*.c \
+ $OPENAIR_DIR/openair-cn/*.h \
+ $OPENAIR_DIR/openair-cn/*.c \
+ $OPENAIR_DIR/targets/*.h \
+ $OPENAIR_DIR/targets/*.c
+}
+
+
+main "$@"
diff --git a/cmake_targets/tools/init_exmimo2.sh b/cmake_targets/tools/init_exmimo2
similarity index 95%
rename from cmake_targets/tools/init_exmimo2.sh
rename to cmake_targets/tools/init_exmimo2
index b7b52b4b36..421d458cbb 100755
--- a/cmake_targets/tools/init_exmimo2.sh
+++ b/cmake_targets/tools/init_exmimo2
@@ -1,5 +1,21 @@
#!/bin/bash
+load_module()
+{
+ mod_name=${1##*/}
+ mod_name=${mod_name%.*}
+ if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
+ then
+ echo "module $mod_name already loaded: I remove it first"
+ sudo rmmod $mod_name
+ fi
+ echo loading $mod_name
+ sudo insmod $1
+}
+
+
+function main()
+{
PCI=`lspci -m | grep Xilinx`
if [ -z "$PCI" ]; then
echo "No card found. Stopping!"
@@ -12,17 +28,6 @@ SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'`
sudo setpci -s $SLOT_NUMBER 60.b=10
done
-load_module() {
- mod_name=${1##*/}
- mod_name=${mod_name%.*}
- if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
- then
- echo "module $mod_name already loaded: I remove it first"
- sudo rmmod $mod_name
- fi
- echo loading $mod_name
- sudo insmod $1
-}
load_module $OPENAIR_DIR/targets/bin/openair_rf.ko
sleep 1
@@ -41,3 +46,6 @@ else
echo 'No corresponding firmware found'
return
fi
+}
+
+main "$@"
diff --git a/cmake_targets/tools/run_enb_s1_exmimo b/cmake_targets/tools/run_enb_s1_exmimo
index b547b28250..89d1c5a8da 100755
--- a/cmake_targets/tools/run_enb_s1_exmimo
+++ b/cmake_targets/tools/run_enb_s1_exmimo
@@ -87,7 +87,7 @@ function main()
echo_fatal "config file $CONFIG_FILE not found"
fi
fi
- exe_arguments="$exe_arguments -O $CONFIG_FILE"
+ exe_arguments="$exe_arguments -O $CONFIG_FILE -F $THIS_SCRIPT_PATH/exmimo2_2arxg.lime"
shift 2;
;;
-g | --gdb)
@@ -105,10 +105,12 @@ function main()
# can omit file name if last arg on the line
if [ "x$ITTI_DUMP_FILE" = "x" ]; then
ITTI_DUMP_FILE="/tmp/enb_s1_exmimo_itti.log"
+ shift 1;
+ else
+ shift 2;
fi
echo "setting ITTI dump file to: $ITTI_DUMP_FILE"
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
- shift 2;
;;
-M | --target-dl-mcs)
echo "setting target dl MCS to $2"
@@ -143,25 +145,19 @@ function main()
esac
done
- check_for_root_rights
set_openair_env
- cecho "OPENAIR_HOME = $OPENAIR_HOME" $green
- cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green
- cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green
- cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green
- cecho "OPENAIRCN_DIR = $OPENAIRCN_DIR" $green
- cecho "OPENAIR_TARGETS = $OPENAIR_TARGETS" $green
+ cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
- if [ ! -e $OPENAIR_TARGETS/bin/lte-softmodem ]; then
- echo_fatal "Cannot find $OPENAIR_TARGETS/bin/lte-softmodem executable"
+ if [ ! -e $OPENAIR_DIR/targets/bin/lte-softmodem ]; then
+ echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/lte-softmodem executable"
fi
- if [ ! -e $OPENAIR_TARGETS/bin/updatefw ]; then
- echo_fatal "Cannot find $OPENAIR_TARGETS/bin/updatefw executable"
+ if [ ! -e $OPENAIR_DIR/targets/bin/updatefw ]; then
+ echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/updatefw executable"
fi
- if [ ! -e $OPENAIR_TARGETS/bin/openair_rf.ko ]; then
- echo_fatal "Cannot find $OPENAIR_TARGETS/bin/openair_rf.ko kernel module"
+ if [ ! -e $OPENAIR_DIR/targets/bin/openair_rf.ko ]; then
+ echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/openair_rf.ko kernel module"
fi
for i in `seq 0 64`; do
@@ -171,14 +167,14 @@ function main()
fi;
done
- $THIS_SCRIPT_PATH/init_exmimo2.sh
+ $THIS_SCRIPT_PATH/init_exmimo2
if [ $run_gdb -eq 0 ]; then
- exec $OPENAIR_TARGETS/bin/lte-softmodem `echo $exe_arguments` 2>&1 > /tmp/gdb_lte_softmodem.stdout.txt
+ exec $OPENAIR_DIR/targets/bin/lte-softmodem `echo $exe_arguments` 2>&1 > /tmp/lte_softmodem.stdout.txt
else
touch ~/.gdb_lte_softmodem
chmod 777 ~/.gdb_lte_softmodem
- echo "file $OPENAIR_TARGETS/bin/lte-softmodem" > ~/.gdb_lte_softmodem
+ echo "file $OPENAIR_DIR/targets/bin/lte-softmodem" > ~/.gdb_lte_softmodem
echo "set args $exe_arguments" >> ~/.gdb_lte_softmodem
echo "run" >> ~/.gdb_lte_softmodem
cat ~/.gdb_lte_softmodem
diff --git a/cmake_targets/tools/run_epc b/cmake_targets/tools/run_epc
index bba6b9060c..720b57e920 100755
--- a/cmake_targets/tools/run_epc
+++ b/cmake_targets/tools/run_epc
@@ -115,30 +115,25 @@ function main()
check_for_root_rights
set_openair_env
- cecho "OPENAIR_HOME = $OPENAIR_HOME" $green
- cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green
- cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green
- cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green
- cecho "OPENAIRCN_DIR = $OPENAIRCN_DIR" $green
- cecho "OPENAIR_TARGETS = $OPENAIR_TARGETS" $green
+ cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
- if [ ! -e $OPENAIR_TARGETS/bin/mme_gw ]; then
- echo_fatal "Cannot find $OPENAIR_TARGETS/bin/mme_gw executable, have a look at the output of build_epc executable"
+ if [ ! -e $OPENAIR_DIR/targets/bin/mme_gw ]; then
+ echo_fatal "Cannot find $OPENAIR_DIR/targets/bin/mme_gw executable, have a look at the output of build_epc executable"
fi
if [ $epc_local -eq 1 ]; then
- epc_config_file="$OPENAIR_TARGETS/bin/epc.local.enb.conf"
+ epc_config_file="$OPENAIR_DIR/targets/bin/epc.local.enb.conf"
fi
exe_arguments="-O $epc_config_file $exe_arguments"
if [ $run_gdb -eq 0 ]; then
- exec $OPENAIR_TARGETS/bin/mme_gw `echo $exe_arguments` 2>&1
+ $OPENAIR_DIR/targets/bin/mme_gw `echo $exe_arguments` 2>&1
else
touch ~/.gdb_mme_gw
chmod 777 ~/.gdb_mme_gw
- echo "file $OPENAIR_TARGETS/bin/mme_gw" > ~/.gdb_mme_gw
+ echo "file $OPENAIR_DIR/targets/bin/mme_gw" > ~/.gdb_mme_gw
echo "set args $exe_arguments " >> ~/.gdb_mme_gw
echo "run" >> ~/.gdb_mme_gw
cat ~/.gdb_mme_gw
diff --git a/cmake_targets/tools/run_hss b/cmake_targets/tools/run_hss
index 6faa6870cf..45025854b2 100755
--- a/cmake_targets/tools/run_hss
+++ b/cmake_targets/tools/run_hss
@@ -83,7 +83,7 @@ function main()
check_for_root_rights
set_openair_env
- cecho "OPENAIR_HOME = $OPENAIR_HOME" $green
+ cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
cecho "OPENAIR1_DIR = $OPENAIR1_DIR" $green
cecho "OPENAIR2_DIR = $OPENAIR2_DIR" $green
cecho "OPENAIR3_DIR = $OPENAIR3_DIR" $green