Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • limx1980/oai-cn5g-common-src
  • oai/cn5g/oai-cn5g-common-src
2 results
Show changes
Commits on Source (40)
Showing
with 903 additions and 12 deletions
......@@ -342,6 +342,7 @@ struct pfcp_ie_value_exception : public pfcp_ie_exception {
#define PFCP_IE_UE_IP_ADDRESS_POOL_IDENTITY (177)
#define PFCP_IE_ALTERNATIVE_SMF_IP_ADDRESS (178)
#define PFCP_IE_SPARED (179)
#define PFCP_IE_S_NSSAI (257)
#define PFCP_MESSAGE_RESERVED (0)
// PFCP_NODE_RELATED_MESSAGES
......@@ -1870,6 +1871,10 @@ typedef struct apn_dnn_s {
std::string apn_dnn;
} apn_dnn_t;
typedef struct nssai_s {
uint32_t nssai;
} nssai_t;
//-------------------------------------
// 8.2.118. 3GPP Interface Type
enum _3gpp_interface_type_e {
......
################################################################################
# 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
################################################################################
cmake_minimum_required (VERSION 3.22.1)
project(COMMON_SRC_PROJECT)
enable_testing()
# Override options for COMMON
set ( PACKAGE_NAME "COMMON" )
set ( STATIC_LINKING False )
#############################################
# Base directories, compatible with legacy OAI building
################################################
set (OPENAIRCN_DIR $ENV{OPENAIRCN_DIR})
set (BUILD_TOP_DIR ${OPENAIRCN_DIR}/build)
set (SRC_TOP_DIR $ENV{OPENAIRCN_DIR})
set (3GPP_DIR ${SRC_TOP_DIR}/3gpp)
set (COMMON_DIR ${SRC_TOP_DIR}/common)
set (CONFIG_DIR ${SRC_TOP_DIR}/config)
set (ITTI_DIR ${SRC_TOP_DIR}/itti)
set (LOGGER_DIR ${SRC_TOP_DIR}/logger)
set (MODEL_DIR ${SRC_TOP_DIR}/model)
set (NAS_DIR ${SRC_TOP_DIR}/nas)
set (NGAP_DIR ${SRC_TOP_DIR}/ngap)
set (TEST_DIR ${SRC_TOP_DIR}/test)
set (UTILS_DIR ${SRC_TOP_DIR}/utils)
ADD_SUBDIRECTORY(${COMMON_DIR} ${CMAKE_CURRENT_BINARY_DIR}/common)
ADD_SUBDIRECTORY(${LOGGER_DIR} ${CMAKE_CURRENT_BINARY_DIR}/logger)
ADD_SUBDIRECTORY(${NAS_DIR} ${CMAKE_CURRENT_BINARY_DIR}/nas)
ADD_SUBDIRECTORY(${NGAP_DIR} ${CMAKE_CURRENT_BINARY_DIR}/ngap)
ADD_SUBDIRECTORY(${UTILS_DIR} ${CMAKE_CURRENT_BINARY_DIR}/utils)
# UNIT TESTING, should always be compiled along the main code to let
# it play its role.
ADD_SUBDIRECTORY(${TEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test)
#/*
# * 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
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface AMF service
# Valid for Ubuntu-20.04 (focal),
# Ubuntu-22.04 (jammy)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BASE IMAGE
#---------------------------------------------------------------------
ARG BASE_IMAGE=ubuntu:jammy
FROM $BASE_IMAGE as common-src-unit-tests
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
ENV IS_DOCKERFILE=1
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
git \
build-essential \
cmake \
make \
libasio-dev \
libboost-all-dev \
libasan6 \
googletest-tools \
libgoogle-glog-dev \
libgtest-dev \
libtool \
libfmt-dev \
libspdlog-dev \
nlohmann-json3-dev \
libyaml-cpp-dev \
pkg-config
ENV OPENAIRCN_DIR=/openair-unit-tests
WORKDIR /openair-unit-tests
COPY . /openair-unit-tests
# Building all unit-tests
WORKDIR /openair-unit-tests/build/common/_build
RUN cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF && \
make -j`nproc` all
# Running all unit-tests
WORKDIR /openair-unit-tests/build/common/_build/test
RUN ctest -V
#!/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 Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
#
# 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_common
# brief
# author Lionel Gauthier
# company Eurecom
# email: lionel.gauthier@eurecom.fr
#
set -o pipefail
INSTALL_DIR=/usr/local/bin
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper.common
function help()
{
echo_error " "
echo_error "Usage: build_common [OPTION]..."
echo_error "Build the common libraries."
echo_error " "
echo_error "Options:"
echo_error "Mandatory arguments to long options are mandatory for short options too."
echo_error " -b, --build-type Build type as defined in cmake, allowed values are: Debug Release RelWithDebInfo MinSizeRel"
echo_error " -c, --clean Clean the build generated files: config, object, executable files (build from scratch)"
echo_error " -f, --force No interactive script for installation of software packages."
echo_error " -h, --help Print this help."
echo_error " -i, --install-min-deps Check installed software necessary to run a unit test."
echo_error " -j, --jobs Multiple jobs for compiling."
echo_error " -t, --build-unit-tests Build unit tests."
echo_error " -T, --run-unit-tests Run unit tests."
echo_error " -v, --verbose Build process verbose."
echo_error " -V, --Verbose CMake only build process verbose, display compilation warnings and errors."
echo_error " "
}
function main()
{
local -i clean=0
local -i force=0
local -i debug=0
local -i verbose=0
local -i var_check_install_deps=0
local -i build_unit_tests=0
local -i run_unit_tests=0
local cmake_args=" "
export make_args=" "
until [ -z "$1" ]
do
case "$1" in
-b | --build-type)
list_include_item "Debug Release RelWithDebInfo MinSizeRel" $2
[[ $? -ne 0 ]] && echo_error "Build type $2 not recognized" && return $?
cmake_args="$cmake_args -DCMAKE_BUILD_TYPE=$2"
list_include_item "Debug" $2
[[ $? -ne 0 ]] && debug=1
shift 2;
;;
-c | --clean)
clean=1
echo "Clean the build generated files (build from scratch)"
shift;
;;
-f | --force)
force=1
echo "Force set (no interactive)"
shift;
;;
-h | --help)
help
shift;
return 0
;;
-i | --install-min-deps)
echo "Check installed software necessary to run unit tests:"
set_openair_env
var_check_install_deps=1
shift;
;;
-j | --jobs)
make_args="$make_args -j`nproc`"
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;
;;
-V | --Verbose)
echo "CMake build process verbose"
verbose=1
shift;
;;
-t | --run-unit-tests)
echo "Run unit tests"
run_unit_tests=1
shift;
;;
--gtest* | --rerun-failed | --output-on-failure)
gtest_args="$gtest_args $1"
shift;
;;
*)
echo "Unknown option $1"
help
return 1
;;
esac
done
# Set OPENAIRCN_DIR as base folder
set_openair_env
local dlog=$OPENAIRCN_DIR/build/log
local dext=$OPENAIRCN_DIR/build/ext
mkdir -m 777 -p $dlog
mkdir -m 777 -p $dext
if [ $var_check_install_deps -gt 0 ];then
check_install_common_deps $force $debug
if [[ $? -ne 0 ]]; then
echo_error "Error: Common deps installation failed"
return 1
else
echo_success "Common deps installation successful"
echo_warning "Common not compiled, to compile it, re-run build_pcf without -I option"
return 0
fi
fi
cmake_args="$cmake_args -DBUILD_SHARED_LIBS=OFF"
##############################################################################
# Clean
##############################################################################
cd $OPENAIRCN_DIR/build/common
if [ $clean -ne 0 ]; then
if [[ $verbose -eq 1 ]]; then
echo "Cleaning common: generated configuration files, obj files, executable"
fi
rm -rf $OPENAIRCN_DIR/build/common/build 2>&1
mkdir -m 777 -p -v build
fi
##############################################################################
# Compile common
##############################################################################
cd $OPENAIRCN_DIR/build/common
if [ ! -d ./build ]; then
mkdir -m 777 -p -v build
fi
cd ./build
$CMAKE $cmake_args .. > /dev/null
ret=$?;[[ $ret -ne 0 ]] && return $ret
make $make_args all
ret=$?;[[ $ret -ne 0 ]] && return $ret
if [ $run_unit_tests -ne 0 ]; then
cd $OPENAIRCN_DIR/build/common/build/test && ctest $gtest_args
return $?
fi
return 0
}
main "$@"
################################################################################
# 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
# brief
# author Laurent Thomas, Lionel GAUTHIER
#
#######################################
SUPPORTED_DISTRO="Ubuntu 22.04, RHEL 8, UBI8-8.6"
if [ ! -f /etc/os-release ]; then
echo_fatal "No /etc/os-release file found. You're likely on an unsupported distro."
fi
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
case "$OS_DISTRO" in
fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;;
rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;;
debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
IS_CONTAINER=`egrep -c "docker|podman|kubepods|libpod|buildah" /proc/self/cgroup || true`
IS_DOCKERBUILD=${IS_DOCKERFILE:-0}
if [ $IS_CONTAINER -eq 0 ] && [ $IS_DOCKERBUILD -eq 0 ]
then
SUDO='sudo -S -E'
else
SUDO=''
fi
###############################
## echo and family
###############################
black='\E[30m'
red='\E[31m'
green='\E[32m'
yellow='\E[33m'
blue='\E[1;34m'
magenta='\E[35m'
cyan='\E[36m'
white='\E[37m'
reset_color='\E[00m'
COLORIZE=1
#-------------------------------------------------------------------------------
cecho() {
# Color-echo
# arg1 = message
# arg2 = color
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$green}
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color"
echo -e "$message"
return
}
echo_error() { cecho "$*" $red ;}
echo_fatal() { cecho "$*" $red; exit -1 ;}
echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
#-------------------------------------------------------------------------------
# From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
# arg1 is a dotted (or not) version number (ex 4.10.6.56-ubunutu)
# arg2 is a dotted (or not) version number (ex 4.10.6.56-ubunutu)
# return 0 if $1 lower or equal $2, else 1
version_le() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
# From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
version_lt() {
[ "$1" = "$2" ] && return 1 || version_le $1 $2
}
# From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
version_ge() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | tail -n1`" ]
}
# From https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
version_gt() {
[ "$1" = "$2" ] && return 1 || version_ge $1 $2
}
########################
# distribution helpers #
########################
#-------------------------------------------------------------------------------
# This function return a string to identify the distribution we are running
# If we can't check the distribution, it returns "Unknown"
# This function return always true as exit code by design
# Examples:
# ubuntu18.04
# debian8.5
get_distribution_release() {
if [[ ! -z "$OS_DISTRO$OS_RELEASE" ]]; then
echo -n "$OS_DISTRO$OS_RELEASE"
else
echo -n Unknown
fi
}
check_supported_distribution() {
local distribution=$(get_distribution_release)
case "$distribution" in
"ubuntu20.04") return 0 ;;
"ubuntu22.04") return 0 ;;
"rhel8") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
"rhel8.5") return 0 ;;
"rhel8.6") return 0 ;;
"rhel8.7") return 0 ;;
esac
return 1
}
###########################
# Cleaners
###########################
#-------------------------------------------------------------------------------
clean_kernel() {
$SUDO modprobe ip_tables
$SUDO modprobe x_tables
$SUDO iptables -P INPUT ACCEPT
$SUDO iptables -F INPUT
$SUDO iptables -P OUTPUT ACCEPT
$SUDO iptables -F OUTPUT
$SUDO iptables -P FORWARD ACCEPT
$SUDO iptables -F FORWARD
$SUDO iptables -t nat -F
$SUDO iptables -t mangle -F
$SUDO iptables -t filter -F
$SUDO iptables -t raw -F
echo_info "Flushed iptables"
}
#-------------------------------------------------------------------------------
disable_ipv6() {
$SUDO sysctl -w net.ipv6.conf.all.disable_ipv6=1
}
#-------------------------------------------------------------------------------
# Compare two versions of software. Returns true if $version is greater than $req_version
# arg1 = version
# arg2 = req_version
#
function version_gt() {
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
}
###################################
# Compilers
###################################
# From https://stackoverflow.com/a/20473191
# test if a list include item
# arg1 is list, ex "item1 item2 ..."
# arg2 is item
function list_include_item {
local list="$1"
local item="$2"
if [[ $list =~ (^|[[:space:]])"$item"($|[[:space:]]) ]] ; then
# yes, list include item
result=0
else
result=1
fi
return $result
}
# arg 1 Build directory OPENAIR_DIR/build/?/build
# arg 2 Executable target name
# arg 3 Executable name (no path)
# arg 4 Verbose (1 or 0)
compilations() {
echo_info "Compilation log for $3 is here: $dlog/$2.txt"
cd $OPENAIRCN_DIR/build/$1/build
if [ "a$4" == "a1" ]; then
set -o pipefail
{
rm -f $3
make $make_args $2
} | tee $dlog/$2.txt
else
{
rm -f $3
make $make_args $2
} > $dlog/$2.txt 2>&1
fi
if [ $? == 0 -a -s $3 ] ; then
echo_success "$2 compiled"
return 0
else
echo_error "$2 compilation failed"
return 1
fi
}
###################################
# make test
###################################
# arg 1 Build directory OPENAIRCN_DIR/build/?/build
# arg 2 Executable target name
# arg 3 Executable name (no path)
# arg 4 Verbose (1 or 0)
make_test() {
echo_success "unit tests start"
cd $OPENAIRCN_DIR/build/$1/build
if [ "a$4" == "a1" ]; then
{
make test ARGS="-V"
} | tee $dlog/$2_test.txt
else
{
make test
} > $dlog/$2_test.txt 2>&1
fi
if [ $? == 0 ]; then
echo_success "unit tests passed"
return 0
else
echo_error "unit tests failed"
return -1
fi
}
#-------------------------------------------------------------------------------
# arg1 is package name
test_install_package() {
# usage: test_install_package package_name
if [ $# -eq 1 ]; then
dpkg -s "$1" > /dev/null 2>&1 && {
echo "$1 is installed."
} || {
echo "$1 is not installed."
$SUDO apt-get install --force-yes $1
}
fi
}
#-------------------------------------------------------------------------------
update_package_db() {
if [ ! -f /tmp/no_more_update_package_db ]; then
$SUDO $INSTALLER update
[[ $? -ne 0 ]] && return $?
touch /tmp/no_more_update_package_db
[[ $? -ne 0 ]] && return $?
else
let elapsed_time=$(expr `date +%s` - `stat -c %Y /tmp/no_more_update_package_db`)
if [ $elapsed_time -gt 3600 ]; then
$SUDO $INSTALLER update
[[ $? -ne 0 ]] && return $?
touch /tmp/no_more_update_package_db
[[ $? -ne 0 ]] && return $?
fi
fi
return 0
}
#-------------------------------------------------------------------------------
check_enable_epel_repos() {
# on Enterprise Linuxes, ensure EPEL repos are installed
# (provides: libidn2-devel, vconfig, iperf, phpMyAdmin, dkms, ...)
if [[ "$OS_DISTRO" == "rhel" ]]; then
if rpm -q epel-release > /dev/null; then
echo "EPEL repos already present. Good."
else
echo "EPEL repos not present. Installing them."
$SUDO $INSTALLER install $OPTION https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
fi
fi
}
################################
# set_openair_env
###############################
#-------------------------------------------------------------------------------
set_openair_env(){
fullpath=`readlink -f $BASH_SOURCE`
[ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
openair_path=${fullpath%/build/*}
openair_path=${openair_path%/common/*}
openair_path=${openair_path%/nas/*}
openair_path=${openair_path%/ngap/*}
export OPENAIRCN_DIR=$openair_path
}
################################################################################
# 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.common
# brief
# author Laurent Thomas, Lionel GAUTHIER
#
#######################################
################################
# include helper functions
################################
SCRIPT=$(readlink -f ${BASH_SOURCE})
THIS_SCRIPT_PATH=`dirname $SCRIPT`
source $THIS_SCRIPT_PATH/build_helper
#-------------------------------------------------------------------------------
#arg1 is force (0 or 1) (no interactive script)
#arg2 is debug (0 or 1) (install debug libraries)
check_install_common_deps() {
if [ $1 -gt 0 ]; then
OPTION="-y"
else
OPTION=""
fi
if [ $2 -eq 0 ]; then
debug=0
else
debug=1
fi
echo "Check supported distribution"
check_supported_distribution
[[ $? -ne 0 ]] && return $?
echo "Check supported distribution"
# prevent lock on /var/lib/dpkg/lock
if [[ $OS_DISTRO == "ubuntu" ]]; then
#$SUDO systemctl mask apt-daily.service
#$SUDO systemctl mask apt-daily.timer
#$SUDO systemctl mask apt-daily-upgrade.service
#$SUDO systemctl mask apt-daily-upgrade.timer
if [ $IS_CONTAINER -eq 0 ]; then
$SUDO sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic
fi
fi
update_package_db
check_enable_epel_repos
# Compilers, generators, ...
if [[ $OS_DISTRO == "ubuntu" ]]; then
PACKAGE_LIST="\
autoconf \
automake \
build-essential \
$CMAKE"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\
autoconf \
automake \
gcc-c++ \
$CMAKE \
make"
else
echo_fatal "$OS_DISTRO is not a supported distribution."
fi
echo "Install build tools"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
# Libraries
if [[ $OS_DISTRO == "ubuntu" ]]; then
case "$(get_distribution_release)" in
"ubuntu20.04")
specific_packages="libasio-dev libboost-all-dev libasan5"
;;
"ubuntu22.04")
specific_packages="libasio-dev libboost-all-dev libasan6"
;;
esac
# removed libspdlog-dev
PACKAGE_LIST="\
$specific_packages \
googletest-tools \
libgoogle-glog-dev \
libgtest-dev \
libtool \
pkg-config"
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
PACKAGE_LIST="\
boost-devel \
glog \
gtest \
libtool \
libasan"
else
echo_fatal "$OS_DISTRO is not a supported distribution."
fi
echo "Install distro libs"
$SUDO $INSTALLER install $OPTION $PACKAGE_LIST
ret=$?;[[ $ret -ne 0 ]] && return $ret
echo "distro libs installation complete"
$SUDO ldconfig
return 0
}
################################################################################
#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
################################################################################
cmake_minimum_required (VERSION 3.22.1)
project( COMMON )
include_directories(${COMMON_DIR})
include_directories(${LOGGER_DIR})
include_directories(${UTILS_DIR})
include_directories(${UTILS_DIR}/bstr)
file(GLOB COMMON_src_files
${COMMON_DIR}/*.cpp
${COMMON_DIR}/*.c
)
add_library(COMMON STATIC ${COMMON_src_files})
target_link_libraries( COMMON -Wl,--start-group UTILS LOGGER -lfmt -Wl,--end-group )
......@@ -330,6 +330,6 @@ request http_client::prepare_multipart_request(
req.body = body;
req.headers.insert(
{"content-type",
"multipart/related;boundary=" + std::string(CURL_MIME_BOUNDARY)});
"multipart/related;boundary=" + std::string(MIME_BOUNDARY)});
return req;
}
......@@ -35,7 +35,7 @@ using namespace oai::common::sbi;
namespace oai::http {
const std::string CURL_MIME_BOUNDARY = "----Boundary";
const std::string MIME_BOUNDARY = "----Boundary";
class http_client : public std::enable_shared_from_this<http_client> {
private:
......
/*
* 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 itti_async_shell_cmd.hpp
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_ITTI_ASYNC_SHELL_CMD_SEEN
#define FILE_ITTI_ASYNC_SHELL_CMD_SEEN
#include "itti_msg.hpp"
class itti_async_shell_cmd : public itti_msg {
public:
itti_async_shell_cmd(
const task_id_t origin, const task_id_t destination,
const std::string& system_cmd, bool is_abort_on_error,
const char* src_file, const int src_line)
: itti_msg(ASYNC_SHELL_CMD, origin, destination),
system_command(system_cmd),
is_abort_on_error(is_abort_on_error),
src_file(src_file),
src_line(src_line) {}
itti_async_shell_cmd(const itti_async_shell_cmd& i)
: itti_msg(i),
system_command(i.system_command),
is_abort_on_error(i.is_abort_on_error),
src_file(i.src_file),
src_line(i.src_line) {}
const char* get_msg_name() { return typeid(itti_msg_ping).name(); };
std::string system_command;
bool is_abort_on_error;
// debug
std::string src_file;
int src_line;
};
#endif /* FILE_ITTI_ASYNC_SHELL_CMD_SEEN */
################################################################################
# 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
################################################################################
cmake_minimum_required (VERSION 3.22.1)
project( LOGGER )
set( LIBLOGGER_SOURCES
${LOGGER_DIR}/nf-tp.cpp
${LOGGER_DIR}/lttng_logger_base.cpp
${LOGGER_DIR}/spd_logger_base.cpp
${LOGGER_DIR}/logger_base.cpp
)
add_library( LOGGER STATIC ${LIBLOGGER_SOURCES} )
target_link_libraries( LOGGER -Wl,--start-group -lfmt -lspdlog -Wl,--end-group )
......@@ -5,7 +5,9 @@
#include <stdexcept>
#include <vector>
#define SPDLOG_FMT_EXTERNAL
#ifndef SPDLOG_FMT_EXTERNAL
#define SPDLOG_FMT_EXTERNAL 1
#endif
#include <fmt/printf.h>
#include <spdlog/common.h>
......
......@@ -76,7 +76,6 @@ class Arp {
friend void to_json(nlohmann::json& j, const Arp& o);
friend void from_json(const nlohmann::json& j, Arp& o);
protected:
int32_t m_PriorityLevel;
oai::model::common::PreemptionCapability m_PreemptCap;
......
......@@ -67,7 +67,6 @@ class PreemptionCapability {
friend void to_json(nlohmann::json& j, const PreemptionCapability_anyOf& o);
friend void from_json(const nlohmann::json& j, PreemptionCapability_anyOf& o);
protected:
PreemptionCapability_anyOf m_value;
};
......
......@@ -70,7 +70,6 @@ class PreemptionCapability_anyOf {
friend void to_json(nlohmann::json& j, const PreemptionCapability_anyOf& o);
friend void from_json(const nlohmann::json& j, PreemptionCapability_anyOf& o);
protected:
PreemptionCapability_anyOf::ePreemptionCapability_anyOf m_value =
PreemptionCapability_anyOf::ePreemptionCapability_anyOf::
INVALID_VALUE_OPENAPI_GENERATED;
......
......@@ -70,7 +70,6 @@ class PreemptionVulnerability {
friend void from_json(
const nlohmann::json& j, PreemptionVulnerability_anyOf& o);
protected:
PreemptionVulnerability_anyOf m_value;
};
......
......@@ -74,7 +74,6 @@ class PreemptionVulnerability_anyOf {
friend void from_json(
const nlohmann::json& j, PreemptionVulnerability_anyOf& o);
protected:
PreemptionVulnerability_anyOf::ePreemptionVulnerability_anyOf m_value =
PreemptionVulnerability_anyOf::ePreemptionVulnerability_anyOf::
INVALID_VALUE_OPENAPI_GENERATED;
......
......@@ -88,7 +88,6 @@ class Snssai {
[[nodiscard]] std::string to_string(int indent_level) const;
protected:
int32_t m_Sst;
std::string m_Sd;
......
......@@ -205,7 +205,6 @@ class QosData {
friend void to_json(nlohmann::json& j, const QosData& o);
friend void from_json(const nlohmann::json& j, QosData& o);
protected:
std::string m_QosId;
int32_t m_r_5qi;
......
......@@ -78,8 +78,7 @@ void ControlPlaneServiceRequest::SetNgKsi(uint8_t tsc, uint8_t key_set_id) {
//------------------------------------------------------------------------------
void ControlPlaneServiceRequest::GetNgKsi(uint8_t& ng_ksi) const {
ng_ksi = (ie_ng_ksi_.GetTypeOfSecurityContext()) |
ie_ng_ksi_.GetNasKeyIdentifier();
ng_ksi = ie_ng_ksi_.GetNgKsi();
}
//------------------------------------------------------------------------------
......