Commit 6091323d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Address CPPCheck issues/warnings

parent 58c0816c
......@@ -64,6 +64,34 @@ amf_config::amf_config() {
enable_smf_selection = false;
enable_external_ausf = false;
enable_external_udm = false;
instance = 0;
n2 = {};
n11 = {};
statistics_interval = 0;
guami = {};
guami_list = {};
relativeAMFCapacity = 0;
plmn_list = {};
auth_conf auth_para = {};
nas_cfg = {};
smf_pool = {};
enable_nf_registration = false;
enable_smf_selection = false;
enable_external_ausf = false;
enable_external_udm = false;
struct {
struct in_addr ipv4_addr;
unsigned int port;
std::string api_version;
} nrf_addr;
struct {
struct in_addr ipv4_addr;
unsigned int port;
std::string api_version;
} ausf_addr;
// TODO:
}
......@@ -385,66 +413,50 @@ void amf_config::display() {
Logger::config().info(
"====================== AMF =====================");
Logger::config().info("Configuration AMF:");
Logger::config().info(
"- Instance ...........................................: %d", instance);
Logger::config().info(
"- PID dir ............................................: %s",
pid_dir.c_str());
Logger::config().info(
"- AMF NAME............................................: %s",
AMF_Name.c_str());
Logger::config().info("- Instance ................: %d", instance);
Logger::config().info("- PID dir .................: %s", pid_dir.c_str());
Logger::config().info("- AMF NAME.................: %s", AMF_Name.c_str());
Logger::config().info(
"- GUAMI (MCC, MNC, Region ID, AMF Set ID, AMF pointer): ");
Logger::config().info(
" (%s, %s, %s, %s, %s )", guami.mcc.c_str(), guami.mnc.c_str(),
guami.regionID.c_str(), guami.AmfSetID.c_str(), guami.AmfPointer.c_str());
Logger::config().info(
"- SERVED_GUAMI_LIST...................................: ");
Logger::config().info("- Served_Guami_List .......: ");
for (int i = 0; i < guami_list.size(); i++) {
Logger::config().info(
" (%s, %s, %s , %s, %s)", guami_list[i].mcc.c_str(),
guami_list[i].mnc.c_str(), guami_list[i].regionID.c_str(),
guami_list[i].AmfSetID.c_str(), guami_list[i].AmfPointer.c_str());
}
Logger::config().info(
"- RELATIVE_CAPACITY...................................: %d",
relativeAMFCapacity);
Logger::config().info(
"- PLMN_SUPPORT_LIST...................................: ");
Logger::config().info("- Relative Capacity .......: %d", relativeAMFCapacity);
Logger::config().info("- PLMN Support ............: ");
for (int i = 0; i < plmn_list.size(); i++) {
Logger::config().info(
" (MCC %s, MNC %s) ", plmn_list[i].mcc.c_str(),
" MCC, MNC ...........: %s, %s", plmn_list[i].mcc.c_str(),
plmn_list[i].mnc.c_str());
Logger::config().info(" TAC: %d", plmn_list[i].tac);
Logger::config().info(
" SLICE_SUPPORT_LIST (SST, SD) ....................: ");
Logger::config().info(" TAC ................: %d", plmn_list[i].tac);
Logger::config().info(" Slice Support ......:");
for (int j = 0; j < plmn_list[i].slice_list.size(); j++) {
Logger::config().info(
" (%s, %s) ", plmn_list[i].slice_list[j].sST.c_str(),
" SST, SD ........: %s, %s",
plmn_list[i].slice_list[j].sST.c_str(),
plmn_list[i].slice_list[j].sD.c_str());
}
}
Logger::config().info(
"- Emergency Support................... ...............: %s",
is_emergency_support.c_str());
"- Emergency Support .......: %s", is_emergency_support.c_str());
Logger::config().info(
"- MYSQL Server Addr...................................: %s",
auth_para.mysql_server.c_str());
"- MySQL Server Addr .......: %s", auth_para.mysql_server.c_str());
Logger::config().info(
"- MYSQL user .........................................: %s",
auth_para.mysql_user.c_str());
"- MySQL user ..............: %s", auth_para.mysql_user.c_str());
Logger::config().info(
"- MYSQL pass .........................................: %s",
auth_para.mysql_pass.c_str());
"- MySQL pass ..............: %s", auth_para.mysql_pass.c_str());
Logger::config().info(
"- MYSQL db ...........................................: %s",
auth_para.mysql_db.c_str());
"- MySQL DB ................: %s", auth_para.mysql_db.c_str());
Logger::config().info(
"- operator key .......................................: %s",
auth_para.operator_key.c_str());
"- operator key ............: %s", auth_para.operator_key.c_str());
Logger::config().info(
"- random .............................................: %s",
auth_para.random.c_str());
"- random ..................: %s", auth_para.random.c_str());
Logger::config().info("- N2 Networking:");
Logger::config().info(" iface .................: %s", n2.if_name.c_str());
......@@ -456,24 +468,25 @@ void amf_config::display() {
Logger::config().info(
" ip ....................: %s", inet_ntoa(n11.addr4));
Logger::config().info(" port ..................: %d", n11.port);
Logger::config().info(" API version............: %s", sbi_api_version.c_str());
Logger::config().info(
" API version............: %s", sbi_api_version.c_str());
if (enable_nf_registration or enable_smf_selection) {
Logger::config().info("- NRF:");
Logger::config().info(
" IP addr ..............: %s", inet_ntoa(nrf_addr.ipv4_addr));
Logger::config().info(" Port .................: %d", nrf_addr.port);
" IP addr ...............: %s", inet_ntoa(nrf_addr.ipv4_addr));
Logger::config().info(" Port ..................: %d", nrf_addr.port);
Logger::config().info(
" Api version ..........: %s", nrf_addr.api_version.c_str());
" Api version ...........: %s", nrf_addr.api_version.c_str());
}
if (enable_external_ausf) {
Logger::config().info("- AUSF:");
Logger::config().info(
" IP addr ..............: %s", inet_ntoa(ausf_addr.ipv4_addr));
Logger::config().info(" Port .................: %d", ausf_addr.port);
" IP addr ...............: %s", inet_ntoa(ausf_addr.ipv4_addr));
Logger::config().info(" Port ..................: %d", ausf_addr.port);
Logger::config().info(
" Api version ..........: %s", ausf_addr.api_version.c_str());
" Api version ...........: %s", ausf_addr.api_version.c_str());
}
Logger::config().info("- Remote SMF Pool.........: ");
......@@ -491,13 +504,13 @@ void amf_config::display() {
Logger::config().info("- Supported Features:");
Logger::config().info(
" NF Registration........: %s", enable_nf_registration ? "Yes" : "No");
" NF Registration .......: %s", enable_nf_registration ? "Yes" : "No");
Logger::config().info(
" SMF Selection..........: %s", enable_smf_selection ? "Yes" : "No");
" SMF Selection .........: %s", enable_smf_selection ? "Yes" : "No");
Logger::config().info(
" External AUSF..........: %s", enable_external_ausf ? "Yes" : "No");
" External AUSF .........: %s", enable_external_ausf ? "Yes" : "No");
Logger::config().info(
" External UDM..........: %s", enable_external_udm ? "Yes" : "No");
" External UDM ..........: %s", enable_external_udm ? "Yes" : "No");
}
//------------------------------------------------------------------------------
......
......@@ -45,7 +45,6 @@
#define AMF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL "STATISTICS_TIMER_INTERVAL"
#define AMF_CONFIG_STRING_INTERFACES "INTERFACES"
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NAUSF "NAUSF"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
......@@ -180,7 +179,6 @@ class amf_config {
std::string pid_dir;
interface_cfg_t n2;
interface_cfg_t n11;
interface_cfg_t nausf;
itti_cfg_t itti;
std::string sbi_api_version;
unsigned int statistics_interval;
......
......@@ -91,7 +91,7 @@ int amf_modules::load(const std::string& config_file) {
//------------------------------------------------------------------------------
void amf_modules::display() {
Logger::config().info("======= AMF Registered Modules =======");
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(),
......
......@@ -596,7 +596,7 @@ void amf_n1::service_request_handle(
"Cannot get pdu_session_context with SUPI %s", supi.c_str());
}
//TODO: is_supi_to_pdu_ctx should be removed
// TODO: is_supi_to_pdu_ctx should be removed
if (!amf_n11_inst->is_supi_to_pdu_ctx(supi) || !psc.get()->isn2sm_avaliable) {
Logger::amf_n1().error(
"Cannot get pdu session information with supi (%s)", supi.c_str());
......@@ -943,7 +943,9 @@ void amf_n1::registration_request_handle(
//------------------------------------------------------------------------------
// authentication vector handlers
bool amf_n1::generate_authentication_vector() {return true;}
bool amf_n1::generate_authentication_vector() {
return true;
}
// context management functions
//------------------------------------------------------------------------------
......@@ -1070,7 +1072,7 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
}
} else if (nc.get()->is_5g_guti_present) {
Logger::amf_n1().debug("Start to run UE Identification Request procedure");
nc.get()->is_auth_vectors_present = false;
nc.get()->is_auth_vectors_present = false;
std::unique_ptr<IdentityRequest> ir = std::make_unique<IdentityRequest>();
ir->setHeader(PLAIN_5GS_MSG);
ir->set_5GS_Identity_Type(SUCI);
......@@ -1731,7 +1733,9 @@ bool amf_n1::start_security_mode_control_procedure(
nc.get()->is_current_security_available = true;
}
SecurityModeCommand* smc = new SecurityModeCommand();
// SecurityModeCommand* smc = new SecurityModeCommand();
std::unique_ptr<SecurityModeCommand> smc =
std::make_unique<SecurityModeCommand>();
smc->setHeader(PLAIN_5GS_MSG);
smc->setNAS_Security_Algorithms(amf_nea, amf_nia);
Logger::amf_n1().debug("Encoded ngKSI 0x%x", nc.get()->ngKsi);
......@@ -1754,6 +1758,7 @@ bool amf_n1::start_security_mode_control_procedure(
itti_send_dl_nas_buffer_to_task_n2(
intProtctedNas, nc.get()->ran_ue_ngap_id, nc.get()->amf_ue_ngap_id);
// secu_ctx->dl_count.seq_num ++;
free_wrapper((void**) &data);
return true;
}
......@@ -1955,8 +1960,9 @@ void amf_n1::encode_nas_message_protected(
} break;
case INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX: {
if (!nsc || !is_secu_ctx_new) {
if ((nsc == nullptr) || !is_secu_ctx_new) {
Logger::amf_n1().error("Security context is too old");
return;
}
protected_nas_buf[0] = EPD_5GS_MM_MSG;
protected_nas_buf[1] = INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX;
......@@ -1977,7 +1983,6 @@ void amf_n1::encode_nas_message_protected(
case INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX: {
} break;
}
protected_nas = blk2bstr(protected_nas_buf, encoded_size);
nsc->dl_count.seq_num++;
......@@ -1987,7 +1992,7 @@ void amf_n1::encode_nas_message_protected(
bool amf_n1::nas_message_integrity_protected(
nas_secu_ctx* nsc, uint8_t direction, uint8_t* input_nas, int input_nas_len,
uint32_t& mac32) {
if (nsc == nullptr) return false;
uint32_t count = 0x00000000;
if (direction)
count = 0x00000000 | ((nsc->dl_count.overflow & 0x0000ffff) << 8) |
......@@ -2042,7 +2047,6 @@ bool amf_n1::nas_message_integrity_protected(
Logger::amf_n1().debug("Result for NIA2, mac32: 0x%x", mac32);
return true;
} break;
}
return true;
}
......
......@@ -1111,7 +1111,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std::shared_ptr<nas_context> nc =
amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id);
//setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer
std::vector<PDUSessionResourceHandoverItem_t> handover_list;
PDUSessionResourceHandoverItem_t item;
// set pdu id
......@@ -1145,7 +1145,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
handover_list.push_back(item);
handovercommand->setPduSessionResourceHandoverList(handover_list);
handovercommand->setTargetToSource_TransparentContainer(targetTosource);
//setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
uint8_t buffer[10240];
int encoded_size = handovercommand->encode2buffer(buffer, 10240);
bstring b = blk2bstr(buffer, encoded_size);
......
......@@ -107,16 +107,6 @@ void _Logger::trace(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::trace(const std::string& format, ...) {
#if TRACE_IS_ON
va_list args;
va_start(args, format);
log(_ltTrace, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::debug(const char* format, ...) {
#if DEBUG_IS_ON
......@@ -127,16 +117,6 @@ void _Logger::debug(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::debug(const std::string& format, ...) {
#if DEBUG_IS_ON
va_list args;
va_start(args, format);
log(_ltDebug, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::info(const char* format, ...) {
#if INFO_IS_ON
......@@ -147,16 +127,6 @@ void _Logger::info(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::info(const std::string& format, ...) {
#if INFO_IS_ON
va_list args;
va_start(args, format);
log(_ltInfo, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::startup(const char* format, ...) {
va_list args;
......@@ -165,14 +135,6 @@ void _Logger::startup(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::startup(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltStartup, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::warn(const char* format, ...) {
va_list args;
......@@ -181,14 +143,6 @@ void _Logger::warn(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::warn(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltWarn, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::error(const char* format, ...) {
va_list args;
......@@ -197,14 +151,6 @@ void _Logger::error(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::error(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltError, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::log(_LogType lt, const char* format, va_list& args) {
char buffer[2048];
......
......@@ -29,11 +29,21 @@
#include "nas_context.hpp"
//------------------------------------------------------------------------------
nas_context::nas_context() {
security_ctx = NULL;
is_imsi_present = false;
nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
security_ctx = nullptr;
is_stacs_available = false;
is_auth_vectors_present = false;
auts = nullptr;
ctx_avaliability_ind = false;
amf_ue_ngap_id = 0;
ran_ue_ngap_id = 0;
_5gmm_state = {};
registration_type = 0;
follow_on_req_pending_ind = false;
ngKsi = 0;
mmCapability = 0;
ueSecurityCapEnc = 0;
ueSecurityCapInt = 0;
requestedNssai = {};
is_specific_procedure_for_registration_running = false;
is_specific_procedure_for_deregistration_running = false;
is_specific_procedure_for_eCell_inactivity_running = false;
......@@ -41,7 +51,14 @@ nas_context::nas_context() {
is_common_procedure_for_identification_running = false;
is_common_procedure_for_security_mode_control_running = false;
is_common_procedure_for_nas_transport_running = false;
auts = NULL;
_security = {};
security_ctx = nullptr;
is_current_security_available = false;
registration_attempt_counter = 0;
is_imsi_present = false;
is_5g_guti_present = false;
is_auth_vectors_present = false;
to_be_register_by_new_suci = false;
}
//------------------------------------------------------------------------------
......
......@@ -33,6 +33,17 @@ pdu_session_context::pdu_session_context() {
smf_available = false;
isn2sm_avaliable = false;
isn1sm_avaliable = false;
ran_ue_ngap_id = 0;
amf_ue_ngap_id = 0;
req_type = 0;
pdu_session_id = 0;
// bstring n2sm;
isn2sm_avaliable = false;
// bstring n1sm;
isn1sm_avaliable = false;
smf_available = false;
snssai = {};
plmn = {};
}
//------------------------------------------------------------------------------
......
......@@ -47,7 +47,7 @@ class pdu_session_context {
bstring n1sm;
bool isn1sm_avaliable;
std::string dnn;
std::string smf_addr; //"192.168.12.10:8080"
std::string smf_addr;
std::string smf_api_version;
bool smf_available;
std::string location;
......
......@@ -22,7 +22,15 @@
#include "ue_context.hpp"
//------------------------------------------------------------------------------
ue_context::ue_context() {}
ue_context::ue_context() {
ran_ue_ngap_id = 0;
amf_ue_ngap_id = 0;
rrc_estb_cause = {};
isUeContextRequest = false;
cgi = {};
tai = {};
pdu_sessions = {};
}
//------------------------------------------------------------------------------
bool ue_context::find_pdu_session_context(
......
......@@ -35,8 +35,16 @@
using namespace nas;
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::setIEI(uint8_t _iei) {
iei = _iei;
_5GSMobilityIdentity::_5GSMobilityIdentity() {
iei = 0;
_5g_guti = nullptr;
imei_imeisv = nullptr;
supi_format_imsi = nullptr;
_5g_s_tmsi = nullptr;
_IMEISV = {};
is_no_identity = false;
length = 0;
typeOfIdentity = 0;
}
//------------------------------------------------------------------------------
......@@ -49,6 +57,45 @@ _5GSMobilityIdentity::_5GSMobilityIdentity(
_5g_s_tmsi->amf_set_id = amfSetId;
_5g_s_tmsi->amf_pointer = amfPointer;
_5g_s_tmsi->_5g_tmsi = tmsi;
is_no_identity = false;
length = 0;
_5g_guti = nullptr;
imei_imeisv = nullptr;
supi_format_imsi = nullptr;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin) {
iei = 0;
typeOfIdentity = SUCI;
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protection_sch_id;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
supi_format_imsi->msin = msin;
length = 10 + ceil(msin.length() / 2);
is_no_identity = false;
_5g_s_tmsi = nullptr;
_5g_guti = nullptr;
imei_imeisv = nullptr;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::~_5GSMobilityIdentity() {}
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::setIEI(uint8_t _iei) {
iei = _iei;
}
//------------------------------------------------------------------------------
......@@ -128,42 +175,13 @@ bool _5GSMobilityIdentity::get5G_S_TMSI(
return true;
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin) {
iei = 0;
typeOfIdentity = SUCI;
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protection_sch_id;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
supi_format_imsi->msin = msin;
length = 10 + ceil(msin.length() / 2);
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity() {
iei = 0;
_5g_guti = NULL;
imei_imeisv = NULL;
supi_format_imsi = NULL;
_5g_s_tmsi = NULL;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::~_5GSMobilityIdentity() {}
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::set5GGUTI(
const string mcc, const string mnc, uint8_t amf_region_id,
uint16_t amf_set_id, uint8_t amf_pointer, const uint32_t _5g_tmsi) {
typeOfIdentity = _5G_GUTI;
_5g_guti = (_5G_GUTI_t*) calloc(1, sizeof(_5G_GUTI_t));
typeOfIdentity = _5G_GUTI;
if (_5g_guti == nullptr)
_5g_guti = (_5G_GUTI_t*) calloc(1, sizeof(_5G_GUTI_t));
_5g_guti->mcc = mcc;
_5g_guti->mnc = mnc;
_5g_guti->amf_region_id = amf_region_id;
......@@ -177,10 +195,11 @@ void _5GSMobilityIdentity::set5GGUTI(
void _5GSMobilityIdentity::setSuciWithSupiImsi(
const string& mcc, const string& mnc, const string& routingInd,
uint8_t protecSchId, const string& msin_digits) {
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
if (supi_format_imsi == nullptr)
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protecSchId;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
......@@ -191,7 +210,8 @@ void _5GSMobilityIdentity::setSuciWithSupiImsi(
void _5GSMobilityIdentity::setSuciWithSupiImsi(
const string& mcc, const string& mnc, const string& routingInd,
uint8_t protecSchId, uint8_t home_pki, const string& msin_digits) {
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
if (supi_format_imsi == nullptr)
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
......@@ -428,7 +448,9 @@ int _5GSMobilityIdentity::encodeRoutid2buffer(string routidstr, uint8_t* buf) {
}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {return 1;}
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::imeisv_encode2buffer(uint8_t* buf, int len) {
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
ABBA::ABBA(uint8_t iei) {
_iei = iei;
ABBA::ABBA(uint8_t iei) : _value() {
_iei = iei;
_length = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +46,9 @@ ABBA::ABBA(const uint8_t iei, uint8_t length, uint8_t* value) {
}
//------------------------------------------------------------------------------
ABBA::ABBA() {}
ABBA::ABBA() : _value(), _length(), _iei() {}
//------------------------------------------------------------------------------
ABBA::~ABBA() {}
//------------------------------------------------------------------------------
......@@ -99,9 +102,8 @@ int ABBA::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
if (is_option) {
decoded_size++;
}
_length = 0x00;
_value[255] = {};
_length = *(buf + decoded_size);
_length = 0x00;
_length = *(buf + decoded_size);
decoded_size++;
int i = 0;
uint8_t Length = _length;
......
......@@ -33,7 +33,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information(
uint8_t iei) {
_iei = iei;
_iei = iei;
RINMR = false;
HDP = false;
}
//------------------------------------------------------------------------------
......@@ -45,7 +47,11 @@ Additional_5G_Security_Information::Additional_5G_Security_Information(
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information() {}
Additional_5G_Security_Information::Additional_5G_Security_Information()
: _iei() {
RINMR = false;
HDP = false;
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::~Additional_5G_Security_Information() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Additional_Information::Additional_Information(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,7 @@ Additional_Information::Additional_Information(
}
//------------------------------------------------------------------------------
Additional_Information::Additional_Information() {}
Additional_Information::Additional_Information() : _iei(), length(), _value() {}
//------------------------------------------------------------------------------
Additional_Information::~Additional_Information() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(
}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status() {}
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::~Allowed_PDU_Session_Status() {}
......
......@@ -33,7 +33,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter(
uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
value = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +47,8 @@ Authentication_Failure_Parameter::Authentication_Failure_Parameter(
}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter() {}
Authentication_Failure_Parameter::Authentication_Failure_Parameter()
: _iei(), length(), value() {}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::~Authentication_Failure_Parameter() {}
......
......@@ -31,7 +31,8 @@
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(uint8_t iei) {
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(uint8_t iei)
: _value() {
_iei = iei;
}
......@@ -45,7 +46,8 @@ Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(
}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN() {}
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN()
: _iei(), _value() {}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::~Authentication_Parameter_AUTN() {}
......@@ -54,7 +56,7 @@ Authentication_Parameter_AUTN::~Authentication_Parameter_AUTN() {}
uint8_t* Authentication_Parameter_AUTN::getValue() {
// for (int j = 0; j < 16; j++) {
// Logger::nas_mm().debug("decoded Authentication_Response_Parameter
//value(0x%2x)", _value[j]);
// value(0x%2x)", _value[j]);
//}
return _value;
}
......
......@@ -31,7 +31,8 @@
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND(uint8_t iei) {
Authentication_Parameter_RAND::Authentication_Parameter_RAND(uint8_t iei)
: _value() {
_iei = iei;
}
......@@ -45,7 +46,8 @@ Authentication_Parameter_RAND::Authentication_Parameter_RAND(
}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND() {}
Authentication_Parameter_RAND::Authentication_Parameter_RAND()
: _iei(), _value() {}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::~Authentication_Parameter_RAND() {}
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
DNN::DNN(uint8_t iei) {
_iei = iei;
DNN::DNN(uint8_t iei) : _DNN() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,7 @@ DNN::DNN(const uint8_t iei, bstring dnn) {
}
//------------------------------------------------------------------------------
DNN::DNN() {}
DNN::DNN() : _iei(), _DNN(), length() {}
//------------------------------------------------------------------------------
DNN::~DNN() {}
......@@ -93,8 +94,7 @@ int DNN::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
decode_bstring(&_DNN, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < blength(_DNN); i++) {
Logger::nas_mm().debug(
"Decoded DNN value: 0x%x", (uint8_t) bdata(_DNN)[i]);
Logger::nas_mm().debug("Decoded DNN value: 0x%x", (uint8_t) bdata(_DNN)[i]);
}
Logger::nas_mm().debug("Decoded DNN len: %d", decoded_size);
return decoded_size;
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
EAP_Message::EAP_Message(uint8_t iei) {
_iei = iei;
EAP_Message::EAP_Message(uint8_t iei) : EAP() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,7 @@ EAP_Message::EAP_Message(const uint8_t iei, bstring eap) {
}
//------------------------------------------------------------------------------
EAP_Message::EAP_Message() {}
EAP_Message::EAP_Message() : _iei(), EAP(), length() {}
//------------------------------------------------------------------------------
EAP_Message::~EAP_Message() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(
}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status() {}
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::~EPS_Bearer_Context_Status() {}
......
......@@ -30,8 +30,9 @@
using namespace nas;
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container(uint8_t iei) {
_iei = iei;
EPS_NAS_Message_Container::EPS_NAS_Message_Container(uint8_t iei) : _value() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,8 @@ EPS_NAS_Message_Container::EPS_NAS_Message_Container(
}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container() {}
EPS_NAS_Message_Container::EPS_NAS_Message_Container()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::~EPS_NAS_Message_Container() {}
......
......@@ -31,7 +31,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Extended_DRX_Parameters::Extended_DRX_Parameters(uint8_t iei) {
_iei = iei;
_iei = iei;
_paging_time = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,8 @@ Extended_DRX_Parameters::Extended_DRX_Parameters(
}
//------------------------------------------------------------------------------
Extended_DRX_Parameters::Extended_DRX_Parameters() {}
Extended_DRX_Parameters::Extended_DRX_Parameters()
: _iei(), _paging_time(), _value() {}
//------------------------------------------------------------------------------
Extended_DRX_Parameters::~Extended_DRX_Parameters() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
GPRS_Timer_2::GPRS_Timer_2(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,7 @@ GPRS_Timer_2::GPRS_Timer_2(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
GPRS_Timer_2::GPRS_Timer_2() {}
GPRS_Timer_2::GPRS_Timer_2() : _iei(), _value() {}
//------------------------------------------------------------------------------
GPRS_Timer_2::~GPRS_Timer_2() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
GPRS_Timer_3::GPRS_Timer_3(uint8_t iei) {
_iei = iei;
_iei = iei;
UNIT = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,7 @@ GPRS_Timer_3::GPRS_Timer_3(const uint8_t iei, uint8_t unit, uint8_t value) {
}
//------------------------------------------------------------------------------
GPRS_Timer_3::GPRS_Timer_3() {}
GPRS_Timer_3::GPRS_Timer_3() : _iei(), UNIT(), _value() {}
//------------------------------------------------------------------------------
GPRS_Timer_3::~GPRS_Timer_3() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
IMEISV_Request::IMEISV_Request(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,7 @@ IMEISV_Request::IMEISV_Request(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
IMEISV_Request::IMEISV_Request() {}
IMEISV_Request::IMEISV_Request() : _iei(), _value() {}
//------------------------------------------------------------------------------
IMEISV_Request::~IMEISV_Request() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
LADN_Indication::LADN_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
LADN = {};
}
//------------------------------------------------------------------------------
......@@ -46,7 +48,7 @@ LADN_Indication::LADN_Indication(const uint8_t iei, std::vector<bstring> ladn) {
}
//------------------------------------------------------------------------------
LADN_Indication::LADN_Indication() {}
LADN_Indication::LADN_Indication() : _iei(), length(), LADN() {}
//------------------------------------------------------------------------------
LADN_Indication::~LADN_Indication() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
MA_PDU_Session_Information::MA_PDU_Session_Information(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ MA_PDU_Session_Information::MA_PDU_Session_Information(
}
//------------------------------------------------------------------------------
MA_PDU_Session_Information::MA_PDU_Session_Information() {}
MA_PDU_Session_Information::MA_PDU_Session_Information() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
MA_PDU_Session_Information::~MA_PDU_Session_Information() {}
......
......@@ -89,8 +89,8 @@ int MICO_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
SPRTI = octet & 0x02;
RAAI = octet & 0x01;
Logger::nas_mm().debug(
"decoded MICO_Indication iei (0x%x) sprti (0x%x) raai (0x%x)", iei, SPRTI,
RAAI);
"decoded MICO_Indication iei (0x%x) sprti (0x%x) raai (0x%x)", iei,
SPRTI, RAAI);
return 1;
}
}
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
NAS_Message_Container::NAS_Message_Container(uint8_t iei) {
_iei = iei;
NAS_Message_Container::NAS_Message_Container(uint8_t iei) : _value() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,7 @@ NAS_Message_Container::NAS_Message_Container(const uint8_t iei, bstring value) {
}
//------------------------------------------------------------------------------
NAS_Message_Container::NAS_Message_Container() {}
NAS_Message_Container::NAS_Message_Container() : _iei(), length(), _value() {}
//------------------------------------------------------------------------------
NAS_Message_Container::~NAS_Message_Container() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
//------------------------------------------------------------------------------
NSSAI::NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
S_NSSAI = {};
}
//------------------------------------------------------------------------------
......@@ -51,7 +53,7 @@ NSSAI::NSSAI(const uint8_t iei, std::vector<struct SNSSAI_s> nssai) {
}
//------------------------------------------------------------------------------
NSSAI::NSSAI() {}
NSSAI::NSSAI() : _iei(), length(), S_NSSAI() {}
//------------------------------------------------------------------------------
NSSAI::~NSSAI() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Network_Slicing_Indication::Network_Slicing_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
DCNI = false;
NSSCI = false;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ Network_Slicing_Indication::Network_Slicing_Indication(
}
//------------------------------------------------------------------------------
Network_Slicing_Indication::Network_Slicing_Indication() {}
Network_Slicing_Indication::Network_Slicing_Indication()
: _iei(), DCNI(), NSSCI() {}
//------------------------------------------------------------------------------
Network_Slicing_Indication::~Network_Slicing_Indication() {}
......@@ -71,7 +74,8 @@ bool Network_Slicing_Indication::getNSSCI() {
//------------------------------------------------------------------------------
int Network_Slicing_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("Encoding Network_Slicing_Indication iei (0x%x)", _iei);
Logger::nas_mm().debug(
"Encoding Network_Slicing_Indication iei (0x%x)", _iei);
if (len < 1) {
// Logger::nas_mm().error("len is less than %d", length);
return 0;
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Identity_2::PDU_Session_Identity_2(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ PDU_Session_Identity_2::PDU_Session_Identity_2(
}
//------------------------------------------------------------------------------
PDU_Session_Identity_2::PDU_Session_Identity_2() {}
PDU_Session_Identity_2::PDU_Session_Identity_2() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Identity_2::~PDU_Session_Identity_2() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,11 @@ PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result(
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result() {}
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result() {
_iei = 0;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::~PDU_Session_Reactivation_Result() {}
......
......@@ -33,7 +33,10 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
PDU_Session_Reactivation_Result_Error_Cause(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
SESSION_ID = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -48,7 +51,12 @@ PDU_Session_Reactivation_Result_Error_Cause::
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
PDU_Session_Reactivation_Result_Error_Cause() {}
PDU_Session_Reactivation_Result_Error_Cause() {
_iei = 0;
_value = 0;
SESSION_ID = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Status::PDU_Session_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ PDU_Session_Status::PDU_Session_Status(const uint8_t iei, uint16_t value) {
}
//------------------------------------------------------------------------------
PDU_Session_Status::PDU_Session_Status() {}
PDU_Session_Status::PDU_Session_Status() {
_iei = 0;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Status::~PDU_Session_Status() {}
......
......@@ -32,7 +32,10 @@ using namespace nas;
//------------------------------------------------------------------------------
PLMN_List::PLMN_List(uint8_t iei) {
_iei = iei;
_iei = iei;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +48,12 @@ PLMN_List::PLMN_List(
}
//------------------------------------------------------------------------------
PLMN_List::PLMN_List() {}
PLMN_List::PLMN_List() {
_iei = 0;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
}
//------------------------------------------------------------------------------
PLMN_List::~PLMN_List() {}
......
......@@ -31,14 +31,17 @@
using namespace nas;
//------------------------------------------------------------------------------
Payload_Container::Payload_Container(uint8_t iei) {
_iei = iei;
Payload_Container::Payload_Container(uint8_t iei) : content() {
_iei = iei;
length = 0;
CONTENT = {};
}
//------------------------------------------------------------------------------
Payload_Container::Payload_Container(uint8_t iei, bstring b) {
_iei = iei;
content = b;
CONTENT = {};
}
//------------------------------------------------------------------------------
......@@ -60,7 +63,10 @@ Payload_Container::Payload_Container(
}
//------------------------------------------------------------------------------
Payload_Container::Payload_Container() {}
Payload_Container::Payload_Container() : content() {
_iei = 0;
CONTENT = {};
}
//------------------------------------------------------------------------------
Payload_Container::~Payload_Container() {}
......@@ -154,7 +160,7 @@ int Payload_Container::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int Payload_Container::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
return 0;
return 0;
}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,11 @@ using namespace nas;
//------------------------------------------------------------------------------
Rejected_NSSAI::Rejected_NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_s_nssai_SST = 0;
_s_nssai_length = 0;
_cause = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +49,13 @@ Rejected_NSSAI::Rejected_NSSAI(const uint8_t iei, uint8_t cause, uint8_t SST) {
}
//------------------------------------------------------------------------------
Rejected_NSSAI::Rejected_NSSAI() {}
Rejected_NSSAI::Rejected_NSSAI() {
_iei = 0;
length = 0;
_s_nssai_SST = 0;
_s_nssai_length = 0;
_cause = 0;
}
//------------------------------------------------------------------------------
Rejected_NSSAI::~Rejected_NSSAI() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
Release_Assistance_Indication::Release_Assistance_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ Release_Assistance_Indication::Release_Assistance_Indication(
}
//------------------------------------------------------------------------------
Release_Assistance_Indication::Release_Assistance_Indication() {}
Release_Assistance_Indication::Release_Assistance_Indication() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
Release_Assistance_Indication::~Release_Assistance_Indication() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
Request_Type::Request_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ Request_Type::Request_Type(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
Request_Type::Request_Type() {}
Request_Type::Request_Type() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
Request_Type::~Request_Type() {}
......
......@@ -34,11 +34,19 @@ using namespace std;
//------------------------------------------------------------------------------
S1_UE_Security_Capability::S1_UE_Security_Capability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
S1_UE_Security_Capability::S1_UE_Security_Capability() {}
S1_UE_Security_Capability::S1_UE_Security_Capability() {
_iei = 0;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
S1_UE_Security_Capability::~S1_UE_Security_Capability() {}
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
SOR_Transparent_Container::SOR_Transparent_Container(uint8_t iei) {
_iei = iei;
SOR_Transparent_Container::SOR_Transparent_Container(uint8_t iei) : _value() {
_iei = iei;
HEADER = 0;
}
//------------------------------------------------------------------------------
......@@ -46,7 +47,8 @@ SOR_Transparent_Container::SOR_Transparent_Container(
}
//------------------------------------------------------------------------------
SOR_Transparent_Container::SOR_Transparent_Container() {}
SOR_Transparent_Container::SOR_Transparent_Container()
: _iei(), HEADER(), _value() {}
//------------------------------------------------------------------------------
SOR_Transparent_Container::~SOR_Transparent_Container() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
S_NSSAI::S_NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
SNSSAI = {};
}
//------------------------------------------------------------------------------
......@@ -52,7 +54,11 @@ S_NSSAI::S_NSSAI(const uint8_t iei, SNSSAI_s snssai) {
}
//------------------------------------------------------------------------------
S_NSSAI::S_NSSAI() {}
S_NSSAI::S_NSSAI() {
_iei = 0;
length = 0;
SNSSAI = {};
}
//------------------------------------------------------------------------------
S_NSSAI::~S_NSSAI() {}
......
......@@ -34,11 +34,19 @@ using namespace std;
//------------------------------------------------------------------------------
UENetworkCapability::UENetworkCapability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UENetworkCapability::UENetworkCapability() {}
UENetworkCapability::UENetworkCapability() {
_iei = 0;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UENetworkCapability::~UENetworkCapability() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UES_Usage_Setting::UES_Usage_Setting(uint8_t iei) {
_iei = iei;
_iei = iei;
_ues_usage_setting = false;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ UES_Usage_Setting::UES_Usage_Setting(
}
//------------------------------------------------------------------------------
UES_Usage_Setting::UES_Usage_Setting() {}
UES_Usage_Setting::UES_Usage_Setting() {
_iei = 0;
_ues_usage_setting = false;
}
//------------------------------------------------------------------------------
UES_Usage_Setting::~UES_Usage_Setting() {}
......
......@@ -32,11 +32,19 @@ using namespace nas;
//------------------------------------------------------------------------------
UESecurityCapability::UESecurityCapability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EASel = 0;
_5g_IASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UESecurityCapability::UESecurityCapability() {}
UESecurityCapability::UESecurityCapability() {
_iei = 0;
_5g_EASel = 0;
_5g_IASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UESecurityCapability::~UESecurityCapability() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::UE_Radio_Capability_ID(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ UE_Radio_Capability_ID::UE_Radio_Capability_ID(
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::UE_Radio_Capability_ID() {}
UE_Radio_Capability_ID::UE_Radio_Capability_ID() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::~UE_Radio_Capability_ID() {}
......
......@@ -33,6 +33,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UE_Status::UE_Status(uint8_t iei) {
_iei = iei;
S1 = false;
N1 = false;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ UE_Status::UE_Status(const uint8_t iei, bool n1, bool s1) {
}
//------------------------------------------------------------------------------
UE_Status::UE_Status() {}
UE_Status::UE_Status() {
_iei = 0;
S1 = false;
N1 = false;
}
//------------------------------------------------------------------------------
UE_Status::~UE_Status() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
UplinkDataStatus::UplinkDataStatus(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ UplinkDataStatus::UplinkDataStatus(const uint8_t iei, uint16_t value) {
}
//------------------------------------------------------------------------------
UplinkDataStatus::UplinkDataStatus() {}
UplinkDataStatus::UplinkDataStatus() {
_iei = 0;
_value = 0;
length = 0;
}
//-----------------------------------------------------------------------------
UplinkDataStatus::~UplinkDataStatus() {}
......
......@@ -95,13 +95,13 @@ int _5GSTrackingAreaIdList::encode_00_type(
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_01_type(
p_tai_t item, uint8_t* buf, int len) {
return 1;
return 1;
}
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_10_type(
p_tai_t item, uint8_t* buf, int len) {
return 1;
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_DRX_arameters::_5GS_DRX_arameters(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ _5GS_DRX_arameters::_5GS_DRX_arameters(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
_5GS_DRX_arameters::_5GS_DRX_arameters() {}
_5GS_DRX_arameters::_5GS_DRX_arameters() {
_iei = 0;
_value = 0;
}
_5GS_DRX_arameters::~_5GS_DRX_arameters() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Identity_Type::_5GS_Identity_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ _5GS_Identity_Type::_5GS_Identity_Type(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
_5GS_Identity_Type::_5GS_Identity_Type() {}
_5GS_Identity_Type::_5GS_Identity_Type() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
_5GS_Identity_Type::~_5GS_Identity_Type() {}
......
......@@ -32,11 +32,21 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
_value2 = 0;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support() {
_iei = 0;
_value = 0;
_value2 = 0;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support() {}
_5GS_Network_Feature_Support::~_5GS_Network_Feature_Support() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,11 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Registration_Result::_5GS_Registration_Result(uint8_t iei) {
_iei = iei;
_iei = iei;
Emergency = false;
NSSAA = false;
SMS = false;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -46,7 +50,13 @@ _5GS_Registration_Result::_5GS_Registration_Result(
}
//------------------------------------------------------------------------------
_5GS_Registration_Result::_5GS_Registration_Result() {}
_5GS_Registration_Result::_5GS_Registration_Result() {
_iei = 0;
Emergency = false;
NSSAA = false;
SMS = false;
_value = 0;
}
_5GS_Registration_Result::~_5GS_Registration_Result() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,13 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(uint8_t iei) {
_iei = iei;
_iei = iei;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
_TAC1 = 0;
_TAC2 = 0;
_TAC3 = 0;
}
//------------------------------------------------------------------------------
......@@ -55,7 +61,15 @@ _5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(
}
//------------------------------------------------------------------------------
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity() {}
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity() {
_iei = 0;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
_TAC1 = 0;
_TAC2 = 0;
_TAC3 = 0;
}
_5GS_Tracking_Area_Identity::~_5GS_Tracking_Area_Identity() {}
//------------------------------------------------------------------------------
......
......@@ -34,11 +34,23 @@ using namespace std;
//------------------------------------------------------------------------------
_5GS_Update_Type::_5GS_Update_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
EPS_PNB_CIoT = 0;
_5GS_PNB_CIoT = 0;
NG_RAN = false;
SMS = false;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Update_Type::_5GS_Update_Type() {}
_5GS_Update_Type::_5GS_Update_Type() {
_iei = 0;
EPS_PNB_CIoT = 0;
_5GS_PNB_CIoT = 0;
NG_RAN = false;
SMS = false;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Update_Type::~_5GS_Update_Type() {}
......
......@@ -35,34 +35,35 @@ using namespace nas;
//------------------------------------------------------------------------------
RegistrationAccept::RegistrationAccept() {
plain_header = NULL;
ie_5gs_registration_result = NULL;
ie_5g_guti = NULL;
ie_equivalent_plmns = NULL;
ie_allowed_nssai = NULL;
ie_rejected_nssai = NULL;
ie_configured_nssai = NULL;
ie_5gs_network_feature_support = NULL;
ie_PDU_session_status = NULL;
ie_pdu_session_reactivation_result = NULL;
ie_pdu_session_reactivation_result_error_cause = NULL;
ie_MICO_indicationl = NULL;
ie_network_slicing_indication = NULL;
ie_T3512_value = NULL;
ie_Non_3GPP_de_registration_timer_value = NULL;
ie_T3502_value = NULL;
ie_sor_transparent_container = NULL;
ie_eap_message = NULL;
ie_nssai_inclusion_mode = NULL;
ie_negotiated_drx_parameters = NULL;
ie_non_3gpp_nw_policies = NULL;
ie_eps_bearer_context_status = NULL;
ie_extended_drx_parameters = NULL;
ie_T3447_value = NULL;
ie_T3448_value = NULL;
ie_T3324_value = NULL;
ie_ue_radio_capability_id = NULL;
ie_pending_nssai = NULL;
plain_header = nullptr;
ie_5gs_registration_result = nullptr;
ie_5g_guti = nullptr;
ie_equivalent_plmns = nullptr;
ie_allowed_nssai = nullptr;
ie_rejected_nssai = nullptr;
ie_configured_nssai = nullptr;
ie_5gs_network_feature_support = nullptr;
ie_PDU_session_status = nullptr;
ie_pdu_session_reactivation_result = nullptr;
ie_pdu_session_reactivation_result_error_cause = nullptr;
ie_MICO_indicationl = nullptr;
ie_network_slicing_indication = nullptr;
ie_T3512_value = nullptr;
ie_Non_3GPP_de_registration_timer_value = nullptr;
ie_T3502_value = nullptr;
ie_sor_transparent_container = nullptr;
ie_eap_message = nullptr;
ie_nssai_inclusion_mode = nullptr;
ie_negotiated_drx_parameters = nullptr;
ie_non_3gpp_nw_policies = nullptr;
ie_eps_bearer_context_status = nullptr;
ie_extended_drx_parameters = nullptr;
ie_T3447_value = nullptr;
ie_T3448_value = nullptr;
ie_T3324_value = nullptr;
ie_ue_radio_capability_id = nullptr;
ie_pending_nssai = nullptr;
ie_tai_list = nullptr;
}
//------------------------------------------------------------------------------
......
......@@ -33,7 +33,16 @@
using namespace nas;
//------------------------------------------------------------------------------
ServiceRequest::ServiceRequest() {}
ServiceRequest::ServiceRequest() {
plain_header = nullptr;
ie_ngKSI = nullptr;
ie_service_type = nullptr;
ie_5g_s_tmsi = nullptr;
ie_uplink_data_status = nullptr;
ie_PDU_session_status = nullptr;
ie_allowed_PDU_session_status = nullptr;
ie_nas_message_container = nullptr;
}
//------------------------------------------------------------------------------
ServiceRequest::~ServiceRequest() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {}
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {
amfUeNgapId = 0;
}
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::~AMF_UE_NGAP_ID() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFPointer::AMFPointer() {}
AMFPointer::AMFPointer() {
pointer = 0;
}
//------------------------------------------------------------------------------
AMFPointer::~AMFPointer() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFRegionID::AMFRegionID() {}
AMFRegionID::AMFRegionID() {
regionid = 0;
}
//------------------------------------------------------------------------------
AMFRegionID::~AMFRegionID() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFSetID::AMFSetID() {}
AMFSetID::AMFSetID() {
setid = 0;
}
//------------------------------------------------------------------------------
AMFSetID::~AMFSetID() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {}
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {
additional = 0;
}
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::~AdditionalQosFlowInformation() {}
......
......@@ -35,9 +35,9 @@ namespace ngap {
//------------------------------------------------------------------------------
AllocationAndRetentionPriority::AllocationAndRetentionPriority() {
priorityLevelARP = NULL;
pre_emptionCapability = NULL;
pre_emptionVulnerability = NULL;
priorityLevelARP = nullptr;
pre_emptionCapability = nullptr;
pre_emptionVulnerability = nullptr;
}
//------------------------------------------------------------------------------
......@@ -87,9 +87,11 @@ bool AllocationAndRetentionPriority::encode2AllocationAndRetentionPriority(
//------------------------------------------------------------------------------
bool AllocationAndRetentionPriority::decodefromAllocationAndRetentionPriority(
Ngap_AllocationAndRetentionPriority_t* allocationAndRetentionPriority) {
priorityLevelARP = new PriorityLevelARP();
pre_emptionCapability = new Pre_emptionCapability();
pre_emptionVulnerability = new Pre_emptionVulnerability();
if (priorityLevelARP == nullptr) priorityLevelARP = new PriorityLevelARP();
if (pre_emptionCapability == nullptr)
pre_emptionCapability = new Pre_emptionCapability();
if (pre_emptionVulnerability == nullptr)
pre_emptionVulnerability = new Pre_emptionVulnerability();
if (!priorityLevelARP->decodefromPriorityLevelARP(
&allocationAndRetentionPriority->priorityLevelARP))
return false;
......
......@@ -84,7 +84,7 @@ bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(
//------------------------------------------------------------------------------
bool AssociatedQosFlowItem::decodefromAssociatedQosFlowItem(
Ngap_AssociatedQosFlowItem_t* associatedQosFlowItem) {
qosFlowIdentifier = new QosFlowIdentifier();
if (qosFlowIdentifier == nullptr) qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(
&associatedQosFlowItem->qosFlowIdentifier))
return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AveragingWindow::AveragingWindow() {}
AveragingWindow::AveragingWindow() {
averagingwindow = 0;
}
//------------------------------------------------------------------------------
AveragingWindow::~AveragingWindow() {}
......
......@@ -85,7 +85,7 @@ bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* pdu) {
plmn = new PlmnId();
if (plmn == nullptr) plmn = new PlmnId();
if (!plmn->decodefromoctetstring(pdu->pLMNIdentity)) return false;
numOfSnssai = pdu->tAISliceSupportList.list.count;
snssai = new S_NSSAI[numOfSnssai]();
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {}
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {
indication = 0;
}
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication() {}
......
......@@ -39,11 +39,11 @@ namespace ngap {
//------------------------------------------------------------------------------
CoreNetworkAssistanceInfo::CoreNetworkAssistanceInfo() {
ueIdentityIndexValue = NULL;
pagingDRX = NULL;
periodicRegUpdateTimer = NULL;
micoModeInd = NULL;
tai = NULL;
ueIdentityIndexValue = nullptr;
pagingDRX = nullptr;
periodicRegUpdateTimer = nullptr;
micoModeInd = nullptr;
tai = nullptr;
numoftai = 0;
}
......@@ -118,8 +118,10 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
ueIdentityIndexValue = new UEIdentityIndexValue();
periodicRegUpdateTimer = new PeriodicRegistrationUpdateTimer();
if (ueIdentityIndexValue == nullptr)
ueIdentityIndexValue = new UEIdentityIndexValue();
if (periodicRegUpdateTimer == nullptr)
periodicRegUpdateTimer = new PeriodicRegistrationUpdateTimer();
if (!ueIdentityIndexValue->decodefromUEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
......
......@@ -39,6 +39,7 @@ CriticalityDiagnostics::CriticalityDiagnostics() {
triggeringMessageIsSet = false;
procedureCriticalityIsSet = false;
numberOfIEsCriticalityDiagnostics = 0;
iEsCriticalityDiagnostics = nullptr;
}
//------------------------------------------------------------------------------
......
......@@ -76,8 +76,10 @@ bool DLQoSFlowPerTNLInformation::encode2DLQoSFlowPerTNLInformation(
//------------------------------------------------------------------------------
bool DLQoSFlowPerTNLInformation::decodefromDLQoSFlowPerTNLInformation(
Ngap_QosFlowPerTNLInformation_t* qosFlowPerTNLInformation) {
uPTransportLayerInformation = new UpTransportLayerInformation();
associatedQosFlowList = new AssociatedQosFlowList();
if (uPTransportLayerInformation == nullptr)
uPTransportLayerInformation = new UpTransportLayerInformation();
if (associatedQosFlowList == nullptr)
associatedQosFlowList = new AssociatedQosFlowList();
if (!uPTransportLayerInformation->decodefromUpTransportLayerInformation(
qosFlowPerTNLInformation->uPTransportLayerInformation))
return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
DefaultPagingDRX::DefaultPagingDRX() {}
DefaultPagingDRX::DefaultPagingDRX() {
pagingDrx = 0;
}
//------------------------------------------------------------------------------
DefaultPagingDRX::~DefaultPagingDRX() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
DelayCritical::DelayCritical() {}
DelayCritical::DelayCritical() {
delaycritical = 0;
}
//------------------------------------------------------------------------------
DelayCritical::~DelayCritical() {}
......
......@@ -144,9 +144,9 @@ bool Dynamic5QIDescriptor::encode2Dynamic5QIDescriptor(
//------------------------------------------------------------------------------
bool Dynamic5QIDescriptor::decodefromDynamic5QIDescriptor(
Ngap_Dynamic5QIDescriptor_t* dynamic5QIDescriptor) {
priorityLevelQos = new PriorityLevelQos();
packetDelayBudget = new PacketDelayBudget();
packetErrorRate = new PacketErrorRate();
if (priorityLevelQos == nullptr) priorityLevelQos = new PriorityLevelQos();
if (packetDelayBudget == nullptr) packetDelayBudget = new PacketDelayBudget();
if (packetErrorRate == nullptr) packetErrorRate = new PacketErrorRate();
if (!priorityLevelQos->decodefromPriorityLevelQos(
&dynamic5QIDescriptor->priorityLevelQos))
return false;
......
......@@ -59,8 +59,8 @@ bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
//------------------------------------------------------------------------------
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
plmnId = new PlmnId();
eUTRACellIdentity = new EUTRACellIdentity();
if (plmnId == nullptr) plmnId = new PlmnId();
if (eUTRACellIdentity == nullptr) eUTRACellIdentity = new EUTRACellIdentity();
if (!plmnId->decodefromoctetstring(eutra_cgi->pLMNIdentity)) return false;
if (!eUTRACellIdentity->decodefrombitstring(eutra_cgi->eUTRACellIdentity))
return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
FiveQI::FiveQI() {}
FiveQI::FiveQI() {
fiveqi = 0;
}
//------------------------------------------------------------------------------
FiveQI::~FiveQI() {}
......
......@@ -35,9 +35,13 @@ namespace ngap {
//------------------------------------------------------------------------------
GBR_QosInformation::GBR_QosInformation() {
notificationControl = NULL;
maximumPacketLossRateDL = NULL;
maximumPacketLossRateUL = NULL;
notificationControl = nullptr;
maximumPacketLossRateDL = nullptr;
maximumPacketLossRateUL = nullptr;
maximumFlowBitRateDL = 0;
maximumFlowBitRateUL = 0;
guaranteedFlowBitRateDL = 0;
guaranteedFlowBitRateUL = 0;
}
//------------------------------------------------------------------------------
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
GNB_ID::GNB_ID() {}
GNB_ID::GNB_ID() {
gNBId = {};
}
//------------------------------------------------------------------------------
GNB_ID::~GNB_ID() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
GtpTeid::GtpTeid() {}
GtpTeid::GtpTeid() {
gtp_teid = 0;
}
//------------------------------------------------------------------------------
GtpTeid::~GtpTeid() {}
......
......@@ -66,10 +66,10 @@ bool GUAMI::encode2GUAMI(Ngap_GUAMI_t* guami) {
//------------------------------------------------------------------------------
bool GUAMI::decodefromGUAMI(Ngap_GUAMI_t* pdu) {
plmnId = new PlmnId();
aMFRegionID = new AMFRegionID();
aMFSetID = new AMFSetID();
aMFPointer = new AMFPointer();
if (plmnId == nullptr) plmnId = new PlmnId();
if (aMFRegionID == nullptr) aMFRegionID = new AMFRegionID();
if (aMFSetID == nullptr) aMFSetID = new AMFSetID();
if (aMFPointer == nullptr) aMFPointer = new AMFPointer();
if (!plmnId->decodefromoctetstring(pdu->pLMNIdentity)) return false;
if (!aMFRegionID->decodefrombitstring(pdu->aMFRegionID)) return false;
if (!aMFSetID->decodefrombitstring(pdu->aMFSetID)) return false;
......
......@@ -58,8 +58,8 @@ bool GlobalgNBId::encode2GlobalgNBId(Ngap_GlobalGNB_ID_t* globalgnbid) {
//------------------------------------------------------------------------------
bool GlobalgNBId::decodefromGlobalgNBId(Ngap_GlobalGNB_ID_t* globalgnbid) {
plmnId = new PlmnId();
gNB_ID = new GNB_ID();
if (plmnId == nullptr) plmnId = new PlmnId();
if (gNB_ID == nullptr) gNB_ID = new GNB_ID();
if (!plmnId->decodefromoctetstring(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID->decodefrombitstring(globalgnbid->gNB_ID)) return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
IndexToRFSP::IndexToRFSP() {}
IndexToRFSP::IndexToRFSP() {
indexToRFSP = 0;
}
//------------------------------------------------------------------------------
IndexToRFSP::~IndexToRFSP() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
IntegrityProtectionIndication::IntegrityProtectionIndication() {}
IntegrityProtectionIndication::IntegrityProtectionIndication() {
indication = 0;
}
//------------------------------------------------------------------------------
IntegrityProtectionIndication::~IntegrityProtectionIndication() {}
......
......@@ -33,7 +33,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
MaximumDataBurstVolume::MaximumDataBurstVolume() {}
MaximumDataBurstVolume::MaximumDataBurstVolume() {
maximumdataburstvolume = 0;
}
//------------------------------------------------------------------------------
MaximumDataBurstVolume::~MaximumDataBurstVolume() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
MaximumIntegrityProtectedDataRate::MaximumIntegrityProtectedDataRate() {}
MaximumIntegrityProtectedDataRate::MaximumIntegrityProtectedDataRate() {
maxintprotdatarate = 0;
}
//------------------------------------------------------------------------------
MaximumIntegrityProtectedDataRate::~MaximumIntegrityProtectedDataRate() {}
......
......@@ -58,8 +58,8 @@ bool NR_CGI::encode2NR_CGI(Ngap_NR_CGI_t* nr_cgi) {
//------------------------------------------------------------------------------
bool NR_CGI::decodefromNR_CGI(Ngap_NR_CGI_t* nr_cgi) {
plmnId = new PlmnId();
nRCellIdentity = new NRCellIdentity();
if (plmnId == nullptr) plmnId = new PlmnId();
if (nRCellIdentity == nullptr) nRCellIdentity = new NRCellIdentity();
if (!plmnId->decodefromoctetstring(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity->decodefrombitstring(nr_cgi->nRCellIdentity))
return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
NetworkInstance::NetworkInstance() {}
NetworkInstance::NetworkInstance() {
networkinstance = 0;
}
//------------------------------------------------------------------------------
NetworkInstance::~NetworkInstance() {}
......
......@@ -109,7 +109,7 @@ bool NonDynamic5QIDescriptor::encode2NonDynamic5QIDescriptor(
//------------------------------------------------------------------------------
bool NonDynamic5QIDescriptor::decodefromNonDynamic5QIDescriptor(
Ngap_NonDynamic5QIDescriptor_t* nonDynamic5QIDescriptor) {
fiveQI = new FiveQI();
if (fiveQI == nullptr) fiveQI = new FiveQI();
if (!fiveQI->decodefromFiveQI(&nonDynamic5QIDescriptor->fiveQI)) return false;
if (nonDynamic5QIDescriptor->priorityLevelQos) {
priorityLevelQos = new PriorityLevelQos();
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
NotificationControl::NotificationControl() {}
NotificationControl::NotificationControl() {
notificationcontrol = 0;
}
//------------------------------------------------------------------------------
NotificationControl::~NotificationControl() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionID::PDUSessionID() {}
PDUSessionID::PDUSessionID() {
pdusessionid = 0;
}
//------------------------------------------------------------------------------
PDUSessionID::~PDUSessionID() {}
......
......@@ -46,10 +46,10 @@ bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(
return true;
}
//�����......
bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
return false;
......
......@@ -74,7 +74,7 @@ bool PDUSessionResourceFailedToSetupItemCxtFail::
decodefromPDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemCxtFail->pDUSessionID))
return false;
......
......@@ -74,7 +74,7 @@ bool PDUSessionResourceFailedToSetupItemCxtRes::
decodefromPDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemCxtRes->pDUSessionID))
return false;
......
......@@ -74,7 +74,7 @@ bool PDUSessionResourceFailedToSetupItemSURes::
decodefromPDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemSURes->pDUSessionID))
return false;
......
......@@ -94,7 +94,7 @@ bool PDUSessionResourceHandoverRequiredTransfer::decodefromIE(
bool PDUSessionResourceHandoverRequiredTransfer::
getDirectForwardingPathAvailability(
long* directForwardingPathAvailability) {
directForwardingPathAvailability = DirectForwardingPathAvailability;
directForwardingPathAvailability = (long*) DirectForwardingPathAvailability;
return true;
}
......
......@@ -54,7 +54,7 @@ bool PDUSessionResourceItemHORqd::encode2PDUSessionResourceItemHORqd(
}
bool PDUSessionResourceItemHORqd::decodefromPDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t* pdUSessionResourceItemHORqd) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pdUSessionResourceItemHORqd->pDUSessionID))
return false;
......
......@@ -61,7 +61,7 @@ bool PDUSessionResourceReleaseItemCmd::
decodefromPDUSessionResourceReleaseItemCmd(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t*
pduSessionResourceReleaseCommandTransfer) {
pDUSessionID = new PDUSessionID();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceReleaseCommandTransfer->pDUSessionID))
return false;
......
......@@ -79,8 +79,9 @@ bool PDUSessionResourceReleasedItemRelRes::
decodefromPDUSessionResourceReleasedItemRelRes(
Ngap_PDUSessionResourceReleasedItemRelRes_t*
pduSessionResourceReleasedItemRelRes) {
pDUSessionID = new PDUSessionID();
pDUSessionID->setPDUSessionID(pduSessionResourceReleasedItemRelRes->pDUSessionID);
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
pDUSessionID->setPDUSessionID(
pduSessionResourceReleasedItemRelRes->pDUSessionID);
pDUSessionResourceReleaseResponseTransfer =
pduSessionResourceReleasedItemRelRes
->pDUSessionResourceReleaseResponseTransfer;
......
......@@ -69,7 +69,10 @@ bool PDUSessionResourceSetupItemCxtReq::
Ngap_NAS_PDU_t* naspdu =
(Ngap_NAS_PDU_t*) calloc(1, sizeof(Ngap_NAS_PDU_t));
if (!naspdu) return false;
if (!nAS_PDU->encode2octetstring(*naspdu)) return false;
if (!nAS_PDU->encode2octetstring(*naspdu)) {
if (naspdu != nullptr) free(naspdu);
return false;
}
pduSessionResourceSetupItemCxtReq->nAS_PDU = naspdu;
cout << "encode2pdu nas-pdu over" << endl;
}
......@@ -88,8 +91,8 @@ bool PDUSessionResourceSetupItemCxtReq::
decodefromPDUSessionResourceSetupItemCxtReq(
Ngap_PDUSessionResourceSetupItemCxtReq_t*
pduSessionResourceSetupItemCxtReq) {
pDUSessionID = new PDUSessionID();
s_NSSAI = new S_NSSAI();
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (s_NSSAI == nullptr) s_NSSAI = new S_NSSAI();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceSetupItemCxtReq->pDUSessionID))
return false;
......@@ -98,7 +101,7 @@ bool PDUSessionResourceSetupItemCxtReq::
return false;
if (pduSessionResourceSetupItemCxtReq->nAS_PDU) {
nAS_PDU = new NAS_PDU();
if (nAS_PDU == nullptr) nAS_PDU = new NAS_PDU();
if (!nAS_PDU->decodefromoctetstring(
*pduSessionResourceSetupItemCxtReq->nAS_PDU))
return false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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