Commit 41822e76 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'ngap_cleanup' into 'develop'

Code cleanup for NGAP messages

See merge request oai/cn5g/oai-cn5g-amf!119
parents 4d752f46 8aeef1a2
......@@ -27,6 +27,7 @@
*/
#include "amf_module_from_config.hpp"
#include "common_defs.h"
#include <iostream>
#include <string>
......@@ -58,7 +59,7 @@ int amf_modules::load(const std::string& config_file) {
const Setting& modules = root[MODULES_CONFIG_STRING_AMF_MODULES];
} catch (const SettingNotFoundException& nfex) {
Logger::amf_app().error("%s : %s", nfex.what(), nfex.getPath());
return -1;
return RETURNerror;
}
const Setting& modules = root[MODULES_CONFIG_STRING_AMF_MODULES];
const Setting& msg = modules[MODULES_CONFIG_STRING_AMF_MODULES_NGAP_MESSAGE];
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/utils/)
include_directories(${SRC_TOP_DIR}/utils/bstr)
include_directories(${SRC_TOP_DIR}/ngap/libngap)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
include_directories(${SRC_TOP_DIR}/common/unicode)
file(GLOB COMMON_SRC ${SRC_TOP_DIR}/common/conversions.cpp)
......
......@@ -32,10 +32,6 @@
#include <arpa/inet.h>
#include <stdint.h>
#define RETURNclear (int) 2
#define RETURNerror (int) 1
#define RETURNok (int) 0
typedef enum {
/* Fatal errors - received message should not be processed */
TLV_MAC_MISMATCH = -14,
......@@ -52,12 +48,18 @@ typedef enum {
// RETURNerror = -1,
// RETURNok = 0,
TLV_ERROR_OK = RETURNok,
TLV_ERROR_OK = 0,
/* Defines error code limit below which received message should be discarded
* because it cannot be further processed */
TLV_FATAL_ERROR = TLV_VALUE_DOESNT_MATCH
} error_code_e;
typedef enum {
RETURNerror = -1,
RETURNok = 0,
} status_code_e;
//------------------------------------------------------------------------------
#define DECODE_U8(bUFFER, vALUE, sIZE) \
vALUE = *(uint8_t*) (bUFFER); \
......
......@@ -251,3 +251,14 @@ void conv::msg_str_2_msg_hex(std::string msg, bstring& b) {
conv::ascii_to_hex(msg_hex, (const char*) data);
b = blk2bstr(msg_hex, (msg_len / 2));
}
//------------------------------------------------------------------------------
void conv::octet_string_2_bstring(
const OCTET_STRING_t& octet_str, bstring& b_str) {
b_str = blk2bstr(octet_str.buf, octet_str.size);
}
//------------------------------------------------------------------------------
void conv::bstring_2_octet_string(bstring& b_str, OCTET_STRING_t& octet_str) {
OCTET_STRING_fromBuf(&octet_str, (char*) bdata(b_str), blength(b_str));
}
......@@ -39,6 +39,7 @@
extern "C" {
#include "dynamic_memory_check.h"
#include "OCTET_STRING.h"
}
/* Used to format an uint32_t containing an ipv4 address */
......@@ -70,5 +71,7 @@ class conv {
static unsigned char* format_string_as_hex(std::string str);
static void convert_string_2_hex(
std::string& input_str, std::string& output_str);
void octet_string_2_bstring(const OCTET_STRING_t& octet_str, bstring& b_str);
void bstring_2_octet_string(bstring& b_str, OCTET_STRING_t& octet_str);
};
#endif /* FILE_CONVERSIONS_HPP_SEEN */
......@@ -46,7 +46,6 @@ typedef enum {
} ng_ue_state_t;
class ue_ngap_context {
public:
public:
ue_ngap_context() {
ran_ue_ngap_id = 0;
......
#NGAP Library - CODEOWNERS
Keliang DU, BUPT
Niuxiansheng Niu, BUPT
Tien Thinh NGUYEN, Eurecom
......@@ -69,7 +69,6 @@ bool AmfName::encode2AmfName(Ngap_AMFName_t* amfNameIe) {
if (amfname)
if (OCTET_STRING_fromBuf(amfNameIe, amfname, strlen(amfname)) < 0)
return false;
return true;
}
......
......@@ -48,6 +48,11 @@ void AMFPointer::setAMFPointer(const std::string charPointer) {
pointer = fromString<int>(charPointer);
}
//------------------------------------------------------------------------------
void AMFPointer::setAMFPointer(const uint8_t& p) {
pointer = p;
}
//------------------------------------------------------------------------------
void AMFPointer::getAMFPointer(std::string& charPointer) {
charPointer = to_string(pointer);
......
......@@ -44,6 +44,7 @@ class AMFPointer {
void setAMFPointer(const std::string);
void getAMFPointer(std::string&);
void setAMFPointer(const uint8_t&);
bool encode2bitstring(Ngap_AMFPointer_t&);
bool decodefrombitstring(Ngap_AMFPointer_t&);
......
......@@ -48,6 +48,11 @@ void AMFRegionID::setAMFRegionID(const std::string charid) {
regionid = fromString<int>(charid);
}
//------------------------------------------------------------------------------
void AMFRegionID::setAMFRegionID(const uint8_t& id) {
regionid = id;
}
//------------------------------------------------------------------------------
void AMFRegionID::getAMFRegionID(std::string& charid) {
charid = to_string(regionid);
......
......@@ -45,6 +45,8 @@ class AMFRegionID {
void setAMFRegionID(const std::string);
void getAMFRegionID(std::string&);
void setAMFRegionID(const uint8_t&);
bool encode2bitstring(Ngap_AMFRegionID_t&);
bool decodefrombitstring(Ngap_AMFRegionID_t&);
......
......@@ -19,69 +19,61 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AMFSetID.hpp"
#include <iostream>
#include "String2Value.hpp"
using namespace std;
#include <string>
namespace ngap {
//------------------------------------------------------------------------------
AMFSetID::AMFSetID() {
setid = 0;
setId = 0;
}
//------------------------------------------------------------------------------
AMFSetID::~AMFSetID() {}
//------------------------------------------------------------------------------
void AMFSetID::setAMFSetID(const std::string charid) {
setid = fromString<uint16_t>(charid);
void AMFSetID::setAMFSetID(const std::string& charid) {
setId = fromString<uint16_t>(charid);
}
//------------------------------------------------------------------------------
void AMFSetID::setAMFSetID(const uint16_t set_id) {
setid = set_id;
void AMFSetID::setAMFSetID(const uint16_t& set_id) {
setId = set_id;
}
//------------------------------------------------------------------------------
void AMFSetID::getAMFSetID(std::string& charid) {
charid = to_string(setid);
charid = std::to_string(setId);
}
//------------------------------------------------------------------------------
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t& amfsetid) {
amfsetid.size = 2;
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t& amfSetId) {
amfSetId.size = 2;
uint8_t* buffer = (uint8_t*) calloc(1, sizeof(uint16_t));
if (!buffer) return false;
//*(uint16_t *)buffer = setid & 0x3ff;
buffer[0] = ((setid & 0x03fc) >> 2);
buffer[1] = ((setid & 0x0003) << 6);
amfsetid.buf = buffer;
amfsetid.bits_unused = 6;
//*(uint16_t *)buffer = setId & 0x3ff;
buffer[0] = ((setId & 0x03fc) >> 2);
buffer[1] = ((setId & 0x0003) << 6);
amfSetId.buf = buffer;
amfSetId.bits_unused = 6;
return true;
}
//------------------------------------------------------------------------------
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t& amfsetid) {
if (!amfsetid.buf) return false;
for (int i = 0; i < amfsetid.size; i++) {
printf("%x ", amfsetid.buf[i]);
bool AMFSetID::decodefrombitstring(Ngap_AMFSetID_t& amfSetId) {
if (!amfSetId.buf) return false;
for (int i = 0; i < amfSetId.size; i++) {
printf("%x ", amfSetId.buf[i]);
}
printf("\n");
uint16_t temp = 0;
temp |= amfsetid.buf[0] << 8;
temp |= amfsetid.buf[1];
setid = (temp & 0xffc0) >> 6; // 1111 1111 11 00 0000
temp |= amfSetId.buf[0] << 8;
temp |= amfSetId.buf[1];
setId = (temp & 0xffc0) >> 6; // 1111 1111 11 00 0000
return true;
}
......
......@@ -18,16 +18,8 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMFSETID_H_
#define _AMFSETID_H_
#ifndef _AMF_SET_ID_H_
#define _AMF_SET_ID_H_
#include <string>
......@@ -42,15 +34,15 @@ class AMFSetID {
AMFSetID();
virtual ~AMFSetID();
void setAMFSetID(const std::string);
void setAMFSetID(const uint16_t set_id);
void setAMFSetID(const std::string&);
void setAMFSetID(const uint16_t& set_id);
void getAMFSetID(std::string&);
bool encode2bitstring(Ngap_AMFSetID_t&);
bool decodefrombitstring(Ngap_AMFSetID_t&);
private:
uint16_t setid;
uint16_t setId;
};
} // namespace ngap
......
......@@ -19,58 +19,37 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "AllowedNssai.hpp"
extern "C" {
#include "Ngap_AllowedNSSAI-Item.h"
// #include "Ngap_SliceSupportItem.h"
}
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AllowedNSSAI::AllowedNSSAI() {
snssai = nullptr;
numofSnssai = 0;
}
AllowedNSSAI::AllowedNSSAI() {}
//------------------------------------------------------------------------------
AllowedNSSAI::~AllowedNSSAI() {}
//------------------------------------------------------------------------------
void AllowedNSSAI::setAllowedNSSAI(S_NSSAI* m_snssai, int m_numofsnssai) {
snssai = m_snssai;
numofSnssai = m_numofsnssai;
void AllowedNSSAI::setAllowedNSSAI(const std::vector<S_NSSAI>& list) {
allowedSnssaiList = list;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::getAllowedNSSAI(S_NSSAI*& m_snssai, int& m_numofsnssai) {
m_snssai = snssai;
m_numofsnssai = numofSnssai;
if (!snssai) return false;
if (!numofSnssai) return false;
return true;
void AllowedNSSAI::getAllowedNSSAI(std::vector<S_NSSAI>& list) {
list = allowedSnssaiList;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList) {
for (int i = 0; i < numofSnssai; i++) {
for (std::vector<S_NSSAI>::iterator it = std::begin(allowedSnssaiList);
it < std::end(allowedSnssaiList); ++it) {
Ngap_AllowedNSSAI_Item_t* allowednssaiitem =
(Ngap_AllowedNSSAI_Item_t*) calloc(1, sizeof(Ngap_AllowedNSSAI_Item_t));
if (!allowednssaiitem) return false;
if (!snssai[i].encode2S_NSSAI(&allowednssaiitem->s_NSSAI)) return false;
if (!it->encode2S_NSSAI(&allowednssaiitem->s_NSSAI)) return false;
if (ASN_SEQUENCE_ADD(&allowedNssaiList->list, allowednssaiitem) != 0)
return false;
}
......@@ -80,11 +59,11 @@ bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList) {
//------------------------------------------------------------------------------
bool AllowedNSSAI::decodefromAllowedNSSAI(
Ngap_AllowedNSSAI_t* allowedNssaiList) {
numofSnssai = allowedNssaiList->list.count;
snssai = new S_NSSAI[numofSnssai]();
for (int i = 0; i < numofSnssai; i++) {
if (!snssai[i].decodefromS_NSSAI(&allowedNssaiList->list.array[i]->s_NSSAI))
for (int i = 0; i < allowedNssaiList->list.count; i++) {
S_NSSAI snssai = {};
if (!snssai.decodefromS_NSSAI(&allowedNssaiList->list.array[i]->s_NSSAI))
return false;
allowedSnssaiList.push_back(snssai);
}
return true;
}
......
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ALLOWEDNSSAI_H_
#define _ALLOWEDNSSAI_H_
#ifndef _ALLOWED_NSSAI_H_
#define _ALLOWED_NSSAI_H_
#include "S-NSSAI.hpp"
#include <vector>
extern "C" {
#include "Ngap_AllowedNSSAI.h"
......@@ -42,14 +36,14 @@ class AllowedNSSAI {
AllowedNSSAI();
virtual ~AllowedNSSAI();
void setAllowedNSSAI(S_NSSAI* m_snssai, int m_numofsnssai);
bool getAllowedNSSAI(S_NSSAI*& m_snssai, int& m_numofsnssai);
void setAllowedNSSAI(const std::vector<S_NSSAI>& list);
void getAllowedNSSAI(std::vector<S_NSSAI>& list);
bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList);
bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList);
private:
S_NSSAI* snssai;
int numofSnssai;
std::vector<S_NSSAI> allowedSnssaiList;
};
} // namespace ngap
#endif
......@@ -21,7 +21,7 @@
/*! \file
\brief
\author Keliang DU, BUPT
\author
\date 2020
\email: contact@openairinterface.org
*/
......@@ -42,42 +42,36 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
BroadcastPLMNItem::BroadcastPLMNItem() {
plmn = nullptr;
snssai = nullptr;
numOfSnssai = 0;
}
BroadcastPLMNItem::BroadcastPLMNItem() {}
//------------------------------------------------------------------------------
BroadcastPLMNItem::~BroadcastPLMNItem() {}
//------------------------------------------------------------------------------
void BroadcastPLMNItem::setPlmnSliceSupportList(
PlmnId* m_plmn, S_NSSAI* m_snssai, int num) {
plmn = m_plmn;
snssai = m_snssai;
numOfSnssai = num;
const PlmnId& m_plmn, const std::vector<S_NSSAI>& sliceList) {
plmn = m_plmn;
supportedSliceList = sliceList;
}
//------------------------------------------------------------------------------
void BroadcastPLMNItem::getPlmnSliceSupportList(
PlmnId*& m_plmn, S_NSSAI*& m_snssai, int& snssainum) {
PlmnId& m_plmn, std::vector<S_NSSAI>& sliceList) {
m_plmn = plmn;
m_snssai = snssai;
snssainum = numOfSnssai;
sliceList = supportedSliceList;
}
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* plmnItem) {
if (!plmn) return false;
if (!snssai) return false;
if (!plmn->encode2octetstring(plmnItem->pLMNIdentity)) return false;
for (int i = 0; i < numOfSnssai; i++) {
if (!plmn.encode2octetstring(plmnItem->pLMNIdentity)) return false;
for (std::vector<S_NSSAI>::iterator it = std::begin(supportedSliceList);
it < std::end(supportedSliceList); ++it) {
Ngap_SliceSupportItem_t* slice =
(Ngap_SliceSupportItem_t*) calloc(1, sizeof(Ngap_SliceSupportItem_t));
if (!slice) return false;
if (!snssai[i].encode2S_NSSAI(&slice->s_NSSAI)) return false;
if (!it->encode2S_NSSAI(&slice->s_NSSAI)) return false;
if (ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0)
return false;
}
......@@ -87,14 +81,13 @@ bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* pdu) {
if (plmn == nullptr) plmn = new PlmnId();
if (!plmn->decodefromoctetstring(pdu->pLMNIdentity)) return false;
numOfSnssai = pdu->tAISliceSupportList.list.count;
if (snssai == nullptr) snssai = new S_NSSAI[numOfSnssai]();
for (int i = 0; i < numOfSnssai; i++) {
if (!snssai[i].decodefromS_NSSAI(
if (!plmn.decodefromoctetstring(pdu->pLMNIdentity)) return false;
for (int i = 0; i < pdu->tAISliceSupportList.list.count; i++) {
S_NSSAI snssai = {};
if (!snssai.decodefromS_NSSAI(
&pdu->tAISliceSupportList.list.array[i]->s_NSSAI))
return false;
supportedSliceList.push_back(snssai);
}
return true;
}
......
......@@ -31,6 +31,7 @@
#include "PlmnId.hpp"
#include "S-NSSAI.hpp"
#include <vector>
extern "C" {
#include "Ngap_BroadcastPLMNItem.h"
......@@ -43,16 +44,17 @@ class BroadcastPLMNItem {
BroadcastPLMNItem();
virtual ~BroadcastPLMNItem();
void setPlmnSliceSupportList(PlmnId* m_plmn, S_NSSAI* snssai, int num);
void getPlmnSliceSupportList(
PlmnId*& m_plmn, S_NSSAI*& m_snssai, int& snssainum);
void setPlmnSliceSupportList(
const PlmnId& m_plmn, const std::vector<S_NSSAI>& sliceList);
void getPlmnSliceSupportList(PlmnId& m_plmn, std::vector<S_NSSAI>& sliceList);
bool encode2BroadcastPLMNItem(Ngap_BroadcastPLMNItem_t*);
bool decodefromBroadcastPLMNItem(Ngap_BroadcastPLMNItem_t* pdu);
private:
PlmnId* plmn;
S_NSSAI* snssai;
int numOfSnssai;
PlmnId plmn; // Mandatory
std::vector<S_NSSAI> supportedSliceList; // TAI Slice Support List
// (Mandatory)
};
} // namespace ngap
#endif
......@@ -27,9 +27,8 @@ extern "C" {
namespace ngap {
class COUNTValueForPDCP_SN18 {
private:
/* data */
long pdcp;
long hfn_pdcp;
long pdcp; // Mandatory (18 bits)
long hfn_pdcp; // Mandatory (14 bits)
public:
COUNTValueForPDCP_SN18(/* args */);
......
......@@ -39,12 +39,8 @@ namespace ngap {
//------------------------------------------------------------------------------
CoreNetworkAssistanceInfo::CoreNetworkAssistanceInfo() {
ueIdentityIndexValue = nullptr;
pagingDRX = nullptr;
periodicRegUpdateTimer = nullptr;
micoModeInd = nullptr;
tai = nullptr;
numoftai = 0;
pagingDRX = nullptr;
micoModeInd = nullptr;
}
//------------------------------------------------------------------------------
......@@ -52,52 +48,58 @@ CoreNetworkAssistanceInfo::~CoreNetworkAssistanceInfo() {}
//------------------------------------------------------------------------------
void CoreNetworkAssistanceInfo::setCoreNetworkAssistanceInfo(
UEIdentityIndexValue* m_ueIdentityIndexValue, DefaultPagingDRX* m_pagingDRX,
PeriodicRegistrationUpdateTimer* m_periodicRegUpdateTimer,
bool m_micoModeInd, TAI* m_tai, int m_numoftai) {
const UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX* m_pagingDRX,
const PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
const bool& m_micoModeInd, const std::vector<TAI>& m_tai) {
ueIdentityIndexValue = m_ueIdentityIndexValue;
pagingDRX = m_pagingDRX;
periodicRegUpdateTimer = m_periodicRegUpdateTimer;
if (m_micoModeInd) micoModeInd = new MICOModeIndication();
tai = m_tai;
numoftai = m_numoftai;
if (m_micoModeInd) {
micoModeInd = new MICOModeIndication();
}
}
//------------------------------------------------------------------------------
void CoreNetworkAssistanceInfo::setCoreNetworkAssistanceInfo(
UEIdentityIndexValue* m_ueIdentityIndexValue,
PeriodicRegistrationUpdateTimer* m_periodicRegUpdateTimer,
bool m_micoModeInd, TAI* m_tai, int m_numoftai) {
ueIdentityIndexValue = m_ueIdentityIndexValue;
periodicRegUpdateTimer = m_periodicRegUpdateTimer;
if (m_micoModeInd) micoModeInd = new MICOModeIndication();
tai = m_tai;
numoftai = m_numoftai;
void CoreNetworkAssistanceInfo::getCoreNetworkAssistanceInfo(
UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX*& m_pagingDRX,
PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
bool& m_micoModeInd, std::vector<TAI>& m_tai) {
m_ueIdentityIndexValue = ueIdentityIndexValue;
m_pagingDRX = pagingDRX;
m_periodicRegUpdateTimer = periodicRegUpdateTimer;
if (micoModeInd)
m_micoModeInd = true;
else
m_micoModeInd = false;
m_tai = taiList;
}
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
if (!ueIdentityIndexValue) return false;
if (!ueIdentityIndexValue->encode2UEIdentityIndexValue(
if (!ueIdentityIndexValue.encode2UEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
if (!periodicRegUpdateTimer) return false;
if (!periodicRegUpdateTimer->encode2PeriodicRegistrationUpdateTimer(
if (!periodicRegUpdateTimer.encode2PeriodicRegistrationUpdateTimer(
&coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
return false;
if (!tai) return false;
for (int i = 0; i < numoftai; i++) {
for (std::vector<TAI>::iterator it = std::begin(taiList);
it < std::end(taiList); ++it) {
Ngap_TAIListForInactiveItem_t* taiListForInactiveItem =
(Ngap_TAIListForInactiveItem_t*) calloc(
1, sizeof(Ngap_TAIListForInactiveItem_t));
if (!taiListForInactiveItem) return false;
if (!tai[i].encode2TAI(&taiListForInactiveItem->tAI)) return false;
if (!it->encode2TAI(&taiListForInactiveItem->tAI)) return false;
if (ASN_SEQUENCE_ADD(
&coreNetworkAssistanceInformation->tAIListForInactive.list,
taiListForInactiveItem) != 0)
return false;
}
if (pagingDRX) {
Ngap_PagingDRX_t* pagingdrx =
(Ngap_PagingDRX_t*) calloc(1, sizeof(Ngap_PagingDRX_t));
......@@ -105,6 +107,7 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
if (!pagingDRX->encode2DefaultPagingDRX(*pagingdrx)) return false;
coreNetworkAssistanceInformation->uESpecificDRX = pagingdrx;
}
if (micoModeInd) {
Ngap_MICOModeIndication_t* micomodeindication =
(Ngap_MICOModeIndication_t*) calloc(
......@@ -121,30 +124,32 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
if (ueIdentityIndexValue == nullptr)
ueIdentityIndexValue = new UEIdentityIndexValue();
if (periodicRegUpdateTimer == nullptr)
periodicRegUpdateTimer = new PeriodicRegistrationUpdateTimer();
if (!ueIdentityIndexValue->decodefromUEIdentityIndexValue(
if (!ueIdentityIndexValue.decodefromUEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
if (!periodicRegUpdateTimer->decodefromPeriodicRegistrationUpdateTimer(
if (!periodicRegUpdateTimer.decodefromPeriodicRegistrationUpdateTimer(
&coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
return false;
numoftai = coreNetworkAssistanceInformation->tAIListForInactive.list.count;
if (tai == nullptr) tai = new TAI[numoftai]();
for (int i = 0; i < numoftai; i++) {
if (!tai[i].decodefromTAI(
for (int i = 0;
i < coreNetworkAssistanceInformation->tAIListForInactive.list.count;
i++) {
TAI tai_item = {};
if (!tai_item.decodefromTAI(
&coreNetworkAssistanceInformation->tAIListForInactive.list.array[i]
->tAI))
return false;
taiList.push_back(tai_item);
}
if (coreNetworkAssistanceInformation->uESpecificDRX) {
if (pagingDRX == nullptr) pagingDRX = new DefaultPagingDRX();
if (!pagingDRX->decodefromDefaultPagingDRX(
*(coreNetworkAssistanceInformation->uESpecificDRX)))
return false;
}
if (coreNetworkAssistanceInformation->mICOModeIndication) {
if (micoModeInd == nullptr) micoModeInd = new MICOModeIndication();
if (!micoModeInd->decodefromMICOModeIndication(
......@@ -155,20 +160,4 @@ bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
return true;
}
//------------------------------------------------------------------------------
void CoreNetworkAssistanceInfo::getCoreNetworkAssistanceInfo(
UEIdentityIndexValue*& m_ueIdentityIndexValue,
DefaultPagingDRX*& m_pagingDRX,
PeriodicRegistrationUpdateTimer*& m_periodicRegUpdateTimer,
bool& m_micoModeInd, TAI*& m_tai, int& m_numoftai) {
m_ueIdentityIndexValue = ueIdentityIndexValue;
m_pagingDRX = pagingDRX;
m_periodicRegUpdateTimer = periodicRegUpdateTimer;
if (micoModeInd)
m_micoModeInd = true;
else
m_micoModeInd = false;
m_tai = tai;
m_numoftai = numoftai;
}
} // namespace ngap
......@@ -47,19 +47,16 @@ class CoreNetworkAssistanceInfo {
virtual ~CoreNetworkAssistanceInfo();
void setCoreNetworkAssistanceInfo(
UEIdentityIndexValue* m_ueIdentityIndexValue,
const UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX* m_pagingDRX,
PeriodicRegistrationUpdateTimer* m_periodicRegUpdateTimer,
bool m_micoModeInd, TAI* m_tai, int m_numoftai);
void setCoreNetworkAssistanceInfo(
UEIdentityIndexValue* m_ueIdentityIndexValue,
PeriodicRegistrationUpdateTimer* m_periodicRegUpdateTimer,
bool m_micoModeInd, TAI* m_tai, int m_numoftai);
const PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
const bool& m_micoModeInd, const std::vector<TAI>& m_tai);
void getCoreNetworkAssistanceInfo(
UEIdentityIndexValue*& m_ueIdentityIndexValue,
UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX*& m_pagingDRX,
PeriodicRegistrationUpdateTimer*& m_periodicRegUpdateTimer,
bool& m_micoModeInd, TAI*& m_tai, int& m_numoftai);
PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
bool& m_micoModeInd, std::vector<TAI>& m_tai);
bool encode2CoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t*
coreNetworkAssistanceInformation);
......@@ -68,12 +65,13 @@ class CoreNetworkAssistanceInfo {
coreNetworkAssistanceInformation);
private:
UEIdentityIndexValue* ueIdentityIndexValue;
DefaultPagingDRX* pagingDRX;
PeriodicRegistrationUpdateTimer* periodicRegUpdateTimer;
MICOModeIndication* micoModeInd;
TAI* tai;
int numoftai;
UEIdentityIndexValue ueIdentityIndexValue; // Mandatory
DefaultPagingDRX* pagingDRX; // UE Specific DRX, Optional
PeriodicRegistrationUpdateTimer periodicRegUpdateTimer; // Mandatory
MICOModeIndication* micoModeInd; // Optional
std::vector<TAI> taiList; // Mandatory
// int numoftai;
// TODO: Expected UE Behaviour (Optional)
};
} // namespace ngap
......
......@@ -66,8 +66,9 @@ void FiveGSTmsi::getValue(
//------------------------------------------------------------------------------
void FiveGSTmsi::setValue(
std::string& setid, std::string& pointer, std::string& tmsi) {
amfSetid.setAMFSetID(setid);
const std::string& setId, const std::string& pointer,
const std::string& tmsi) {
amfSetid.setAMFSetID(setId);
amfPointer.setAMFPointer(pointer);
_5g_s_tmsi = tmsi;
}
......
......@@ -47,8 +47,10 @@ class FiveGSTmsi {
public:
bool decodefrompdu(Ngap_FiveG_S_TMSI_t pdu);
void getValue(std::string& value);
void getValue(std::string& setid, std::string& pointer, std::string& tmsi);
void setValue(std::string& setid, std::string& pointer, std::string& tmsi);
void getValue(std::string& setId, std::string& pointer, std::string& tmsi);
void setValue(
const std::string& setId, const std::string& pointer,
const std::string& tmsi);
bool encode2pdu(Ngap_FiveG_S_TMSI_t* pdu);
private:
......
......@@ -34,57 +34,79 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
GUAMI::GUAMI() {
plmnId = NULL;
aMFRegionID = NULL;
aMFSetID = NULL;
aMFPointer = NULL;
}
GUAMI::GUAMI() {}
//------------------------------------------------------------------------------
GUAMI::~GUAMI() {}
//------------------------------------------------------------------------------
void GUAMI::setGUAMI(
PlmnId* m_plmnId, AMFRegionID* m_aMFRegionID, AMFSetID* m_aMFSetID,
AMFPointer* m_aMFPointer) {
const PlmnId& m_plmnId, const AMFRegionID& m_aMFRegionID,
const AMFSetID& m_aMFSetID, const AMFPointer& m_aMFPointer) {
plmnId = m_plmnId;
aMFRegionID = m_aMFRegionID;
aMFSetID = m_aMFSetID;
aMFPointer = m_aMFPointer;
}
//------------------------------------------------------------------------------
void GUAMI::setGUAMI(
const std::string& mcc, const std::string& mnc, const uint8_t& regionId,
const uint16_t& setId, const uint8_t& pointer) {
plmnId.setMccMnc(mcc, mnc);
aMFRegionID.setAMFRegionID(regionId);
aMFSetID.setAMFSetID(setId);
aMFPointer.setAMFPointer(pointer);
}
//------------------------------------------------------------------------------
void GUAMI::setGUAMI(
const std::string& mcc, const std::string& mnc, const std::string& regionId,
const std::string& setId, const std::string& pointer) {
plmnId.setMccMnc(mcc, mnc);
aMFRegionID.setAMFRegionID(regionId);
aMFSetID.setAMFSetID(setId);
aMFPointer.setAMFPointer(pointer);
}
//------------------------------------------------------------------------------
bool GUAMI::encode2GUAMI(Ngap_GUAMI_t* guami) {
if (!plmnId->encode2octetstring(guami->pLMNIdentity)) return false;
if (!aMFRegionID->encode2bitstring(guami->aMFRegionID)) return false;
if (!aMFSetID->encode2bitstring(guami->aMFSetID)) return false;
if (!aMFPointer->encode2bitstring(guami->aMFPointer)) return false;
if (!plmnId.encode2octetstring(guami->pLMNIdentity)) return false;
if (!aMFRegionID.encode2bitstring(guami->aMFRegionID)) return false;
if (!aMFSetID.encode2bitstring(guami->aMFSetID)) return false;
if (!aMFPointer.encode2bitstring(guami->aMFPointer)) return false;
return true;
}
//------------------------------------------------------------------------------
bool GUAMI::decodefromGUAMI(Ngap_GUAMI_t* pdu) {
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;
if (!aMFPointer->decodefrombitstring(pdu->aMFPointer)) return false;
if (!plmnId.decodefromoctetstring(pdu->pLMNIdentity)) return false;
if (!aMFRegionID.decodefrombitstring(pdu->aMFRegionID)) return false;
if (!aMFSetID.decodefrombitstring(pdu->aMFSetID)) return false;
if (!aMFPointer.decodefrombitstring(pdu->aMFPointer)) return false;
return true;
}
//------------------------------------------------------------------------------
void GUAMI::getGUAMI(
PlmnId*& m_plmnId, AMFRegionID*& m_aMFRegionID, AMFSetID*& m_aMFSetID,
AMFPointer*& m_aMFPointer) {
PlmnId& m_plmnId, AMFRegionID& m_aMFRegionID, AMFSetID& m_aMFSetID,
AMFPointer& m_aMFPointer) {
m_plmnId = plmnId;
m_aMFRegionID = aMFRegionID;
m_aMFSetID = aMFSetID;
m_aMFPointer = aMFPointer;
}
void GUAMI::getGUAMI(
std::string& mcc, std::string& mnc, std::string& regionId,
std::string& setId, std::string& pointer) {
plmnId.getMcc(mcc);
plmnId.getMnc(mnc);
aMFRegionID.getAMFRegionID(regionId);
aMFSetID.getAMFSetID(setId);
aMFPointer.getAMFPointer(pointer);
}
} // namespace ngap
......@@ -46,20 +46,32 @@ class GUAMI {
virtual ~GUAMI();
void setGUAMI(
PlmnId* m_plmnId, AMFRegionID* m_aMFRegionID, AMFSetID* m_aMFSetID,
AMFPointer* m_aMFPointer);
const PlmnId& m_plmnId, const AMFRegionID& m_aMFRegionID,
const AMFSetID& m_aMFSetID, const AMFPointer& m_aMFPointer);
void setGUAMI(
const std::string& mcc, const std::string& mnc, const uint8_t& regionId,
const uint16_t& setId, const uint8_t& pointer);
void setGUAMI(
const std::string& mcc, const std::string& mnc,
const std::string& regionId, const std::string& setId,
const std::string& pointer);
void getGUAMI(
PlmnId& m_plmnId, AMFRegionID& m_aMFRegionID, AMFSetID& m_aMFSetID,
AMFPointer& m_aMFPointer);
void getGUAMI(
PlmnId*& m_plmnId, AMFRegionID*& m_aMFRegionID, AMFSetID*& m_aMFSetID,
AMFPointer*& m_aMFPointer);
std::string& mcc, std::string& mnc, std::string& regionId,
std::string& setId, std::string& pointer);
bool encode2GUAMI(Ngap_GUAMI_t* guami);
bool decodefromGUAMI(Ngap_GUAMI_t* pdu);
private:
PlmnId* plmnId;
AMFRegionID* aMFRegionID;
AMFSetID* aMFSetID;
AMFPointer* aMFPointer;
PlmnId plmnId; // Mandatory
AMFRegionID aMFRegionID; // Mandatory
AMFSetID aMFSetID; // Mandatory
AMFPointer aMFPointer; // Mandatory
};
} // namespace ngap
......
......@@ -19,31 +19,20 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "GlobalRanNodeId.hpp"
#include <iostream>
using namespace std;
#include "logger.hpp"
namespace ngap {
//------------------------------------------------------------------------------
GlobalRanNodeId::GlobalRanNodeId() {
globalgNBId = NULL;
}
GlobalRanNodeId::GlobalRanNodeId() {}
//------------------------------------------------------------------------------
GlobalRanNodeId::~GlobalRanNodeId() {}
//------------------------------------------------------------------------------
void GlobalRanNodeId::setChoiceOfRanNodeId(
Ngap_GlobalRANNodeID_PR m_idPresent) {
const Ngap_GlobalRANNodeID_PR& m_idPresent) {
idPresent = m_idPresent;
}
......@@ -53,13 +42,13 @@ Ngap_GlobalRANNodeID_PR GlobalRanNodeId::getChoiceOfRanNodeId() {
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::setGlobalgNBID(GlobalgNBId* m_globalgNBId) {
void GlobalRanNodeId::setGlobalgNBID(const GlobalgNBId& m_globalgNBId) {
globalgNBId = m_globalgNBId;
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::getGlobalgNBID(GlobalgNBId*& ptr) {
ptr = globalgNBId;
void GlobalRanNodeId::getGlobalgNBID(GlobalgNBId& id) {
id = globalgNBId;
}
//------------------------------------------------------------------------------
......@@ -72,7 +61,7 @@ bool GlobalRanNodeId::encode2GlobalRANNodeID(
Ngap_GlobalGNB_ID_t* globalGNB_ID =
(Ngap_GlobalGNB_ID_t*) calloc(1, sizeof(struct Ngap_GlobalGNB_ID));
if (!globalGNB_ID) return false;
if (!globalgNBId->encode2GlobalgNBId(globalGNB_ID)) return false;
if (!globalgNBId.encode2GlobalgNBId(globalGNB_ID)) return false;
globalRANNodeID->choice.globalGNB_ID = globalGNB_ID;
break;
}
......@@ -83,7 +72,7 @@ bool GlobalRanNodeId::encode2GlobalRANNodeID(
break;
}
default:
cout << "[Warning] GlobalRanNodeId Present encode error!" << endl;
Logger::ngap().warn("GlobalRanNodeId Present encode error!");
return false;
}
return true;
......@@ -95,22 +84,21 @@ bool GlobalRanNodeId::decodefromGlobalRANNodeID(
idPresent = globalRANNodeID->present;
switch (idPresent) {
case Ngap_GlobalRANNodeID_PR_globalGNB_ID: {
globalgNBId = new GlobalgNBId();
if (!globalgNBId->decodefromGlobalgNBId(
if (!globalgNBId.decodefromGlobalgNBId(
globalRANNodeID->choice.globalGNB_ID))
return false;
break;
}
case Ngap_GlobalRANNodeID_PR_globalNgENB_ID: {
cout << "[Warning] GlobalRANNodeID Present is globalNgENB!" << endl;
Logger::ngap().warn("GlobalRANNodeID Present is globalNgENB!");
break;
}
case Ngap_GlobalRANNodeID_PR_globalN3IWF_ID: {
cout << "[Warning] GlobalRanNodeId Present is globalN3IWF!" << endl;
Logger::ngap().warn("GlobalRANNodeID Present is globalN3IWF!");
break;
}
default:
cout << "[Warning] GlobalRanNodeId Present decode error!" << endl;
Logger::ngap().warn("GlobalRanNodeId Present decode error!");
return false;
}
return true;
......
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _GLOBALRANNODEID_H_
#define _GLOBALRANNODEID_H_
#ifndef _GLOBAL_RAN_NODE_ID_H_
#define _GLOBAL_RAN_NODE_ID_H_
extern "C" {
#include "Ngap_GlobalRANNodeID.h"
......@@ -42,15 +35,17 @@ class GlobalRanNodeId {
GlobalRanNodeId();
virtual ~GlobalRanNodeId();
void setChoiceOfRanNodeId(Ngap_GlobalRANNodeID_PR m_idPresent);
void setGlobalgNBID(GlobalgNBId*);
void setChoiceOfRanNodeId(const Ngap_GlobalRANNodeID_PR& m_idPresent);
Ngap_GlobalRANNodeID_PR getChoiceOfRanNodeId();
void setGlobalgNBID(const GlobalgNBId&);
void getGlobalgNBID(GlobalgNBId&);
bool encode2GlobalRANNodeID(Ngap_GlobalRANNodeID_t*);
bool decodefromGlobalRANNodeID(Ngap_GlobalRANNodeID_t*);
Ngap_GlobalRANNodeID_PR getChoiceOfRanNodeId();
void getGlobalgNBID(GlobalgNBId*&);
private:
GlobalgNBId* globalgNBId;
GlobalgNBId globalgNBId; // Mandatory
Ngap_GlobalRANNodeID_PR idPresent;
};
......
......@@ -19,56 +19,41 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "GlobalgNBId.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
GlobalgNBId::GlobalgNBId() {
plmnId = NULL;
gNB_ID = NULL;
}
GlobalgNBId::GlobalgNBId() {}
//------------------------------------------------------------------------------
GlobalgNBId::~GlobalgNBId() {}
//------------------------------------------------------------------------------
void GlobalgNBId::setGlobalgNBId(PlmnId* plmn, GNB_ID* gnbid) {
void GlobalgNBId::setGlobalgNBId(const PlmnId& plmn, const GNB_ID& gnbid) {
plmnId = plmn;
gNB_ID = gnbid;
}
//------------------------------------------------------------------------------
bool GlobalgNBId::encode2GlobalgNBId(Ngap_GlobalGNB_ID_t* globalgnbid) {
if (!plmnId->encode2octetstring(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID->encode2bitstring(globalgnbid->gNB_ID)) return false;
if (!plmnId.encode2octetstring(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID.encode2bitstring(globalgnbid->gNB_ID)) return false;
return true;
}
//------------------------------------------------------------------------------
bool GlobalgNBId::decodefromGlobalgNBId(Ngap_GlobalGNB_ID_t* globalgnbid) {
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;
if (!plmnId.decodefromoctetstring(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID.decodefrombitstring(globalgnbid->gNB_ID)) return false;
return true;
}
//------------------------------------------------------------------------------
void GlobalgNBId::getGlobalgNBId(PlmnId*& plmn, GNB_ID*& gnbid) {
if (plmnId) plmn = plmnId;
if (gNB_ID) gnbid = gNB_ID;
void GlobalgNBId::getGlobalgNBId(PlmnId& plmn, GNB_ID& gnbid) {
plmn = plmnId;
gnbid = gNB_ID;
}
} // namespace ngap
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _GlobalgNBId_H
#define _GlobalgNBId_H
#ifndef _GLOBAL_GNB_ID_H
#define _GLOBAL_GNB_ID_H
#include "GNB-ID.hpp"
#include "PlmnId.hpp"
......@@ -45,12 +38,13 @@ class GlobalgNBId {
bool encode2GlobalgNBId(Ngap_GlobalGNB_ID_t*);
bool decodefromGlobalgNBId(Ngap_GlobalGNB_ID_t*);
void setGlobalgNBId(PlmnId* plmn, GNB_ID* gnbid);
void getGlobalgNBId(PlmnId*& plmn, GNB_ID*& gnbid);
void setGlobalgNBId(const PlmnId& plmn, const GNB_ID& gnbid);
void getGlobalgNBId(PlmnId& plmn, GNB_ID& gnbid);
private:
PlmnId* plmnId;
GNB_ID* gNB_ID;
PlmnId plmnId; // Mandatory
GNB_ID gNB_ID; // Mandatory
};
} // namespace ngap
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _MICOMODEINDICATION_H_
#define _MICOMODEINDICATION_H_
......@@ -46,8 +39,6 @@ class MICOModeIndication {
bool encode2MICOModeIndication(Ngap_MICOModeIndication_t* micoModeIndication);
bool decodefromMICOModeIndication(
Ngap_MICOModeIndication_t* micoModeIndication);
// private:
// uint16_t indexLength10;
};
} // namespace ngap
......
......@@ -48,6 +48,13 @@ MessageType::MessageType() {
criticality = Ngap_Criticality_reject;
}
MessageType::MessageType(
Ngap_ProcedureCode_t m_procedureCode, Ngap_NGAP_PDU_PR m_typeOfMessage) {
criticality = Ngap_Criticality_reject;
procedureCode = m_procedureCode;
typeOfMessage = m_typeOfMessage;
}
//------------------------------------------------------------------------------
MessageType::~MessageType() {}
......
......@@ -43,6 +43,8 @@ namespace ngap {
class MessageType {
public:
MessageType();
MessageType(
Ngap_ProcedureCode_t m_procedureCode, Ngap_NGAP_PDU_PR m_typeOfMessage);
virtual ~MessageType();
int encode2pdu(Ngap_NGAP_PDU_t*&);
......
......@@ -32,19 +32,24 @@
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
MobilityRestrictionList::MobilityRestrictionList() {
Servingplmn = NULL;
}
MobilityRestrictionList::MobilityRestrictionList() {}
//------------------------------------------------------------------------------
MobilityRestrictionList::~MobilityRestrictionList() {}
//------------------------------------------------------------------------------
void MobilityRestrictionList::setMobilityRestrictionList(const PlmnId& sPLMN) {
servingPLMN = sPLMN;
}
//------------------------------------------------------------------------------
void MobilityRestrictionList::setMobilityRestrictionList(PlmnId* servingplmn) {
Servingplmn = servingplmn;
void MobilityRestrictionList::getMobilityRestrictionList(PlmnId& sPLMN) {
sPLMN = servingPLMN;
}
//------------------------------------------------------------------------------
bool MobilityRestrictionList::encodeMobilityRestrictionList(
Ngap_MobilityRestrictionList_t* mobilityrestrictionlist) {
if (!Servingplmn->encode2octetstring(mobilityrestrictionlist->servingPLMN)) {
if (!servingPLMN.encode2octetstring(mobilityrestrictionlist->servingPLMN)) {
return false;
}
return true;
......
......@@ -25,8 +25,8 @@
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _MOBILITYRESTRICETIONLIST_H_
#define _MOBILITYRESTRICETIONLIST_H_
#ifndef _MOBILITY_RESTRICTION_LIST_H_
#define _MOBILITYRESTRICTION_LIST_H_
#include "PlmnId.hpp"
extern "C" {
......@@ -37,12 +37,22 @@ class MobilityRestrictionList {
public:
MobilityRestrictionList();
virtual ~MobilityRestrictionList();
void setMobilityRestrictionList(PlmnId* servingplmn);
void setMobilityRestrictionList(const PlmnId& sPlmn);
void getMobilityRestrictionList(PlmnId& sPlmn);
bool encodeMobilityRestrictionList(
Ngap_MobilityRestrictionList_t* mobilityrestrictionlist);
private:
PlmnId* Servingplmn;
PlmnId servingPLMN; // Mandatory
// TODO: Equivalent PLMNs (optional)
// TODO: RAT Restrictions (optional)
// TODO: Forbidden Area Information (optional)
// TODO: Service Area Information (optional)
// TODO: Last E-UTRAN PLMN Identity (optional)
// TODO: Core Network Type Restriction for Serving PLMN (optional)
// TODO: Core Network Type Restriction for Equivalent PLMNs (optional)
};
} // namespace ngap
#endif
......@@ -34,41 +34,56 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
NR_CGI::NR_CGI() {
plmnId = NULL;
nRCellIdentity = NULL;
}
NR_CGI::NR_CGI() {}
//------------------------------------------------------------------------------
NR_CGI::~NR_CGI() {}
//------------------------------------------------------------------------------
void NR_CGI::setNR_CGI(PlmnId* m_plmnId, NRCellIdentity* m_nRCellIdentity) {
void NR_CGI::setNR_CGI(
const PlmnId& m_plmnId, const NRCellIdentity& m_nRCellIdentity) {
plmnId = m_plmnId;
nRCellIdentity = m_nRCellIdentity;
}
//------------------------------------------------------------------------------
void NR_CGI::setNR_CGI(
const std::string& mcc, const std::string& mnc,
const unsigned long& nrcellidentity) {
plmnId.setMccMnc(mcc, mnc);
nRCellIdentity.setNRCellIdentity(nrcellidentity);
}
//------------------------------------------------------------------------------
void NR_CGI::setNR_CGI(const struct NrCgi_s& cig) {
plmnId.setMccMnc(cig.mcc, cig.mnc);
nRCellIdentity.setNRCellIdentity(cig.nrCellID);
}
//------------------------------------------------------------------------------
void NR_CGI::getNR_CGI(struct NrCgi_s& cig) {
plmnId.getMcc(cig.mcc);
plmnId.getMnc(cig.mnc);
cig.nrCellID = nRCellIdentity.getNRCellIdentity();
}
//------------------------------------------------------------------------------
bool NR_CGI::encode2NR_CGI(Ngap_NR_CGI_t* nr_cgi) {
if (!plmnId->encode2octetstring(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity->encode2bitstring(nr_cgi->nRCellIdentity)) return false;
if (!plmnId.encode2octetstring(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity.encode2bitstring(nr_cgi->nRCellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
bool NR_CGI::decodefromNR_CGI(Ngap_NR_CGI_t* nr_cgi) {
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;
if (!plmnId.decodefromoctetstring(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity.decodefrombitstring(nr_cgi->nRCellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
void NR_CGI::getNR_CGI(PlmnId*& m_plmnId, NRCellIdentity*& m_nRCellIdentity) {
void NR_CGI::getNR_CGI(PlmnId& m_plmnId, NRCellIdentity& m_nRCellIdentity) {
m_plmnId = plmnId;
m_nRCellIdentity = nRCellIdentity;
}
......
......@@ -31,6 +31,7 @@
#include "NRCellIdentity.hpp"
#include "PlmnId.hpp"
#include "NgapIEsStruct.hpp"
extern "C" {
#include "Ngap_NR-CGI.h"
......@@ -43,14 +44,20 @@ class NR_CGI {
NR_CGI();
virtual ~NR_CGI();
void setNR_CGI(PlmnId*, NRCellIdentity*);
void setNR_CGI(const PlmnId&, const NRCellIdentity&);
void getNR_CGI(PlmnId&, NRCellIdentity&);
void setNR_CGI(
const std::string& mcc, const std::string& mnc,
const unsigned long& nrcellidentity);
void setNR_CGI(const struct NrCgi_s& cig);
void getNR_CGI(struct NrCgi_s& cig);
bool encode2NR_CGI(Ngap_NR_CGI_t*);
bool decodefromNR_CGI(Ngap_NR_CGI_t*);
void getNR_CGI(PlmnId*&, NRCellIdentity*&);
private:
PlmnId* plmnId;
NRCellIdentity* nRCellIdentity;
PlmnId plmnId; // Mandatory
NRCellIdentity nRCellIdentity; // Mandatory
};
} // namespace ngap
......
......@@ -42,6 +42,7 @@ class NRCellIdentity {
bool encode2bitstring(Ngap_NRCellIdentity_t& nRCellIdentity);
bool decodefrombitstring(Ngap_NRCellIdentity_t& nRCellIdentity);
unsigned long getNRCellIdentity();
void setNRCellIdentity(unsigned long m_nrcellidentity);
......
......@@ -21,48 +21,50 @@
#include "PDUSessionResourceAdmittedItem.hpp"
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceAdmittedItem::PDUSessionResourceAdmittedItem() {
pDUSessionID = NULL;
}
//------------------------------------------------------------------------------
PDUSessionResourceAdmittedItem::PDUSessionResourceAdmittedItem() {}
//------------------------------------------------------------------------------
PDUSessionResourceAdmittedItem::~PDUSessionResourceAdmittedItem() {}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedItem::setPDUSessionResourceAdmittedItem(
PDUSessionID* m_pDUSessionID, OCTET_STRING_t m_handoverrequestAcktransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_handoverRequestAckTransfer) {
pDUSessionID = m_pDUSessionID;
handoverrequestAcktransfer = m_handoverrequestAcktransfer;
handoverRequestAckTransfer = m_handoverRequestAckTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_handoverRequestAckTransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverRequestAckTransfer = handoverRequestAckTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
return false;
pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer =
handoverrequestAcktransfer;
handoverRequestAckTransfer;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
return false;
handoverrequestAcktransfer =
handoverRequestAckTransfer =
pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer;
return true;
}
void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_handoverrequestAcktransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverrequestAcktransfer = handoverrequestAcktransfer;
}
} // namespace ngap
......@@ -36,11 +36,11 @@ class PDUSessionResourceAdmittedItem {
virtual ~PDUSessionResourceAdmittedItem();
void setPDUSessionResourceAdmittedItem(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_handoverrequestAcktransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_handoverRequestAckTransfer);
void getPDUSessionResourceAdmittedItem(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_handoverrequestAcktransfer);
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_handoverRequestAckTransfer);
bool encode2PDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem);
......@@ -48,8 +48,8 @@ class PDUSessionResourceAdmittedItem {
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t handoverrequestAcktransfer;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t handoverRequestAckTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -21,56 +21,54 @@
#include "PDUSessionResourceAdmittedList.hpp"
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList() {
pduSessionResourceAdmittedItem = NULL;
numofSessionResourceAdmittedItem = 0;
}
//------------------------------------------------------------------------------
PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList() {}
//------------------------------------------------------------------------------
PDUSessionResourceAdmittedList::~PDUSessionResourceAdmittedList() {}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedList::setPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem* m_pduSessionResourceAdmittedItem, int num) {
pduSessionResourceAdmittedItem = m_pduSessionResourceAdmittedItem;
numofSessionResourceAdmittedItem = num;
const std::vector<PDUSessionResourceAdmittedItem>& list) {
admittedItemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(
std::vector<PDUSessionResourceAdmittedItem>& item) {
item = admittedItemList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedList::encode2PDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList) {
for (int i = 0; i < numofSessionResourceAdmittedItem; i++) {
for (auto& item : admittedItemList) {
Ngap_PDUSessionResourceAdmittedItem_t* response =
(Ngap_PDUSessionResourceAdmittedItem_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
if (!response) return false;
if (!pduSessionResourceAdmittedItem[i]
.encode2PDUSessionResourceAdmittedItem(response))
return false;
if (!item.encode2PDUSessionResourceAdmittedItem(response)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceAdmittedList->list, response) != 0)
return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedList::decodefromPDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList) {
numofSessionResourceAdmittedItem = pduSessionResourceAdmittedList->list.count;
pduSessionResourceAdmittedItem =
new PDUSessionResourceAdmittedItem[numofSessionResourceAdmittedItem]();
for (int i = 0; i < numofSessionResourceAdmittedItem; i++) {
if (!pduSessionResourceAdmittedItem[i]
.decodefromPDUSessionResourceAdmittedItem(
pduSessionResourceAdmittedList->list.array[i]))
for (int i = 0; i < pduSessionResourceAdmittedList->list.count; i++) {
PDUSessionResourceAdmittedItem item = {};
if (!item.decodefromPDUSessionResourceAdmittedItem(
pduSessionResourceAdmittedList->list.array[i]))
return false;
admittedItemList.push_back(item);
}
return true;
}
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem*& m_pduSessionResourceAdmittedItem,
int& num) {
m_pduSessionResourceAdmittedItem = pduSessionResourceAdmittedItem;
num = numofSessionResourceAdmittedItem;
}
} // namespace ngap
......@@ -36,11 +36,9 @@ class PDUSessionResourceAdmittedList {
virtual ~PDUSessionResourceAdmittedList();
void setPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem* m_pduSessionResourceAdmittedItem,
int num);
const std::vector<PDUSessionResourceAdmittedItem>& list);
void getPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem*& m_pduSessionResourceAdmittedItem,
int& num);
std::vector<PDUSessionResourceAdmittedItem>& list);
bool encode2PDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList);
......@@ -48,8 +46,7 @@ class PDUSessionResourceAdmittedList {
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList);
private:
PDUSessionResourceAdmittedItem* pduSessionResourceAdmittedItem;
int numofSessionResourceAdmittedItem;
std::vector<PDUSessionResourceAdmittedItem> admittedItemList;
};
} // namespace ngap
......
......@@ -19,25 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceFailedToSetupItemCxtFail.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemCxtFail::
PDUSessionResourceFailedToSetupItemCxtFail() {
pDUSessionID = NULL;
}
PDUSessionResourceFailedToSetupItemCxtFail() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemCxtFail::
......@@ -46,20 +34,29 @@ PDUSessionResourceFailedToSetupItemCxtFail::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtFail::
setPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtFail::
getPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtFail::
encode2PDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceFailedToSetupItemCxtFail->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemCxtFail
......@@ -74,8 +71,7 @@ bool PDUSessionResourceFailedToSetupItemCxtFail::
decodefromPDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemCxtFail->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
......@@ -85,14 +81,4 @@ bool PDUSessionResourceFailedToSetupItemCxtFail::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtFail::
getPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
} // namespace ngap
......@@ -43,10 +43,10 @@ class PDUSessionResourceFailedToSetupItemCxtFail {
virtual ~PDUSessionResourceFailedToSetupItemCxtFail();
void setPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemCxtFail(
......@@ -57,7 +57,7 @@ class PDUSessionResourceFailedToSetupItemCxtFail {
pduSessionResourceFailedToSetupItemCxtFail);
private:
PDUSessionID* pDUSessionID;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer;
};
......
......@@ -35,9 +35,7 @@ namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemCxtRes::
PDUSessionResourceFailedToSetupItemCxtRes() {
pDUSessionID = NULL;
}
PDUSessionResourceFailedToSetupItemCxtRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemCxtRes::
......@@ -46,20 +44,29 @@ PDUSessionResourceFailedToSetupItemCxtRes::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtRes::
setPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtRes::
getPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtRes::
encode2PDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceFailedToSetupItemCxtRes->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemCxtRes
......@@ -74,8 +81,7 @@ bool PDUSessionResourceFailedToSetupItemCxtRes::
decodefromPDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemCxtRes->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
......@@ -85,14 +91,4 @@ bool PDUSessionResourceFailedToSetupItemCxtRes::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtRes::
getPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
} // namespace ngap
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEFAILEDTOSETUPITEMCXTRES_H_
#define _PDUSESSIONRESOURCEFAILEDTOSETUPITEMCXTRES_H_
#ifndef _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_ITEM_CXT_RES_H_
#define _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_ITEM_CXT_RES_H_
#include "PDUSessionID.hpp"
......@@ -43,10 +36,10 @@ class PDUSessionResourceFailedToSetupItemCxtRes {
virtual ~PDUSessionResourceFailedToSetupItemCxtRes();
void setPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemCxtRes(
......@@ -57,8 +50,8 @@ class PDUSessionResourceFailedToSetupItemCxtRes {
pduSessionResourceFailedToSetupItemCxtRes);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -19,25 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceFailedToSetupItemSURes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemSURes::
PDUSessionResourceFailedToSetupItemSURes() {
pDUSessionID = NULL;
}
PDUSessionResourceFailedToSetupItemSURes() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupItemSURes::
......@@ -46,20 +34,29 @@ PDUSessionResourceFailedToSetupItemSURes::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemSURes::
setPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemSURes::
getPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemSURes::
encode2PDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceFailedToSetupItemSURes->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemSURes
......@@ -74,8 +71,7 @@ bool PDUSessionResourceFailedToSetupItemSURes::
decodefromPDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemSURes->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
......@@ -85,14 +81,4 @@ bool PDUSessionResourceFailedToSetupItemSURes::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemSURes::
getPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
}
} // namespace ngap
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEFAILEDTOSETUPITEMSURES_H_
#define _PDUSESSIONRESOURCEFAILEDTOSETUPITEMSURES_H_
#ifndef _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_ITEM_SU_RES_H_
#define _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_ITEM_SU_RES_H_
#include "PDUSessionID.hpp"
......@@ -43,10 +36,10 @@ class PDUSessionResourceFailedToSetupItemSURes {
virtual ~PDUSessionResourceFailedToSetupItemSURes();
void setPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupUnsuccessfulTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemSURes(
......@@ -57,7 +50,7 @@ class PDUSessionResourceFailedToSetupItemSURes {
pduSessionResourceFailedToSetupItemSURes);
private:
PDUSessionID* pDUSessionID;
PDUSessionID pDUSessionID;
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer;
};
......
......@@ -19,26 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceFailedToSetupListCxtFail.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListCxtFail::
PDUSessionResourceFailedToSetupListCxtFail() {
pduSessionResourceFailedToSetupItemCxtFail = NULL;
numofpduSessionResourceFailedToSetupItemCxtFail = 0;
}
PDUSessionResourceFailedToSetupListCxtFail() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListCxtFail::
......@@ -47,12 +34,15 @@ PDUSessionResourceFailedToSetupListCxtFail::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtFail::
setPDUSessionResourceFailedToSetupListCxtFail(
PDUSessionResourceFailedToSetupItemCxtFail*
m_pduSessionResourceFailedToSetupItemCxtFail,
int num) {
pduSessionResourceFailedToSetupItemCxtFail =
m_pduSessionResourceFailedToSetupItemCxtFail;
numofpduSessionResourceFailedToSetupItemCxtFail = num;
const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
itemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtFail::
getPDUSessionResourceFailedToSetupListCxtFail(
std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
list = itemList;
}
//------------------------------------------------------------------------------
......@@ -60,14 +50,14 @@ bool PDUSessionResourceFailedToSetupListCxtFail::
encode2PDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemCxtFail; i++) {
for (std::vector<PDUSessionResourceFailedToSetupItemCxtFail>::iterator it =
std::begin(itemList);
it < std::end(itemList); ++it) {
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t* failedToFailure =
(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t));
if (!failedToFailure) return false;
if (!pduSessionResourceFailedToSetupItemCxtFail[i]
.encode2PDUSessionResourceFailedToSetupItemCxtFail(
failedToFailure))
if (!it->encode2PDUSessionResourceFailedToSetupItemCxtFail(failedToFailure))
return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListCxtFail->list,
......@@ -83,30 +73,18 @@ bool PDUSessionResourceFailedToSetupListCxtFail::
decodefromPDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
numofpduSessionResourceFailedToSetupItemCxtFail =
pduSessionResourceFailedToSetupListCxtFail->list.count;
pduSessionResourceFailedToSetupItemCxtFail =
new PDUSessionResourceFailedToSetupItemCxtFail
[numofpduSessionResourceFailedToSetupItemCxtFail]();
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemCxtFail; i++) {
if (!pduSessionResourceFailedToSetupItemCxtFail[i]
.decodefromPDUSessionResourceFailedToSetupItemCxtFail(
pduSessionResourceFailedToSetupListCxtFail->list.array[i]))
itemList.reserve(pduSessionResourceFailedToSetupListCxtFail->list.count);
for (int i = 0; i < pduSessionResourceFailedToSetupListCxtFail->list.count;
i++) {
PDUSessionResourceFailedToSetupItemCxtFail itemCxtFail = {};
if (!itemCxtFail.decodefromPDUSessionResourceFailedToSetupItemCxtFail(
pduSessionResourceFailedToSetupListCxtFail->list.array[i]))
return false;
itemList.push_back(itemCxtFail);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtFail::
getPDUSessionResourceFailedToSetupListCxtFail(
PDUSessionResourceFailedToSetupItemCxtFail*&
m_pduSessionResourceFailedToSetupItemCxtFail,
int& num) {
m_pduSessionResourceFailedToSetupItemCxtFail =
pduSessionResourceFailedToSetupItemCxtFail;
num = numofpduSessionResourceFailedToSetupItemCxtFail;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEFAILEDTOSETUPLISTCXTFAIL_H_
#define _PDUSESSIONRESOURCEFAILEDTOSETUPLISTCXTFAIL_H_
#ifndef _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_CXT_FAIL_H_
#define _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_CXT_FAIL_H_
#include "PDUSessionResourceFailedToSetupItemCxtFail.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceFailedToSetupListCxtFail.h"
......@@ -43,13 +37,9 @@ class PDUSessionResourceFailedToSetupListCxtFail {
virtual ~PDUSessionResourceFailedToSetupListCxtFail();
void setPDUSessionResourceFailedToSetupListCxtFail(
PDUSessionResourceFailedToSetupItemCxtFail*
m_pduSessionResourceFailedToSetupItemCxtFail,
int num);
const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
void getPDUSessionResourceFailedToSetupListCxtFail(
PDUSessionResourceFailedToSetupItemCxtFail*&
m_pduSessionResourceFailedToSetupItemCxtFail,
int& num);
std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
bool encode2PDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
......@@ -59,9 +49,7 @@ class PDUSessionResourceFailedToSetupListCxtFail {
pduSessionResourceFailedToSetupListCxtFail);
private:
PDUSessionResourceFailedToSetupItemCxtFail*
pduSessionResourceFailedToSetupItemCxtFail;
int numofpduSessionResourceFailedToSetupItemCxtFail;
std::vector<PDUSessionResourceFailedToSetupItemCxtFail> itemList;
};
} // namespace ngap
......
......@@ -35,10 +35,7 @@ namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListCxtRes::
PDUSessionResourceFailedToSetupListCxtRes() {
pduSessionResourceFailedToSetupItemCxtRes = NULL;
numofpduSessionResourceFailedToSetupItemCxtRes = 0;
}
PDUSessionResourceFailedToSetupListCxtRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListCxtRes::
......@@ -47,12 +44,15 @@ PDUSessionResourceFailedToSetupListCxtRes::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtRes::
setPDUSessionResourceFailedToSetupListCxtRes(
PDUSessionResourceFailedToSetupItemCxtRes*
m_pduSessionResourceFailedToSetupItemCxtRes,
int num) {
pduSessionResourceFailedToSetupItemCxtRes =
m_pduSessionResourceFailedToSetupItemCxtRes;
numofpduSessionResourceFailedToSetupItemCxtRes = num;
const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
itemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtRes::
getPDUSessionResourceFailedToSetupListCxtRes(
std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
list = itemList;
}
//------------------------------------------------------------------------------
......@@ -60,14 +60,15 @@ bool PDUSessionResourceFailedToSetupListCxtRes::
encode2PDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemCxtRes; i++) {
for (std::vector<PDUSessionResourceFailedToSetupItemCxtRes>::iterator it =
std::begin(itemList);
it < std::end(itemList); ++it) {
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t* failedToResponse =
(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t));
if (!failedToResponse) return false;
if (!pduSessionResourceFailedToSetupItemCxtRes[i]
.encode2PDUSessionResourceFailedToSetupItemCxtRes(
failedToResponse))
if (!it->encode2PDUSessionResourceFailedToSetupItemCxtRes(failedToResponse))
return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListCxtRes->list,
......@@ -83,30 +84,17 @@ bool PDUSessionResourceFailedToSetupListCxtRes::
decodefromPDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
numofpduSessionResourceFailedToSetupItemCxtRes =
pduSessionResourceFailedToSetupListCxtRes->list.count;
pduSessionResourceFailedToSetupItemCxtRes =
new PDUSessionResourceFailedToSetupItemCxtRes
[numofpduSessionResourceFailedToSetupItemCxtRes]();
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemCxtRes; i++) {
if (!pduSessionResourceFailedToSetupItemCxtRes[i]
.decodefromPDUSessionResourceFailedToSetupItemCxtRes(
pduSessionResourceFailedToSetupListCxtRes->list.array[i]))
itemList.reserve(pduSessionResourceFailedToSetupListCxtRes->list.count);
for (int i = 0; i < pduSessionResourceFailedToSetupListCxtRes->list.count;
i++) {
PDUSessionResourceFailedToSetupItemCxtRes item = {};
if (!item.decodefromPDUSessionResourceFailedToSetupItemCxtRes(
pduSessionResourceFailedToSetupListCxtRes->list.array[i]))
return false;
itemList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtRes::
getPDUSessionResourceFailedToSetupListCxtRes(
PDUSessionResourceFailedToSetupItemCxtRes*&
m_pduSessionResourceFailedToSetupItemCxtRes,
int& num) {
m_pduSessionResourceFailedToSetupItemCxtRes =
pduSessionResourceFailedToSetupItemCxtRes;
num = numofpduSessionResourceFailedToSetupItemCxtRes;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEFAILEDTOSETUPLISTCXTRES_H_
#define _PDUSESSIONRESOURCEFAILEDTOSETUPLISTCXTRES_H_
#ifndef _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_CXT_RES_H_
#define _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_CXT_RES_H_
#include "PDUSessionResourceFailedToSetupItemCxtRes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceFailedToSetupListCxtRes.h"
......@@ -43,13 +37,9 @@ class PDUSessionResourceFailedToSetupListCxtRes {
virtual ~PDUSessionResourceFailedToSetupListCxtRes();
void setPDUSessionResourceFailedToSetupListCxtRes(
PDUSessionResourceFailedToSetupItemCxtRes*
m_pduSessionResourceFailedToSetupItemCxtRes,
int num);
const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
void getPDUSessionResourceFailedToSetupListCxtRes(
PDUSessionResourceFailedToSetupItemCxtRes*&
m_pduSessionResourceFailedToSetupItemCxtRes,
int& num);
std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
bool encode2PDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
......@@ -59,9 +49,7 @@ class PDUSessionResourceFailedToSetupListCxtRes {
pduSessionResourceFailedToSetupListCxtRes);
private:
PDUSessionResourceFailedToSetupItemCxtRes*
pduSessionResourceFailedToSetupItemCxtRes;
int numofpduSessionResourceFailedToSetupItemCxtRes;
std::vector<PDUSessionResourceFailedToSetupItemCxtRes> itemList;
};
} // namespace ngap
......
......@@ -19,26 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceFailedToSetupListSURes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListSURes::
PDUSessionResourceFailedToSetupListSURes() {
pduSessionResourceFailedToSetupItemSURes = NULL;
numofpduSessionResourceFailedToSetupItemSURes = 0;
}
PDUSessionResourceFailedToSetupListSURes() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListSURes::
......@@ -47,26 +34,27 @@ PDUSessionResourceFailedToSetupListSURes::
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListSURes::
setPDUSessionResourceFailedToSetupListSURes(
PDUSessionResourceFailedToSetupItemSURes*
m_pduSessionResourceFailedToSetupItemSURes,
int num) {
pduSessionResourceFailedToSetupItemSURes =
m_pduSessionResourceFailedToSetupItemSURes;
numofpduSessionResourceFailedToSetupItemSURes = num;
const std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
itemSUResList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListSURes::
getPDUSessionResourceFailedToSetupListSURes(
std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
list = itemSUResList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListSURes::
encode2PDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes) {
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemSURes; i++) {
for (auto& item : itemSUResList) {
Ngap_PDUSessionResourceFailedToSetupItemSURes_t* failedToResponse =
(Ngap_PDUSessionResourceFailedToSetupItemSURes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemSURes_t));
if (!failedToResponse) return false;
if (!pduSessionResourceFailedToSetupItemSURes[i]
.encode2PDUSessionResourceFailedToSetupItemSURes(failedToResponse))
if (!item.encode2PDUSessionResourceFailedToSetupItemSURes(failedToResponse))
return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListSURes->list,
......@@ -82,30 +70,16 @@ bool PDUSessionResourceFailedToSetupListSURes::
decodefromPDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes) {
numofpduSessionResourceFailedToSetupItemSURes =
pduSessionResourceFailedToSetupListSURes->list.count;
pduSessionResourceFailedToSetupItemSURes =
new PDUSessionResourceFailedToSetupItemSURes
[numofpduSessionResourceFailedToSetupItemSURes]();
for (int i = 0; i < numofpduSessionResourceFailedToSetupItemSURes; i++) {
if (!pduSessionResourceFailedToSetupItemSURes[i]
.decodefromPDUSessionResourceFailedToSetupItemSURes(
pduSessionResourceFailedToSetupListSURes->list.array[i]))
for (int i = 0; i < pduSessionResourceFailedToSetupListSURes->list.count;
i++) {
PDUSessionResourceFailedToSetupItemSURes item = {};
if (!item.decodefromPDUSessionResourceFailedToSetupItemSURes(
pduSessionResourceFailedToSetupListSURes->list.array[i]))
return false;
itemSUResList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListSURes::
getPDUSessionResourceFailedToSetupListSURes(
PDUSessionResourceFailedToSetupItemSURes*&
m_pduSessionResourceFailedToSetupItemSURes,
int& num) {
m_pduSessionResourceFailedToSetupItemSURes =
pduSessionResourceFailedToSetupItemSURes;
num = numofpduSessionResourceFailedToSetupItemSURes;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEFAILEDTOSETUPLISTSURES_H_
#define _PDUSESSIONRESOURCEFAILEDTOSETUPLISTSURES_H_
#ifndef _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_SU_RES_H_
#define _PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_SU_RES_H_
#include "PDUSessionResourceFailedToSetupItemSURes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceFailedToSetupListSURes.h"
......@@ -43,13 +37,9 @@ class PDUSessionResourceFailedToSetupListSURes {
virtual ~PDUSessionResourceFailedToSetupListSURes();
void setPDUSessionResourceFailedToSetupListSURes(
PDUSessionResourceFailedToSetupItemSURes*
m_pduSessionResourceFailedToSetupItemSURes,
int num);
const std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
void getPDUSessionResourceFailedToSetupListSURes(
PDUSessionResourceFailedToSetupItemSURes*&
m_pduSessionResourceFailedToSetupItemSURes,
int& num);
std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
bool encode2PDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
......@@ -59,9 +49,7 @@ class PDUSessionResourceFailedToSetupListSURes {
pduSessionResourceFailedToSetupListSURes);
private:
PDUSessionResourceFailedToSetupItemSURes*
pduSessionResourceFailedToSetupItemSURes;
int numofpduSessionResourceFailedToSetupItemSURes;
std::vector<PDUSessionResourceFailedToSetupItemSURes> itemSUResList;
};
} // namespace ngap
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PDUSessionResourceHandoverItem.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceHandoverItem::PDUSessionResourceHandoverItem() {}
//------------------------------------------------------------------------------
PDUSessionResourceHandoverItem::~PDUSessionResourceHandoverItem() {}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverItem::setPDUSessionResourceHandoverItem(
const PDUSessionID& sessionID, const OCTET_STRING_t& commandTransfer) {
pDUSessionID = sessionID;
handoverCommandTransfer = commandTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverItem::getPDUSessionResourceHandoverItem(
PDUSessionID& sessionID, OCTET_STRING_t& commandTransfer) {
sessionID = pDUSessionID;
commandTransfer = handoverCommandTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverItem::encode(
Ngap_PDUSessionResourceHandoverItem_t& item) {
if (!pDUSessionID.encode2PDUSessionID(item.pDUSessionID)) return false;
item.handoverCommandTransfer = handoverCommandTransfer;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverItem::decode(
const Ngap_PDUSessionResourceHandoverItem_t& item) {
if (!pDUSessionID.decodefromPDUSessionID(item.pDUSessionID)) return false;
handoverCommandTransfer = item.handoverCommandTransfer;
return true;
}
} // namespace ngap
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_HANDOVER_ITEM_H_
#define _PDU_SESSION_RESOURCE_HANDOVER_ITEM_H_
#include "PDUSessionID.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceHandoverItem.h"
}
namespace ngap {
class PDUSessionResourceHandoverItem {
public:
PDUSessionResourceHandoverItem();
virtual ~PDUSessionResourceHandoverItem();
void setPDUSessionResourceHandoverItem(
const PDUSessionID& sessionID, const OCTET_STRING_t& commandTransfer);
void getPDUSessionResourceHandoverItem(
PDUSessionID& sessionID, OCTET_STRING_t& commandTransfer);
bool encode(Ngap_PDUSessionResourceHandoverItem_t& item);
bool decode(const Ngap_PDUSessionResourceHandoverItem_t& item);
private:
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t handoverCommandTransfer; // Mandatory
};
} // namespace ngap
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PDUSessionResourceHandoverList.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceHandoverList::PDUSessionResourceHandoverList() {}
//------------------------------------------------------------------------------
PDUSessionResourceHandoverList::~PDUSessionResourceHandoverList() {}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverList::setPDUSessionResourceHandoverList(
const std::vector<PDUSessionResourceHandoverItem>& list) {
handoverItemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverList::getPDUSessionResourceHandoverList(
std::vector<PDUSessionResourceHandoverItem>& list) {
list = handoverItemList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverList::encode(
Ngap_PDUSessionResourceHandoverList_t& pduSessionResourceHandoverList) {
for (auto& item : handoverItemList) {
Ngap_PDUSessionResourceHandoverItem_t* handoverItem =
(Ngap_PDUSessionResourceHandoverItem_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceHandoverItem_t));
if (!handoverItem) return false;
if (!item.encode(*handoverItem)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceHandoverList.list, handoverItem) !=
0)
return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverList::decode(
const Ngap_PDUSessionResourceHandoverList_t&
pduSessionResourceHandoverList) {
for (int i = 0; i < pduSessionResourceHandoverList.list.count; i++) {
PDUSessionResourceHandoverItem item = {};
if (!item.decode(*pduSessionResourceHandoverList.list.array[i]))
return false;
handoverItemList.push_back(item);
}
return true;
}
} // namespace ngap
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_HANDOVER_LIST_H_
#define _PDU_SESSION_RESOURCE_HANDOVER_LIST_H_
#include "PDUSessionResourceHandoverItem.hpp"
#include "vector"
extern "C" {
#include "Ngap_PDUSessionResourceHandoverList.h"
}
namespace ngap {
class PDUSessionResourceHandoverList {
public:
PDUSessionResourceHandoverList();
virtual ~PDUSessionResourceHandoverList();
void setPDUSessionResourceHandoverList(
const std::vector<PDUSessionResourceHandoverItem>& list);
void getPDUSessionResourceHandoverList(
std::vector<PDUSessionResourceHandoverItem>& list);
bool encode(
Ngap_PDUSessionResourceHandoverList_t& pduSessionResourceHandoverList);
bool decode(const Ngap_PDUSessionResourceHandoverList_t&
pduSessionResourceHandoverList);
private:
std::vector<PDUSessionResourceHandoverItem> handoverItemList;
};
} // namespace ngap
#endif
......@@ -19,54 +19,53 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author niuxiansheng-niu, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceItemHORqd.hpp"
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceItemHORqd::PDUSessionResourceItemHORqd() {
pDUSessionID = NULL;
}
//------------------------------------------------------------------------------
PDUSessionResourceItemHORqd::PDUSessionResourceItemHORqd() {}
//------------------------------------------------------------------------------
PDUSessionResourceItemHORqd::~PDUSessionResourceItemHORqd() {}
//------------------------------------------------------------------------------
void PDUSessionResourceItemHORqd::setPDUSessionResourceItemHORqd(
PDUSessionID* m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_handoverRequiredTransfer) {
pDUSessionID = m_pDUSessionID;
handoverrequiredtransfer = m_handoverrequiredtransfer;
handoverRequiredTransfer = m_handoverRequiredTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceItemHORqd::getPDUSessionResourceItemHORqd(
PDUSessionID& m_pDUSessionID, OCTET_STRING_t& m_handoverRequiredTransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverRequiredTransfer = handoverRequiredTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItemHORqd::encode2PDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t* pdUSessionResourceItemHORqd) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pdUSessionResourceItemHORqd->pDUSessionID))
return false;
pdUSessionResourceItemHORqd->handoverRequiredTransfer =
handoverrequiredtransfer;
handoverRequiredTransfer;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItemHORqd::decodefromPDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t* pdUSessionResourceItemHORqd) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pdUSessionResourceItemHORqd->pDUSessionID))
return false;
handoverrequiredtransfer =
handoverRequiredTransfer =
pdUSessionResourceItemHORqd->handoverRequiredTransfer;
return true;
}
void PDUSessionResourceItemHORqd::getPDUSessionResourceItemHORqd(
PDUSessionID*& m_pDUSessionID, OCTET_STRING_t& m_handoverrequiredtransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverrequiredtransfer = handoverrequiredtransfer;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author niuxiansheng-niu, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEITEMHORQD_H_
#define _PDUSESSIONRESOURCEITEMHQRQD_H_
#ifndef _PDU_SESSION_RESOURCE_ITEM_HO_RQD_H_
#define _PDU_SESSION_RESOURCE_ITEM_HO_RQD_H_
#include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceItemHORqd.h"
}
......@@ -42,10 +36,10 @@ class PDUSessionResourceItemHORqd {
virtual ~PDUSessionResourceItemHORqd();
void setPDUSessionResourceItemHORqd(
PDUSessionID* m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_handoverRequiredTransfer);
void getPDUSessionResourceItemHORqd(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_handoverrequiredtransfer);
PDUSessionID& m_pDUSessionID, OCTET_STRING_t& m_handoverRequiredTransfer);
bool encode2PDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t* pdUSessionResourceItemHORqd);
......@@ -53,8 +47,8 @@ class PDUSessionResourceItemHORqd {
Ngap_PDUSessionResourceItemHORqd_t* pdUSessionResourceItemHORqd);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t handoverrequiredtransfer;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t handoverRequiredTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -21,56 +21,53 @@
#include "PDUSessionResourceListHORqd.hpp"
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceListHORqd::PDUSessionResourceListHORqd() {
pduSessionResourceItemHORqd = NULL;
numofpduSessionResourceItemHORqd = 0;
}
//------------------------------------------------------------------------------
PDUSessionResourceListHORqd::PDUSessionResourceListHORqd() {}
//------------------------------------------------------------------------------
PDUSessionResourceListHORqd::~PDUSessionResourceListHORqd() {}
//------------------------------------------------------------------------------
void PDUSessionResourceListHORqd::setPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd* m_pduSessionResourceItemHORqd, int num) {
pduSessionResourceItemHORqd = m_pduSessionResourceItemHORqd;
numofpduSessionResourceItemHORqd = num;
const std::vector<PDUSessionResourceItemHORqd>& list) {
itemHORqdList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceListHORqd::getPDUSessionResourceListHORqd(
std::vector<PDUSessionResourceItemHORqd>& list) {
list = itemHORqdList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceListHORqd::encode2PDUSessionResourceListHORqd(
Ngap_PDUSessionResourceListHORqd_t* pduSessionResourceListHORQqd) {
for (int i = 0; i < numofpduSessionResourceItemHORqd; i++) {
Ngap_PDUSessionResourceItemHORqd_t* response =
for (auto& item : itemHORqdList) {
Ngap_PDUSessionResourceItemHORqd_t* itemHORqd =
(Ngap_PDUSessionResourceItemHORqd_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceItemHORqd_t));
if (!response) return false;
if (!pduSessionResourceItemHORqd[i].encode2PDUSessionResourceItemHORqd(
response))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceListHORQqd->list, response) != 0)
if (!itemHORqd) return false;
if (!item.encode2PDUSessionResourceItemHORqd(itemHORqd)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceListHORQqd->list, itemHORqd) != 0)
return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceListHORqd::decodefromPDUSessionResourceListHORqd(
Ngap_PDUSessionResourceListHORqd_t* pduSessionResourceListHORQqd) {
numofpduSessionResourceItemHORqd = pduSessionResourceListHORQqd->list.count;
pduSessionResourceItemHORqd =
new PDUSessionResourceItemHORqd[numofpduSessionResourceItemHORqd]();
for (int i = 0; i < numofpduSessionResourceItemHORqd; i++) {
if (!pduSessionResourceItemHORqd[i].decodefromPDUSessionResourceItemHORqd(
for (int i = 0; i < pduSessionResourceListHORQqd->list.count; i++) {
PDUSessionResourceItemHORqd item = {};
if (!item.decodefromPDUSessionResourceItemHORqd(
pduSessionResourceListHORQqd->list.array[i]))
return false;
itemHORqdList.push_back(item);
}
return true;
}
void PDUSessionResourceListHORqd::getPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd*& m_pduSessionResourceItemHORqd, int& num) {
if (pduSessionResourceItemHORqd) {
m_pduSessionResourceItemHORqd = pduSessionResourceItemHORqd;
num = numofpduSessionResourceItemHORqd;
}
}
} // namespace ngap
......@@ -19,10 +19,11 @@
* contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCELISTHORqd_H_
#define _PDUSESSIONRESOURCELISTHORqd_H_
#ifndef _PDU_SESSION_RESOURCE_LIST_HO_RQD_H_
#define _PDU_SESSION_RESOURCE_LIST_HO_RQD_H_
#include "PDUSessionResourceItemHORqd.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceListHORqd.h"
......@@ -36,9 +37,9 @@ class PDUSessionResourceListHORqd {
virtual ~PDUSessionResourceListHORqd();
void setPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd* m_pduSessionResourceItemHORqd, int num);
const std::vector<PDUSessionResourceItemHORqd>& list);
void getPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd*& m_pduSessionResourceItemHORqd, int& num);
std::vector<PDUSessionResourceItemHORqd>& list);
bool encode2PDUSessionResourceListHORqd(
Ngap_PDUSessionResourceListHORqd_t* pduSessionResourceListHORQqd);
......@@ -46,8 +47,7 @@ class PDUSessionResourceListHORqd {
Ngap_PDUSessionResourceListHORqd_t* pduSessionResourceListHORQqd);
private:
PDUSessionResourceItemHORqd* pduSessionResourceItemHORqd;
int numofpduSessionResourceItemHORqd;
std::vector<PDUSessionResourceItemHORqd> itemHORqdList;
};
} // namespace ngap
......
......@@ -19,18 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceModifyItemModReq.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
......@@ -45,7 +35,7 @@ PDUSessionResourceModifyItemModReq::~PDUSessionResourceModifyItemModReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyItemModReq::setPDUSessionResourceModifyItemModReq(
const PDUSessionID& m_pDUSessionID, const NAS_PDU& m_nAS_PDU,
const OCTET_STRING_t m_pDUSessionResourceModifyRequestTransfer,
const OCTET_STRING_t& m_pDUSessionResourceModifyRequestTransfer,
const S_NSSAI& m_s_NSSAI) {
pDUSessionID = m_pDUSessionID;
uint8_t* nas_buf = nullptr;
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author
\date
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_MODIFY_ITEM_MOD_REQ_H_
#define _PDU_SESSION_RESOURCE_MODIFY_ITEM_MOD_REQ_H_
......@@ -46,7 +39,7 @@ class PDUSessionResourceModifyItemModReq {
void setPDUSessionResourceModifyItemModReq(
const PDUSessionID& m_pDUSessionID, const NAS_PDU& m_nAS_PDU,
const OCTET_STRING_t m_pDUSessionResourceModifyRequestTransfer,
const OCTET_STRING_t& m_pDUSessionResourceModifyRequestTransfer,
const S_NSSAI& m_s_NSSAI);
void getPDUSessionResourceModifyItemModReq(
PDUSessionID& m_pDUSessionID, NAS_PDU& m_nAS_PDU,
......@@ -61,10 +54,10 @@ class PDUSessionResourceModifyItemModReq {
pduSessionResourceModifyItemModReq);
private:
PDUSessionID pDUSessionID;
NAS_PDU* nAS_PDU; // Optional
OCTET_STRING_t pDUSessionResourceModifyRequestTransfer;
S_NSSAI* s_NSSAI; // Optional
PDUSessionID pDUSessionID; // Mandatory
NAS_PDU* nAS_PDU; // Optional
OCTET_STRING_t pDUSessionResourceModifyRequestTransfer; // Mandatory
S_NSSAI* s_NSSAI; // Optional
};
} // namespace ngap
......
......@@ -19,21 +19,12 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceReleasedItemRelRes.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceReleasedItemRelRes::PDUSessionResourceReleasedItemRelRes() {
pDUSessionID = NULL;
}
PDUSessionResourceReleasedItemRelRes::PDUSessionResourceReleasedItemRelRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceReleasedItemRelRes::~PDUSessionResourceReleasedItemRelRes() {}
......@@ -41,8 +32,8 @@ PDUSessionResourceReleasedItemRelRes::~PDUSessionResourceReleasedItemRelRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceReleasedItemRelRes::
setPDUSessionResourceReleasedItemRelRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceReleaseResponseTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceReleaseResponseTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceReleaseResponseTransfer =
m_pDUSessionResourceReleaseResponseTransfer;
......@@ -51,7 +42,7 @@ void PDUSessionResourceReleasedItemRelRes::
//------------------------------------------------------------------------------
void PDUSessionResourceReleasedItemRelRes::
getPDUSessionResourceReleasedItemRelRes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceReleaseResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceReleaseResponseTransfer =
......@@ -63,7 +54,7 @@ bool PDUSessionResourceReleasedItemRelRes::
encode2PDUSessionResourceReleasedItemRelRes(
Ngap_PDUSessionResourceReleasedItemRelRes_t*
pduSessionResourceReleasedItemRelRes) {
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceReleasedItemRelRes->pDUSessionID))
return false;
......@@ -79,8 +70,7 @@ bool PDUSessionResourceReleasedItemRelRes::
decodefromPDUSessionResourceReleasedItemRelRes(
Ngap_PDUSessionResourceReleasedItemRelRes_t*
pduSessionResourceReleasedItemRelRes) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
pDUSessionID->setPDUSessionID(
pDUSessionID.setPDUSessionID(
pduSessionResourceReleasedItemRelRes->pDUSessionID);
pDUSessionResourceReleaseResponseTransfer =
pduSessionResourceReleasedItemRelRes
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_RELEASED_ITEM_REL_RES_H_
#define _PDU_SESSION_RESOURCE_RELEASED_ITEM_REL_RES_H_
......@@ -43,11 +36,11 @@ class PDUSessionResourceReleasedItemRelRes {
virtual ~PDUSessionResourceReleasedItemRelRes();
void setPDUSessionResourceReleasedItemRelRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceReleaseResponseTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceReleaseResponseTransfer);
void getPDUSessionResourceReleasedItemRelRes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceReleaseResponseTransfer);
bool encode2PDUSessionResourceReleasedItemRelRes(
......@@ -58,9 +51,8 @@ class PDUSessionResourceReleasedItemRelRes {
pduSessionResourceReleasedItemRelRes);
private:
PDUSessionID* pDUSessionID;
PDUSessionID pDUSessionID;
OCTET_STRING_t pDUSessionResourceReleaseResponseTransfer;
// ProtocolExtensionContainer (OPTIONAL)
};
} // namespace ngap
......
......@@ -19,22 +19,12 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceReleasedListRelRes.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceReleasedListRelRes::PDUSessionResourceReleasedListRelRes() {
pduSessionResourceReleasedItemRelRes = NULL;
maxnoofPDUSessions = 0;
}
PDUSessionResourceReleasedListRelRes::PDUSessionResourceReleasedListRelRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() {}
......@@ -42,21 +32,15 @@ PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceReleasedListRelRes::
setPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes*
m_pduSessionResourceReleasedItemRelRes,
int num) {
pduSessionResourceReleasedItemRelRes = m_pduSessionResourceReleasedItemRelRes;
maxnoofPDUSessions = num;
const std::vector<PDUSessionResourceReleasedItemRelRes>& list) {
itemRelResList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceReleasedListRelRes::
getPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes*&
m_pduSessionResourceReleasedItemRelRes,
int& num) {
m_pduSessionResourceReleasedItemRelRes = pduSessionResourceReleasedItemRelRes;
num = maxnoofPDUSessions;
std::vector<PDUSessionResourceReleasedItemRelRes>& list) {
list = itemRelResList;
}
//------------------------------------------------------------------------------
......@@ -64,14 +48,12 @@ bool PDUSessionResourceReleasedListRelRes::
encode2PDUSessionResourceReleasedListRelRes(
Ngap_PDUSessionResourceReleasedListRelRes_t*
pduSessionResourceReleasedListRelRes) {
for (int i = 0; i < maxnoofPDUSessions; i++) {
for (auto& item : itemRelResList) {
Ngap_PDUSessionResourceReleasedItemRelRes_t* rel =
(Ngap_PDUSessionResourceReleasedItemRelRes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceReleasedItemRelRes_t));
if (!rel) return false;
if (!pduSessionResourceReleasedItemRelRes[i]
.encode2PDUSessionResourceReleasedItemRelRes(rel))
return false;
if (!item.encode2PDUSessionResourceReleasedItemRelRes(rel)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceReleasedListRelRes->list, rel) != 0)
return false;
}
......@@ -83,14 +65,12 @@ bool PDUSessionResourceReleasedListRelRes::
decodefromPDUSessionResourceReleasedListRelRes(
Ngap_PDUSessionResourceReleasedListRelRes_t*
pduSessionResourceReleasedListRelRes) {
maxnoofPDUSessions = pduSessionResourceReleasedListRelRes->list.count;
pduSessionResourceReleasedItemRelRes =
new PDUSessionResourceReleasedItemRelRes[maxnoofPDUSessions]();
for (int i = 0; i < maxnoofPDUSessions; i++) {
if (!pduSessionResourceReleasedItemRelRes[i]
.decodefromPDUSessionResourceReleasedItemRelRes(
pduSessionResourceReleasedListRelRes->list.array[i]))
for (int i = 0; i < pduSessionResourceReleasedListRelRes->list.count; i++) {
PDUSessionResourceReleasedItemRelRes item = {};
if (!item.decodefromPDUSessionResourceReleasedItemRelRes(
pduSessionResourceReleasedListRelRes->list.array[i]))
return false;
itemRelResList.push_back(item);
}
return true;
}
......
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_RELEASED_LIST_REL_RES_H_
#define _PDU_SESSION_RESOURCE_RELEASED_LIST_REL_RES_H_
#include "PDUSessionResourceReleasedItemRelRes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceReleasedItemRelRes.h"
......@@ -44,14 +38,10 @@ class PDUSessionResourceReleasedListRelRes {
virtual ~PDUSessionResourceReleasedListRelRes();
void setPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes*
m_pduSessionResourceReleasedItemRelRes,
int num);
const std::vector<PDUSessionResourceReleasedItemRelRes>& list);
void getPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes*&
m_pduSessionResourceReleasedItemRelRes,
int& num);
std::vector<PDUSessionResourceReleasedItemRelRes>& list);
bool encode2PDUSessionResourceReleasedListRelRes(
Ngap_PDUSessionResourceReleasedListRelRes_t*
......@@ -62,8 +52,7 @@ class PDUSessionResourceReleasedListRelRes {
pduSessionResourceReleasedListRelRes);
private:
PDUSessionResourceReleasedItemRelRes* pduSessionResourceReleasedItemRelRes;
int maxnoofPDUSessions;
std::vector<PDUSessionResourceReleasedItemRelRes> itemRelResList;
};
} // namespace ngap
......
......@@ -19,29 +19,18 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupItemCxtReq.hpp"
//#include "dynamic_memory_check.h"
#include "logger.hpp"
extern "C" {
#include "dynamic_memory_check.h"
}
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemCxtReq::PDUSessionResourceSetupItemCxtReq() {
pDUSessionID = NULL;
nAS_PDU = NULL;
s_NSSAI = NULL;
nAS_PDU = nullptr;
}
//------------------------------------------------------------------------------
......@@ -49,8 +38,9 @@ PDUSessionResourceSetupItemCxtReq::~PDUSessionResourceSetupItemCxtReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtReq::setPDUSessionResourceSetupItemCxtReq(
PDUSessionID* m_pDUSessionID, NAS_PDU* m_nAS_PDU, S_NSSAI* m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer) {
const PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU,
const S_NSSAI& m_s_NSSAI,
const OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
pDUSessionID = m_pDUSessionID;
nAS_PDU = m_nAS_PDU;
s_NSSAI = m_s_NSSAI;
......@@ -58,18 +48,27 @@ void PDUSessionResourceSetupItemCxtReq::setPDUSessionResourceSetupItemCxtReq(
m_pDUSessionResourceSetupRequestTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtReq::getPDUSessionResourceSetupItemCxtReq(
PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = nAS_PDU;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupItemCxtReq::
encode2PDUSessionResourceSetupItemCxtReq(
Ngap_PDUSessionResourceSetupItemCxtReq_t*
pduSessionResourceSetupItemCxtReq) {
cout << "encode2pdu pdusession_id" << endl;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceSetupItemCxtReq->pDUSessionID))
return false;
cout << "encode2pdu pdusession_id over" << endl;
if (nAS_PDU) {
cout << "encode2pdu nas-pdu" << endl;
Ngap_NAS_PDU_t* naspdu =
(Ngap_NAS_PDU_t*) calloc(1, sizeof(Ngap_NAS_PDU_t));
if (!naspdu) return false;
......@@ -78,12 +77,10 @@ bool PDUSessionResourceSetupItemCxtReq::
return false;
}
pduSessionResourceSetupItemCxtReq->nAS_PDU = naspdu;
cout << "encode2pdu nas-pdu over" << endl;
}
cout << "encode2pdu nssai" << endl;
if (!s_NSSAI->encode2S_NSSAI(&pduSessionResourceSetupItemCxtReq->s_NSSAI))
if (!s_NSSAI.encode2S_NSSAI(&pduSessionResourceSetupItemCxtReq->s_NSSAI))
return false;
cout << "encode2pdu nssai over" << endl;
pduSessionResourceSetupItemCxtReq->pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
......@@ -95,13 +92,10 @@ bool PDUSessionResourceSetupItemCxtReq::
decodefromPDUSessionResourceSetupItemCxtReq(
Ngap_PDUSessionResourceSetupItemCxtReq_t*
pduSessionResourceSetupItemCxtReq) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (s_NSSAI == nullptr) s_NSSAI = new S_NSSAI();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceSetupItemCxtReq->pDUSessionID))
return false;
if (!s_NSSAI->decodefromS_NSSAI(
&(pduSessionResourceSetupItemCxtReq->s_NSSAI)))
if (!s_NSSAI.decodefromS_NSSAI(&(pduSessionResourceSetupItemCxtReq->s_NSSAI)))
return false;
if (pduSessionResourceSetupItemCxtReq->nAS_PDU) {
......@@ -117,15 +111,4 @@ bool PDUSessionResourceSetupItemCxtReq::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtReq::getPDUSessionResourceSetupItemCxtReq(
PDUSessionID*& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI*& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = nAS_PDU;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
}
} // namespace ngap
......@@ -19,20 +19,13 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPITEMCXTREQ_H_
#define _PDUSESSIONRESOURCESETUPITEMCXTREQ_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_ITEM_CXT_REQ_H_
#define _PDU_SESSION_RESOURCE_SETUP_ITEM_CXT_REQ_H_
#include "NAS-PDU.hpp"
#include "PDUSessionID.hpp"
#include "S-NSSAI.hpp"
//#include "PDUSessionResourceSetupRequestTransfer.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceSetupItemCxtReq.h"
......@@ -46,10 +39,11 @@ class PDUSessionResourceSetupItemCxtReq {
virtual ~PDUSessionResourceSetupItemCxtReq();
void setPDUSessionResourceSetupItemCxtReq(
PDUSessionID* m_pDUSessionID, NAS_PDU* m_nAS_PDU, S_NSSAI* m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer);
const PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU,
const S_NSSAI& m_s_NSSAI,
const OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer);
void getPDUSessionResourceSetupItemCxtReq(
PDUSessionID*& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI*& m_s_NSSAI,
PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer);
bool encode2PDUSessionResourceSetupItemCxtReq(
......@@ -60,12 +54,10 @@ class PDUSessionResourceSetupItemCxtReq {
pduSessionResourceSetupItemCxtReq);
private:
PDUSessionID* pDUSessionID;
NAS_PDU* nAS_PDU; /* OPTIONAL */
S_NSSAI* s_NSSAI;
// PduSessionResourceSetupRequestTransferIE
// *pduSessionResourceSetupRequestTransfer;
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer;
PDUSessionID pDUSessionID; // Mandatory
NAS_PDU* nAS_PDU; // Optional
S_NSSAI s_NSSAI; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -19,44 +19,40 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupItemCxtRes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemCxtRes::PDUSessionResourceSetupItemCxtRes() {
pDUSessionID = NULL;
}
PDUSessionResourceSetupItemCxtRes::PDUSessionResourceSetupItemCxtRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemCxtRes::~PDUSessionResourceSetupItemCxtRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtRes::setPDUSessionResourceSetupItemCxtRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupResponseTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupResponseTransfer =
m_pDUSessionResourceSetupResponseTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtRes::getPDUSessionResourceSetupItemCxtRes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupResponseTransfer =
pDUSessionResourceSetupResponseTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupItemCxtRes::
encode2PDUSessionResourceSetupItemCxtRes(
Ngap_PDUSessionResourceSetupItemCxtRes_t*
pduSessionResourceSetupItemCxtRes) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceSetupItemCxtRes->pDUSessionID))
return false;
pduSessionResourceSetupItemCxtRes->pDUSessionResourceSetupResponseTransfer =
......@@ -70,8 +66,7 @@ bool PDUSessionResourceSetupItemCxtRes::
decodefromPDUSessionResourceSetupItemCxtRes(
Ngap_PDUSessionResourceSetupItemCxtRes_t*
pduSessionResourceSetupItemCxtRes) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceSetupItemCxtRes->pDUSessionID))
return false;
pDUSessionResourceSetupResponseTransfer =
......@@ -81,13 +76,4 @@ bool PDUSessionResourceSetupItemCxtRes::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemCxtRes::getPDUSessionResourceSetupItemCxtRes(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupResponseTransfer =
pDUSessionResourceSetupResponseTransfer;
}
} // namespace ngap
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPITEMCXTRES_H_
#define _PDUSESSIONRESOURCESETUPITEMCXTRES_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_ITEM_CXT_RES_H_
#define _PDU_SESSION_RESOURCE_SETUP_ITEM_CXT_RES_H_
#include "PDUSessionID.hpp"
......@@ -43,10 +36,10 @@ class PDUSessionResourceSetupItemCxtRes {
virtual ~PDUSessionResourceSetupItemCxtRes();
void setPDUSessionResourceSetupItemCxtRes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupResponseTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer);
void getPDUSessionResourceSetupItemCxtRes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer);
bool encode2PDUSessionResourceSetupItemCxtRes(
......@@ -57,8 +50,8 @@ class PDUSessionResourceSetupItemCxtRes {
pduSessionResourceSetupItemCxtRes);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t pDUSessionResourceSetupResponseTransfer;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupResponseTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -19,28 +19,17 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupItemSUReq.hpp"
extern "C" {
#include "dynamic_memory_check.h"
}
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemSUReq::PDUSessionResourceSetupItemSUReq() {
pDUSessionID = NULL;
nAS_PDU = NULL;
s_NSSAI = NULL;
nAS_PDU = nullptr;
}
//------------------------------------------------------------------------------
......@@ -48,8 +37,9 @@ PDUSessionResourceSetupItemSUReq::~PDUSessionResourceSetupItemSUReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSUReq::setPDUSessionResourceSetupItemSUReq(
PDUSessionID* m_pDUSessionID, NAS_PDU* m_nAS_PDU, S_NSSAI* m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer) {
const PDUSessionID& m_pDUSessionID, NAS_PDU* m_nAS_PDU,
const S_NSSAI& m_s_NSSAI,
const OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
pDUSessionID = m_pDUSessionID;
nAS_PDU = m_nAS_PDU;
s_NSSAI = m_s_NSSAI;
......@@ -57,10 +47,21 @@ void PDUSessionResourceSetupItemSUReq::setPDUSessionResourceSetupItemSUReq(
m_pDUSessionResourceSetupRequestTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSUReq::getPDUSessionResourceSetupItemSUReq(
PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = nAS_PDU;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupItemSUReq::encode2PDUSessionResourceSetupItemSUReq(
Ngap_PDUSessionResourceSetupItemSUReq_t* pduSessionResourceSetupItemSUReq) {
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceSetupItemSUReq->pDUSessionID))
return false;
if (nAS_PDU) {
......@@ -73,7 +74,7 @@ bool PDUSessionResourceSetupItemSUReq::encode2PDUSessionResourceSetupItemSUReq(
}
pduSessionResourceSetupItemSUReq->pDUSessionNAS_PDU = naspdu;
}
if (!s_NSSAI->encode2S_NSSAI(&pduSessionResourceSetupItemSUReq->s_NSSAI))
if (!s_NSSAI.encode2S_NSSAI(&pduSessionResourceSetupItemSUReq->s_NSSAI))
return false;
pduSessionResourceSetupItemSUReq->pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
......@@ -86,12 +87,10 @@ bool PDUSessionResourceSetupItemSUReq::
decodefromPDUSessionResourceSetupItemSUReq(
Ngap_PDUSessionResourceSetupItemSUReq_t*
pduSessionResourceSetupItemSUReq) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
s_NSSAI = new S_NSSAI();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceSetupItemSUReq->pDUSessionID))
return false;
if (!s_NSSAI->decodefromS_NSSAI(&pduSessionResourceSetupItemSUReq->s_NSSAI))
if (!s_NSSAI.decodefromS_NSSAI(&pduSessionResourceSetupItemSUReq->s_NSSAI))
return false;
if (pduSessionResourceSetupItemSUReq->pDUSessionNAS_PDU) {
......@@ -107,15 +106,4 @@ bool PDUSessionResourceSetupItemSUReq::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSUReq::getPDUSessionResourceSetupItemSUReq(
PDUSessionID*& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI*& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = nAS_PDU;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
}
} // namespace ngap
......@@ -19,20 +19,12 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPITEMSUREQ_H_
#define _PDUSESSIONRESOURCESETUPITEMSUREQ_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_ITEM_SU_REQ_H_
#define _PDU_SESSION_RESOURCE_SETUP_ITEM_SU_REQ_H_
#include "NAS-PDU.hpp"
#include "PDUSessionID.hpp"
#include "S-NSSAI.hpp"
//#include "PDUSessionResourceSetupRequestTransfer.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceSetupItemSUReq.h"
......@@ -46,10 +38,11 @@ class PDUSessionResourceSetupItemSUReq {
virtual ~PDUSessionResourceSetupItemSUReq();
void setPDUSessionResourceSetupItemSUReq(
PDUSessionID* m_pDUSessionID, NAS_PDU* m_nAS_PDU, S_NSSAI* m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer);
const PDUSessionID& m_pDUSessionID, NAS_PDU* m_nAS_PDU,
const S_NSSAI& m_s_NSSAI,
const OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer);
void getPDUSessionResourceSetupItemSUReq(
PDUSessionID*& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI*& m_s_NSSAI,
PDUSessionID& m_pDUSessionID, NAS_PDU*& m_nAS_PDU, S_NSSAI& m_s_NSSAI,
OCTET_STRING_t& m_pDUSessionResourceSetupRequestTransfer);
bool encode2PDUSessionResourceSetupItemSUReq(
......@@ -60,12 +53,11 @@ class PDUSessionResourceSetupItemSUReq {
pduSessionResourceSetupItemSUReq);
private:
PDUSessionID* pDUSessionID;
NAS_PDU* nAS_PDU; /* OPTIONAL */
S_NSSAI* s_NSSAI;
// PduSessionResourceSetupRequestTransferIE
// *pduSessionResourceSetupRequestTransfer;
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer;
PDUSessionID pDUSessionID; // Mandatory
NAS_PDU* nAS_PDU; // Optional
S_NSSAI s_NSSAI; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer; // Mandatory
// TODO: UE Aggregate Maximum Bit Rate (Optional)
};
} // namespace ngap
......
......@@ -19,42 +19,38 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupItemSURes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemSURes::PDUSessionResourceSetupItemSURes() {
pDUSessionID = NULL;
}
PDUSessionResourceSetupItemSURes::PDUSessionResourceSetupItemSURes() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupItemSURes::~PDUSessionResourceSetupItemSURes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSURes::setPDUSessionResourceSetupItemSURes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupResponseTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupResponseTransfer =
m_pDUSessionResourceSetupResponseTransfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSURes::getPDUSessionResourceSetupItemSURes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupResponseTransfer =
pDUSessionResourceSetupResponseTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupItemSURes::encode2PDUSessionResourceSetupItemSURes(
Ngap_PDUSessionResourceSetupItemSURes_t* pduSessionResourceSetupItemSURes) {
if (!pDUSessionID) return false;
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceSetupItemSURes->pDUSessionID))
return false;
pduSessionResourceSetupItemSURes->pDUSessionResourceSetupResponseTransfer =
......@@ -68,8 +64,7 @@ bool PDUSessionResourceSetupItemSURes::
decodefromPDUSessionResourceSetupItemSURes(
Ngap_PDUSessionResourceSetupItemSURes_t*
pduSessionResourceSetupItemSURes) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
if (!pDUSessionID->decodefromPDUSessionID(
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceSetupItemSURes->pDUSessionID))
return false;
pDUSessionResourceSetupResponseTransfer =
......@@ -78,13 +73,4 @@ bool PDUSessionResourceSetupItemSURes::
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupItemSURes::getPDUSessionResourceSetupItemSURes(
PDUSessionID*& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupResponseTransfer =
pDUSessionResourceSetupResponseTransfer;
}
} // namespace ngap
......@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPITEMSURES_H_
#define _PDUSESSIONRESOURCESETUPITEMSURES_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_ITEM_SU_RES_H_
#define _PDU_SESSION_RESOURCE_SETUP_ITEM_SU_RES_H_
#include "PDUSessionID.hpp"
......@@ -43,10 +36,10 @@ class PDUSessionResourceSetupItemSURes {
virtual ~PDUSessionResourceSetupItemSURes();
void setPDUSessionResourceSetupItemSURes(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceSetupResponseTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer);
void getPDUSessionResourceSetupItemSURes(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupResponseTransfer);
bool encode2PDUSessionResourceSetupItemSURes(
......@@ -57,8 +50,8 @@ class PDUSessionResourceSetupItemSURes {
pduSessionResourceSetupItemSURes);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t pDUSessionResourceSetupResponseTransfer;
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupResponseTransfer; // Mandatory
};
} // namespace ngap
......
......@@ -19,51 +19,39 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupListCxtReq.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupListCxtReq::PDUSessionResourceSetupListCxtReq() {
pduSessionResourceSetupItemCxtReq = NULL;
numofpduSessionResourceSetupItemCxtReq = 0;
}
PDUSessionResourceSetupListCxtReq::PDUSessionResourceSetupListCxtReq() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupListCxtReq::~PDUSessionResourceSetupListCxtReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtReq::setPDUSessionResourceSetupListCxtReq(
PDUSessionResourceSetupItemCxtReq* m_pduSessionResourceSetupItemCxtReq,
int num) {
pduSessionResourceSetupItemCxtReq = m_pduSessionResourceSetupItemCxtReq;
numofpduSessionResourceSetupItemCxtReq = num;
const std::vector<PDUSessionResourceSetupItemCxtReq>& itemList) {
pduSessionResourceSetupItemCxtReqList = itemList;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtReq::getPDUSessionResourceSetupListCxtReq(
std::vector<PDUSessionResourceSetupItemCxtReq>& itemList) {}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupListCxtReq::
encode2PDUSessionResourceSetupListCxtReq(
Ngap_PDUSessionResourceSetupListCxtReq_t*
pduSessionResourceSetupListCxtReq) {
for (int i = 0; i < numofpduSessionResourceSetupItemCxtReq; i++) {
cout << "encoding items" << endl;
for (std::vector<PDUSessionResourceSetupItemCxtReq>::iterator it =
std::begin(pduSessionResourceSetupItemCxtReqList);
it < std::end(pduSessionResourceSetupItemCxtReqList); ++it) {
Ngap_PDUSessionResourceSetupItemCxtReq_t* request =
(Ngap_PDUSessionResourceSetupItemCxtReq_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemCxtReq_t));
if (!request) return false;
if (!pduSessionResourceSetupItemCxtReq[i]
.encode2PDUSessionResourceSetupItemCxtReq(request))
return false;
if (!it->encode2PDUSessionResourceSetupItemCxtReq(request)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListCxtReq->list, request) !=
0)
return false;
......@@ -77,26 +65,18 @@ bool PDUSessionResourceSetupListCxtReq::
decodefromPDUSessionResourceSetupListCxtReq(
Ngap_PDUSessionResourceSetupListCxtReq_t*
pduSessionResourceSetupListCxtReq) {
numofpduSessionResourceSetupItemCxtReq =
pduSessionResourceSetupListCxtReq->list.count;
pduSessionResourceSetupItemCxtReq = new PDUSessionResourceSetupItemCxtReq
[numofpduSessionResourceSetupItemCxtReq]();
for (int i = 0; i < numofpduSessionResourceSetupItemCxtReq; i++) {
if (!pduSessionResourceSetupItemCxtReq[i]
.decodefromPDUSessionResourceSetupItemCxtReq(
pduSessionResourceSetupListCxtReq->list.array[i]))
pduSessionResourceSetupItemCxtReqList.reserve(
pduSessionResourceSetupListCxtReq->list.count);
for (int i = 0; i < pduSessionResourceSetupListCxtReq->list.count; i++) {
PDUSessionResourceSetupItemCxtReq item = {};
if (!item.decodefromPDUSessionResourceSetupItemCxtReq(
pduSessionResourceSetupListCxtReq->list.array[i]))
return false;
pduSessionResourceSetupItemCxtReqList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtReq::getPDUSessionResourceSetupListCxtReq(
PDUSessionResourceSetupItemCxtReq*& m_pduSessionResourceSetupItemCxtReq,
int& num) {
m_pduSessionResourceSetupItemCxtReq = pduSessionResourceSetupItemCxtReq;
num = numofpduSessionResourceSetupItemCxtReq;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPLISTCXTREQ_H_
#define _PDUSESSIONRESOURCESETUPLISTCXTREQ_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_LIST_CXT_REQ_H_
#define _PDU_SESSION_RESOURCE_SETUP_LIST_CXT_REQ_H_
#include "PDUSessionResourceSetupItemCxtReq.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceSetupListCxtReq.h"
......@@ -43,11 +37,9 @@ class PDUSessionResourceSetupListCxtReq {
virtual ~PDUSessionResourceSetupListCxtReq();
void setPDUSessionResourceSetupListCxtReq(
PDUSessionResourceSetupItemCxtReq* m_pduSessionResourceSetupItemCxtReq,
int num);
const std::vector<PDUSessionResourceSetupItemCxtReq>& itemList);
void getPDUSessionResourceSetupListCxtReq(
PDUSessionResourceSetupItemCxtReq*& m_pduSessionResourceSetupItemCxtReq,
int& num);
std::vector<PDUSessionResourceSetupItemCxtReq>& itemList);
bool encode2PDUSessionResourceSetupListCxtReq(
Ngap_PDUSessionResourceSetupListCxtReq_t*
......@@ -57,8 +49,8 @@ class PDUSessionResourceSetupListCxtReq {
pduSessionResourceSetupListCxtReq);
private:
PDUSessionResourceSetupItemCxtReq* pduSessionResourceSetupItemCxtReq;
int numofpduSessionResourceSetupItemCxtReq;
std::vector<PDUSessionResourceSetupItemCxtReq>
pduSessionResourceSetupItemCxtReqList;
};
} // namespace ngap
......
......@@ -28,26 +28,24 @@
#include "PDUSessionResourceSetupListCxtRes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupListCxtRes::PDUSessionResourceSetupListCxtRes() {
pduSessionResourceSetupItemCxtRes = NULL;
numofpduSessionResourceSetupItemCxtRes = 0;
}
PDUSessionResourceSetupListCxtRes::PDUSessionResourceSetupListCxtRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupListCxtRes::~PDUSessionResourceSetupListCxtRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtRes::setPDUSessionResourceSetupListCxtRes(
PDUSessionResourceSetupItemCxtRes* m_pduSessionResourceSetupItemCxtRes,
int num) {
pduSessionResourceSetupItemCxtRes = m_pduSessionResourceSetupItemCxtRes;
numofpduSessionResourceSetupItemCxtRes = num;
const std::vector<PDUSessionResourceSetupItemCxtRes>& list) {
itemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtRes::getPDUSessionResourceSetupListCxtRes(
std::vector<PDUSessionResourceSetupItemCxtRes>& list) {
list = itemList;
}
//------------------------------------------------------------------------------
......@@ -55,14 +53,14 @@ bool PDUSessionResourceSetupListCxtRes::
encode2PDUSessionResourceSetupListCxtRes(
Ngap_PDUSessionResourceSetupListCxtRes_t*
pduSessionResourceSetupListCxtRes) {
for (int i = 0; i < numofpduSessionResourceSetupItemCxtRes; i++) {
for (std::vector<PDUSessionResourceSetupItemCxtRes>::iterator it =
std::begin(itemList);
it < std::end(itemList); ++it) {
Ngap_PDUSessionResourceSetupItemCxtRes_t* response =
(Ngap_PDUSessionResourceSetupItemCxtRes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemCxtRes_t));
if (!response) return false;
if (!pduSessionResourceSetupItemCxtRes[i]
.encode2PDUSessionResourceSetupItemCxtRes(response))
return false;
if (!it->encode2PDUSessionResourceSetupItemCxtRes(response)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListCxtRes->list, response) !=
0)
return false;
......@@ -76,26 +74,16 @@ bool PDUSessionResourceSetupListCxtRes::
decodefromPDUSessionResourceSetupListCxtRes(
Ngap_PDUSessionResourceSetupListCxtRes_t*
pduSessionResourceSetupListCxtRes) {
numofpduSessionResourceSetupItemCxtRes =
pduSessionResourceSetupListCxtRes->list.count;
pduSessionResourceSetupItemCxtRes = new PDUSessionResourceSetupItemCxtRes
[numofpduSessionResourceSetupItemCxtRes]();
for (int i = 0; i < numofpduSessionResourceSetupItemCxtRes; i++) {
if (!pduSessionResourceSetupItemCxtRes[i]
.decodefromPDUSessionResourceSetupItemCxtRes(
pduSessionResourceSetupListCxtRes->list.array[i]))
itemList.reserve(pduSessionResourceSetupListCxtRes->list.count);
for (int i = 0; i < pduSessionResourceSetupListCxtRes->list.count; i++) {
PDUSessionResourceSetupItemCxtRes item = {};
if (!item.decodefromPDUSessionResourceSetupItemCxtRes(
pduSessionResourceSetupListCxtRes->list.array[i]))
return false;
itemList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListCxtRes::getPDUSessionResourceSetupListCxtRes(
PDUSessionResourceSetupItemCxtRes*& m_pduSessionResourceSetupItemCxtRes,
int& num) {
m_pduSessionResourceSetupItemCxtRes = pduSessionResourceSetupItemCxtRes;
num = numofpduSessionResourceSetupItemCxtRes;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPLISTCXTRES_H_
#define _PDUSESSIONRESOURCESETUPLISTCXTRES_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_LIST_CXT_RES_H_
#define _PDU_SESSION_RESOURCE_SETUP_LIST_CXT_RES_H_
#include "PDUSessionResourceSetupItemCxtRes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceSetupListCxtRes.h"
......@@ -43,11 +37,9 @@ class PDUSessionResourceSetupListCxtRes {
virtual ~PDUSessionResourceSetupListCxtRes();
void setPDUSessionResourceSetupListCxtRes(
PDUSessionResourceSetupItemCxtRes* m_pduSessionResourceSetupItemCxtRes,
int num);
const std::vector<PDUSessionResourceSetupItemCxtRes>& list);
void getPDUSessionResourceSetupListCxtRes(
PDUSessionResourceSetupItemCxtRes*& m_pduSessionResourceSetupItemCxtRes,
int& num);
std::vector<PDUSessionResourceSetupItemCxtRes>& list);
bool encode2PDUSessionResourceSetupListCxtRes(
Ngap_PDUSessionResourceSetupListCxtRes_t*
......@@ -57,8 +49,7 @@ class PDUSessionResourceSetupListCxtRes {
pduSessionResourceSetupListCxtRes);
private:
PDUSessionResourceSetupItemCxtRes* pduSessionResourceSetupItemCxtRes;
int numofpduSessionResourceSetupItemCxtRes;
std::vector<PDUSessionResourceSetupItemCxtRes> itemList;
};
} // namespace ngap
......
......@@ -19,48 +19,37 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupListSUReq.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupListSUReq::PDUSessionResourceSetupListSUReq() {
pduSessionResourceSetupItemSUReq = NULL;
numofpduSessionResourceSetupItemSUReq = 0;
}
PDUSessionResourceSetupListSUReq::PDUSessionResourceSetupListSUReq() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupListSUReq::~PDUSessionResourceSetupListSUReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSUReq::setPDUSessionResourceSetupListSUReq(
PDUSessionResourceSetupItemSUReq* m_pduSessionResourceSetupItemSUReq,
int num) {
pduSessionResourceSetupItemSUReq = m_pduSessionResourceSetupItemSUReq;
numofpduSessionResourceSetupItemSUReq = num;
const std::vector<PDUSessionResourceSetupItemSUReq>& list) {
itemSUReqList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSUReq::getPDUSessionResourceSetupListSUReq(
std::vector<PDUSessionResourceSetupItemSUReq>& list) {
list = itemSUReqList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupListSUReq::encode2PDUSessionResourceSetupListSUReq(
Ngap_PDUSessionResourceSetupListSUReq_t* pduSessionResourceSetupListSUReq) {
for (int i = 0; i < numofpduSessionResourceSetupItemSUReq; i++) {
for (auto& item : itemSUReqList) {
Ngap_PDUSessionResourceSetupItemSUReq_t* request =
(Ngap_PDUSessionResourceSetupItemSUReq_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemSUReq_t));
if (!request) return false;
if (!pduSessionResourceSetupItemSUReq[i]
.encode2PDUSessionResourceSetupItemSUReq(request))
return false;
if (!item.encode2PDUSessionResourceSetupItemSUReq(request)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListSUReq->list, request) != 0)
return false;
}
......@@ -73,26 +62,15 @@ bool PDUSessionResourceSetupListSUReq::
decodefromPDUSessionResourceSetupListSUReq(
Ngap_PDUSessionResourceSetupListSUReq_t*
pduSessionResourceSetupListSUReq) {
numofpduSessionResourceSetupItemSUReq =
pduSessionResourceSetupListSUReq->list.count;
pduSessionResourceSetupItemSUReq = new PDUSessionResourceSetupItemSUReq
[numofpduSessionResourceSetupItemSUReq]();
for (int i = 0; i < numofpduSessionResourceSetupItemSUReq; i++) {
if (!pduSessionResourceSetupItemSUReq[i]
.decodefromPDUSessionResourceSetupItemSUReq(
pduSessionResourceSetupListSUReq->list.array[i]))
for (int i = 0; i < pduSessionResourceSetupListSUReq->list.count; i++) {
PDUSessionResourceSetupItemSUReq item = {};
if (!item.decodefromPDUSessionResourceSetupItemSUReq(
pduSessionResourceSetupListSUReq->list.array[i]))
return false;
itemSUReqList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSUReq::getPDUSessionResourceSetupListSUReq(
PDUSessionResourceSetupItemSUReq*& m_pduSessionResourceSetupItemSUReq,
int& num) {
m_pduSessionResourceSetupItemSUReq = pduSessionResourceSetupItemSUReq;
num = numofpduSessionResourceSetupItemSUReq;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPLISTSUREQ_H_
#define _PDUSESSIONRESOURCESETUPLISTSUREQ_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_LIST_SU_REQ_H_
#define _PDU_SESSION_RESOURCE_SETUP_LIST_SU_REQ_H_
#include "PDUSessionResourceSetupItemSUReq.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceSetupListSUReq.h"
......@@ -43,11 +37,9 @@ class PDUSessionResourceSetupListSUReq {
virtual ~PDUSessionResourceSetupListSUReq();
void setPDUSessionResourceSetupListSUReq(
PDUSessionResourceSetupItemSUReq* m_pduSessionResourceSetupItemSUReq,
int num);
const std::vector<PDUSessionResourceSetupItemSUReq>& itemSUReqList);
void getPDUSessionResourceSetupListSUReq(
PDUSessionResourceSetupItemSUReq*& m_pduSessionResourceSetupItemSUReq,
int& num);
std::vector<PDUSessionResourceSetupItemSUReq>& list);
bool encode2PDUSessionResourceSetupListSUReq(
Ngap_PDUSessionResourceSetupListSUReq_t*
......@@ -57,8 +49,7 @@ class PDUSessionResourceSetupListSUReq {
pduSessionResourceSetupListSUReq);
private:
PDUSessionResourceSetupItemSUReq* pduSessionResourceSetupItemSUReq;
int numofpduSessionResourceSetupItemSUReq;
std::vector<PDUSessionResourceSetupItemSUReq> itemSUReqList;
};
} // namespace ngap
......
......@@ -19,48 +19,37 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceSetupListSURes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceSetupListSURes::PDUSessionResourceSetupListSURes() {
pduSessionResourceSetupItemSURes = NULL;
numofpduSessionResourceSetupItemSURes = 0;
}
PDUSessionResourceSetupListSURes::PDUSessionResourceSetupListSURes() {}
//------------------------------------------------------------------------------
PDUSessionResourceSetupListSURes::~PDUSessionResourceSetupListSURes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSURes::setPDUSessionResourceSetupListSURes(
PDUSessionResourceSetupItemSURes* m_pduSessionResourceSetupItemSURes,
int num) {
pduSessionResourceSetupItemSURes = m_pduSessionResourceSetupItemSURes;
numofpduSessionResourceSetupItemSURes = num;
const std::vector<PDUSessionResourceSetupItemSURes>& list) {
itemSUResList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSURes::getPDUSessionResourceSetupListSURes(
std::vector<PDUSessionResourceSetupItemSURes>& list) {
list = itemSUResList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceSetupListSURes::encode2PDUSessionResourceSetupListSURes(
Ngap_PDUSessionResourceSetupListSURes_t* pduSessionResourceSetupListSURes) {
for (int i = 0; i < numofpduSessionResourceSetupItemSURes; i++) {
for (auto& item : itemSUResList) {
Ngap_PDUSessionResourceSetupItemSURes_t* response =
(Ngap_PDUSessionResourceSetupItemSURes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemSURes_t));
if (!response) return false;
if (!pduSessionResourceSetupItemSURes[i]
.encode2PDUSessionResourceSetupItemSURes(response))
return false;
if (!item.encode2PDUSessionResourceSetupItemSURes(response)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListSURes->list, response) !=
0)
return false;
......@@ -74,26 +63,15 @@ bool PDUSessionResourceSetupListSURes::
decodefromPDUSessionResourceSetupListSURes(
Ngap_PDUSessionResourceSetupListSURes_t*
pduSessionResourceSetupListSURes) {
numofpduSessionResourceSetupItemSURes =
pduSessionResourceSetupListSURes->list.count;
pduSessionResourceSetupItemSURes = new PDUSessionResourceSetupItemSURes
[numofpduSessionResourceSetupItemSURes]();
for (int i = 0; i < numofpduSessionResourceSetupItemSURes; i++) {
if (!pduSessionResourceSetupItemSURes[i]
.decodefromPDUSessionResourceSetupItemSURes(
pduSessionResourceSetupListSURes->list.array[i]))
for (int i = 0; i < pduSessionResourceSetupListSURes->list.count; i++) {
PDUSessionResourceSetupItemSURes item = {};
if (!item.decodefromPDUSessionResourceSetupItemSURes(
pduSessionResourceSetupListSURes->list.array[i]))
return false;
itemSUResList.push_back(item);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceSetupListSURes::getPDUSessionResourceSetupListSURes(
PDUSessionResourceSetupItemSURes*& m_pduSessionResourceSetupItemSURes,
int& num) {
m_pduSessionResourceSetupItemSURes = pduSessionResourceSetupItemSURes;
num = numofpduSessionResourceSetupItemSURes;
}
} // namespace ngap
......@@ -19,17 +19,11 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCESETUPLISTSURES_H_
#define _PDUSESSIONRESOURCESETUPLISTSURES_H_
#ifndef _PDU_SESSION_RESOURCE_SETUP_LIST_SU_RES_H_
#define _PDU_SESSION_RESOURCE_SETUP_LIST_SU_RES_H_
#include "PDUSessionResourceSetupItemSURes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceSetupListSURes.h"
......@@ -43,11 +37,9 @@ class PDUSessionResourceSetupListSURes {
virtual ~PDUSessionResourceSetupListSURes();
void setPDUSessionResourceSetupListSURes(
PDUSessionResourceSetupItemSURes* m_pduSessionResourceSetupItemSURes,
int num);
const std::vector<PDUSessionResourceSetupItemSURes>& list);
void getPDUSessionResourceSetupListSURes(
PDUSessionResourceSetupItemSURes*& m_pduSessionResourceSetupItemSURes,
int& num);
std::vector<PDUSessionResourceSetupItemSURes>& list);
bool encode2PDUSessionResourceSetupListSURes(
Ngap_PDUSessionResourceSetupListSURes_t*
......@@ -57,8 +49,7 @@ class PDUSessionResourceSetupListSURes {
pduSessionResourceSetupListSURes);
private:
PDUSessionResourceSetupItemSURes* pduSessionResourceSetupItemSURes;
int numofpduSessionResourceSetupItemSURes;
std::vector<PDUSessionResourceSetupItemSURes> itemSUResList;
};
} // namespace ngap
......
......@@ -19,20 +19,12 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceToReleaseItemRelCmd.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceToReleaseItemRelCmd::PDUSessionResourceToReleaseItemRelCmd() {
pDUSessionID = NULL;
}
//------------------------------------------------------------------------------
......@@ -42,8 +34,8 @@ PDUSessionResourceToReleaseItemRelCmd::
//------------------------------------------------------------------------------
void PDUSessionResourceToReleaseItemRelCmd::
setPDUSessionResourceToReleaseItemRelCmd(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer) {
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceReleaseCommandTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceReleaseCommandTransfer =
m_pDUSessionResourceReleaseCommandTransfer;
......@@ -52,7 +44,7 @@ void PDUSessionResourceToReleaseItemRelCmd::
//------------------------------------------------------------------------------
void PDUSessionResourceToReleaseItemRelCmd::
getPDUSessionResourceToReleaseItemRelCmd(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceReleaseCommandTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceReleaseCommandTransfer =
......@@ -64,7 +56,7 @@ bool PDUSessionResourceToReleaseItemRelCmd::
encode2PDUSessionResourceToReleaseItemRelCmd(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t*
pduSessionResourceToReleaseItemRelCmd) {
if (!pDUSessionID->encode2PDUSessionID(
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceToReleaseItemRelCmd->pDUSessionID))
return false;
......@@ -80,8 +72,6 @@ bool PDUSessionResourceToReleaseItemRelCmd::
decodefromPDUSessionResourceToReleaseItemRelCmd(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t*
pduSessionResourceToReleaseItemRelCmd) {
if (pDUSessionID == nullptr) pDUSessionID = new PDUSessionID();
pDUSessionResourceReleaseCommandTransfer =
pduSessionResourceToReleaseItemRelCmd
->pDUSessionResourceReleaseCommandTransfer;
......
......@@ -19,13 +19,6 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU (BUPT), Tien-Thinh NGUYEN (EURECOM)
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_TO_RELEASE_ITEM_REL_CMD_H_
#define _PDU_SESSION_RESOURCE_TO_RELEASE_ITEM_REL_CMD_H_
......@@ -43,10 +36,10 @@ class PDUSessionResourceToReleaseItemRelCmd {
virtual ~PDUSessionResourceToReleaseItemRelCmd();
void setPDUSessionResourceToReleaseItemRelCmd(
PDUSessionID* m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer);
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceReleaseCommandTransfer);
void getPDUSessionResourceToReleaseItemRelCmd(
PDUSessionID*& m_pDUSessionID,
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceReleaseCommandTransfer);
bool encode2PDUSessionResourceToReleaseItemRelCmd(
......@@ -57,9 +50,8 @@ class PDUSessionResourceToReleaseItemRelCmd {
pduSessionResourceToReleaseItemRelCmd);
private:
PDUSessionID* pDUSessionID;
OCTET_STRING_t pDUSessionResourceReleaseCommandTransfer;
// ProtocolExtensionContainer (OPTIONAL)
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceReleaseCommandTransfer; // Mandatory
};
} // namespace ngap
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -30,6 +30,7 @@
#define _PLMNSUPPORTLIST_H_
#include "PLMNSupportItem.hpp"
#include <vector>
extern "C" {
#include "Ngap_PLMNSupportList.h"
......@@ -44,14 +45,14 @@ class PLMNSupportList {
bool encode2PLMNSupportList(Ngap_PLMNSupportList_t*);
bool decodefromPLMNSupportList(Ngap_PLMNSupportList_t*);
void addPLMNSupportItems(
PLMNSupportItem* m_plmnsupportItemItem, int numOfItem);
void getPLMNSupportItems(
PLMNSupportItem*& m_plmnsupportItemItem, int& numOfItem);
void addPLMNSupportItems(const std::vector<PLMNSupportItem>& items);
void getPLMNSupportItems(std::vector<PLMNSupportItem>& items);
void addPLMNSupportItem(const PLMNSupportItem& item);
private:
PLMNSupportItem* plmnsupportItemItem;
int numberOfplmnsupportItemItem;
std::vector<PLMNSupportItem> plmnSupportItems;
};
} // namespace ngap
......
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.
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