Commit 82814a01 authored by Niuhaiwen's avatar Niuhaiwen

merge: initial registration request OK

parent a44ba544
......@@ -321,20 +321,20 @@ check_install_amf_deps(){
ret=$?;[[ $ret -ne 0 ]] && return $ret
# Use fmt lib included in spdlog
install_fmt $1
ret=$?;[[ $ret -ne 0 ]] && return $ret
#install_fmt $1
#ret=$?;[[ $ret -ne 0 ]] && return $ret
install_spdlog_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
#install_spdlog_from_git $1 $2
#ret=$?;[[ $ret -ne 0 ]] && return $ret
install_fb_folly_from_source $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
#install_fb_folly_from_source $1 $2
#ret=$?;[[ $ret -ne 0 ]] && return $ret
install_pistache_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
install_nlohmann_from_git $1 $2
ret=$?;[[ $ret -ne 0 ]] && return $ret
#install_nlohmann_from_git $1 $2
#ret=$?;[[ $ret -ne 0 ]] && return $ret
$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
################################################################################
## amf configuration file
AMF =
{
INSTANCE_ID = @INSTANCE@; # 0 is the default
PID_DIRECTORY = "@PID_DIRECTORY@"; # /var/run is the default
AMF_NAME = "OAI-AMF";
RELATIVE_CAPACITY = 30;
# Display statistics about whole system (in seconds)
STATISTICS_TIMER_INTERVAL = 20; # YOUR CONFIG HERE
CORE_CONFIGURATION:
{
EMERGENCY_SUPPORT = "false";
};
GUAMI:
{
MCC = "@MCC@"; MNC = "@MNC@"; RegionID = "@REGION_ID@"; AMFSetID = "@AMF_SET_ID@"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE
}
INSTANCE_ID = 10;
PID_DIRECTORY = "/var/run";
######################################################################## NG SETUP RESPONSE IEs ############################################################
AMF_NAME = "bupt-amf";
GUAMI:{MCC = "110"; MNC = "11"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"}
SERVED_GUAMI_LIST = (
{MCC = "@SERVED_GUAMI_MCC_0@"; MNC = "@SERVED_GUAMI_MNC_0@"; RegionID = "@SERVED_GUAMI_REGION_ID_0@"; AMFSetID = "@SERVED_GUAMI_AMF_SET_ID_0@"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "@SERVED_GUAMI_MCC_1@"; MNC = "@SERVED_GUAMI_MNC_1@"; RegionID = "@SERVED_GUAMI_REGION_ID_1@"; AMFSetID = "@SERVED_GUAMI_AMF_SET_ID_1@"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
RELATIVE_CAPACITY = 30;
PLMN_SUPPORT_LIST = (
{
MCC = "@PLMN_SUPPORT_MCC@"; MNC = "@PLMN_SUPPORT_MNC@"; TAC = @PLMN_SUPPORT_TAC@; # YOUR PLMN CONFIG HERE
SLICE_SUPPORT_LIST = (
{SST = "@SST_0@"; SD = "@SD_0@"}, # YOUR NSSAI CONFIG HERE
{SST = "@SST_1@"; SD = "@SD_1@"} # YOUR NSSAI CONFIG HERE
{MCC = "110"; MNC = "11"; TAC = 100;
SLICE_SUPPORT_LIST = (
{SST = "1"; SD = "none"},
{SST = "1"; SD = "12"}
)
}
}
);
INTERFACES:
{
# AMF binded interface for N1/N2 interface (NGAP)
NGAP_AMF:
{
INTERFACE_NAME = "@AMF_INTERFACE_NAME_FOR_NGAP@"; # YOUR NETWORK CONFIG HERE
##################################################################### clause 9.2.6.2, 3gpp ts38.413 ####################################################
STATISTICS_TIMER_INTERVAL = 20; #second
INTERFACES:{
NGAP_AMF:{
INTERFACE_NAME = "ens32";
IPV4_ADDRESS = "read";
PORT = 38412; # YOUR NETWORK CONFIG HERE
PPID = 60; # YOUR NETWORK CONFIG HERE
PORT = 38412;
PPID = 60;
};
# AMF binded interface for N11
N11:
{
INTERFACE_NAME = "@AMF_INTERFACE_NAME_FOR_N11@"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE
N11:{
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = @SMF_INSTANCE_ID_0@; IPV4_ADDRESS = "@SMF_IPV4_ADDR_0@"; PORT = "80"; VERSION = "@SMF_HTTP_VERSION_0@"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = @SMF_INSTANCE_ID_1@; IPV4_ADDRESS = "@SMF_IPV4_ADDR_1@"; PORT = "80"; VERSION = "@SMF_HTTP_VERSION_1@"; SELECTED = "false"} # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.199.203"; PORT = "8889"; VERSION = "v2"; SELECTED = "true"},
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "10.103.238.21"; PORT = "8181"; VERSION = "v1"; SELECTED = "false"}
);
};
};
AUTHENTICATION:
{
## MySQL mandatory options
MYSQL_server = "@MYSQL_SERVER@"; # MySQL Server address
MYSQL_user = "@MYSQL_USER@"; # Database server login
MYSQL_pass = "@MYSQL_PASS@"; # Database server password
MYSQL_db = "@MYSQL_DB@"; # Your database name
## OP
OPERATOR_key = "@OPERATOR_KEY@"; # OP key matching your database
CORE_CONFIGURATION:{
EMERGENCY_SUPPORT = "false";
};
AUTHENTICATION:{
MYSQL_server = "127.0.0.1";
MYSQL_user = "bupt"; # Database server login
MYSQL_pass = "linux"; # Database server password
MYSQL_db = "OAI_DB";
OPERATOR_key = "1006020f0a478bf6b699f15c062e42b3"; # op
RANDOM = "true";
};
NAS:
{
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA0" , "NIA1" , "NIA2" ];
NAS:{
#ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA2" , "NIA1" , "NIA0" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA1" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA0" , "NEA1" , "NEA2" ];
#ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA1" , "NEA1" , "NEA1" ];
};
};
......
......@@ -37,19 +37,19 @@ AMF =
GUAMI:
{
MCC = "208"; MNC = "95"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE
MCC = "110"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "1" # YOUR GUAMI CONFIG HERE
}
SERVED_GUAMI_LIST = (
{MCC = "208"; MNC = "95"; RegionID = "128"; 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>
{MCC = "110"; MNC = "11"; RegionID = "128"; AMFSetID = "1"; AMFPointer = "0"}, #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "110"; MNC = "11"; RegionID = "10"; AMFSetID = "1"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
PLMN_SUPPORT_LIST = (
{
MCC = "208"; MNC = "95"; TAC = 0xa000; # YOUR PLMN CONFIG HERE
MCC = "110"; MNC = "11"; TAC = 100; # YOUR PLMN CONFIG HERE
SLICE_SUPPORT_LIST = (
{SST = "222"; SD = "123"}, # YOUR NSSAI CONFIG HERE
{SST = "1"; SD = "none"}, # YOUR NSSAI CONFIG HERE
{SST = "1"; SD = "12"} # YOUR NSSAI CONFIG HERE
)
}
......@@ -60,7 +60,7 @@ AMF =
# AMF binded interface for N1/N2 interface (NGAP)
NGAP_AMF:
{
INTERFACE_NAME = "ens3"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "ens32"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 38412; # YOUR NETWORK CONFIG HERE
PPID = 60; # YOUR NETWORK CONFIG HERE
......@@ -69,12 +69,12 @@ AMF =
# AMF binded interface for N11
N11:
{
INTERFACE_NAME = "ens3"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "ens32"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE
PORT = 8282; # YOUR NETWORK CONFIG HERE
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.122.1"; PORT = "80"; VERSION = "v1"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 1; IPV4_ADDRESS = "192.168.199.203"; PORT = "8889"; VERSION = "v1"; SELECTED = "true"}, # YOUR SMF CONFIG HERE
{SMF_INSTANCE_ID = 2; IPV4_ADDRESS = "192.168.122.2"; PORT = "80"; VERSION = "v1"; SELECTED = "false"} # YOUR SMF CONFIG HERE
);
};
......@@ -85,9 +85,9 @@ AMF =
{
## MySQL mandatory options
MYSQL_server = "127.0.0.1"; # MySQL Server address
MYSQL_user = "root"; # Database server login
MYSQL_user = "bupt"; # Database server login
MYSQL_pass = "linux"; # Database server password
MYSQL_db = "oai_db"; # Your database name
MYSQL_db = "OAI_DB"; # Your database name
## OP
OPERATOR_key = "63bfa50ee6523365ff14c1f45f88737d"; # OP key matching your database
......@@ -96,7 +96,7 @@ AMF =
NAS:
{
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA0" , "NIA1" , "NIA2" ];
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "NIA1" , "NIA1" , "NIA1" ];
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "NEA0" , "NEA1" , "NEA2" ];
};
......
This diff is collapsed.
/*
* 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 amf_app.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_APP_H_
#define _AMF_APP_H_
......@@ -17,53 +45,39 @@ using namespace std;
static uint32_t amf_app_ue_ngap_id_generator = 1;
namespace amf_application{
namespace amf_application {
#define TASK_AMF_APP_PERIODIC_STATISTICS (0)
class amf_app{
public:
class amf_app {
public:
explicit amf_app(const amf_config &amf_cfg);
amf_app(amf_app const&) = delete;
void operator=(amf_app const&) = delete;
void allRegistredModulesInit(const amf_modules & modules);
void operator=(amf_app const&) = delete;
void allRegistredModulesInit(const amf_modules &modules);
long generate_amf_ue_ngap_id();
public://itti handlers
void handle_itti_message(itti_nas_signalling_establishment_request & itti_msg);
void handle_itti_message(itti_n1n2_message_transfer_request & itti_msg);
public://context management
//itti handlers
void handle_itti_message(itti_nas_signalling_establishment_request &itti_msg);
void handle_itti_message(itti_n1n2_message_transfer_request &itti_msg);
//context management
std::map<long, std::shared_ptr<ue_context>> amf_ue_ngap_id2ue_ctx;
mutable std::shared_mutex m_amf_ue_ngap_id2ue_ctx;
std::map<std::string, std::shared_ptr<ue_context>> ue_ctx_key;
mutable std::shared_mutex m_ue_ctx_key;
bool is_amf_ue_id_2_ue_context(const long & amf_ue_ngap_id) const;
std::shared_ptr<ue_context> amf_ue_id_2_ue_context(const long & amf_ue_ngap_id) const;
void set_amf_ue_ngap_id_2_ue_context(const long & amf_ue_ngap_id, std::shared_ptr<ue_context> uc);
bool is_ran_amf_id_2_ue_context(const string & ue_context_key) const;
std::shared_ptr<ue_context> ran_amf_id_2_ue_context(const string & ue_context_key) const;
void set_ran_amf_id_2_ue_context(const string & ue_context_key, std::shared_ptr<ue_context> uc);
public:/*** SMF Client response handlers ****/
bool is_amf_ue_id_2_ue_context(const long &amf_ue_ngap_id) const;
std::shared_ptr<ue_context> amf_ue_id_2_ue_context(const long &amf_ue_ngap_id) const;
void set_amf_ue_ngap_id_2_ue_context(const long &amf_ue_ngap_id, std::shared_ptr<ue_context> uc);
bool is_ran_amf_id_2_ue_context(const std::string &ue_context_key) const;
std::shared_ptr<ue_context> ran_amf_id_2_ue_context(const std::string &ue_context_key) const;
void set_ran_amf_id_2_ue_context(const std::string &ue_context_key, std::shared_ptr<ue_context> uc);
// SMF Client response handlers
void handle_post_sm_context_response_error_400();
public:
bool generate_5g_guti(uint32_t ranid, long amfid, string &mcc, string &mnc, uint32_t& tmsi);
//others
bool generate_5g_guti(uint32_t ranid, long amfid, std::string &mcc, std::string &mnc, uint32_t &tmsi);
};
}
#endif
This diff is collapsed.
/*
* 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 amf_config.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_CONFIG_H_
#define _AMF_CONFIG_H_
#include "amf_config.hpp"
#include <arpa/inet.h>
#include <libconfig.h++>
#include <netinet/in.h>
#include <sys/socket.h>
#include <mutex>
#include <vector>
#include <string>
#include "thread_sched.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "amf_config.hpp"
#include "thread_sched.hpp"
#define AMF_CONFIG_STRING_AMF_CONFIG "AMF"
#define AMF_CONFIG_STRING_PID_DIRECTORY "PID_DIRECTORY"
#define AMF_CONFIG_STRING_INSTANCE_ID "INSTANCE_ID"
......@@ -25,7 +52,7 @@
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define AMF_CONFIG_STRING_SCTP_PORT "SCTP_PORT"
#define AMF_CONFIG_STRING_PORT "PORT"
#define AMF_CONFIG_STRING_PPID "PPID"
#define AMF_CONFIG_STRING_INTERFACE_N11 "N11"
......@@ -42,16 +69,16 @@
#define AMF_CONFIG_STRING_AMF_NAME "AMF_NAME"
#define AMF_CONFIG_STRING_GUAMI "GUAMI"
#define AMF_CONFIG_STRING_ServedGUAMIList "ServedGUAMIList"
#define AMF_CONFIG_STRING_SERVED_GUAMI_LIST "SERVED_GUAMI_LIST"
#define AMF_CONFIG_STRING_TAC "TAC"
#define AMF_CONFIG_STRING_MCC "MCC"
#define AMF_CONFIG_STRING_MNC "MNC"
#define AMF_CONFIG_STRING_RegionID "RegionID"
#define AMF_CONFIG_STRING_AMFSetID "AMFSetID"
#define AMF_CONFIG_STRING_AMFPointer "AMFPointer"
#define AMF_CONFIG_STRING_RelativeAMFCapacity "RelativeAMFCapacity"
#define AMF_CONFIG_STRING_PLMNSupportList "PLMNSupportList"
#define AMF_CONFIG_STRING_SliceSupportList "SliceSupportList"
#define AMF_CONFIG_STRING_RELATIVE_AMF_CAPACITY "RELATIVE_CAPACITY"
#define AMF_CONFIG_STRING_PLMN_SUPPORT_LIST "PLMN_SUPPORT_LIST"
#define AMF_CONFIG_STRING_SLICE_SUPPORT_LIST "SLICE_SUPPORT_LIST"
#define AMF_CONFIG_STRING_SST "SST"
#define AMF_CONFIG_STRING_SD "SD"
#define AMF_CONFIG_STRING_CORE_CONFIGURATION "CORE_CONFIGURATION"
......@@ -67,28 +94,26 @@
#define AMF_CONFIG_STRING_NAS_SUPPORTED_INTEGRITY_ALGORITHM_LIST "ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST"
#define AMF_CONFIG_STRING_NAS_SUPPORTED_CIPHERING_ALGORITHM_LIST "ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST"
using namespace libconfig;
using namespace std;
namespace config{
namespace config {
typedef struct{
string mysql_server;
string mysql_user;
string mysql_pass;
string mysql_db;
string operator_key;
string random;
}auth_conf;
typedef struct {
std::string mysql_server;
std::string mysql_user;
std::string mysql_pass;
std::string mysql_db;
std::string operator_key;
std::string random;
} auth_conf;
typedef struct interface_cfg_s {
std::string if_name;
struct in_addr addr4;
struct in_addr network4;
std::string if_name;
struct in_addr addr4;
struct in_addr network4;
struct in6_addr addr6;
unsigned int mtu;
unsigned int port;
unsigned int mtu;
unsigned int port;
util::thread_sched_params thread_rd_sched_params;
} interface_cfg_t;
......@@ -100,75 +125,64 @@ typedef struct itti_cfg_s {
util::thread_sched_params async_cmd_sched_params;
} itti_cfg_t;
typedef struct guami_s{
string mcc;
string mnc;
string regionID;
string AmfSetID;
string AmfPointer;
}guami_t;
typedef struct slice_s{
string sST;
string sD;
}slice_t;
typedef struct plmn_support_item_s{
string mcc;
string mnc;
typedef struct guami_s {
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
} guami_t;
typedef struct slice_s {
std::string sST;
std::string sD;
} slice_t;
typedef struct plmn_support_item_s {
std::string mcc;
std::string mnc;
uint32_t tac;
vector<slice_t> slice_list;
}plmn_item_t;
std::vector<slice_t> slice_list;
} plmn_item_t;
typedef struct{
uint8_t prefered_integrity_algorithm[8];
uint8_t prefered_ciphering_algorithm[8];
}nas_conf_t;
typedef struct {
uint8_t prefered_integrity_algorithm[8];
uint8_t prefered_ciphering_algorithm[8];
} nas_conf_t;
typedef struct{
typedef struct {
int id;
string ipv4;
string port;
string version;
std::string ipv4;
std::string port;
std::string version;
bool selected;
}smf_inst_t;
} smf_inst_t;
class amf_config{
public:
class amf_config {
public:
amf_config();
~amf_config();
int load(const std::string &config_file);
int load_interface(const Setting& if_cfg, interface_cfg_t & cfg);
int load_thread_sched_params(const libconfig::Setting& thread_sched_params_cfg, util::thread_sched_params& cfg);
int load_interface(const Setting &if_cfg, interface_cfg_t &cfg);
int load_thread_sched_params(const libconfig::Setting &thread_sched_params_cfg, util::thread_sched_params &cfg);
void display();
public:
unsigned int instance;
string pid_dir;
interface_cfg_t n2;
itti_cfg_t itti;
unsigned int statistics_interval;
string AMF_Name;
guami_t guami;
vector<guami_t> guami_list;
unsigned int relativeAMFCapacity;
vector<plmn_item_t> plmn_list;
string is_emergency_support;
auth_conf auth_para;
nas_conf_t nas_cfg;
vector<smf_inst_t> smf_pool;
unsigned int instance;
std::string pid_dir;
interface_cfg_t n2;
interface_cfg_t n11;
itti_cfg_t itti;
unsigned int statistics_interval;
std::string AMF_Name;
guami_t guami;
std::vector<guami_t> guami_list;
unsigned int relativeAMFCapacity;
std::vector<plmn_item_t> plmn_list;
std::string is_emergency_support;
auth_conf auth_para;
nas_conf_t nas_cfg;
std::vector<smf_inst_t> smf_pool;
};
}
#endif
/*
* 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 amf_module_from_config.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_module_from_config.hpp"
#include "logger.hpp"
#include <iostream>
#include <string>
using namespace std;
#include "logger.hpp"
namespace config{
namespace config {
int amf_modules::load(const std::string &config_file){
cout<<endl;
Logger::amf_app().debug("Load amf module configuration file(%s)",config_file.c_str());
Config cfg;
try{
//------------------------------------------------------------------------------
int amf_modules::load(const std::string &config_file) {
Logger::amf_app().debug("\nLoad AMF module configuration file (%s)", config_file.c_str());
Config cfg;
try {
cfg.readFile(config_file.c_str());
}catch(const FileIOException &fioex){
} catch (const FileIOException &fioex) {
Logger::amf_app().error("I/O error while reading file %s - %s", config_file.c_str(), fioex.what());
throw;
}catch(const ParseException &pex){
} catch (const ParseException &pex) {
Logger::amf_app().error("Parse error at %s:%d - %s", pex.getFile(), pex.getLine(), pex.getError());
throw;
}
const Setting &root = cfg.getRoot();
try{
const Setting& modules = root[MODULES_CONFIG_STRING_AMF_MODULES];
}catch(const SettingNotFoundException &nfex){
try {
const Setting &modules = root[MODULES_CONFIG_STRING_AMF_MODULES];
} catch (const SettingNotFoundException &nfex) {
Logger::amf_app().error("%s : %s", nfex.what(), nfex.getPath());
return -1;
}
const Setting &modules = root[MODULES_CONFIG_STRING_AMF_MODULES];
const Setting &msg = modules[MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE];
int count = msg.getLength();
for(int i=0; i< count; i++){
const Setting & item = msg[i];
for (int i = 0; i < count; i++) {
const Setting &item = msg[i];
std::string typeOfMessage;
int procedure_code;
item.lookupValue(MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_NAME, msgName);
item.lookupValue(MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_PROCEDURECODE, procedure_code);
item.lookupValue(MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_TYPEOFMSG, typeOfMessage);
procedureCode = (Ngap_ProcedureCode_t)procedure_code;
if(!(typeOfMessage.compare("initialMessage"))){
procedureCode = (Ngap_ProcedureCode_t) procedure_code;
if (!(typeOfMessage.compare("initialMessage"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_initiatingMessage;
}else if(!(typeOfMessage.compare("successfuloutcome"))){
} else if (!(typeOfMessage.compare("successfuloutcome"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_successfulOutcome;
}else if(!(typeOfMessage.compare("unsuccessfuloutcome"))){
} else if (!(typeOfMessage.compare("unsuccessfuloutcome"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_unsuccessfulOutcome;
}else{
} else {
Logger::config().error("wrong NGAP message configuration");
}
}
}
void amf_modules::display(){
Logger::config().info( "======= AMF Registred Modules =======");
Logger::config().info( "NGAP Message Modules Repository(SourceCode) Path( ~/oai-5g-amf/src/ngap/ngapMsgs )");
Logger::config().info( "NGAP Message Modules:");
Logger::config().info( "- %s([%d,%d])\n", msgName.c_str(), procedureCode, typeOfMsg);
//------------------------------------------------------------------------------
void amf_modules::display() {
Logger::config().info("======= AMF Registered Modules =======");
Logger::config().info("NGAP Message Modules:");
Logger::config().info("- %s(Procedure code %d, Type of Msg %d)\n", msgName.c_str(), procedureCode, typeOfMsg);
}
}
/*
* 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 amf_module_from_config.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_MODULE_FROM_CONFIG_H_
#define _AMF_MODULE_FROM_CONFIG_H_
......@@ -16,38 +44,28 @@
#include "Ngap_ProcedureCode.h"
#include "Ngap_NGAP-PDU.h"
#define MODULES_CONFIG_STRING_AMF_MODULES "MODULES"
#define MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE "NGAP_MESSAGE"
#define MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_NAME "MSG_NAME"
#define MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_PROCEDURECODE "ProcedureCode"
#define MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE_TYPEOFMSG "TypeOfMessage"
using namespace libconfig;
namespace config{
namespace config {
class amf_modules{
public:
class amf_modules {
public:
int load(const std::string &config_file);
void display();
void makeModulesAlive();
private:
std::string msgName;//vector to store more msgs
Ngap_NGAP_PDU_PR typeOfMsg;
void makeModulesAlive();
private:
std::string msgName; //vector to store more msgs
Ngap_NGAP_PDU_PR typeOfMsg;
Ngap_ProcedureCode_t procedureCode;
// NGSetupRequestMsg *ngSetupRequest;
};
}
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
/*
* 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 amf_n11.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_N11_H_
#define _AMF_N11_H_
#include "itti_msg_n11.hpp"
#include <map>
#include <shared_mutex>
#include "pdu_session_context.hpp"
#include <string>
using namespace std;
namespace amf_application{
#include "itti_msg_n11.hpp"
#include "pdu_session_context.hpp"
class amf_n11{
public:
namespace amf_application {
class amf_n11 {
public:
amf_n11();
~amf_n11();
public:
void handle_itti_message(itti_smf_services_consumer &);
void handle_pdu_session_initial_request(string supi, std::shared_ptr<pdu_session_context> psc, string smf_addr, bstring sm_msg, string dnn);
void handle_itti_message(itti_smf_services_consumer&);
void handle_pdu_session_initial_request(std::string supi, std::shared_ptr<pdu_session_context> psc, std::string smf_addr, bstring sm_msg, std::string dnn);
void handle_itti_message(itti_pdu_session_resource_setup_response &itti_msg);
void handle_itti_message(itti_nsmf_pdusession_update_sm_context &itti_msg);
void handle_itti_message(itti_nsmf_pdusession_release_sm_context &itti_msg);
public:
std::map<string, std::shared_ptr<pdu_session_context>> supi2pdu; // amf ue ngap id
std::map<std::string, std::shared_ptr<pdu_session_context>> supi2pdu; // amf ue ngap id
mutable std::shared_mutex m_supi2pdu;
bool is_supi_to_pdu_ctx(const string &supi) const;
std::shared_ptr<pdu_session_context> supi_to_pdu_ctx(const string & supi) const;
void set_supi_to_pdu_ctx(const string &supi, std::shared_ptr<pdu_session_context> psc);
public:
std::map<uint8_t, string> pduid2supi;
bool is_supi_to_pdu_ctx(const std::string &supi) const;
std::shared_ptr<pdu_session_context> supi_to_pdu_ctx(const std::string &supi) const;
void set_supi_to_pdu_ctx(const std::string &supi, std::shared_ptr<pdu_session_context> psc);
std::map<uint8_t, std::string> pduid2supi;
public:
bool smf_selection_from_configuration(string & smf_addr);
bool smf_selection_from_context(string & smf_addr);
public:
bool smf_selection_from_configuration(std::string &smf_addr);
bool smf_selection_from_context(std::string &smf_addr);
void handle_post_sm_context_response_error_400();
void handle_post_sm_context_response_error(long code, string cause, bstring n1sm, string supi, uint8_t pdu_session_id);
public:
void curl_http_client(string remoteUri, string jsonData, string n1SmMsg, string n2SmMsg, string supi, uint8_t pdu_session_id);
};
void handle_post_sm_context_response_error(long code, std::string cause, bstring n1sm, std::string supi, uint8_t pdu_session_id);
void curl_http_client(std::string remoteUri, std::string jsonData, std::string n1SmMsg, std::string n2SmMsg, std::string supi, uint8_t pdu_session_id);
};
}
#endif
This diff is collapsed.
/*
* 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 amf_n2.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_N2_H_
#define _AMF_N2_H_
......@@ -8,41 +36,42 @@
#include "HandoverRequest.hpp"
#include "HandoverCommandMsg.hpp"
#include "DownlinkRANStatusTransfer.hpp"
namespace amf_application
{
class amf_n2 : public ngap::ngap_app
{
public:
amf_n2(const string &address, const uint16_t port_num);
~amf_n2();
//void handle_receive(bstring payload, sctp_assoc_id_t assoc_id, sctp_stream_id_t stream, sctp_stream_id_t instreams, sctp_stream_id_t outstreams);
void handle_itti_message(itti_new_sctp_association &new_assoc);
void handle_itti_message(itti_ng_setup_request &ngsetupreq);
void handle_itti_message(itti_initial_ue_message &init_ue_msg);
void handle_itti_message(itti_ul_nas_transport &ul_nas_transport);
void handle_itti_message(itti_dl_nas_transport &dl_nas_transport);
void handle_itti_message(itti_initial_context_setup_request &itti_msg);
void handle_itti_message(itti_pdu_session_resource_setup_request &itti_msg);
void handle_itti_message(itti_ue_context_release_request &itti_msg);
void handle_itti_message(itti_ue_radio_capability_indication &itti_msg);
void handle_itti_message(itti_ue_context_release_command &itti_msg);
void handle_itti_message(itti_pdu_session_resource_release_command &itti_msg);
void handle_itti_message(itti_handover_required &itti_msg);
void handle_itti_message(itti_handover_request_Ack &itti_msg);
void handle_itti_message(itti_handover_notify &itti_msg);
void handle_itti_message(itti_uplinkranstatsutransfer &itti_msg);
bool verifyPlmn(vector<SupportedItem_t> list);
public:
std::map<uint32_t, std::shared_ptr<ue_ngap_context>> ranid2uecontext; // ran ue ngap id
mutable std::shared_mutex m_ranid2uecontext;
bool is_ran_ue_id_2_ue_ngap_context(const uint32_t &ran_ue_ngap_id) const;
std::shared_ptr<ue_ngap_context> ran_ue_id_2_ue_ngap_context(const uint32_t &ran_ue_ngap_id) const;
void set_ran_ue_ngap_id_2_ue_ngap_context(const uint32_t &ran_ue_ngap_id, std::shared_ptr<ue_ngap_context> unc);
};
} // namespace amf_application
#include "amf.hpp"
namespace amf_application{
class amf_n2 : public ngap::ngap_app{
public:
amf_n2(const std::string &address, const uint16_t port_num);
~amf_n2();
void handle_itti_message(itti_new_sctp_association &new_assoc);
void handle_itti_message(itti_ng_setup_request &ngsetupreq);
void handle_itti_message(itti_initial_ue_message &init_ue_msg);
void handle_itti_message(itti_ul_nas_transport &ul_nas_transport);
void handle_itti_message(itti_dl_nas_transport &dl_nas_transport);
void handle_itti_message(itti_initial_context_setup_request &itti_msg);
void handle_itti_message(itti_pdu_session_resource_setup_request &itti_msg);
void handle_itti_message(itti_ue_context_release_request &itti_msg);
void handle_itti_message(itti_ue_radio_capability_indication &itti_msg);
void handle_itti_message(itti_ue_context_release_command &itti_msg);
void handle_itti_message(itti_pdu_session_resource_release_command &itti_msg);
void handle_itti_message(itti_handover_required &itti_msg);
void handle_itti_message(itti_handover_request_Ack &itti_msg);
void handle_itti_message(itti_handover_notify &itti_msg);
void handle_itti_message(itti_uplinkranstatsutransfer &itti_msg);
bool verifyPlmn(std::vector<SupportedItem_t> list);
std::vector<SupportedItem_t> get_common_plmn(std::vector<SupportedItem_t> list);
public:
std::map<uint32_t, std::shared_ptr<ue_ngap_context>> ranid2uecontext;// ran ue ngap id
mutable std::shared_mutex m_ranid2uecontext;
bool is_ran_ue_id_2_ue_ngap_context(const uint32_t & ran_ue_ngap_id) const;
std::shared_ptr<ue_ngap_context> ran_ue_id_2_ue_ngap_context(const uint32_t & ran_ue_ngap_id) const;
void set_ran_ue_ngap_id_2_ue_ngap_context(const uint32_t & ran_ue_ngap_id, std::shared_ptr<ue_ngap_context> unc);
};
}
#endif
/*
* 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 amf_statistics.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_statistics.hpp"
#include "logger.hpp"
#include <iostream>
using namespace std;
#include "logger.hpp"
void statistics::display(){
cout<<endl;
//------------------------------------------------------------------------------
void statistics::display() {
Logger::amf_app().info("");
//Logger::amf_app().info("--------------------------------------------------");
//Logger::amf_app().info("| connected gNBs | connected UEs | registred UEs |");
//Logger::amf_app().info("| connected gNBs | connected UEs | registered UEs |");
//Logger::amf_app().info("--------------------------------------------------");
//Logger::amf_app().info("| %d | %d | %d |",gNB_connected,UE_connected,UE_registred);
//Logger::amf_app().info("--------------------------------------------------");
Logger::amf_app().info("|--------------------------------------------------------------------------------------------------------------------|");
Logger::amf_app().info("-----------------------------------------------------------------------------------------------------------------");
Logger::amf_app().info("|----------------------------------------------------gNBs' information--------------------------------------------|");
for(int i=0; i<gnbs.size(); i++){
Logger::amf_app().info("[index %d][connected][GlobalID: 0x%x][gnb name: %s][Tracking Area: plmn(%s), tac(%d)]", i+1, gnbs[i].gnb_id, gnbs[i].gnb_name.c_str(), (gnbs[i].mcc+gnbs[i].mnc).c_str(), gnbs[i].tac);
Logger::amf_app().info("|----------------------------------------------------------------------------------------------------------------|");
Logger::amf_app().info("|----------------------------------------------------gNBs' information-------------------------------------------|");
Logger::amf_app().info("| Index | Status | Global ID | gNB Name | Tracking Area (PLMN, TAC) |");
if (gnbs.size() ==0 ) {
Logger::amf_app().info("| - | - | - | - | - |");
}
Logger::amf_app().info("-----------------------------------------------------------------------------------------------------------------"); cout<<endl;
Logger::amf_app().info("-----------------------------------------------------------------------------------------------------------------");
//TODO: Show the list of common PLMNs
for (int i = 0; i < gnbs.size(); i++) {
Logger::amf_app().info("| %d | Connected | 0x%x | %s | %s, %d | ", i + 1, gnbs[i].gnb_id, gnbs[i].gnb_name.c_str(), (gnbs[i].mcc + gnbs[i].mnc).c_str(), gnbs[i].tac);
}
Logger::amf_app().info("|----------------------------------------------------------------------------------------------------------------|");
Logger::amf_app().info("");
Logger::amf_app().info("|----------------------------------------------------------------------------------------------------------------|");
Logger::amf_app().info("|----------------------------------------------------UEs' information--------------------------------------------|");
for(int i=0; i<ues.size();i++){
Logger::amf_app().info("[index %d][%s][%s][imsi %s][guti %s]", i+1, ues[i].connStatus.c_str(), ues[i].registerStatus.c_str(), ues[i].imsi.c_str(), ues[i].guti.c_str());
Logger::amf_app().info("Current ran_ue_ngap_id[%d]; Current amf_ue_ngap_id[%d]", ues[i].ranid, ues[i].amfid);
Logger::amf_app().info("Location[NrCgi][PLMN(%s), cellID(%d)]", (ues[i].mcc+ues[i].mnc).c_str(), ues[i].cellId); cout<<endl;
Logger::amf_app().info("| Index | Connection state | Registration state | IMSI | GUTI | RAN UE NGAP ID | AMF UE ID |");
for (int i = 0; i < ues.size(); i++) {
Logger::amf_app().info("| %d | %s | %s | %s | %s | %d | %d | ", i + 1, ues[i].connStatus.c_str(), ues[i].registerStatus.c_str(), ues[i].imsi.c_str(), ues[i].guti.c_str(), ues[i].ranid, ues[i].amfid);
//Logger::amf_app().info("Current ran_ue_ngap_id[%d]; Current amf_ue_ngap_id[%d]", ues[i].ranid, ues[i].amfid);
Logger::amf_app().info("Location [NrCgi][PLMN(%s), cellID(%d)]", (ues[i].mcc + ues[i].mnc).c_str(), ues[i].cellId);
Logger::amf_app().info("");
}
Logger::amf_app().info("-----------------------------------------------------------------------------------------------------------------");
Logger::amf_app().info("|--------------------------------------------------------------------------------------------------------------------|"); cout<<endl;
Logger::amf_app().info("|----------------------------------------------------------------------------------------------------------------|");
Logger::amf_app().info("");
}
statistics::statistics(){
//------------------------------------------------------------------------------
statistics::statistics() {
gNB_connected = 0;
UE_connected = 0;
UE_registred = 0;
}
statistics::~statistics(){}
//------------------------------------------------------------------------------
statistics::~statistics() {
}
/*
* 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 amf_statistics.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _STATISTICS_H_
#define _STATISTICS_H_
......@@ -7,49 +35,45 @@
#include <vector>
#include <string>
using namespace std;
#include "amf.hpp"
#include "ngap_app.hpp"
typedef struct{
typedef struct {
uint32_t gnb_id;
string mcc;
string mnc;
string gnb_name;
//TODO: list of PLMNs
std::vector<SupportedItem_t> plmn_list;
std::string mcc;
std::string mnc;
std::string gnb_name;
uint32_t tac;
//long nrCellId;
}gnb_infos;
} gnb_infos;
typedef struct{
string connStatus;
string registerStatus;
typedef struct {
std::string connStatus;
std::string registerStatus;
uint32_t ranid;
long amfid;
string imsi;
string guti;
string mcc;
string mnc;
long amfid;
std::string imsi;
std::string guti;
std::string mcc;
std::string mnc;
uint32_t cellId;
}ue_infos;
} ue_infos;
class statistics{
public:
class statistics {
public:
void display();
statistics();
~statistics();
public:
uint32_t gNB_connected;
uint32_t UE_connected;
uint32_t UE_registred;
public:
uint32_t gNB_connected;
uint32_t UE_connected;
uint32_t UE_registred;
//uint32_t system_pdu_sessions;
vector<gnb_infos> gnbs;
vector<ue_infos> ues;
std::vector<gnb_infos> gnbs;
std::vector<ue_infos> ues;
};
#endif
This diff is collapsed.
/*
* 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 mysql_db.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _MYSQL_DB_HANDLERS_H_
#define _MYSQL_DB_HANDLERS_H_
......@@ -10,15 +38,15 @@
#define KEY_LENGTH (16)
#define SQN_LENGTH (6)
#define RAND_LENGTH (16)
typedef struct{
typedef struct {
uint8_t key[KEY_LENGTH];
uint8_t sqn[SQN_LENGTH];
uint8_t opc[KEY_LENGTH];
uint8_t rand[RAND_LENGTH];
}mysql_auth_info_t;
} mysql_auth_info_t;
typedef struct {
/* The mysql reference connector object */
//mysql reference connector object
MYSQL *db_conn;
std::string server;
std::string user;
......
......@@ -74,7 +74,7 @@ void Logger::_init(const char *app, const bool log_stdout, const bool log_rot_fi
m_amf_n1 = new _Logger("amf_n1 ", m_sinks, ss.str().c_str());
m_amf_n11 = new _Logger("amf_n11", m_sinks, ss.str().c_str());
m_amf_server = new _Logger("amf_server", m_sinks, ss.str().c_str());
m_task_amf_n2 = new _Logger("task_amf_n2", m_sinks, ss.str().c_str());
}
//------------------------------------------------------------------------------
......
......@@ -127,6 +127,9 @@ class Logger {
static _Logger& amf_server() {
return *singleton().m_amf_server;
}
static _Logger& task_amf_n2() {
return *singleton().m_task_amf_n2;
}
private:
static Logger *m_singleton;
......@@ -159,6 +162,7 @@ class Logger {
_Logger *m_amf_n1;
_Logger *m_amf_n11;
_Logger *m_amf_server;
_Logger *m_task_amf_n2;
};
......
......@@ -85,7 +85,7 @@ class nas_context {
bool is_imsi_present;
bool is_5g_guti_present;
bool is_auth_vectors_present;
bool to_be_register_by_new_suci;
};
#endif
......@@ -33,8 +33,9 @@
#include "bstrlib.h"
#include "amf.hpp"
class pdu_session_context {
public:
class pdu_session_context
{
public:
pdu_session_context();
~pdu_session_context();
......@@ -43,9 +44,13 @@ class pdu_session_context {
uint8_t req_type;
uint8_t pdu_session_id;
bstring n2sm;
bool isn2sm_avaliable;
bstring n1sm;
bool isn1sm_avaliable;
std::string dnn;
std::string remote_smf_addr[0]; //"192.168.12.10:8080"
std::string remote_smf_addr[0]; //"192.168.12.10:8080"
bool smf_available;
std::string location;
snssai_t snssai;
plmn_t plmn;
std::string smf_context_location;
......
......@@ -3,9 +3,9 @@
* 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
* 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
*
......@@ -30,7 +30,8 @@
#include <stdint.h>
#include <utility>
typedef enum {
typedef enum
{
TASK_FIRST = 0,
TASK_ITTI_TIMER = TASK_FIRST,
TASK_ASYNC_SHELL_CMD,
......@@ -45,7 +46,8 @@ typedef enum {
TASK_ALL = 255
} task_id_t;
typedef enum message_priorities_e {
typedef enum message_priorities_e
{
MESSAGE_PRIORITY_MAX = 100,
MESSAGE_PRIORITY_MAX_LEAST = 85,
MESSAGE_PRIORITY_MED_PLUS = 70,
......@@ -55,7 +57,8 @@ typedef enum message_priorities_e {
MESSAGE_PRIORITY_MIN = 10,
} message_priorities_t;
typedef enum {
typedef enum
{
ITTI_MSG_TYPE_NONE = -1,
ITTI_MSG_TYPE_FIRST = 0,
ASYNC_SHELL_CMD = ITTI_MSG_TYPE_FIRST,
......@@ -68,15 +71,19 @@ typedef enum {
PDU_SESSION_RESOURCE_SETUP_REQUEST,
UE_CONTEXT_RELEASE_REQUEST,
UE_RADIO_CAP_IND,
UL_NAS_DATA_IND, // task amf_n1 message id
UL_NAS_DATA_IND, //task amf_n1 message id
DOWNLINK_NAS_TRANSFER,
NAS_SIG_ESTAB_REQ, // task amf_app
NAS_SIG_ESTAB_REQ, //task amf_app
N1N2_MESSAGE_TRANSFER_REQ,
SMF_SERVICES_CONSUMER,
NSMF_PDU_SESSION_UPDATE_SM_CTX,
UE_CONTEXT_RELEASE_COMMAND,
PDU_SESSION_RESOURCE_RELEASE_COMMAND,
NSMF_PDU_SESS_RELEASE_SMCTX,
HANDOVER_REQUIRED,
HANDOVER_REQUEST_ACK,
HANDOVER_NOTIFY,
UPLINKRANSTATUSTRANSFER,
PDU_SESS_RES_SET_RESP,
TIME_OUT,
HEALTH_PING,
......@@ -86,14 +93,15 @@ typedef enum {
typedef unsigned long message_number_t;
class itti_msg {
class itti_msg
{
public:
itti_msg();
itti_msg(const itti_msg_type_t msg_type, const task_id_t origin,
const task_id_t destination);
itti_msg(const itti_msg_type_t msg_type, const task_id_t origin, const task_id_t destination);
itti_msg(const itti_msg &i);
itti_msg &operator=(itti_msg other) {
itti_msg &operator=(itti_msg other)
{
std::swap(msg_num, other.msg_num);
std::swap(origin, other.origin);
std::swap(destination, other.destination);
......@@ -110,35 +118,30 @@ public:
itti_msg_type_t msg_type;
};
class itti_msg_timeout : public itti_msg {
class itti_msg_timeout : public itti_msg
{
public:
itti_msg_timeout(const task_id_t origin, const task_id_t destination,
uint32_t timer_id, uint64_t arg1_user, uint64_t arg2_user)
: itti_msg(TIME_OUT, origin, destination), timer_id(timer_id),
arg1_user(arg1_user), arg2_user(arg2_user) {}
itti_msg_timeout(const itti_msg_timeout &i)
: itti_msg(i), timer_id(i.timer_id), arg1_user(i.arg1_user),
arg2_user(i.arg2_user) {}
itti_msg_timeout(const task_id_t origin, const task_id_t destination, uint32_t timer_id, uint64_t arg1_user, uint64_t arg2_user) : itti_msg(TIME_OUT, origin, destination), timer_id(timer_id), arg1_user(arg1_user), arg2_user(arg2_user) {}
itti_msg_timeout(const itti_msg_timeout &i) : itti_msg(i), timer_id(i.timer_id), arg1_user(i.arg1_user), arg2_user(i.arg2_user) {}
static const char *get_msg_name() { return "TIME_OUT"; };
uint32_t timer_id;
uint64_t arg1_user;
uint64_t arg2_user;
};
class itti_msg_ping : public itti_msg {
class itti_msg_ping : public itti_msg
{
public:
itti_msg_ping(const task_id_t origin, const task_id_t destination,
uint32_t seq)
: itti_msg(HEALTH_PING, origin, destination), seq(seq) {}
itti_msg_ping(const task_id_t origin, const task_id_t destination, uint32_t seq) : itti_msg(HEALTH_PING, origin, destination), seq(seq) {}
itti_msg_ping(const itti_msg_ping &i) : itti_msg(i), seq(i.seq) {}
static const char *get_msg_name() { return "HEALTH_PING"; };
uint32_t seq;
};
class itti_msg_terminate : public itti_msg {
class itti_msg_terminate : public itti_msg
{
public:
itti_msg_terminate(const task_id_t origin, const task_id_t destination)
: itti_msg(TERMINATE, origin, destination) {}
itti_msg_terminate(const task_id_t origin, const task_id_t destination) : itti_msg(TERMINATE, origin, destination) {}
itti_msg_terminate(const itti_msg_terminate &i) : itti_msg(i) {}
static const char *get_msg_name() { return "TERMINATE"; };
};
......
......@@ -49,8 +49,18 @@ public:
itti_nsmf_pdusession_update_sm_context(const task_id_t origin, const task_id_t destination) : itti_msg_n11(NSMF_PDU_SESSION_UPDATE_SM_CTX, origin, destination){}
itti_nsmf_pdusession_update_sm_context(const itti_nsmf_pdusession_update_sm_context &i) : itti_msg_n11(i){}
public:
std::string supi;
uint8_t pdu_session_id;
bstring n2sm;
};
class itti_nsmf_pdusession_release_sm_context : public itti_msg_n11
{
public:
itti_nsmf_pdusession_release_sm_context(const task_id_t origin, const task_id_t destination) : itti_msg_n11(NSMF_PDU_SESS_RELEASE_SMCTX, origin, destination) {}
itti_nsmf_pdusession_release_sm_context(const itti_nsmf_pdusession_update_sm_context &i) : itti_msg_n11(i) {}
public:
std::string supi;
};
#endif
#ifndef _ITTI_MSG_N2_H_
#define _ITTI_MSG_N2_H_
#include "HandoverNotifyMsg.hpp"
#include "HandoverRequestAck.hpp"
#include "HandoverRequiredMsg.hpp"
#include "InitialUEMessage.hpp"
#include "itti_msg.hpp"
#include "NGSetupRequest.hpp"
#include "InitialUEMessage.hpp"
#include "UplinkNASTransport.hpp"
#include "UEContextReleaseRequest.hpp"
#include "UERadioCapabilityInfoIndication.hpp"
#include "UplinkNASTransport.hpp"
#include "itti_msg.hpp"
#include "sctp_server.hpp"
#include "HandoverRequestAck.hpp"
#include "HandoverRequiredMsg.hpp"
#include "HandoverNotifyMsg.hpp"
#include "UplinkRANStatusTransfer.hpp"
using namespace ngap;
using namespace sctp;
class itti_msg_n2 : public itti_msg {
class itti_msg_n2 : public itti_msg
{
public:
itti_msg_n2(const itti_msg_type_t msg_type, const task_id_t origin,
const task_id_t destination)
: itti_msg(msg_type, origin, destination) {}
itti_msg_n2(const itti_msg_n2 &i) : itti_msg(i) {
itti_msg_n2(const itti_msg_type_t msg_type, const task_id_t origin, const task_id_t destination) : itti_msg(msg_type, origin, destination)
{
}
itti_msg_n2(const itti_msg_n2 &i) : itti_msg(i)
{
assoc_id = i.assoc_id;
stream = i.stream;
}
......@@ -27,44 +30,46 @@ public:
sctp_stream_id_t stream;
};
class itti_new_sctp_association : public itti_msg_n2 {
class itti_new_sctp_association : public itti_msg_n2
{
public:
itti_new_sctp_association(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(NEW_SCTP_ASSOCIATION, origin, destination) {}
itti_new_sctp_association(const task_id_t origin, const task_id_t destination) : itti_msg_n2(NEW_SCTP_ASSOCIATION, origin, destination) {}
};
class itti_ng_setup_request : public itti_msg_n2 {
class itti_ng_setup_request : public itti_msg_n2
{
public:
itti_ng_setup_request(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(NG_SETUP_REQ, origin, destination) {}
itti_ng_setup_request(const itti_ng_setup_request &i) : itti_msg_n2(i) {}
itti_ng_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(NG_SETUP_REQ, origin, destination) {}
itti_ng_setup_request(const itti_ng_setup_request &i) : itti_msg_n2(i)
{
}
public:
NGSetupRequestMsg *ngSetupReq;
};
class itti_initial_ue_message : public itti_msg_n2 {
class itti_initial_ue_message : public itti_msg_n2
{
public:
itti_initial_ue_message(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(INITIAL_UE_MSG, origin, destination) {}
itti_initial_ue_message(const task_id_t origin, const task_id_t destination) : itti_msg_n2(INITIAL_UE_MSG, origin, destination) {}
itti_initial_ue_message(const itti_initial_ue_message &i) : itti_msg_n2(i) {}
InitialUEMessageMsg *initUeMsg;
};
class itti_ul_nas_transport : public itti_msg_n2 {
class itti_ul_nas_transport : public itti_msg_n2
{
public:
itti_ul_nas_transport(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(ITTI_UL_NAS_TRANSPORT, origin, destination) {}
itti_ul_nas_transport(const task_id_t origin, const task_id_t destination) : itti_msg_n2(ITTI_UL_NAS_TRANSPORT, origin, destination) {}
itti_ul_nas_transport(const itti_ul_nas_transport &i) : itti_msg_n2(i) {}
UplinkNASTransportMsg *ulNas;
};
class itti_dl_nas_transport : public itti_msg_n2 {
class itti_dl_nas_transport : public itti_msg_n2
{
public:
itti_dl_nas_transport(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(ITTI_DL_NAS_TRANSPORT, origin, destination) {}
itti_dl_nas_transport(const task_id_t origin, const task_id_t destination) : itti_msg_n2(ITTI_DL_NAS_TRANSPORT, origin, destination) {}
itti_dl_nas_transport(const itti_dl_nas_transport &i) : itti_msg_n2(i) {}
public:
......@@ -73,14 +78,11 @@ public:
bstring nas;
};
class itti_initial_context_setup_request : public itti_msg_n2 {
class itti_initial_context_setup_request : public itti_msg_n2
{
public:
itti_initial_context_setup_request(const task_id_t origin,
const task_id_t destination)
: itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {}
itti_initial_context_setup_request(
const itti_initial_context_setup_request &i)
: itti_msg_n2(i) {}
itti_initial_context_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {}
itti_initial_context_setup_request(const itti_initial_context_setup_request &i) : itti_msg_n2(i) {}
uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id;
bstring kgnb;
......@@ -88,16 +90,15 @@ public:
bool is_sr;
bstring n2sm;
uint8_t pdu_session_id;
bool is_pdu_exist; //true is no pdu context
bool isn2sm_avaliable;
};
class itti_pdu_session_resource_setup_request : public itti_msg_n2 {
class itti_pdu_session_resource_setup_request : public itti_msg_n2
{
public:
itti_pdu_session_resource_setup_request(const task_id_t origin,
const task_id_t destination)
: itti_msg_n2(PDU_SESSION_RESOURCE_SETUP_REQUEST, origin, destination) {}
itti_pdu_session_resource_setup_request(
const itti_pdu_session_resource_setup_request &i)
: itti_msg_n2(i) {}
itti_pdu_session_resource_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(PDU_SESSION_RESOURCE_SETUP_REQUEST, origin, destination) {}
itti_pdu_session_resource_setup_request(const itti_pdu_session_resource_setup_request &i) : itti_msg_n2(i) {}
bstring nas;
bstring n2sm;
uint32_t ran_ue_ngap_id;
......@@ -105,47 +106,68 @@ public:
uint8_t pdu_session_id;
};
class itti_ue_context_release_request : public itti_msg_n2 {
class itti_ue_context_release_request : public itti_msg_n2
{
public:
itti_ue_context_release_request(const task_id_t origin,
const task_id_t destination)
: itti_msg_n2(UE_CONTEXT_RELEASE_REQUEST, origin, destination) {}
itti_ue_context_release_request(const itti_ue_context_release_request &i)
: itti_msg_n2(i) {}
itti_ue_context_release_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UE_CONTEXT_RELEASE_REQUEST, origin, destination) {}
itti_ue_context_release_request(const itti_ue_context_release_request &i) : itti_msg_n2(i) {}
UEContextReleaseRequestMsg *ueCtxRel;
};
class itti_pdu_session_resource_release_command : public itti_msg_n2
{
public:
itti_pdu_session_resource_release_command(const task_id_t origin, const task_id_t destination) : itti_msg_n2(PDU_SESSION_RESOURCE_RELEASE_COMMAND, origin, destination) {}
itti_pdu_session_resource_release_command(const itti_dl_nas_transport &i) : itti_msg_n2(i) {}
public:
uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id;
};
class itti_ue_context_release_command : public itti_msg_n2
{
public:
itti_ue_context_release_command(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UE_CONTEXT_RELEASE_COMMAND, origin, destination) {}
itti_ue_context_release_command(const itti_dl_nas_transport &i) : itti_msg_n2(i) {}
class itti_ue_radio_capability_indication : public itti_msg_n2 {
public:
itti_ue_radio_capability_indication(const task_id_t origin,
const task_id_t destination)
: itti_msg_n2(UE_RADIO_CAP_IND, origin, destination) {}
itti_ue_radio_capability_indication(
const itti_ue_radio_capability_indication &i)
: itti_msg_n2(i) {}
uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id;
Cause cause;
};
class itti_ue_radio_capability_indication : public itti_msg_n2
{
public:
itti_ue_radio_capability_indication(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UE_RADIO_CAP_IND, origin, destination) {}
itti_ue_radio_capability_indication(const itti_ue_radio_capability_indication &i) : itti_msg_n2(i) {}
UeRadioCapabilityInfoIndicationMsg *ueRadioCap;
};
class itti_handover_required : public itti_msg_n2 {
class itti_handover_required : public itti_msg_n2
{
public:
itti_handover_required(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(HANDOVER_REQUIRED, origin, destination) {}
itti_handover_required(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_REQUIRED, origin, destination) {}
itti_handover_required(const itti_handover_required &i) : itti_msg_n2(i) {}
HandoverRequiredMsg *handvoerRequ;
};
class itti_handover_request_Ack : public itti_msg_n2 {
class itti_handover_request_Ack : public itti_msg_n2
{
public:
itti_handover_request_Ack(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(HANDOVER_REQUEST_ACK, origin, destination) {}
itti_handover_request_Ack(const itti_handover_request_Ack &i)
: itti_msg_n2(i) {}
itti_handover_request_Ack(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_REQUEST_ACK, origin, destination) {}
itti_handover_request_Ack(const itti_handover_request_Ack &i) : itti_msg_n2(i) {}
HandoverRequestAck *handoverrequestAck;
};
class itti_handover_notify : public itti_msg_n2 {
class itti_handover_notify : public itti_msg_n2
{
public:
itti_handover_notify(const task_id_t origin, const task_id_t destination)
: itti_msg_n2(HANDOVER_NOTIFY, origin, destination) {}
itti_handover_notify(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_NOTIFY, origin, destination) {}
itti_handover_notify(const itti_handover_notify &i) : itti_msg_n2(i) {}
HandoverNotifyMsg *handovernotify;
};
class itti_uplinkranstatsutransfer : public itti_msg_n2
{
public:
itti_uplinkranstatsutransfer(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UPLINKRANSTATUSTRANSFER, origin, destination) {}
itti_uplinkranstatsutransfer(const itti_uplinkranstatsutransfer &i) : itti_msg_n2(i) {}
UplinkRANStatusTransfer *uplinkrantransfer;
};
#endif
......@@ -116,7 +116,8 @@
/************************** cause value for 5g mobility management(Annex A) ********************************/
#define _5GMM_CAUSE_ILLEGAL_UE 3
#define _5GMM_CAUSE_SYNCH_FAILURE 0b00010101
#define _5GMM_CAUSE_IMPLICITLY_DE_REGISTERED 10
#define _5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED 9
// A.5 Causes related to invalid messages
//------------------------------------------------------------------------------
#define _5GMM_CAUSE_SEMANTICALLY_INCORRECT 95
......
......@@ -32,13 +32,17 @@
using namespace nas;
//------------------------------------------------------------------------------
ServiceAccept::ServiceAccept() {
ServiceAccept::ServiceAccept(){
plain_header = NULL;
ie_PDU_session_status = NULL;
ie_session_reactivation_result = NULL;
}
//------------------------------------------------------------------------------
ServiceAccept::~ServiceAccept() {
ServiceAccept::~ServiceAccept(){
if (plain_header) delete plain_header;
if (ie_PDU_session_status) delete ie_PDU_session_status;
if (ie_session_reactivation_result) delete ie_session_reactivation_result;
}
//------------------------------------------------------------------------------
void ServiceAccept::setHeader(uint8_t security_header_type) {
plain_header = new NasMmPlainHeader();
......
This diff is collapsed.
......@@ -206,8 +206,7 @@ bool NGSetupRequestMsg::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu) {
ngSetupRequestPdu = ngap_msg_pdu;
if (ngSetupRequestPdu->present == Ngap_NGAP_PDU_PR_initiatingMessage) {
if (ngSetupRequestPdu->choice.initiatingMessage && ngSetupRequestPdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_NGSetup && ngSetupRequestPdu->choice.initiatingMessage->criticality == Ngap_Criticality_reject
&& ngSetupRequestPdu->choice.initiatingMessage->value.present == Ngap_InitiatingMessage__value_PR_NGSetupRequest) {
if (ngSetupRequestPdu->choice.initiatingMessage && ngSetupRequestPdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_NGSetup && ngSetupRequestPdu->choice.initiatingMessage->criticality == Ngap_Criticality_reject && ngSetupRequestPdu->choice.initiatingMessage->value.present == Ngap_InitiatingMessage__value_PR_NGSetupRequest) {
ngSetupRequestIEs = &ngSetupRequestPdu->choice.initiatingMessage->value.choice.NGSetupRequest;
for (int i = 0; i < ngSetupRequestIEs->protocolIEs.list.count; i++) {
switch (ngSetupRequestIEs->protocolIEs.list.array[i]->id) {
......
......@@ -25,7 +25,6 @@
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _UE_CONTEXT_RELEASE_COMMAND_H_
#define _UE_CONTEXT_RELEASE_COMMAND_H_
......@@ -34,27 +33,30 @@
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
extern "C" {
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
extern "C"{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
}
namespace ngap {
class UEContextReleaseCommandMsg {
public:
namespace ngap{
class UEContextReleaseCommandMsg{
public:
UEContextReleaseCommandMsg();
~UEContextReleaseCommandMsg();
public:
public:
void setMessageType();
void setAmfUeNgapId(unsigned long id);
void setUeNgapIdPair(unsigned long amfId, uint32_t ranId);
void addCauseIE();
void setCauseRadioNetwork(e_Ngap_CauseRadioNetwork cause_value);
void setCauseNas(e_Ngap_CauseNas cause_value);
int encode2buffer(uint8_t *buf, int buf_size);
public:
public:
bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
private:
private:
Ngap_NGAP_PDU_t *pdu;
Ngap_UEContextReleaseCommand_t *ies;
......@@ -65,4 +67,12 @@ class UEContextReleaseCommandMsg {
}
#endif
......@@ -132,7 +132,7 @@ int UEContextReleaseRequestMsg::encode2buffer(uint8_t *buf, int buf_size) {
bool UEContextReleaseRequestMsg::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu) {
pdu = ngap_msg_pdu;
if (pdu->present == Ngap_NGAP_PDU_PR_initiatingMessage) {
if (pdu->choice.initiatingMessage && pdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_UEContextReleaseRequest && pdu->choice.initiatingMessage->criticality == Ngap_Criticality_reject
if (pdu->choice.initiatingMessage && pdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_UEContextReleaseRequest && pdu->choice.initiatingMessage->criticality == Ngap_Criticality_ignore
&& pdu->choice.initiatingMessage->value.present == Ngap_InitiatingMessage__value_PR_UEContextReleaseRequest) {
ies = &pdu->choice.initiatingMessage->value.choice.UEContextReleaseRequest;
} else {
......
This diff is collapsed.
......@@ -44,7 +44,7 @@ public:
virtual ~N1N2MessageCollectionDocumentApi() {}
void init();
const std::string base = "/namf-comm/v1";
const std::string base = "/namf-comm/v2";
private:
void setupRoutes();
......
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