Commit d0b47397 authored by thomasl's avatar thomasl

test copy back from 0.3 branch to trunk, set GTP-U as the correct default case behavior


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6884 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 32c179e9
......@@ -39,10 +39,6 @@ ORIGIN_PATH=$PWD
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/tools/build_helper.bash
#EMULATION_DEV_INTERFACE="eth0"
#EMULATION_MULTICAST_GROUP=1
#EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
XFORMS="False"
VCD_TIMING="False"
REL="Rel10"
......@@ -326,7 +322,17 @@ if [ "$EPC" = "1" ] ; then
epc_build_oai xt_GTPUAH \
CMakeFiles/xt_GTPUAH/xt_GTPUAH.ko $dbin
compile_hss
if [ "$INSTALL_SYSTEM_FILES" = "1" ] ;then
# Example HSS and EPC run on the same host
$OPENAIR_HOME/cmake_targets/tools/build_hss --clean --debug --install-hss-files --transport-tcp-only --transport-prefer-tcp --fqdn `hostname --fqdn` --connect-to-mme `hostname --fqdn`
# example HHS and EPC run on separate hosts (can use SCTP)
# $OPENAIR_HOME/cmake_targets/tools/build_hss --clean --debug --install-hss-files
else
# Example HSS and EPC run on the same host
$OPENAIR_HOME/cmake_targets/tools/build_hss --debug --transport-tcp-only --transport-prefer-tcp --fqdn `hostname --fqdn` --connect-to-mme `hostname --fqdn`
# example HHS and EPC run on separate hosts (can use SCTP)
# $OPENAIR_HOME/cmake_targets/tools/build_hss --debug
fi
fi
if [ "$INSTALL_SYSTEM_FILES" = "1" ] ;then
......@@ -343,18 +349,18 @@ if [ "$INSTALL_SYSTEM_FILES" = "1" ] ;then
install_nas_tools $dbin $dconf
# Do EPC
cp $DIR/epc_build_oai/epc.*.conf $dconf
$SUDO cp $DIR/epc_build_oai/epc_s6a.conf /usr/local/etc/freeDiameter
cp $DIR/epc_build_oai/build/epc.*.conf $dconf
$SUDO cp $DIR/epc_build_oai/build/epc_s6a.conf /usr/local/etc/freeDiameter
# Do HSS
# bash doesn't like space char around = char
cp $DIR/hss_build/hss.conf $dbin
$SUDO cp $DIR/hss_build/hss_fd.conf $DIR/hss_build/acl.conf /usr/local/etc/freeDiameter
sed -e 's/ *= */=/' $OPENAIRCN_DIR/OPENAIRHSS/conf/hss.conf > $dconf/hss.conf.nospace
sed -e 's/ *= */=/' $dbin/hss.conf > $dconf/hss.conf.nospace
source $dconf/hss.conf.nospace
rm -f $dconf/hss.conf.nospace
create_hss_database root linux "$MYSQL_user" "$MYSQL_pass" "$MYSQL_db"
fi
# Auto-tests
......
......@@ -269,13 +269,13 @@ site_name(SITE_HSS_FQDN)
add_option(HSS_FQDN ${SITE_HSS_FQDN} "HSS Fully qualified domain name")
add_option(REALM openair4G.eur "HSS realm TODO: extract this default value from SITE_HSS_FQDN")
add_option(MYSQL_server "127.0.0.1" "Database server IP address")
add_option(MYSQL_admin root "Database admin login")
add_option(MYSQL_admin_pass linux "Database admin password")
add_option(MYSQL_user hssadmin "Database username login")
add_option(MYSQL_pass admin "Database username password")
add_option(MYSQL_db oai_db "Database name")
add_option(TRANSPORT_option No_SCTP "No_TCP or No_SCTP, FreeDiameter config option")
add_option(TRANSPORT_PREFER_TCP_option Prefer_TCP "Prefer_TCP or null string, FreeDiameter config option")
add_option(MYSQL_admin "root" "Database admin login")
add_option(MYSQL_admin_pass "linux" "Database admin password")
add_option(MYSQL_user "hssadmin" "Database username login")
add_option(MYSQL_pass "admin" "Database username password")
add_option(MYSQL_db "oai_db" "Database name")
add_option(TRANSPORT_option "#No_TCP" "No_TCP or No_SCTP or comment string, FreeDiameter config option")
add_option(TRANSPORT_PREFER_TCP_option "#Prefer_TCP" "Prefer_TCP or comment string, FreeDiameter config option")
add_option(AppServThreads 2 "FreeDiameter AppServThreads config option")
add_option(OPERATOR_key "11111111111111111111111111111111" "LTE operator clear text key (hex bytes)")
add_option(REMOTE_PEER_WHITELIST "*.${REALM}" "Remote peer whitlist (separeted by spaces), for freediameter acl.conf config file")
......@@ -285,6 +285,15 @@ ELSE( FD_SERVER_IP_BIND_LIST )
set(ListenOn "#ListenOn=\"\"" "//FreeDiameter server IP bind addresses list")
ENDIF( FD_SERVER_IP_BIND_LIST )
IF( HSS_CONNECT_TO_MME )
add_option(ConnectPeer "ConnectPeer" "HSS connect to MME")
add_option(DIAMETER_PORT "#Port = 3868" "Diameter bind port")
add_option(DIAMETER_SEC_PORT "#SecPort = 3869" "Diameter bind sec port")
ELSE( HSS_CONNECT_TO_MME )
add_option(ConnectPeer "#ConnectPeer" "HSS act as a server")
add_option(DIAMETER_PORT "Port = 3868" "Diameter bind port")
add_option(DIAMETER_SEC_PORT "SecPort = 3869" "Diameter bind sec port")
ENDIF( HSS_CONNECT_TO_MME )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/hss_fd.conf.in
${CMAKE_CURRENT_BINARY_DIR}/hss_fd.conf)
......@@ -295,6 +304,7 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/acl.conf.in
${CMAKE_CURRENT_BINARY_DIR}/acl.conf)
install (TARGETS openair-hss
DESTINATION ${OPENAIR_TARGETS}/bin)
......@@ -369,26 +369,6 @@ install_asn1c_from_source(){
#################################################
# 2. compile
################################################
compile_hss() {
cd $OPENAIR_DIR/cmake_targets/hss_build
rm -f $OPENAIR_TARGETS/bin/openair-hss openair-hss
if [ "$CLEAN" = "1" ]; then
echo "Cleaning HSS"
rm -rf BUILD
fi
mkdir -p BUILD
cd ./BUILD
cmake $SOFTMODEM_DIRECTIVES ..
make -j $NUM_CPU openair-hss > $dlog/hss.txt 2>&1
if [ -s openair-hss ] ; then
cp openair-hss $OPENAIR_TARGETS/bin
echo_success "hss compiled"
else
echo_error "hss compilation failed"
fi
return $?
}
install_nas_tools() {
cd $1
......@@ -408,48 +388,60 @@ install_nas_tools() {
# create HSS DB
################################
# arg 1 is mysql user (root)
# arg 2 is mysql password (linux)
# arg 3 is hss username (hssadmin)
# arg 4 is hss password (admin)
# arg 5 is database name (oai_db)
# arg 1 is mysql admin (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)
create_hss_database(){
EXPECTED_ARGS=5
if [ $# -ne $EXPECTED_ARGS ]
then
echo_error "Usage: $0 dbuser dbpass hssuser hsspass databasename"
return 1
fi
EXPECTED_ARGS=5
if [ $# -ne $EXPECTED_ARGS ]
then
echo_error "Usage: $0 dbadmin dbpass hssuser hsspass databasename"
return 1
fi
local mysql_admin=$1
local mysql_password=$2
local hss_username=$3
local hss_password=$4
local database_name=$5
Q1="GRANT ALL PRIVILEGES ON *.* TO '$3'@'localhost' IDENTIFIED BY '$4' WITH GRANT OPTION;"
Q2="FLUSH PRIVILEGES;"
mysql -u $1 --password=$2 -e "${Q1}${Q2}"
if [ $? -ne 0 ]; then
echo_error "$3 permissions creation failed"
echo_error "verify root password for mysql is linux: mysql -u root --password=linux"
echo_error "if not, reset it to "linux" with sudo dpkg-reconfigure mysql-server-5.5"
return 1
else
echo_success "$3 permissions creation succeeded"
fi
Q1="GRANT ALL PRIVILEGES ON *.* TO '$hss_username'@'localhost' IDENTIFIED BY '$hss_password' WITH GRANT OPTION;"
Q2="FLUSH PRIVILEGES;"
mysql -u $mysql_admin --password=$mysql_password -e "${Q1}${Q2}"
if [ $? -ne 0 ]; then
echo_error "HSS: $hss_username permissions creation failed"
echo_error "verify root password for mysql is linux: mysql -u root --password=linux"
echo_error "if not, reset it to "linux" with sudo dpkg-reconfigure mysql-server-5.5"
return 1
else
echo_success "HSS: $hss_username permissions creation succeeded"
fi
Q3="CREATE DATABASE IF NOT EXISTS $5;"
mysql -u $3 --password=$4 -e "${Q3}"
if [ $? -ne 0 ]; then
echo_error "$5 creation failed"
return 1
else
echo_success "$5 creation succeeded"
fi
Q3="CREATE DATABASE IF NOT EXISTS $database_name;"
mysql -u $hss_username --password=$hss_password -e "${Q3}"
if [ $? -ne 0 ]; then
echo_error "HSS: $database_name creation failed"
return 1
else
echo_success "HSS: $database_name creation succeeded"
fi
mysql -u $3 --password=$4 $5 < $OPENAIRCN_DIR/OPENAIRHSS/db/oai_db.sql
# test if tables have been created
mysql -u $hss_username --password=$hss_password -e "desc $database_name.users" > /dev/null 2>&1
if [ $? -eq 1 ]; then
mysql -u $hss_username --password=$hss_password $database_name < $OPENAIRCN_DIR/OPENAIRHSS/db/$database_name.sql
if [ $? -ne 0 ]; then
echo_error "$5 tables creation failed"
return 1
echo_error "HSS: $database_name tables creation failed"
return 1
else
echo_success "$5 tables creation succeeded"
echo_success "HSS: $database_name tables creation succeeded"
fi
return 0
else
echo_success "HSS: $database_name tables already created, nothing done"
fi
return 0
}
################################
......
......@@ -44,29 +44,30 @@ source $THIS_SCRIPT_PATH/build_helper
function help()
{
echo_error " "
echo_error "Usage: run_enb_s1_exmimo [OPTION]..."
echo_error "Usage: run_enb_s1_exmimo -c config_file [OPTION]..."
echo_error "Run the eNB executable, hardware target is EXMIMO."
echo_error " "
echo_error "Mandatory arguments:"
echo_error " -c, -C, --config-file eNB_config_file eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -c, -C, --config-file eNB config file (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file ITTI dump file containing all ITTI events occuring during EPC runtime."
echo_error " -H, --hss HSS hostname."
echo_error " -M, --target-dl-mcs Downlink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs Uplink target MCS."
echo_error " -x, --xforms Run XFORMS scope windows."
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
echo_error " -x, --xforms Run XFORMS scope windows."
}
function main()
{
local declare -i run_gdb=0
local declare exe_arguments=""
local -i run_gdb=0
local exe_arguments=""
until [ -z "$1" ]
do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment