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
...@@ -205,7 +205,7 @@ endif (${RTAI}) ...@@ -205,7 +205,7 @@ endif (${RTAI})
# (so creating new asn.1 objects instead of modifying the object attributes) # (so creating new asn.1 objects instead of modifying the object attributes)
# New C code source file, cmake must be re-run (instead of re-running make only) # New C code source file, cmake must be re-run (instead of re-running make only)
############# #############
set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1.bash") set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
set(asn1_generated_dir ${OPENAIR_BIN_DIR}) set(asn1_generated_dir ${OPENAIR_BIN_DIR})
# RRC # RRC
...@@ -325,7 +325,7 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4 ...@@ -325,7 +325,7 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4
add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4") add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4") add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "USRP" "ETHERNET" "CPRIGW") add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "CPRIGW")
if (${RF_BOARD} STREQUAL "EXMIMO") if (${RF_BOARD} STREQUAL "EXMIMO")
set(DRIVER2013) set(DRIVER2013)
...@@ -335,7 +335,7 @@ if (${RF_BOARD} STREQUAL "EXMIMO") ...@@ -335,7 +335,7 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c) ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
elseif (${RF_BOARD} STREQUAL "USRP") elseif (${RF_BOARD} STREQUAL "OAI_USRP")
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/") include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
include_directories("/opt/include/uhd") include_directories("/opt/include/uhd")
set(HW_SOURCE ${HW_SOURCE} set(HW_SOURCE ${HW_SOURCE}
...@@ -376,7 +376,6 @@ add_boolean_option(ENABLE_USE_NETFILTER_FOR_SGI False "SGI option") ...@@ -376,7 +376,6 @@ add_boolean_option(ENABLE_USE_NETFILTER_FOR_SGI False "SGI option")
add_boolean_option(ENABLE_USE_PCAP_FOR_SGI False "SGI option") add_boolean_option(ENABLE_USE_PCAP_FOR_SGI False "SGI option")
add_boolean_option(ENABLE_USE_RAW_SOCKET_FOR_SGI False "As per name") add_boolean_option(ENABLE_USE_RAW_SOCKET_FOR_SGI False "As per name")
add_boolean_option(EPC_BUILD False "???") add_boolean_option(EPC_BUILD False "???")
add_boolean_option(LINK_PDCP_TO_GTPV1U True "????")
add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver") add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai") add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
...@@ -385,6 +384,7 @@ add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") ...@@ -385,6 +384,7 @@ add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(UE_BUILD False "????") add_boolean_option(UE_BUILD False "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c") add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name") add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
######################## ########################
# Include order # Include order
...@@ -608,6 +608,11 @@ add_library(HASHTABLE ...@@ -608,6 +608,11 @@ add_library(HASHTABLE
) )
include_directories(${OPENAIRCN_DIR}/UTILS/HASHTABLE) include_directories(${OPENAIRCN_DIR}/UTILS/HASHTABLE)
add_library(MSC
${OPENAIR_DIR}/common/utils/msc/msc.c
)
include_directories(${OPENAIR_DIR}/common/utils/msc)
set(UTIL_SRC set(UTIL_SRC
${OPENAIR2_DIR}/UTIL/CLI/cli.c ${OPENAIR2_DIR}/UTIL/CLI/cli.c
${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
...@@ -818,7 +823,7 @@ set(L2_SRC ...@@ -818,7 +823,7 @@ set(L2_SRC
${RRC_DIR}/rrc_UE.c ${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_eNB.c ${RRC_DIR}/rrc_eNB.c
${RRC_DIR}/rrc_eNB_S1AP.c ${RRC_DIR}/rrc_eNB_S1AP.c
#${RRC_DIR}/rrc_eNB_UE_context.c ${RRC_DIR}/rrc_eNB_UE_context.c
${RRC_DIR}/rrc_common.c ${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface.c ${RRC_DIR}/L2_interface.c
) )
...@@ -1395,10 +1400,10 @@ pkg_search_module(CRYPTO libcrypto REQUIRED) ...@@ -1395,10 +1400,10 @@ pkg_search_module(CRYPTO libcrypto REQUIRED)
include_directories(${CRYPTO_INCLUDE_DIRS}) include_directories(${CRYPTO_INCLUDE_DIRS})
#use native cmake method as this package is not in pkg-config #use native cmake method as this package is not in pkg-config
if (${RF_BOARD} STREQUAL "USRP") if (${RF_BOARD} STREQUAL "OAI_USRP")
find_package(Boost REQUIRED) find_package(Boost REQUIRED)
include_directories(${LIBBOOST_INCLUDE_DIR}) include_directories(${LIBBOOST_INCLUDE_DIR})
endif (${RF_BOARD} STREQUAL "USRP") endif (${RF_BOARD} STREQUAL "OAI_USRP")
pkg_search_module(OPENPGM openpgm-5.1) pkg_search_module(OPENPGM openpgm-5.1)
if(NOT ${OPENPGM_FOUND}) if(NOT ${OPENPGM_FOUND})
...@@ -1440,6 +1445,9 @@ if (${XFORMS}) ...@@ -1440,6 +1445,9 @@ if (${XFORMS})
set(XFORMS_LIBRARIES "forms") set(XFORMS_LIBRARIES "forms")
endif (${XFORMS}) endif (${XFORMS})
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
# Hack on a test of asn1c version (already dirty) # Hack on a test of asn1c version (already dirty)
add_definitions(-DASN1_MINIMUM_VERSION=924) add_definitions(-DASN1_MINIMUM_VERSION=924)
...@@ -1470,7 +1478,7 @@ add_executable(lte-softmodem ...@@ -1470,7 +1478,7 @@ add_executable(lte-softmodem
) )
target_link_libraries (lte-softmodem target_link_libraries (lte-softmodem
-Wl,--start-group -Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} ${ITTI_LIB} ${MIH_LIB} RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 MSC ${RAL_LIB} ${NAS_LIB} ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES}) target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} ) target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} )
...@@ -1488,32 +1496,82 @@ add_executable(mme_gw ...@@ -1488,32 +1496,82 @@ add_executable(mme_gw
) )
target_link_libraries (mme_gw target_link_libraries (mme_gw
-Wl,--start-group -Wl,--start-group
NAS S1AP_LIB S1AP_EPC GTPV1U GTPV2C SCTP_SERVER UDP_SERVER SECU_CN SECU_OSA SGI S6A SGW MME_APP LFDS ${ITTI_LIB} CN_UTILS HASHTABLE NAS S1AP_LIB S1AP_EPC GTPV1U GTPV2C SCTP_SERVER UDP_SERVER SECU_CN SECU_OSA SGI S6A SGW MME_APP LFDS MSC ${ITTI_LIB} CN_UTILS HASHTABLE
-Wl,--end-group -Wl,--end-group
pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
) )
# Default parameters # Default parameters
site_name(SITE_HSS_HOSTNAME) # Does not work on simple install (fqdn in /etc/hosts 127.0.1.1)
site_name(SITE_MME_HOSTNAME) #cmake_host_system_information(RESULT HSS_FQDN_STR QUERY FQDN)
add_option(MME_HOSTNAME ${SITE_MME_HOSTNAME} "HSS Fully qualified domain name") #cmake_host_system_information(RESULT MME_FQDN_STR QUERY FQDN)
add_option(HSS_HOSTNAME ${SITE_HSS_HOSTNAME} "HSS Fully qualified domain name") IF( EPC_BUILD )
add_option(HSS_IP 127.0.1.1 "HSS IP address, default is local") INCLUDE(FindFreeDiameter)
add_option(REALM openair4G.eur "Realm TODO: extract this default value from SITE_MME_FQDN") # if standalone eNB or UE no need for FreeDiameter
add_option(MME_FQDN ${SITE_MME_HOSTNAME}.${REALM} "MME Fully qualified domain name") IF( FREEDIAMETER_FOUND )
add_option(HSS_FQDN ${SITE_HSS_HOSTNAME}.${REALM} "HSS Fully qualified domain name") IF( NOT FREEDIAMETER_HSS_S6A_ENABLED )
add_option(TRANSPORT_option No_SCTP "No_TCP or No_SCTP") MESSAGE( SEND_ERROR "FreeDiameter is not enabled for OPENAIRHSS" )
add_option(TRANSPORT_PREFER_TCP_option Prefer_TCP "Prefer_TCP or null string ") ENDIF( NOT FREEDIAMETER_HSS_S6A_ENABLED )
ENDIF( FREEDIAMETER_FOUND )
configure_file(
execute_process(COMMAND hostname --fqdn OUTPUT_VARIABLE HSS_FQDN_STR TIMEOUT 3)
execute_process(COMMAND hostname --fqdn OUTPUT_VARIABLE MME_FQDN_STR TIMEOUT 3)
string(STRIP ${HSS_FQDN_STR} HSS_FQDN_STR)
string(STRIP ${MME_FQDN_STR} MME_FQDN_STR)
set(HSS_IP 127.0.1.1 CACHE STRING "HSS IP address, default is local")
set(MME_FQDN ${MME_FQDN_STR} CACHE STRING "MME Fully qualified domain name")
set(HSS_FQDN ${HSS_FQDN_STR} CACHE STRING "HSS Fully qualified domain 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")
IF( NOT DEFINED REALM )
string(FIND ${MME_FQDN} "." pos)
math(EXPR pos1 "${pos}+1")
string(SUBSTRING ${MME_FQDN} ${pos1} -1 realm_string)
message("REALM extracted from MME FQDN is ${realm_string}")
set(REALM ${realm_string} CACHE STRING "EPC realm")
ENDIF( NOT DEFINED REALM )
message("REALM is ${REALM}")
IF( NOT DEFINED MME_HOSTNAME )
string(FIND ${MME_FQDN} "." pos)
string(SUBSTRING ${MME_FQDN} 0 ${pos} mme_hostname_string)
message("MME_HOSTNAME extracted from MME FQDN is ${mme_hostname_string}")
set(MME_HOSTNAME ${mme_hostname_string} CACHE STRING "MME hostname")
ENDIF( NOT DEFINED MME_HOSTNAME )
IF( NOT DEFINED HSS_HOSTNAME )
string(FIND ${HSS_FQDN} "." pos)
string(SUBSTRING ${HSS_FQDN} 0 ${pos} hss_hostname_string)
message("HSS_HOSTNAME extracted from HSS FQDN is ${hss_hostname_string}")
set(HSS_HOSTNAME ${hss_hostname_string} CACHE STRING "HSS hostname")
ENDIF( NOT DEFINED HSS_HOSTNAME )
if ( ${MME_HOSTNAME} STREQUAL ${HSS_HOSTNAME} )
set(MME_S6A_IS_SERVER 1 )
endif( ${MME_HOSTNAME} STREQUAL ${HSS_HOSTNAME} )
IF( MME_S6A_IS_SERVER )
set(ConnectPeer "#ConnectPeer" CACHE STRING "HSS connect to MME")
set(DIAMETER_PORT "Port = 3870" CACHE STRING "Diameter bind port, 3868 is always used by default by HSS, even if HSS client")
set(DIAMETER_SEC_PORT "SecPort = 3871" CACHE STRING "Diameter bind sec port")
ELSE( MME_S6A_IS_SERVER )
set(ConnectPeer "#ConnectPeer" CACHE STRING "HSS act as a server")
set(DIAMETER_PORT "#Port = 3870" CACHE STRING "Diameter bind port")
set(DIAMETER_SEC_PORT "#SecPort = 3871" CACHE STRING "Diameter bind sec port")
ENDIF( MME_S6A_IS_SERVER )
execute_process(COMMAND sudo ${OPENAIR_CMAKE}/tools/check_mme_s6a_certificate ${FREEDIAMETER_PATH}/.. ${MME_FQDN} WORKING_DIRECTORY ${OPENAIR_CMAKE})
configure_file(
${OPENAIR_CMAKE}/tools/s6a.conf.in ${OPENAIR_CMAKE}/tools/s6a.conf.in
${CMAKE_CURRENT_BINARY_DIR}/epc_s6a.conf) ${CMAKE_CURRENT_BINARY_DIR}/mme_fd.conf)
configure_file( configure_file(
${OPENAIR_CMAKE}/tools/epc.local.enb.conf.in ${OPENAIR_CMAKE}/tools/epc.local.enb.conf.in
${CMAKE_CURRENT_BINARY_DIR}/epc.local.enb.conf) ${CMAKE_CURRENT_BINARY_DIR}/epc.local.enb.conf)
configure_file( configure_file(
${OPENAIR_CMAKE}/tools/epc.conf.in ${OPENAIR_CMAKE}/tools/epc.conf.in
${CMAKE_CURRENT_BINARY_DIR}/epc.conf) ${CMAKE_CURRENT_BINARY_DIR}/epc.conf)
ENDIF( EPC_BUILD )
# oai_sgw is SGW node implementation # oai_sgw is SGW node implementation
################################ ################################
...@@ -1524,7 +1582,7 @@ add_executable(oai_sgw ...@@ -1524,7 +1582,7 @@ add_executable(oai_sgw
) )
target_link_libraries (oai_sgw target_link_libraries (oai_sgw
-Wl,--start-group -Wl,--start-group
GTPV1U SECU_CN SECU_OSA SGI S6A SGW CN_UTILS LFDS ${ITTI_LIB} GTPV1U SECU_CN SECU_OSA SGI S6A SGW CN_UTILS LFDS MSC ${ITTI_LIB}
-Wl,--end-group -Wl,--end-group
pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
) )
...@@ -1572,7 +1630,7 @@ add_executable(oaisim ...@@ -1572,7 +1630,7 @@ add_executable(oaisim
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim target_link_libraries (oaisim
-Wl,--start-group -Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${RAL_LIB} ${NAS_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 MSC ${RAL_LIB} ${NAS_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib}
...@@ -1631,7 +1689,7 @@ add_executable(oaisim_mme ...@@ -1631,7 +1689,7 @@ add_executable(oaisim_mme
) )
target_link_libraries (oaisim_mme target_link_libraries (oaisim_mme
-Wl,--start-group -Wl,--start-group
NAS S1AP_LIB S1AP_EPC GTPV1U GTPV2C SCTP_SERVER UDP_SERVER SECU_CN SECU_OSA SGI S6A S11 SGW MME_APP LFDS ${ITTI_LIB} CN_UTILS HASHTABLE NAS S1AP_LIB S1AP_EPC GTPV1U GTPV2C SCTP_SERVER UDP_SERVER SECU_CN SECU_OSA SGI S6A S11 SGW MME_APP LFDS MSC ${ITTI_LIB} CN_UTILS HASHTABLE
-Wl,--end-group -Wl,--end-group
pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore pthread m sctp rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} fdproto fdcore
) )
......
...@@ -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