Commit 7f1380a5 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'fix_smf_pdusession_uri' into 'develop'

Fix smf pdusession uri

See merge request oai/cn5g/oai-cn5g-amf!140
parents d7720955 a84012fc
# CODEOWNERS
src/contexts:
- Keliang DU, BUPT
- Tien Thinh NGUYEN, Eurecom
src/amf-app
- Keliang DU, BUPT
- Tien Thinh NGUYEN, Eurecom
- Shivam Gandhi, KCL
src/itti
- Lionel GAUTHIER, Eurecom
- Tien Thinh NGUYEN, Eurecom
src/common
- Sebastien ROUX, Eurecom
- Lionel Gauthier, Eurecom
- Tien Thinh NGUYEN, Eurecom
- Keliang DU, BUPT
Secu_algorithms
- Kharbach Othmane
- GAUTHIER Lionel, Eurecom
- Keliang DU, Bupt
SCTP
- Keliang DU, Bupt
NAS/NGAP/SBI/UTILS: To be updated
\ No newline at end of file
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_app.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_app.hpp"
#include <boost/uuid/random_generator.hpp>
......@@ -35,17 +28,17 @@
#include <stdexcept>
#include "DLNASTransport.hpp"
#include "GlobalRanNodeId.h"
#include "RegistrationContextContainer.h"
#include "UeN1N2InfoSubscriptionCreatedData.h"
#include "amf_config.hpp"
#include "amf_n1.hpp"
#include "amf_sbi.hpp"
#include "amf_n2.hpp"
#include "amf_sbi.hpp"
#include "amf_statistics.hpp"
#include "comUt.hpp"
#include "itti.hpp"
#include "ngap_app.hpp"
#include "comUt.hpp"
#include "RegistrationContextContainer.h"
#include "GlobalRanNodeId.h"
#include "UeN1N2InfoSubscriptionCreatedData.h"
using namespace ngap;
using namespace nas;
......
......@@ -19,36 +19,27 @@
* 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_
#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
#include <map>
#include <shared_mutex>
#include <string>
#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"
#include "itti.hpp"
#include "itti_msg_sbi.hpp"
#include "itti_msg_amf_app.hpp"
#include "ue_context.hpp"
#include "amf_subscription.hpp"
#include "itti_msg_sbi.hpp"
#include "amf_msg.hpp"
#include "ProblemDetails.h"
#include "UeN1N2InfoSubscriptionCreateData.h"
#include "ue_context.hpp"
#include "uint_generator.hpp"
#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
using namespace config;
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_config.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_config.hpp"
#include <boost/algorithm/string.hpp>
......@@ -34,14 +27,15 @@
#include <iostream>
#include <libconfig.h++>
#include "3gpp_29.502.h"
#include "3gpp_ts24501.hpp"
#include "amf_app.hpp"
#include "conversions.hpp"
#include "fqdn.hpp"
#include "if.hpp"
#include "logger.hpp"
#include "string.hpp"
#include "thread_sched.hpp"
#include "fqdn.hpp"
#include "conversions.hpp"
extern "C" {
#include <arpa/inet.h>
......@@ -81,7 +75,7 @@ amf_config::amf_config() {
guami_list = {};
relative_amf_capacity = 0;
plmn_list = {};
auth_conf auth_para = {};
auth_para = {};
nas_cfg = {};
smf_pool = {};
support_features.enable_nf_registration = false;
......@@ -361,6 +355,7 @@ int amf_config::load(const std::string& config_file) {
throw(AMF_CONFIG_STRING_SBI_HTTP2_PORT "failed");
}
if (!support_features.enable_smf_selection) {
// SMF
const Setting& smf_addr_pool =
sbi_cfg[AMF_CONFIG_STRING_SMF_INSTANCES_POOL];
......@@ -377,7 +372,8 @@ int amf_config::load(const std::string& config_file) {
// Store FQDN
smf_addr_item.lookupValue(AMF_CONFIG_STRING_FQDN_DNS, smf_inst.fqdn);
smf_addr_item.lookupValue(AMF_CONFIG_STRING_SMF_INSTANCE_ID, smf_inst.id);
smf_addr_item.lookupValue(
AMF_CONFIG_STRING_SMF_INSTANCE_ID, smf_inst.id);
if (!support_features.use_fqdn_dns) {
smf_addr_item.lookupValue(
AMF_CONFIG_STRING_IPV4_ADDRESS, smf_inst.ipv4);
......@@ -386,7 +382,8 @@ int amf_config::load(const std::string& config_file) {
"BAD IPv4 ADDRESS FORMAT FOR SMF !");
if (!(smf_addr_item.lookupValue(
AMF_CONFIG_STRING_SMF_INSTANCE_PORT, smf_inst.port))) {
Logger::amf_app().error(AMF_CONFIG_STRING_SMF_INSTANCE_PORT "failed");
Logger::amf_app().error(AMF_CONFIG_STRING_SMF_INSTANCE_PORT
"failed");
throw(AMF_CONFIG_STRING_SMF_INSTANCE_PORT "failed");
}
if (!(smf_addr_item.lookupValue(
......@@ -414,6 +411,7 @@ int amf_config::load(const std::string& config_file) {
smf_inst.selected = false;
smf_pool.push_back(smf_inst);
}
}
// NRF
const Setting& nrf_cfg = new_if_cfg[AMF_CONFIG_STRING_NRF];
......@@ -960,6 +958,54 @@ std::string amf_config::get_ausf_ue_authentications_uri() {
ausf_addr.api_version + "/ue-authentications";
}
//------------------------------------------------------------------------------
bool amf_config::get_smf_pdu_session_context_uri(
const std::shared_ptr<pdu_session_context>& psc, std::string& smf_uri) {
if (!psc) return false;
if (!psc.get()->smf_info.info_available) {
Logger::amf_sbi().error("No SMF is available for this PDU session");
return false;
}
std::string smf_addr = {};
std::string smf_port = {};
std::string smf_ip_addr = {};
smf_addr = psc->smf_info.addr;
smf_port = psc->smf_info.port;
// remove http port from the URI if existed
std::size_t found_port = smf_addr.find(":");
if (found_port != std::string::npos)
smf_ip_addr = smf_addr.substr(0, found_port - 1);
else
smf_ip_addr = smf_addr;
std::size_t found = psc.get()->smf_info.context_location.find(smf_ip_addr);
if (found != std::string::npos)
smf_uri = psc.get()->smf_info.context_location;
else
smf_uri = smf_addr + ":" + smf_port + psc.get()->smf_info.context_location;
return true;
}
//------------------------------------------------------------------------------
std::string amf_config::get_smf_pdu_session_base_uri(
const std::string& smf_addr, const std::string& smf_port,
const std::string& smf_api_version) {
// Remove http port from the URI if existed
std::string smf_ip_addr = {};
std::size_t found_port = smf_addr.find(":");
if (found_port != std::string::npos)
smf_ip_addr = smf_addr.substr(0, found_port);
else
smf_ip_addr = smf_addr;
return smf_ip_addr + ":" + smf_port + "/nsmf-pdusession/" + smf_api_version +
NSMF_PDU_SESSION_CREATE;
}
//------------------------------------------------------------------------------
void amf_config::to_json(nlohmann::json& json_data) const {
json_data["instance"] = instance;
......
......@@ -19,13 +19,6 @@
* 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_
......@@ -33,18 +26,19 @@
#include <netinet/in.h>
#include <sys/socket.h>
#include <boost/algorithm/string.hpp>
#include <libconfig.h++>
#include <nlohmann/json.hpp>
#include <string>
#include <vector>
#include <boost/algorithm/string.hpp>
#include "amf_config.hpp"
#include "amf.hpp"
#include "amf_config.hpp"
#include "common_defs.h"
#include "if.hpp"
#include "pdu_session_context.hpp"
#include "string.hpp"
#include "thread_sched.hpp"
#include "common_defs.h"
#define AMF_CONFIG_STRING_AMF_CONFIG "AMF"
#define AMF_CONFIG_STRING_PID_DIRECTORY "PID_DIRECTORY"
......@@ -124,7 +118,7 @@ using namespace libconfig;
namespace config {
typedef struct {
typedef struct auth_conf_s {
std::string mysql_server;
std::string mysql_user;
std::string mysql_pass;
......@@ -148,7 +142,7 @@ typedef struct {
this->random = json_data["random"].get<std::string>();
}
} auth_conf;
} auth_conf_t;
typedef struct interface_cfg_s {
std::string if_name;
......@@ -457,6 +451,28 @@ class amf_config {
*/
std::string get_ausf_ue_authentications_uri();
/*
* Get the URI of SMF PDU Session Service
* @param [const std::shared_ptr<pdu_session_context>&] psc: pointer to the
* PDU Session Context
* @param [std::string&] smf_uri: based URI of Nsmf_PDUSession Services
* @return true if can get the URI. otherwise false
*/
bool get_smf_pdu_session_context_uri(
const std::shared_ptr<pdu_session_context>& psc, std::string& smf_uri);
/*
* Get the URI of SMF Services
* @param [const std::string&] smf_addr: SMF's Addr in String representation
* @param [const std::string&] smf_port: SMF's port in String representation
* @param [const std::string&] smf_api_version: SMF's API version in String
* representation
* @return URI in string format
*/
std::string get_smf_pdu_session_base_uri(
const std::string& smf_addr, const std::string& smf_port,
const std::string& smf_api_version);
/*
* Display the AMF configuration parameters
* @param void
......@@ -493,7 +509,7 @@ class amf_config {
unsigned int relative_amf_capacity;
std::vector<plmn_item_t> plmn_list;
std::string is_emergency_support;
auth_conf auth_para;
auth_conf_t auth_para;
nas_conf_t nas_cfg;
std::vector<smf_inst_t> smf_pool;
......
......@@ -19,16 +19,9 @@
* contact@openairinterface.org
*/
/*! \file amf_event.cpp
\brief
\author Shivam Gandhi (KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email: contact@openairinterface.org
*/
#include "amf_event.hpp"
using namespace amf_application;
//------------------------------------------------------------------------------
bs2::connection amf_event::subscribe_ue_location_report(
const ue_location_report_sig_t::slot_type& sig) {
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_event.hpp
\brief
\author Shivam Gandhi (KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email: contact@openairinterface.org
*/
#include <boost/signals2.hpp>
namespace bs2 = boost::signals2;
......
......@@ -19,19 +19,12 @@
* contact@openairinterface.org
*/
/*! \file amf_event_sig.hpp
\brief
\author Shivam Gandhi (KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email: contact@openairinterface.org
*/
#ifndef FILE_SMF_EVENT_SIG_HPP_SEEN
#define FILE_SMF_EVENT_SIG_HPP_SEEN
#include <boost/signals2.hpp>
#include <string>
#include "UserLocation.h"
namespace bs2 = boost::signals2;
......
......@@ -19,19 +19,12 @@
* 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 "common_defs.h"
#include <iostream>
#include <string>
#include "common_defs.h"
#include "logger.hpp"
namespace config {
......
......@@ -19,13 +19,6 @@
* 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_
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_msg.cpp
\brief
\author Shivam Gandhi
\company KCL
\date 2021
\email: shivam.gandhi@kcl.ac.uk
*/
#include "amf_msg.hpp"
using namespace amf_application;
......
......@@ -19,20 +19,13 @@
* contact@openairinterface.org
*/
/*! \file amf_msg.hpp
\brief
\author
\company
\date 2021
\email:
*/
#ifndef FILE_AMF_MSG_HPP_SEEN
#define FILE_AMF_MSG_HPP_SEEN
#include "amf.hpp"
#include "3gpp_29.518.h"
#include "amf_profile.hpp"
#include "AmfEventReport.h"
#include "amf.hpp"
#include "amf_profile.hpp"
namespace amf_application {
......
......@@ -19,19 +19,15 @@
* contact@openairinterface.org
*/
/*! \file amf_n1.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_n1.hpp"
#include <curl/curl.h>
#include <bitset>
#include "3gpp_24.501.h"
#include "AmfEventReport.h"
#include "AmfEventType.h"
#include "AuthenticationFailure.hpp"
#include "AuthenticationInfo.h"
#include "AuthenticationRequest.hpp"
......@@ -46,27 +42,23 @@
#include "RegistrationReject.hpp"
#include "RegistrationRequest.hpp"
#include "SecurityModeCommand.hpp"
#include "ServiceAccept.hpp"
#include "SecurityModeComplete.hpp"
#include "ServiceAccept.hpp"
#include "ServiceRequest.hpp"
#include "String2Value.hpp"
#include "UEAuthenticationCtx.h"
#include "ULNASTransport.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "amf_sbi.hpp"
#include "amf_n2.hpp"
#include "amf_sbi.hpp"
#include "comUt.hpp"
#include "itti.hpp"
#include "itti_msg_sbi.hpp"
#include "itti_msg_n2.hpp"
#include "itti_msg_sbi.hpp"
#include "logger.hpp"
#include "nas_algorithms.hpp"
#include "comUt.hpp"
#include "3gpp_24.501.h"
#include "sha256.hpp"
#include "AmfEventReport.h"
#include "AmfEventType.h"
extern "C" {
#include "bstrlib.h"
......@@ -2998,7 +2990,7 @@ void amf_n1::ue_initiate_de_registration_handle(
itti_msg->supi = uc->supi;
itti_msg->pdu_session_id = session->pdu_session_id;
itti_msg->promise_id = promise_id;
itti_msg->context_location = session->smf_context_location;
itti_msg->context_location = session->smf_info.context_location;
int ret = itti_inst->send_msg(itti_msg);
if (0 != ret) {
......@@ -3735,7 +3727,8 @@ void amf_n1::initialize_registration_accept(
std::unique_ptr<nas::RegistrationAccept>& registration_accept) {
registration_accept->setHeader(PLAIN_5GS_MSG);
registration_accept->set_5GS_Registration_Result(
false, false, false, 0x01); // 3GPP Access
false, false, false,
0x01); // 3GPP Access
registration_accept->setT3512_Value(0x5, T3512_TIMER_VALUE_MIN);
std::vector<p_tai_t> tai_list;
......@@ -3776,7 +3769,8 @@ void amf_n1::initialize_registration_accept(
const std::shared_ptr<nas_context>& nc) {
registration_accept->setHeader(PLAIN_5GS_MSG);
registration_accept->set_5GS_Registration_Result(
false, false, false, 0x01); // 3GPP Access
false, false, false,
0x01); // 3GPP Access
registration_accept->setT3512_Value(0x5, T3512_TIMER_VALUE_MIN);
// Find UE Context
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_n1.hpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_N1_H_
#define _AMF_N1_H_
......@@ -36,22 +29,22 @@
#include <map>
#include <shared_mutex>
#include "3gpp_ts24501.hpp"
#include "3gpp_29.503.h"
#include "3gpp_ts24501.hpp"
#include "AuthorizedNetworkSliceInfo.h"
#include "Nssai.h"
#include "RegistrationAccept.hpp"
#include "SliceInfoForRegistration.h"
#include "amf.hpp"
#include "amf_event.hpp"
#include "amf_statistics.hpp"
#include "bstrlib.h"
#include "itti.hpp"
#include "itti_msg_n1.hpp"
#include "mysql_db.hpp"
#include "nas_context.hpp"
#include "pdu_session_context.hpp"
#include "amf_event.hpp"
#include "RegistrationAccept.hpp"
#include "ue_context.hpp"
#include "itti.hpp"
#include "SliceInfoForRegistration.h"
#include "AuthorizedNetworkSliceInfo.h"
#include "Nssai.h"
namespace amf_application {
......
......@@ -19,18 +19,19 @@
* contact@openairinterface.org
*/
/*! \file amf_n2.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_n2.hpp"
#include <boost/chrono.hpp>
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/system_clocks.hpp>
#include "3gpp_24.501.h"
#include "DefaultPagingDRX.hpp"
#include "DownlinkNasTransport.hpp"
#include "HandoverPreparationFailure.hpp"
#include "InitialContextSetupRequest.hpp"
#include "NGResetAck.hpp"
#include "NGSetupFailure.hpp"
#include "NGSetupResponse.hpp"
#include "Ngap_Cause.h"
......@@ -38,13 +39,12 @@
#include "Ngap_CauseRadioNetwork.h"
#include "Ngap_TimeToWait.h"
#include "PDUSessionResourceHandoverCommandTransfer.hpp"
#include "Paging.hpp"
#include "PduSessionResourceModifyRequest.hpp"
#include "PduSessionResourceReleaseCommand.hpp"
#include "PduSessionResourceSetupRequest.hpp"
#include "PduSessionResourceModifyRequest.hpp"
#include "UEContextReleaseCommand.hpp"
#include "HandoverPreparationFailure.hpp"
#include "Paging.hpp"
#include "RerouteNASRequest.hpp"
#include "UEContextReleaseCommand.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "amf_n1.hpp"
......@@ -55,13 +55,6 @@
#include "itti_msg_amf_app.hpp"
#include "logger.hpp"
#include "sctp_server.hpp"
#include "3gpp_24.501.h"
#include "NGResetAck.hpp"
#include <boost/chrono.hpp>
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/chrono/system_clocks.hpp>
extern "C" {
#include "dynamic_memory_check.h"
......@@ -182,7 +175,7 @@ void amf_n2_task(void* args_p) {
dynamic_cast<itti_ue_radio_capability_indication*>(msg);
amf_n2_inst->handle_itti_message(ref(*m));
} break;
case HANDOVER_REQUIRED: {
case HANDOVER_REQUIRED_MSG: {
Logger::amf_n2().info("Received HANDOVER_REQUIRED message, handling");
itti_handover_required* m = dynamic_cast<itti_handover_required*>(msg);
if (!amf_n2_inst->handle_itti_message(ref(*m)))
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_n2.hpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_N2_H_
#define _AMF_N2_H_
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_profile.cpp
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2020
\email: Tien-Thinh.Nguyen@eurecom.fr
*/
#include "amf_profile.hpp"
#include <boost/algorithm/string/classification.hpp>
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_profile.hpp
\brief
\author Tien-Thinh NGUYEN
\company Eurecom
\date 2021
\email: Tien-Thinh.Nguyen@eurecom.fr
*/
#ifndef FILE_AMF_PROFILE_HPP_SEEN
#define FILE_AMF_PROFILE_HPP_SEEN
......
......@@ -19,34 +19,28 @@
* contact@openairinterface.org
*/
/*! \file amf_sbi.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_sbi.hpp"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include "3gpp_ts24501.hpp"
#include "3gpp_29.500.h"
#include "3gpp_29.502.h"
#include "3gpp_ts24501.hpp"
#include "AmfEventReport.h"
#include "amf.hpp"
#include "amf_app.hpp"
#include "amf_config.hpp"
#include "AmfEventReport.h"
#include "amf_n1.hpp"
#include "conversions.hpp"
#include "comUt.hpp"
#include "ue_context.hpp"
#include "conversions.hpp"
#include "fqdn.hpp"
#include "itti.hpp"
#include "itti_msg_amf_app.hpp"
#include "mime_parser.hpp"
#include "nas_context.hpp"
#include "ue_context.hpp"
extern "C" {
#include "dynamic_memory_check.h"
......@@ -238,34 +232,12 @@ void amf_sbi::handle_itti_message(
return;
}
std::string smf_addr = {};
std::string smf_port = {};
std::string smf_api_version = {};
if (!psc.get()->smf_available) {
Logger::amf_sbi().error("No SMF is available for this PDU session");
} else {
smf_addr = psc->smf_addr;
smf_port = psc->smf_port;
smf_api_version = psc->smf_api_version;
}
std::string smf_ip_addr = {};
std::string remote_uri = {};
// remove http port from the URI if existed
std::size_t found_port = smf_addr.find(":");
if (found_port != std::string::npos)
smf_ip_addr = smf_addr.substr(0, found_port - 1);
else
smf_ip_addr = smf_addr;
std::size_t found = psc.get()->smf_context_location.find(smf_ip_addr);
if (found != std::string::npos)
remote_uri = psc.get()->smf_context_location + "/modify";
else
remote_uri =
smf_addr + ":" + smf_port + psc.get()->smf_context_location + "/modify";
if (!amf_cfg.get_smf_pdu_session_context_uri(psc, remote_uri)) {
Logger::amf_sbi().error("Could not find Nsmf_PDUSession URI");
return;
}
remote_uri += NSMF_PDU_SESSION_MODIFY;
Logger::amf_sbi().debug("SMF URI: %s", remote_uri.c_str());
......@@ -377,7 +349,7 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
std::string smf_addr = {};
std::string smf_api_version = {};
std::string smf_port = "80"; // Set to default port number
if (!psc.get()->smf_available) {
if (!psc.get()->smf_info.info_available) {
if (amf_cfg.support_features.enable_smf_selection) {
// Get NRF URI
std::string nrf_uri = {};
......@@ -403,13 +375,14 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
}
// store smf info to be used with this PDU session
psc.get()->smf_available = true;
psc->smf_addr = smf_addr;
psc->smf_port = smf_port;
psc->smf_api_version = smf_api_version;
psc.get()->smf_info.info_available = true;
psc->smf_info.addr = smf_addr;
psc->smf_info.port = smf_port;
psc->smf_info.api_version = smf_api_version;
} else {
smf_addr = psc->smf_addr;
smf_api_version = psc->smf_api_version;
smf_addr = psc->smf_info.addr;
smf_api_version = psc->smf_info.api_version;
std::string smf_port = psc->smf_info.port;
}
switch (smf.req_type & 0x07) {
......@@ -432,8 +405,7 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
default: {
// send Nsmf_PDUSession_UpdateSM_Context to SMF e.g., for PDU Session
// release request
send_pdu_session_update_sm_context_request(
supi, psc, smf_addr, smf.sm_msg, dnn);
send_pdu_session_update_sm_context_request(supi, psc, smf.sm_msg, dnn);
}
}
}
......@@ -441,26 +413,19 @@ void amf_sbi::handle_itti_message(itti_nsmf_pdusession_create_sm_context& smf) {
//------------------------------------------------------------------------------
void amf_sbi::send_pdu_session_update_sm_context_request(
const std::string& supi, std::shared_ptr<pdu_session_context>& psc,
const std::string& smf_addr, bstring sm_msg, const std::string& dnn) {
bstring sm_msg, const std::string& dnn) {
Logger::amf_sbi().debug(
"Send PDU Session Update SM Context Request to SMF (SUPI %s, PDU Session "
"ID %d, %s)",
supi.c_str(), psc.get()->pdu_session_id, smf_addr.c_str());
supi.c_str(), psc.get()->pdu_session_id,
psc.get()->smf_info.addr.c_str());
std::string smf_ip_addr = {};
std::string remote_uri = {};
// remove http port from the URI if existed
std::size_t found_port = smf_addr.find(":");
if (found_port != std::string::npos)
smf_ip_addr = smf_addr.substr(0, found_port - 1);
else
smf_ip_addr = smf_addr;
std::size_t found = psc.get()->smf_context_location.find(smf_ip_addr);
if (found != std::string::npos)
remote_uri = psc.get()->smf_context_location + "/modify";
else
remote_uri = smf_addr + psc.get()->smf_context_location + "/modify";
if (!amf_cfg.get_smf_pdu_session_context_uri(psc, remote_uri)) {
Logger::amf_sbi().error("Could not find Nsmf_PDUSession URI");
return;
}
remote_uri += NSMF_PDU_SESSION_MODIFY;
Logger::amf_sbi().debug("SMF URI: %s", remote_uri.c_str());
......@@ -489,21 +454,16 @@ void amf_sbi::handle_pdu_session_initial_request(
"Handle PDU Session Establishment Request (SUPI %s, PDU Session ID %d)",
supi.c_str(), psc.get()->pdu_session_id);
// remove http port from the URI if existed
std::string smf_ip_addr = {};
std::size_t found_port = smf_addr.find(":");
if (found_port != std::string::npos)
smf_ip_addr = smf_addr.substr(0, found_port);
else
smf_ip_addr = smf_addr;
// provide http2 port if enabled
// Provide http2 port if enabled
std::string amf_port = to_string(amf_cfg.sbi.port);
if (amf_cfg.support_features.use_http2)
amf_port = to_string(amf_cfg.sbi_http2_port);
// TODO: Remove hardcoded values
std::string remote_uri = smf_ip_addr + ":" + smf_port + "/nsmf-pdusession/" +
smf_api_version + "/sm-contexts";
std::string remote_uri =
amf_cfg.get_smf_pdu_session_base_uri(smf_addr, smf_port, smf_api_version);
Logger::amf_sbi().debug("SMF URI: %s", remote_uri.c_str());
nlohmann::json pdu_session_establishment_request;
pdu_session_establishment_request["supi"] = supi.c_str();
pdu_session_establishment_request["pei"] = "imei-200000000000001";
......@@ -559,18 +519,14 @@ void amf_sbi::handle_itti_message(
return;
}
string smf_addr = {};
std::string smf_api_version = {};
std::string remote_uri = {};
if (!psc.get()->smf_available) {
Logger::amf_sbi().error("No SMF is available for this PDU session");
} else {
smf_addr = psc->smf_addr;
smf_api_version = psc->smf_api_version;
if (!amf_cfg.get_smf_pdu_session_context_uri(psc, remote_uri)) {
Logger::amf_sbi().error("Could not find Nsmf_PDUSession URI");
return;
}
remote_uri += NSMF_PDU_SESSION_RELEASE;
Logger::amf_sbi().debug("SMF URI: %s", remote_uri.c_str());
remote_uri = psc.get()->smf_context_location + "/release";
nlohmann::json pdu_session_release_request;
pdu_session_release_request["supi"] = itti_msg.supi.c_str();
pdu_session_release_request["dnn"] = psc.get()->dnn.c_str();
......@@ -586,10 +542,6 @@ void amf_sbi::handle_itti_message(
nlohmann::json response_json = {};
uint32_t response_code = 0;
// curl_http_client(
// remote_uri, json_part, "", "", itti_msg.supi,
// psc.get()->pdu_session_id, http_version);
curl_http_client(
remote_uri, "POST", msg_body, response_json, response_code, http_version);
......@@ -623,7 +575,7 @@ void amf_sbi::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
report["reachability"] = r.getReachability().get_value();
}
// timestamp
// Timestamp
std::time_t time_epoch_ntp = std::time(nullptr);
uint64_t tv_ntp = time_epoch_ntp + SECONDS_SINCE_FIRST_EPOCH;
report["timeStamp"] = std::to_string(tv_ntp);
......@@ -1233,7 +1185,7 @@ void amf_sbi::curl_http_client(
location_pos + 10, crlf_pos - (location_pos + 10));
Logger::amf_sbi().info(
"Location of the created SMF context: %s", location.c_str());
psc.get()->smf_context_location = location;
psc.get()->smf_info.context_location = location;
}
}
......
......@@ -19,16 +19,12 @@
* contact@openairinterface.org
*/
/*! \file amf_sbi.hpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_SBI_H_
#define _AMF_SBI_H_
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <map>
#include <shared_mutex>
#include <string>
......@@ -38,10 +34,6 @@
#include "itti_msg_sbi.hpp"
#include "pdu_session_context.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
namespace amf_application {
class amf_sbi {
......@@ -161,14 +153,13 @@ class amf_sbi {
* @param [const std::string&] supi: SUPI
* @param [std::shared_ptr<pdu_session_context>&] psc: Pointer to the PDU
* Session Context
* @param [const std::string&] smf_addr: SMF's Address
* @param [bstring] sm_msg: SM message
* @param [const std::string&] dnn: DNN
* @return void
*/
void send_pdu_session_update_sm_context_request(
const std::string& supi, std::shared_ptr<pdu_session_context>& psc,
const std::string& smf_addr, bstring sm_msg, const std::string& dnn);
bstring sm_msg, const std::string& dnn);
/*
* Select SMF from the configuration file
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_statistics.cpp
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_statistics.hpp"
#include "logger.hpp"
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_statistics.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _STATISTICS_H_
#define _STATISTICS_H_
......
......@@ -19,17 +19,10 @@
* contact@openairinterface.org
*/
/*! \file amf_subscription.cpp
\brief
\author
\company
\date 2021
\email:
*/
#include "amf_subscription.hpp"
#include "logger.hpp"
#include "3gpp_conversions.hpp"
#include "logger.hpp"
using namespace amf_application;
......
......@@ -19,14 +19,6 @@
* contact@openairinterface.org
*/
/*! \file amf_subscription.hpp
\brief
\author Shivam Gandhi
\company KCL
\date 2021
\email: shivam.gandhi@kcl.ac.uk
*/
#include "3gpp_29.518.h"
#include "amf.hpp"
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file mysql_db.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "amf_config.hpp"
#include "amf_n1.hpp"
#include "logger.hpp"
......
......@@ -19,13 +19,6 @@
* 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_
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file 3gpp_23.003.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_23_003_SEEN
#define FILE_3GPP_23_003_SEEN
......
......@@ -137,4 +137,8 @@ static const std::vector<std::string> n2_sm_info_type_e2str = {
"HANDOVER_REQ_ACK", "HANDOVER_RES_ALLOC_FAIL",
"SECONDARY_RAT_USAGE"};
#define NSMF_PDU_SESSION_CREATE "/sm-contexts"
#define NSMF_PDU_SESSION_MODIFY "/modify"
#define NSMF_PDU_SESSION_RELEASE "/release"
#endif
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file 3gpp_29.503.h
\brief
\author Tien Thinh NGUYEN
\company Eurecom
\email: tien-thinh.nguyen@eurecom.fr
*/
#ifndef FILE_3GPP_29_503_SEEN
#define FILE_3GPP_29_503_SEEN
......@@ -32,6 +26,7 @@
#include <string>
#include <vector>
#include "3gpp_23.003.h"
typedef struct nssai_s {
......
......@@ -22,9 +22,10 @@
#ifndef FILE_3GPP_29_518_SEEN
#define FILE_3GPP_29_518_SEEN
#include "amf.hpp"
#include <vector>
#include "amf.hpp"
typedef enum amf_event_type_e {
AMF_EVENT_UNKNOWN = 0,
LOCATION_REPORT = 1,
......
......@@ -19,19 +19,13 @@
* contact@openairinterface.org
*/
/*! \file amf.hpp
\brief
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __AMF_HPP
#define __AMF_HPP
#include "3gpp_23.003.h"
#include "string.h"
#include "inttypes.h"
#include "stdio.h"
#include "string.h"
// for CURL
constexpr auto CURL_MIME_BOUNDARY = "----Boundary";
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file comUt.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "comUt.hpp"
#include "logger.hpp"
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file comUt.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PRINT_BUFFER_H
#define _PRINT_BUFFER_H
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file common_defs.h
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_COMMON_DEFS_SEEN
#define FILE_COMMON_DEFS_SEEN
......
......@@ -19,24 +19,20 @@
* contact@openairinterface.org
*/
/*! \file conversions.cpp
\brief
\author Sebastien ROUX
\company Eurecom
*/
#include "conversions.hpp"
#include "amf.hpp"
#include "logger.hpp"
#include <arpa/inet.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <boost/algorithm/string.hpp>
#include "amf.hpp"
#include "logger.hpp"
static const char hex_to_ascii_table[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
......
......@@ -19,27 +19,20 @@
* contact@openairinterface.org
*/
/*! \file conversions.hpp
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_CONVERSIONS_HPP_SEEN
#define FILE_CONVERSIONS_HPP_SEEN
#include <netinet/in.h>
#include <stdint.h>
#include <string>
#include <iostream>
#include <string>
#include "bstrlib.h"
extern "C" {
#include "dynamic_memory_check.h"
#include "OCTET_STRING.h"
#include "dynamic_memory_check.h"
}
/* Used to format an uint32_t containing an ipv4 address */
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file endpoint.hpp
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_ENDPOINT_HPP_SEEN
#define FILE_ENDPOINT_HPP_SEEN
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file logger.cpp
\brief
\date 2020
\email: contact@openairinterface.org
*/
#include "logger.hpp"
#include <iostream>
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file logger.hpp
\brief
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __LOGGER_H
#define __LOGGER_H
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file gNB_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _GNB_CONTEXT_H_
#define _GNB_CONTEXT_H_
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file nas_context.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "nas_context.hpp"
//------------------------------------------------------------------------------
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file nas_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_NAS_CONTEXT_H_
#define _AMF_NAS_CONTEXT_H_
......@@ -34,10 +27,10 @@
#include <string>
#include "authentication_algorithms_with_5gaka.hpp"
#include "itti.hpp"
#include "nas_security_context.hpp"
#include "security_def.hpp"
#include "struct.hpp"
#include "itti.hpp"
typedef enum {
_5GMM_STATE_MIN = 0,
......@@ -59,8 +52,8 @@ static const std::vector<std::string> _5gmm_state_e2str = {
typedef enum { CM_IDLE = 0, CM_CONNECTED } cm_state_t;
static const std::vector<std::string> cm_state_e2str = {"CM_IDLE",
"CM_CONNECTED"};
static const std::vector<std::string> cm_state_e2str = {
"CM_IDLE", "CM_CONNECTED"};
class nas_context {
public:
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file nas_security_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _NAS_SECURITY_CONTEXT_H_
#define _NAS_SECURITY_CONTEXT_H_
......
......@@ -19,18 +19,10 @@
* contact@openairinterface.org
*/
/*! \file pdu_session_context.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "pdu_session_context.hpp"
//------------------------------------------------------------------------------
pdu_session_context::pdu_session_context() {
smf_available = false;
isn2sm_avaliable = false;
isn1sm_avaliable = false;
ran_ue_ngap_id = 0;
......@@ -41,7 +33,10 @@ pdu_session_context::pdu_session_context() {
isn2sm_avaliable = false;
// bstring n1sm;
isn1sm_avaliable = false;
smf_available = false;
smf_info.info_available = false;
smf_info.addr = {};
smf_info.api_version = "v1";
smf_info.port = "80";
snssai = {};
plmn = {};
is_ho_accepted = false;
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file pdu_session_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_CONTEXT_H_
#define _PDU_SESSION_CONTEXT_H_
......@@ -34,6 +27,14 @@
#include "amf.hpp"
#include "bstrlib.h"
typedef struct smf_context_info_s {
bool info_available;
std::string addr;
std::string port;
std::string api_version;
std::string context_location;
} smf_context_info_t;
class pdu_session_context {
public:
pdu_session_context();
......@@ -48,14 +49,10 @@ class pdu_session_context {
bstring n1sm;
bool isn1sm_avaliable;
std::string dnn;
std::string smf_addr;
std::string smf_port;
std::string smf_api_version;
bool smf_available;
std::string location;
smf_context_info_t smf_info;
snssai_t snssai;
plmn_t plmn;
std::string smf_context_location;
bool is_ho_accepted;
};
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file security_def.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _SECURITY_DEF_H_
#define _SECURITY_DEF_H_
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file ue_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _UE_CONTEXT_H_
#define _UE_CONTEXT_H_
......@@ -69,8 +62,7 @@ class ue_context {
Tai_t tai;
std::string supi;
uint32_t tmsi;
// pdu session id <-> pdu_session_contex: map stores all pdu sessions for this
// UE
// pdu session id <-> pdu_session_contex
std::map<std::uint8_t, std::shared_ptr<pdu_session_context>> pdu_sessions;
mutable std::shared_mutex m_pdu_session;
};
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file ue_ngap_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _UE_NGAP_CONTEXT_H_
#define _UE_NGAP_CONTEXT_H_
......@@ -33,8 +26,8 @@
#include <map>
#include "gNB_context.hpp"
#include "amf.hpp"
#include "gNB_context.hpp"
using namespace sctp;
typedef enum {
......
......@@ -18,12 +18,7 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file itti.cpp
\brief
\author Lionel GAUTHIER
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#include "itti.hpp"
#include <signal.h>
......
......@@ -18,12 +18,7 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file itti.hpp
\brief
\author Lionel GAUTHIER
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#ifndef SRC_OAI_ITTI_ITTI_HPP_INCLUDED_
#define SRC_OAI_ITTI_ITTI_HPP_INCLUDED_
......
......@@ -19,12 +19,6 @@
* contact@openairinterface.org
*/
/*! \file itti_msg.cpp
\brief
\author Lionel GAUTHIER
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#include "itti_msg.hpp"
#include "itti.hpp"
......
......@@ -18,12 +18,7 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file itti_msg.hpp
\brief
\author Lionel GAUTHIER
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#ifndef SRC_ITTI_ITTI_MSG_HPP_INCLUDED_
#define SRC_ITTI_ITTI_MSG_HPP_INCLUDED_
......@@ -101,7 +96,7 @@ typedef enum {
SBI_N1_MESSAGE_NOTIFICATION,
SBI_N1N2_MESSAGE_SUBSCRIBE,
SBI_N1N2_MESSAGE_UNSUBSCRIBE,
HANDOVER_REQUIRED,
HANDOVER_REQUIRED_MSG,
HANDOVER_REQUEST_ACK,
HANDOVER_NOTIFY,
UPLINK_RAN_STATUS_TRANSFER,
......
......@@ -28,8 +28,8 @@
#include "InitialUEMessage.hpp"
#include "NGReset.hpp"
#include "NGSetupRequest.hpp"
#include "UEContextReleaseRequest.hpp"
#include "UEContextReleaseComplete.hpp"
#include "UEContextReleaseRequest.hpp"
#include "UERadioCapabilityInfoIndication.hpp"
#include "UplinkNASTransport.hpp"
#include "UplinkRANStatusTransfer.hpp"
......@@ -246,7 +246,7 @@ class itti_ue_radio_capability_indication : 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_msg_n2(HANDOVER_REQUIRED_MSG, origin, destination) {
handoverReq = nullptr;
}
itti_handover_required(const itti_handover_required& i) : itti_msg_n2(i) {}
......
......@@ -19,27 +19,18 @@
* contact@openairinterface.org
*/
/*
* itti_sbi_msg.hpp
*
* Date: 2021
* Company KCL
* Author: shivam.gandhi@kcl.ac.uk
*/
#ifndef ITTI_MSG_SBI_HPP_INCLUDED_
#define ITTI_MSG_SBI_HPP_INCLUDED_
#include "itti_msg.hpp"
#include "pistache/http.h"
#include "amf_msg.hpp"
#include "N1MessageNotification.h"
#include "SliceInfoForRegistration.h"
#include "UeN1N2InfoSubscriptionCreateData.h"
#include "amf.hpp"
#include "amf_msg.hpp"
#include "amf_profile.hpp"
#include "bstrlib.h"
#include "itti_msg.hpp"
#include "SliceInfoForRegistration.h"
#include "pistache/http.h"
// using namespace oai::amf::model;
using namespace amf_application;
......
......@@ -19,19 +19,13 @@
* contact@openairinterface.org
*/
/*! \file sctp_server.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "sctp_server.hpp"
#include "logger.hpp"
extern "C" {
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <pthread.h>
......@@ -39,10 +33,9 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <netdb.h>
#include "bstrlib.h"
}
......
......@@ -19,20 +19,13 @@
* contact@openairinterface.org
*/
/*! \file sctp_server.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _SCTP_SERVER_H_
#define _SCTP_SERVER_H_
#include <thread>
#include "endpoint.hpp"
#include "common_defs.h"
#include "endpoint.hpp"
extern "C" {
#include <netinet/in.h>
......
......@@ -30,8 +30,8 @@
#include <string.h>
#include "OCTET_STRING.h"
#include "logger.hpp"
#include "comUt.hpp"
#include "logger.hpp"
/************ algorithm f1 **************/
/*
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file rijndael.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "authentication_algorithms_with_5gaka.hpp"
typedef uint8_t u8;
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file sha256.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "sha256.hpp"
#include <cstring>
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file sha256.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef Sha256_H
#define Sha256_H
#include <string>
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file nas_algorithms.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "nas_algorithms.hpp"
#include "logger.hpp"
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file nas_algorithms.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _NAS_ALGORITHMS_H_
#define _NAS_ALGORITHMS_H_
......@@ -46,8 +39,8 @@
#include "authentication_algorithms_with_5gaka.hpp"
extern "C" {
#include "snow3g.h"
#include "conversions.h"
#include "snow3g.h"
}
#define SECU_DIRECTION_UPLINK 0
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file rijndael.c
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include <stdint.h>
/* Rijndael S-box SR */
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file rijndael.h
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef FILE_RIJNDAEL_SEEN
#define FILE_RIJNDAEL_SEEN
/* Rijndael S-box SR */
......
......@@ -19,11 +19,7 @@
* contact@openairinterface.org
*/
/*! \file snow3g.c
\brief
\date 2020
\email: contact@openairinterface.org
*/
#include "snow3g.h"
#include <stdint.h>
#include <stdio.h>
......@@ -31,7 +27,6 @@
#include <string.h>
#include "rijndael.h"
#include "snow3g.h"
static uint8_t _MULx(uint8_t V, uint8_t c);
static uint8_t _MULxPOW(uint8_t V, uint8_t i, uint8_t c);
......
......@@ -19,19 +19,9 @@
* contact@openairinterface.org
*/
/*! \file snow3g.h
* \brief
* \author Open source Adapted from Specification of the 3GPP Confidentiality
* and Integrity Algorithms UEA2 & UIA2. Document 2: SNOW 3G Specification
* \integrators Kharbach Othmane, GAUTHIER Lionel.
* \date 2014
* \version
* \note
* \bug
* \warning
*/
#ifndef FILE_SNOW3G_SEEN
#define FILE_SNOW3G_SEEN
#include <stdint.h>
typedef struct snow_3g_context_s {
uint32_t LFSR_S0;
......
......@@ -29,9 +29,9 @@
#ifndef FILE_3GPP_CONVERSIONS_HPP_SEEN
#define FILE_3GPP_CONVERSIONS_HPP_SEEN
#include "amf_msg.hpp"
#include "AmfCreateEventSubscription.h"
#include "3gpp_29.518.h"
#include "AmfCreateEventSubscription.h"
#include "amf_msg.hpp"
using namespace amf_application;
// using namespace oai::amf::model;
......
......@@ -20,10 +20,12 @@
*/
#include "fqdn.hpp"
#include "logger.hpp"
#include <boost/asio.hpp>
#include <iostream>
#include "logger.hpp"
bool fqdn::resolve(
const std::string& host_name, std::string& address, uint32_t& port,
uint8_t& addr_type, const std::string& protocol) {
......@@ -51,6 +53,7 @@ bool fqdn::resolve(
return true;
}
} catch (std::exception& e) {
// TODO: Remove this line so that AMF can re-try several times
throw std::runtime_error(
"Cannot resolve a DNS name " + std::string(e.what()));
return false;
......
......@@ -29,6 +29,7 @@
#define FILE_THREAD_SCHED_HPP_SEEN
#include <sched.h>
#include "logger.hpp"
namespace util {
......
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