Commit ecff2e01 authored by Lionel Gauthier's avatar Lionel Gauthier

OK for start of MME_GW and HSS on same host

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7109 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 19bfa12c
This diff is collapsed.
...@@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.8) ...@@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False ) set ( ADDR_CONF False )
set ( ASSERT False ) set ( ASSERT False )
set ( BYTE_ORDER=LITTLE_ENDIAN )
set ( DEBUG_OMG False ) set ( DEBUG_OMG False )
set ( DISABLE_ITTI_DETECT_SUB_TASK_ID True )
set ( DISABLE_XER_PRINT False ) set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 False ) set ( DRIVER2013 False )
set ( EMOS False ) set ( EMOS False )
...@@ -39,6 +41,7 @@ set ( MSG_PRINT False ) ...@@ -39,6 +41,7 @@ set ( MSG_PRINT False )
set ( MU_RECEIVER False ) set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False ) set ( NAS_ADDRESS_FIX False )
set ( NAS_BUILT_IN_EPC True ) set ( NAS_BUILT_IN_EPC True )
set ( NAS_DEBUG True )
set ( NAS_MME True ) set ( NAS_MME True )
set ( NAS_NETLINK False ) set ( NAS_NETLINK False )
set ( NAS_UE False ) set ( NAS_UE False )
......
...@@ -38,7 +38,10 @@ ENABLE_LANGUAGE(C) ...@@ -38,7 +38,10 @@ ENABLE_LANGUAGE(C)
ADD_DEFINITIONS(-D_GNU_SOURCE) ADD_DEFINITIONS(-D_GNU_SOURCE)
set(OPENAIR_DIR $ENV{OPENAIR_DIR}) if( NOT DEFINED OPENAIR_DIR)
message(SEND_ERROR "OPENAIR_DIR not set: ${OPENAIR_DIR}")
endif( NOT DEFINED OPENAIR_DIR)
set(OPENAIR1_DIR ${OPENAIR_DIR}/openair1) set(OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
set(OPENAIR2_DIR ${OPENAIR_DIR}/openair2) set(OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
set(OPENAIR3_DIR ${OPENAIR_DIR}/openair3) set(OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
...@@ -49,8 +52,7 @@ set(OPENAIRHSS_DIR ${OPENAIRCN_DIR}/OPENAIRHSS) ...@@ -49,8 +52,7 @@ set(OPENAIRHSS_DIR ${OPENAIRCN_DIR}/OPENAIRHSS)
set(OPENAIR_BIN_DIR ${OPENAIR_TARGETS}/bin) set(OPENAIR_BIN_DIR ${OPENAIR_TARGETS}/bin)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OPENAIR_CMAKE_SCRIPTS}/MODULES") set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
include(cmake_useful)
macro(add_option name val helpstr) macro(add_option name val helpstr)
if(DEFINED ${name}) if(DEFINED ${name})
...@@ -265,46 +267,60 @@ target_link_libraries (openair-hss ...@@ -265,46 +267,60 @@ target_link_libraries (openair-hss
${CMAKE_THREAD_LIBS_INIT} ) ${CMAKE_THREAD_LIBS_INIT} )
# Default parameters # Default parameters
site_name(SITE_HSS_FQDN) # Does not work on simple install (fqdn in /etc/hosts 127.0.1.1)
cmake_host_system_information(RESULT SITE_HSS_FQDN QUERY FQDN)
add_option(HSS_FQDN ${SITE_HSS_FQDN} "HSS Fully qualified domain name") 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") IF( NOT DEFINED REALM )
add_option(MYSQL_server "127.0.0.1" "Database server IP address") string(FIND ${HSS_FQDN} "." pos)
add_option(MYSQL_admin "root" "Database admin login") math(EXPR pos1 "${pos}+1")
add_option(MYSQL_admin_pass "linux" "Database admin password") string(SUBSTRING ${HSS_FQDN} ${pos1} -1 realm_string)
add_option(MYSQL_user "hssadmin" "Database username login") message("REALM extracted from HSS FQDN is ${realm_string}")
add_option(MYSQL_pass "admin" "Database username password") set(REALM ${realm_string} CACHE STRING "HSS realm")
add_option(MYSQL_db "oai_db" "Database name") ENDIF( NOT DEFINED REALM )
add_option(TRANSPORT_option "#No_TCP" "No_TCP or No_SCTP or comment string, FreeDiameter config option") set(MYSQL_server "127.0.0.1" CACHE STRING "Database server IP address")
add_option(TRANSPORT_PREFER_TCP_option "#Prefer_TCP" "Prefer_TCP or comment string, FreeDiameter config option") set(MYSQL_admin root CACHE STRING "Database admin login")
add_option(AppServThreads 2 "FreeDiameter AppServThreads config option") set(MYSQL_admin_pass linux CACHE STRING "Database admin password")
add_option(OPERATOR_key "11111111111111111111111111111111" "LTE operator clear text key (hex bytes)") set(MYSQL_user hssadmin CACHE STRING "Database username login")
add_option(REMOTE_PEER_WHITELIST "*.${REALM}" "Remote peer whitlist (separeted by spaces), for freediameter acl.conf config file") set(MYSQL_pass admin CACHE STRING "Database username password")
set(MYSQL_db oai_db CACHE STRING "Database name")
set(TRANSPORT_option "#No_TCP" CACHE STRING "No_TCP or No_SCTP or comment string, FreeDiameter config option")
set(TRANSPORT_PREFER_TCP_option "#Prefer_TCP" CACHE STRING "Prefer_TCP or comment string, FreeDiameter config option")
set(AppServThreads 2 CACHE STRING "FreeDiameter AppServThreads config option")
set(OPERATOR_key "11111111111111111111111111111111" CACHE STRING "LTE operator clear text key (hex bytes)")
set(REMOTE_PEER_WHITELIST "*.${REALM}" CACHE STRING "Remote peer whitelist (separated by spaces), for freediameter acl.conf config file")
IF( FD_SERVER_IP_BIND_LIST ) IF( FD_SERVER_IP_BIND_LIST )
set(ListenOn "ListenOn=\"${FD_SERVER_IP_BIND_LIST}\"" "//FreeDiameter server IP bind addresses list") set(ListenOn "ListenOn = \"${FD_SERVER_IP_BIND_LIST}\"" CACHE STRING "FreeDiameter server IP bind addresses list")
ELSE( FD_SERVER_IP_BIND_LIST ) ELSE( FD_SERVER_IP_BIND_LIST )
set(ListenOn "#ListenOn=\"\"" "//FreeDiameter server IP bind addresses list") set(ListenOn "#ListenOn = \"\"" CACHE STRING "FreeDiameter server IP bind addresses list")
ENDIF( FD_SERVER_IP_BIND_LIST ) ENDIF( FD_SERVER_IP_BIND_LIST )
IF( HSS_CONNECT_TO_MME ) IF( HSS_CONNECT_TO_MME )
add_option(ConnectPeer "ConnectPeer" "HSS connect to MME") set(ConnectPeer "ConnectPeer" CACHE STRING "HSS connect to MME")
add_option(DIAMETER_PORT "#Port = 3868" "Diameter bind port") set(DIAMETER_PORT "#Port = 3868" CACHE STRING "Diameter bind port")
add_option(DIAMETER_SEC_PORT "#SecPort = 3869" "Diameter bind sec port") set(DIAMETER_SEC_PORT "#SecPort = 3869" CACHE STRING "Diameter bind sec port")
ELSE( HSS_CONNECT_TO_MME ) ELSE( HSS_CONNECT_TO_MME )
add_option(ConnectPeer "#ConnectPeer" "HSS act as a server") set(ConnectPeer "#ConnectPeer" CACHE STRING "HSS act as a server")
add_option(DIAMETER_PORT "Port = 3868" "Diameter bind port") set(DIAMETER_PORT "Port = 3868" CACHE STRING "Diameter bind port")
add_option(DIAMETER_SEC_PORT "SecPort = 3869" "Diameter bind sec port") set(DIAMETER_SEC_PORT "SecPort = 3869" CACHE STRING "Diameter bind sec port")
ENDIF( HSS_CONNECT_TO_MME ) ENDIF( HSS_CONNECT_TO_MME )
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/hss_fd.conf.in
${CMAKE_CURRENT_BINARY_DIR}/hss_fd.conf) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hss_fd.conf.in ${CMAKE_CURRENT_BINARY_DIR}/hss_fd.conf)
configure_file( configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hss.conf.in ${CMAKE_CURRENT_BINARY_DIR}/hss.conf)
${CMAKE_CURRENT_SOURCE_DIR}/hss.conf.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/acl.conf.in ${CMAKE_CURRENT_BINARY_DIR}/acl.conf)
${CMAKE_CURRENT_BINARY_DIR}/hss.conf)
configure_file( execute_process(COMMAND sudo ${OPENAIR_CMAKE_SCRIPTS}/check_hss_s6a_certificate ${FREEDIAMETER_PATH}/.. ${HSS_FQDN} WORKING_DIRECTORY ${OPENAIR_CMAKE_SCRIPTS} TIMEOUT 3)
${CMAKE_CURRENT_SOURCE_DIR}/acl.conf.in
${CMAKE_CURRENT_BINARY_DIR}/acl.conf) # This does not overwrite database if it exist
execute_process(COMMAND ${OPENAIR_CMAKE_SCRIPTS}/create_hss_database
${MYSQL_admin} ${MYSQL_admin_pass} ${MYSQL_user} ${MYSQL_pass} ${MYSQL_db}
install (TARGETS openair-hss WORKING_DIRECTORY ${OPENAIR_CMAKE_SCRIPTS}
DESTINATION ${OPENAIR_TARGETS}/bin) ERROR_VARIABLE ERROR_DB
TIMEOUT 5)
IF( ERROR_DB )
MESSAGE( SEND_ERROR "Database setup failed: ${ERROR_DB}" )
ENDIF( ERROR_DB )
install (TARGETS openair-hss DESTINATION ${OPENAIR_TARGETS}/bin)
...@@ -103,4 +103,4 @@ LoadExtension = "dict_s6a.fdx"; ...@@ -103,4 +103,4 @@ LoadExtension = "dict_s6a.fdx";
# For only accepting incoming connections, see the acl_wl.fx extension. # For only accepting incoming connections, see the acl_wl.fx extension.
#ConnectPeer = "ubuntu.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; }; #ConnectPeer = "ubuntu.localdomain" { ConnectTo = "127.0.0.1"; No_TLS; };
@ConnectPeer@ = "@MME_FQDN@" { ConnectTo = "@MME_IP@"; No_IPv6; No_TLS ; port = 3870; }; @ConnectPeer@ = "@MME_FQDN@" { ConnectTo = "@MME_IP@"; Realm = "@REALM@"; No_IPv6; No_TLS ; port = 3870; };
\ No newline at end of file \ No newline at end of file
...@@ -67,6 +67,7 @@ IF(FREEDIAMETER_FOUND) ...@@ -67,6 +67,7 @@ IF(FREEDIAMETER_FOUND)
MESSAGE(STATUS "freeDiameter version found ${FREEDIAMETER_VERSION}") MESSAGE(STATUS "freeDiameter version found ${FREEDIAMETER_VERSION}")
ENDIF(FD_PROJECT_VERSION_MAJOR GREATER 0) ENDIF(FD_PROJECT_VERSION_MAJOR GREATER 0)
ENDIF( FREEDIAMETER_INCLUDE_DIR ) ENDIF( FREEDIAMETER_INCLUDE_DIR )
GET_FILENAME_COMPONENT(FREEDIAMETER_PATH ${FREEDIAMETER_LIBRARY} PATH)
IF( NOT( "${FREEDIAMETER_VERSION_TEST_FOR}" STREQUAL "${FREEDIAMETER_LIBRARIES}" )) IF( NOT( "${FREEDIAMETER_VERSION_TEST_FOR}" STREQUAL "${FREEDIAMETER_LIBRARIES}" ))
INCLUDE (CheckLibraryExists) INCLUDE (CheckLibraryExists)
MESSAGE(STATUS "Checking freeDiameter patched for S6A") MESSAGE(STATUS "Checking freeDiameter patched for S6A")
...@@ -75,7 +76,7 @@ IF(FREEDIAMETER_FOUND) ...@@ -75,7 +76,7 @@ IF(FREEDIAMETER_FOUND)
UNSET(DICT_S6A_FOUND) UNSET(DICT_S6A_FOUND)
UNSET(DICT_S6A_FOUND CACHE) UNSET(DICT_S6A_FOUND CACHE)
GET_FILENAME_COMPONENT(FREEDIAMETER_PATH ${FREEDIAMETER_LIBRARY} PATH)
FIND_FILE(DICT_S6A_FOUND NAMES dict_s6a.fdx PATHS ${FREEDIAMETER_PATH} ${FREEDIAMETER_PATH}/freeDiameter) FIND_FILE(DICT_S6A_FOUND NAMES dict_s6a.fdx PATHS ${FREEDIAMETER_PATH} ${FREEDIAMETER_PATH}/freeDiameter)
IF(DICT_S6A_FOUND) IF(DICT_S6A_FOUND)
SET( FREEDIAMETER_HSS_S6A_ENABLED TRUE CACHE INTERNAL "dict_s6a.fdx Found") SET( FREEDIAMETER_HSS_S6A_ENABLED TRUE CACHE INTERNAL "dict_s6a.fdx Found")
......
...@@ -207,16 +207,16 @@ function main() ...@@ -207,16 +207,16 @@ function main()
echo "Cleaning EPC" echo "Cleaning EPC"
fi fi
rm -Rf build 2>&1 rm -Rf build 2>&1
rm -Rf $OPENAIR_TARGETS/CMAKE/EPC/MME_GW/build 2>&1 $SUDO rm -Rf $OPENAIR_TARGETS/CMAKE/EPC/MME_GW/build 2>&1
rm -f /usr/local/etc/freeDiameter/mme* 2>&1 $SUDO rm -f /usr/local/etc/freeDiameter/mme* 2>&1
rm -f /usr/local/etc/freeDiameter/epc* 2>&1 $SUDO rm -f /usr/local/etc/freeDiameter/epc* 2>&1
rm -f /usr/etc/freeDiameter/mme* 2>&1 $SUDO rm -f /usr/etc/freeDiameter/mme* 2>&1
rm -f /usr/etc/freeDiameter/epc* 2>&1 $SUDO rm -f /usr/etc/freeDiameter/epc* 2>&1
rm -f $OPENAIR_DIR/targets/bin/xt_GTPU*.ko 2>&1 $SUDO rm -f $OPENAIR_DIR/targets/bin/xt_GTPU*.ko 2>&1
(cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH && make clean) ($SUDO cd $OPENAIRCN_DIR/GTPV1-U/GTPUAH && make clean)
(cd $OPENAIRCN_DIR/GTPV1-U/GTPURH && make clean) ($SUDO cd $OPENAIRCN_DIR/GTPV1-U/GTPURH && make clean)
rm -f $OPENAIRCN_DIR/GTPV1-U/GTPUAH/Bin/* 2>&1 $SUDO rm -f $OPENAIRCN_DIR/GTPV1-U/GTPUAH/Bin/* 2>&1
rm -f /lib/xtables/libxt_GTPU*.so 2>&1 $SUDO rm -f /lib/xtables/libxt_GTPU*.so 2>&1
mkdir -m 777 -p -v build mkdir -m 777 -p -v build
fi fi
......
...@@ -113,7 +113,6 @@ function main() ...@@ -113,7 +113,6 @@ function main()
esac esac
done done
check_for_root_rights
set_openair_env set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
......
...@@ -5,9 +5,9 @@ Identity = "@MME_FQDN@"; ...@@ -5,9 +5,9 @@ Identity = "@MME_FQDN@";
Realm = "@REALM@"; Realm = "@REALM@";
# TLS configuration (see previous section) # TLS configuration (see previous section)
TLS_Cred = "${FREEDIAMETER_PATH}/../etc/freeDiameter/mme.cert.pem", TLS_Cred = "@FREEDIAMETER_PATH@/../etc/freeDiameter/mme.cert.pem",
"${FREEDIAMETER_PATH}/../etc/freeDiameter/mme.key.pem"; "@FREEDIAMETER_PATH@/../etc/freeDiameter/mme.key.pem";
TLS_CA = "${FREEDIAMETER_PATH}/../etc/freeDiameter/mme.cacert.pem"; TLS_CA = "@FREEDIAMETER_PATH@/../etc/freeDiameter/mme.cacert.pem";
# Disable use of TCP protocol (only listen and connect in SCTP) # Disable use of TCP protocol (only listen and connect in SCTP)
# Default : TCP enabled # Default : TCP enabled
......
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