Commit 824102f8 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Update CMakeList/Conf file

parent 48dc1b75
#!/bin/bash
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
set -o pipefail
INSTALL_DIR=/usr/local/bin
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source ${THIS_SCRIPT_PATH}/build_helper.amf
......@@ -21,7 +42,7 @@ function help()
echo_error " -f, --force No interactive script for installation of software packages."
echo_error " -h, --help Print this help."
echo_error " -I, --install-deps Check installed software necessary to build and run AMF (support $SUPPORTED_DISTRO)."
#echo_error " -i, --install-min-deps Check installed software necessary to run a statically linked AMF (support $SUPPORTED_DISTRO)."
echo_error " -i, --install-min-deps Check installed software necessary to run a statically linked AMF (support $SUPPORTED_DISTRO)."
echo_error " -j, --jobs Multiple jobs for compiling."
echo_error " -v, --verbose Build process verbose."
echo_error " -V, --Verbose CMake only build process verbose, display compilation warnings and errors."
......@@ -34,6 +55,7 @@ function main()
local -i force=0
local -i debug=0
local -i verbose=0
local -i var_check_install_min_deps=0
local -i var_check_install_deps=0
local cmake_args=" "
export make_args=" "
......@@ -58,8 +80,8 @@ function main()
;;
-f | --force)
force=1
echo "when install deps, no interaction"
shift;
echo "Force set (no interactive)"
shift;
;;
-h | --help)
help
......@@ -67,11 +89,17 @@ function main()
return 0
;;
-I | --install-deps)
echo "check istalled software necessary to build and run AMF(support $SUPPORTED_DISTRO)"
set_openair_env # to ~/oai-5g-amf/
var_check_install_deps=1
shift;
;;
echo "Check installed software necessary to build and run AMF (support $SUPPORTED_DISTRO):"
set_openair_env
var_check_install_deps=1
shift;
;;
-i | --install-min-deps)
echo "Check installed software necessary to run AMF (support $SUPPORTED_DISTRO):"
set_openair_env
var_check_install_min_deps=1
shift;
;;
-j | --jobs)
make_args="$make_args -j`nproc`"
shift;
......@@ -89,10 +117,10 @@ function main()
shift;
;;
*)
echo "unknown option $1"
help
return 1
;;
echo "Unknown option $1"
help
return 1
;;
esac
done
......@@ -106,10 +134,10 @@ function main()
local dlog=$OPENAIRCN_DIR/build/log
local dext=$OPENAIRCN_DIR/build/ext
mkdir -m 777 -p ${dlog}
mkdir -m 777 -p ${dext}
mkdir -m 777 -p $dlog
mkdir -m 777 -p $dext
if [ $var_check_install_deps -gt 0 ]; then
if [ $var_check_install_min_deps -gt 0 ]; then
disable_ipv6
check_install_amf_deps $force 0
if [[ $? -ne 0 ]]; then
......@@ -122,7 +150,24 @@ function main()
fi
fi
if [ $var_check_install_deps -gt 0 ];then
disable_ipv6
check_install_amf_deps $force $debug
if [[ $? -ne 0 ]]; then
echo_error "Error: AMF deps installation failed"
return 1
else
echo_success "AMF deps installation successful"
echo_warning "AMF not compiled, to compile it, re-run build_smf without -I option"
return 0
fi
fi
cmake_args="$cmake_args -DBUILD_SHARED_LIBS=OFF"
##############################################################################
# Clean
##############################################################################
cd $OPENAIRCN_DIR/build/amf
if [ $clean -ne 0 ]; then
if [[ $verbose -eq 1 ]]; then
......@@ -132,13 +177,14 @@ function main()
mkdir -m 777 -p -v build
fi
##############################################################################
# Compile AMF
##############################################################################
cd $OPENAIRCN_DIR/build/amf
if [ ! -d ./build ]; then
mkdir -m 777 -p -v build
fi
cd ./build
$CMAKE $cmake_args .. > /dev/null
ret=$?;[[ $ret -ne 0 ]] && return $ret
......
#!/bin/bash
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
# file build_helper.amf
# brief
#
#######################################
################################
# include helper functions
################################
SCRIPT=$(readlink -f ${BASH_SOURCE})
THIS_SCRIPT_PATH=`dirname $SCRIPT`
source $THIS_SCRIPT_PATH/build_helper
......@@ -8,10 +34,42 @@ source $THIS_SCRIPT_PATH/build_helper.fb_folly
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_fmt() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install open-source formatting library for C++ ? <y/N> " prompt
OPTION=""
else
prompt='y'
OPTION="-y"
fi
install_nlohmann_from_git() {
echo "Install fmt from source"
if [[ $prompt =~ [yY](es)* ]]
then
cd /tmp
echo "Downloading fmt"
$SUDO rm -rf /tmp/fmt*
git clone https://github.com/fmtlib/fmt.git
ret=$?;[[ $ret -ne 0 ]] && return $ret
cd fmt
cmake -DFMT_TEST=FALSE .
ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO make install
cd /tmp
rm -rf /tmp/fmt*
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_spdlog_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install Nlohmann Json ? <y/N> " prompt
read -p "Do you want to install spdlog ? <y/N> " prompt
OPTION=""
else
prompt='y'
......@@ -26,26 +84,20 @@ install_nlohmann_from_git() {
if [[ $prompt =~ [yY](es)* ]]
then
GIT_URL=https://github.com/nlohmann/json.git
echo "Install Nlohmann Json from $GIT_URL"
GIT_URL=https://github.com/gabime/spdlog.git
echo "Install spdlog from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading Nlohmann"
echo "Downloading spdlog"
if [[ $OPTION =~ -[yY](es)* ]]
then
$SUDO rm -rf json
$SUDO rm -rf spdlog
fi
git clone $GIT_URL
git submodule update --init
cd json && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
cd spdlog && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
# enable syslog, Useless (defined in SMF code)
sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h
popd
fi
return 0
......@@ -57,7 +109,7 @@ install_nlohmann_from_git() {
install_pistache_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install Pistache ? <y/N> " prompt
OPTION=""
OPTION="-y"
else
prompt='y'
OPTION="-y"
......@@ -82,7 +134,7 @@ install_pistache_from_git() {
git clone $GIT_URL
git submodule update --init
cd pistache && git checkout master
cd pistache && git checkout e18ed9baeb2145af6f9ea41246cf48054ffd9907
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
......@@ -96,39 +148,12 @@ install_pistache_from_git() {
return 0
}
install_fmt() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install open-source formatting library for C++ ? <y/N> " prompt
OPTION=""
else
prompt='y'
OPTION="-y"
fi
echo "Install fmt from source"
if [[ $prompt =~ [yY](es)* ]]
then
cd /tmp
echo "Downloading fmt"
$SUDO rm -rf /tmp/fmt*
git clone https://github.com/fmtlib/fmt.git
ret=$?;[[ $ret -ne 0 ]] && return $ret
cd fmt
cmake .
ret=$?;[[ $ret -ne 0 ]] && return $ret
make -j `nproc`
ret=$?;[[ $ret -ne 0 ]] && return $ret
$SUDO make install
cd /tmp
rm -rf /tmp/fmt*
fi
return 0
}
install_spdlog_from_git() {
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
install_nlohmann_from_git() {
if [ $1 -eq 0 ]; then
read -p "Do you want to install spdlog ? <y/N> " prompt
read -p "Do you want to install Nlohmann Json ? <y/N> " prompt
OPTION=""
else
prompt='y'
......@@ -139,26 +164,38 @@ install_spdlog_from_git() {
else
debug=1
fi
if [[ $prompt =~ [yY](es)* ]]
then
GIT_URL=https://github.com/gabime/spdlog.git
echo "Install spdlog from $GIT_URL"
GIT_URL=https://github.com/nlohmann/json.git
echo "Install Nlohmann Json from $GIT_URL"
pushd $OPENAIRCN_DIR/build/ext
echo "Downloading spdlog"
echo "Downloading Nlohmann"
if [[ $OPTION =~ -[yY](es)* ]]
then
$SUDO rm -rf spdlog
$SUDO rm -rf json
fi
git clone $GIT_URL
cd spdlog && git checkout master
git submodule update --init
cd json && git checkout master
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
mkdir _build && cd _build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF ..
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
make
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
$SUDO make install
ret=$?;[[ $ret -ne 0 ]] && popd && return $ret
# enable syslog, Useless (defined in SMF code)
sed -i '/#define SPDLOG_ENABLE_SYSLOG/s/^\/\///g' include/spdlog/tweakme.h
popd
fi
return 0
}
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
check_install_amf_deps(){
if [ $1 -gt 0 ]; then
......@@ -166,6 +203,11 @@ check_install_amf_deps(){
else
OPTION=""
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
echo "Check supported distribution"
check_supported_distribution
......@@ -278,6 +320,7 @@ check_install_amf_deps(){
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
# Use fmt lib included in spdlog
install_fmt $1
ret=$?;[[ $ret -ne 0 ]] && return $ret
......
## amf configuration file
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
AMF =
{
INSTANCE_ID = 10;
PID_DIRECTORY = "/var/run";
######################################################################## NG SETUP RESPONSE IEs ############################################################
AMF_NAME = "bupt-amf";
GUAMI:{MCC = "460"; MNC = "11"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"}
########################## NG SETUP RESPONSE IEs ###############################
AMF_NAME = "amf";
GUAMI:{MCC = "208"; MNC = "95"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1"}
ServedGUAMIList = (
{MCC = "460"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "208"; MNC = "95"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "460"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
RelativeAMFCapacity = 30;
PLMNSupportList = (
{MCC = "460"; MNC = "11"; TAC = 100;
{MCC = "208"; MNC = "95"; TAC = 0xa000;
SliceSupportList = (
{SST = "222"; SD = "123"},
{SST = "1"; SD = "none"},
......@@ -20,18 +40,19 @@ AMF =
)
}
);
##################################################################### clause 9.2.6.2, 3gpp ts38.413 ####################################################
STATISTICS_TIMER_INTERVAL = 4; #second
######################### clause 9.2.6.2, 3gpp ts38.413 #######################
STATISTICS_TIMER_INTERVAL = 20; #second
INTERFACES:{
NGAP_AMF:{
INTERFACE_NAME = "ens32";
INTERFACE_NAME = "ens3";
IPV4_ADDRESS = "read";
SCTP_PORT = 38412;
PPID = 60;
};
N11:{
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.1.106"; PORT = "8889"; VERSION = "v1"; SELECTED = "true"},
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.122.168"; PORT = "80"; VERSION = "v2"; SELECTED = "true"},
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "10.103.238.21"; PORT = "8181"; VERSION = "v1"; SELECTED = "false"}
);
};
......@@ -41,15 +62,15 @@ AMF =
};
AUTHENTICATION:{
MYSQL_server = "127.0.0.1";
MYSQL_user = "bupt"; # Database server login
MYSQL_user = "root"; # Database server login
MYSQL_pass = "linux"; # Database server password
MYSQL_db = "OAI_DB";
OPERATOR_key = "1006020f0a478bf6b699f15c062e42b3"; # op
MYSQL_db = "oai_db";
OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d";
RANDOM = "true";
};
NAS:{
#ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA2" , "NIA1" , "NIA0" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA1" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA0" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA0" , "NEA1" , "NEA2" ];
#ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA1" , "NEA1" , "NEA1" ];
};
......
......@@ -4,15 +4,15 @@ AMF =
INSTANCE_ID = 10;
PID_DIRECTORY = "/var/run";
######################################################################## NG SETUP RESPONSE IEs ############################################################
AMF_NAME = "amf";
GUAMI:{MCC = "208"; MNC = "95"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1"}
AMF_NAME = "bupt-amf";
GUAMI:{MCC = "460"; MNC = "11"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"}
ServedGUAMIList = (
{MCC = "208"; MNC = "95"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "460"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "460"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
RelativeAMFCapacity = 30;
PLMNSupportList = (
{MCC = "208"; MNC = "95"; TAC = 0xa000;
{MCC = "460"; MNC = "11"; TAC = 100;
SliceSupportList = (
{SST = "222"; SD = "123"},
{SST = "1"; SD = "none"},
......@@ -21,17 +21,17 @@ AMF =
}
);
##################################################################### clause 9.2.6.2, 3gpp ts38.413 ####################################################
STATISTICS_TIMER_INTERVAL = 20; #second
STATISTICS_TIMER_INTERVAL = 4; #second
INTERFACES:{
NGAP_AMF:{
INTERFACE_NAME = "ens3";
INTERFACE_NAME = "ens32";
IPV4_ADDRESS = "read";
SCTP_PORT = 38412;
PPID = 60;
};
N11:{
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.122.168"; PORT = "80"; VERSION = "v2"; SELECTED = "true"},
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.1.106"; PORT = "8889"; VERSION = "v1"; SELECTED = "true"},
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "10.103.238.21"; PORT = "8181"; VERSION = "v1"; SELECTED = "false"}
);
};
......@@ -41,15 +41,15 @@ AMF =
};
AUTHENTICATION:{
MYSQL_server = "127.0.0.1";
MYSQL_user = "root"; # Database server login
MYSQL_user = "bupt"; # Database server login
MYSQL_pass = "linux"; # Database server password
MYSQL_db = "oai_db";
OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d";
MYSQL_db = "OAI_DB";
OPERATOR_key = "1006020f0a478bf6b699f15c062e42b3"; # op
RANDOM = "true";
};
NAS:{
#ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA2" , "NIA1" , "NIA0" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA0" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA1" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA0" , "NEA1" , "NEA2" ];
#ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA1" , "NEA1" , "NEA1" ];
};
......
......@@ -248,8 +248,6 @@ pkg_search_module(CONFIG REQUIRED libconfig++)
include_directories(${CONFIG_INCLUDE_DIRS})
set(THREADS_PREFER_PTHREAD_FLAG ON)
#find_package(Threads REQUIRED)
pkg_search_module(CRYPTO libcrypto REQUIRED)
include_directories(${CRYPTO_INCLUDE_DIRS})
......
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