Commit 4f19d2cc authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'remove_amf_module' into 'develop'

Remove unused files/parameters: amf module

See merge request oai/cn5g/oai-cn5g-amf!197
parents 640f8921 d54b2de0
......@@ -147,11 +147,4 @@ AMF =
ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = {{ env["INT_ALGO_LIST"] if "INT_ALGO_LIST" in env.keys() else [ "NIA0" , "NIA1" , "NIA2" ] | tojson }} ;
ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = {{ env["CIPH_ALGO_LIST"] if "CIPH_ALGO_LIST" in env.keys() else [ "NEA0" , "NEA1" , "NEA2" ] | tojson }} ;
};
};
MODULES =
{
NGAP_MESSAGE = (
{MSG_NAME = "NGSetupRequest"; ProcedureCode = 21; TypeOfMessage = "initialMessage"}
);
};
\ No newline at end of file
## system modules, such as NGAP message modules and NAS message modules
MODULES =
{
NGAP_MESSAGE = (
{MSG_NAME = "NGSetupRequest"; ProcedureCode = 21; TypeOfMessage = "initialMessage"}
);
};
......@@ -47,7 +47,6 @@ include_directories(${SRC_TOP_DIR}/utils/bstr)
file(GLOB AMF_src_files
${CMAKE_CURRENT_SOURCE_DIR}/amf_app.cpp
${CMAKE_CURRENT_SOURCE_DIR}/amf_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/amf_module_from_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/amf_n1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/amf_n2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/amf_sbi.cpp
......
......@@ -31,7 +31,6 @@
#include "ProblemDetails.h"
#include "UeN1N2InfoSubscriptionCreateData.h"
#include "amf_config.hpp"
#include "amf_module_from_config.hpp"
#include "amf_msg.hpp"
#include "amf_profile.hpp"
#include "amf_subscription.hpp"
......
/*
* 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
*/
#include "amf_module_from_config.hpp"
#include <iostream>
#include <string>
#include "common_defs.h"
#include "logger.hpp"
namespace config {
//------------------------------------------------------------------------------
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) {
Logger::amf_app().error(
"I/O error while reading file %s - %s", config_file.c_str(),
fioex.what());
throw;
} 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) {
Logger::amf_app().error("%s : %s", nfex.what(), nfex.getPath());
return RETURNerror;
}
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];
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"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_initiatingMessage;
} else if (!(typeOfMessage.compare("successfuloutcome"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_successfulOutcome;
} else if (!(typeOfMessage.compare("unsuccessfuloutcome"))) {
typeOfMsg = Ngap_NGAP_PDU_PR_unsuccessfulOutcome;
} else {
Logger::config().error("wrong NGAP message configuration");
}
}
return 1;
}
//------------------------------------------------------------------------------
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);
}
} // namespace config
/*
* 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
*/
#ifndef _AMF_MODULE_FROM_CONFIG_H_
#define _AMF_MODULE_FROM_CONFIG_H_
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <libconfig.h++>
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProcedureCode.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 {
class amf_modules {
public:
/*
* Load AMF modules configuration
* @param [const std::string&] config_file: Configuration file
* @return RETURNclear/RETURNerror/RETURNok
*/
int load(const std::string& config_file);
/*
* Display the AMF modules configuration parameters
* @param void
* @return void
*/
void display();
private:
std::string msgName; // vector to store more msgs
Ngap_NGAP_PDU_PR typeOfMsg;
Ngap_ProcedureCode_t procedureCode;
};
} // namespace config
#endif
......@@ -33,7 +33,6 @@
#include "amf-http2-server.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "amf_module_from_config.hpp"
#include "amf_statistics.hpp"
#include "itti.hpp"
#include "logger.hpp"
......@@ -48,7 +47,6 @@ using namespace config;
using namespace amf_application;
amf_config amf_cfg;
amf_modules modules;
itti_mw* itti_inst = nullptr;
amf_app* amf_app_inst = nullptr;
statistics stacs;
......@@ -108,8 +106,6 @@ int main(int argc, char** argv) {
amf_cfg.load(Options::getlibconfigConfig());
amf_cfg.display();
modules.load(Options::getlibconfigConfig());
modules.display();
itti_inst = new itti_mw();
itti_inst->start(amf_cfg.itti.itti_timer_sched_params);
......
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