Commit 0388dabc authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'ngap_ies_code_refactoring' into 'develop'

Ngap ies code refactoring

See merge request oai/cn5g/oai-cn5g-amf!150
parents e96a9e2a ed4e1638
......@@ -34,13 +34,14 @@ ARG BASE_IMAGE=ubuntu:bionic
FROM oai-amf-base:latest as oai-amf-builder
# Copying source code
RUN rm -Rf /openair-amf/
WORKDIR /openair-amf/
COPY . /openair-amf
RUN cp -Rf /openair-amf-ext-ref /openair-amf/build/ext
# Building AMF
WORKDIR /openair-amf/build/scripts
RUN ldconfig && \
cp -Rf /openair-amf-ext-ref /openair-amf/build/ext && \
./build_amf --clean --Verbose --build-type Release --jobs && \
ldd /openair-amf/build/amf/build/amf && \
mv /openair-amf/build/amf/build/amf /openair-amf/build/amf/build/oai_amf
......
......@@ -3241,8 +3241,8 @@ void amf_n1::ul_nas_transport_handle(
itti_msg->amf_ue_ngap_id = amf_ue_ngap_id;
itti_msg->req_type = request_type;
itti_msg->pdu_sess_id = pdu_session_id;
itti_msg->dnn = dnn;
itti_msg->sm_msg = sm_msg;
itti_msg->dnn = bstrcpy(dnn);
itti_msg->sm_msg = bstrcpy(sm_msg);
itti_msg->snssai.sST = snssai.sst;
itti_msg->snssai.sD = std::to_string(snssai.sd);
itti_msg->plmn.mnc = plmn.mnc;
......
This diff is collapsed.
......@@ -56,7 +56,8 @@ class amf_n2 : public ngap::ngap_app {
* @param [std::shared_ptr<itti_ng_setup_request>]: ITTI message
* @return void
*/
void handle_itti_message(std::shared_ptr<itti_ng_setup_request> ng_setup_req);
void handle_itti_message(
std::shared_ptr<itti_ng_setup_request>& ng_setup_req);
/*
* Handle ITTI message (NG Reset)
......
......@@ -803,7 +803,7 @@ void amf_sbi::handle_post_sm_context_response_error(
"amf_sbi", "n1 sm", (uint8_t*) bdata(n1sm), blength(n1sm));
itti_n1n2_message_transfer_request* itti_msg =
new itti_n1n2_message_transfer_request(TASK_AMF_SBI, TASK_AMF_APP);
itti_msg->n1sm = n1sm;
itti_msg->n1sm = bstrcpy(n1sm);
itti_msg->is_n2sm_set = false;
itti_msg->supi = supi;
itti_msg->pdu_session_id = pdu_session_id;
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
extern "C" {
#include "OCTET_STRING.h"
#include "BIT_STRING.h"
#include "dynamic_memory_check.h"
}
......@@ -48,7 +49,6 @@ extern "C" {
class conv {
public:
static void hexa_to_ascii(uint8_t* from, char* to, size_t length);
static int ascii_to_hex(uint8_t* dst, const char* h);
static struct in_addr fromString(const std::string addr4);
static std::string toString(const struct in_addr& inaddr);
......@@ -64,9 +64,32 @@ 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);
static void octet_string_2_bstring(
static bool octet_string_2_bstring(
const OCTET_STRING_t& octet_str, bstring& b_str);
static void bstring_2_octet_string(bstring& b_str, OCTET_STRING_t& octet_str);
static void sd_string_to_int(const std::string& sd_str, uint32_t& sd);
static bool bstring_2_octet_string(
const bstring& b_str, OCTET_STRING_t& octet_str);
static bool octet_string_2_bit_string(
const OCTET_STRING_t& octet_str, BIT_STRING_t& bit_str,
const uint8_t& bits_unused);
static bool bstring_2_bit_string(const bstring& b_str, BIT_STRING_t& bit_str);
static bool sd_string_to_int(const std::string& sd_str, uint32_t& sd);
static bool string_to_int(
const std::string& str, uint32_t& value, const uint8_t& base);
static bool string_to_int8(const std::string& str, uint8_t& value);
static bool string_to_int32(const std::string& str, uint32_t& value);
static void bstring_2_string(const bstring& b_str, std::string& str);
static void string_2_bstring(const std::string& str, bstring& b_str);
static void octet_string_2_string(
const OCTET_STRING_t& octet_str, std::string& str);
static void string_2_octet_string(
const std::string& str, OCTET_STRING_t& o_str);
static bool int8_2_octet_string(const uint8_t& value, OCTET_STRING_t& o_str);
static bool octet_string_2_int8(const OCTET_STRING_t& o_str, uint8_t& value);
// TODO: bitstring_2_int32
static bool octet_string_copy(
OCTET_STRING_t& destination, const OCTET_STRING_t& source);
static bool check_bstring(const bstring& b_str);
static bool check_octet_string(const OCTET_STRING_t& octet_str);
};
#endif /* FILE_CONVERSIONS_HPP_SEEN */
......@@ -21,38 +21,38 @@
#include "AMF-UE-NGAP-ID.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {
amfUeNgapId = 0;
id_ = 0;
}
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::~AMF_UE_NGAP_ID() {}
//------------------------------------------------------------------------------
void AMF_UE_NGAP_ID::setAMF_UE_NGAP_ID(unsigned long m_amfUeNgapId) {
amfUeNgapId = m_amfUeNgapId;
bool AMF_UE_NGAP_ID::set(const uint64_t& id) {
if (id > AMF_UE_NGAP_ID_MAX_VALUE) return false;
id_ = id;
return true;
}
//------------------------------------------------------------------------------
unsigned long AMF_UE_NGAP_ID::getAMF_UE_NGAP_ID() {
return amfUeNgapId;
uint64_t AMF_UE_NGAP_ID::get() {
return id_;
}
//------------------------------------------------------------------------------
bool AMF_UE_NGAP_ID::encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t& amfuengapid) {
amfuengapid.size = 5;
amfuengapid.buf = (uint8_t*) calloc(1, amfuengapid.size);
if (!amfuengapid.buf) return false;
bool AMF_UE_NGAP_ID::encode2AMF_UE_NGAP_ID(
Ngap_AMF_UE_NGAP_ID_t& amf_ue_ngap_id) {
amf_ue_ngap_id.size = 5;
amf_ue_ngap_id.buf = (uint8_t*) calloc(1, amf_ue_ngap_id.size);
if (!amf_ue_ngap_id.buf) return false;
for (int i = 0; i < amfuengapid.size; i++) {
amfuengapid.buf[i] = (amfUeNgapId & (0xff00000000 >> i * 8)) >>
((amfuengapid.size - i - 1) * 8);
for (int i = 0; i < amf_ue_ngap_id.size; i++) {
amf_ue_ngap_id.buf[i] =
(id_ & (0xff00000000 >> i * 8)) >> ((amf_ue_ngap_id.size - i - 1) * 8);
}
return true;
......@@ -60,13 +60,13 @@ bool AMF_UE_NGAP_ID::encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t& amfuengapid) {
//------------------------------------------------------------------------------
bool AMF_UE_NGAP_ID::decodefromAMF_UE_NGAP_ID(
Ngap_AMF_UE_NGAP_ID_t& amfuengapid) {
if (!amfuengapid.buf) return false;
Ngap_AMF_UE_NGAP_ID_t& amf_ue_ngap_id) {
if (!amf_ue_ngap_id.buf) return false;
amfUeNgapId = 0;
for (int i = 0; i < amfuengapid.size; i++) {
amfUeNgapId = amfUeNgapId << 8;
amfUeNgapId |= amfuengapid.buf[i];
id_ = 0;
for (int i = 0; i < amf_ue_ngap_id.size; i++) {
id_ = id_ << 8;
id_ |= amf_ue_ngap_id.buf[i];
}
return true;
......
......@@ -21,6 +21,9 @@
#ifndef _AMF_UE_NGAP_ID_H_
#define _AMF_UE_NGAP_ID_H_
#include <cstdint>
constexpr uint64_t AMF_UE_NGAP_ID_MAX_VALUE = 1099511627775; // 2^40 -1
extern "C" {
#include "Ngap_AMF-UE-NGAP-ID.h"
......@@ -33,14 +36,14 @@ class AMF_UE_NGAP_ID {
AMF_UE_NGAP_ID();
virtual ~AMF_UE_NGAP_ID();
void setAMF_UE_NGAP_ID(unsigned long);
unsigned long getAMF_UE_NGAP_ID();
bool set(const uint64_t&);
uint64_t get();
bool encode2AMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
bool decodefromAMF_UE_NGAP_ID(Ngap_AMF_UE_NGAP_ID_t&);
private:
unsigned long amfUeNgapId;
uint64_t id_;
};
} // namespace ngap
......
......@@ -21,54 +21,38 @@
#include "AMFName.hpp"
extern "C" {
#include "OCTET_STRING.h"
}
#include <iostream>
using namespace std;
#include "conversions.hpp"
namespace ngap {
//------------------------------------------------------------------------------
AmfName::AmfName() {
amfname = nullptr;
}
AmfName::AmfName() {}
//------------------------------------------------------------------------------
AmfName::~AmfName() {
free(amfname);
amfname = nullptr;
}
AmfName::~AmfName() {}
//------------------------------------------------------------------------------
void AmfName::setValue(const std::string m_amfName) {
if (amfname) {
free(amfname);
amfname = nullptr;
}
amfname = (char*) calloc(1, m_amfName.size() + 1);
memcpy(amfname, m_amfName.c_str(), m_amfName.size());
amfname[m_amfName.size()] = '\0';
bool AmfName::setValue(const std::string& amf_name) {
if (amf_name.size() > AMF_NAME_SIZE_MAX) return false;
amf_name_ = amf_name;
return true;
}
//------------------------------------------------------------------------------
void AmfName::getValue(std::string& m_amfName) {
if (amfname) m_amfName = amfname;
void AmfName::getValue(std::string& amf_name) const {
amf_name = amf_name_;
}
//------------------------------------------------------------------------------
bool AmfName::encode2AmfName(Ngap_AMFName_t* amfNameIe) {
if (amfname)
if (OCTET_STRING_fromBuf(amfNameIe, amfname, strlen(amfname)) < 0)
return false;
bool AmfName::encode(Ngap_AMFName_t* amf_name_ie) {
conv::string_2_octet_string(amf_name_, *amf_name_ie);
return true;
}
//------------------------------------------------------------------------------
bool AmfName::decodefromAmfName(Ngap_AMFName_t* pdu) {
if (!pdu->buf) return false;
amfname = (char*) pdu->buf;
bool AmfName::decode(const Ngap_AMFName_t* amf_name_ie) {
if (!amf_name_ie->buf) return false;
conv::octet_string_2_string(*amf_name_ie, amf_name_);
return true;
}
......
......@@ -28,6 +28,7 @@ extern "C" {
#include "Ngap_AMFName.h"
}
constexpr uint8_t AMF_NAME_SIZE_MAX = 150;
namespace ngap {
class AmfName {
......@@ -35,13 +36,13 @@ class AmfName {
AmfName();
virtual ~AmfName();
bool encode2AmfName(Ngap_AMFName_t*);
bool decodefromAmfName(Ngap_AMFName_t*);
void setValue(const std::string m_amfName);
void getValue(std::string&);
bool encode(Ngap_AMFName_t*);
bool decode(const Ngap_AMFName_t*);
bool setValue(const std::string& amf_name);
void getValue(std::string& amf_name) const;
private:
char* amfname;
std::string amf_name_;
};
} // namespace ngap
......
......@@ -21,52 +21,54 @@
#include "AMFPointer.hpp"
#include <iostream>
#include "String2Value.hpp"
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFPointer::AMFPointer() {
pointer = 0;
pointer_ = 0;
}
//------------------------------------------------------------------------------
AMFPointer::~AMFPointer() {}
//------------------------------------------------------------------------------
void AMFPointer::setAMFPointer(const std::string charPointer) {
pointer = fromString<int>(charPointer);
bool AMFPointer::set(const std::string& pointer) {
uint8_t tmp = fromString<int>(pointer);
if (tmp > kAmfPointerMaxValue) return false;
pointer_ = tmp;
return true;
}
//------------------------------------------------------------------------------
void AMFPointer::setAMFPointer(const uint8_t& p) {
pointer = p;
bool AMFPointer::set(const uint8_t& pointer) {
if (pointer > kAmfPointerMaxValue) return false;
pointer_ = pointer;
return true;
}
//------------------------------------------------------------------------------
void AMFPointer::getAMFPointer(std::string& charPointer) {
charPointer = to_string(pointer);
void AMFPointer::get(std::string& pointer) {
pointer = std::to_string(pointer_);
}
//------------------------------------------------------------------------------
bool AMFPointer::encode2bitstring(Ngap_AMFPointer_t& amfpointer) {
amfpointer.size = 1;
uint8_t* buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
bool AMFPointer::encode(Ngap_AMFPointer_t& amf_pointer) {
amf_pointer.size = 1;
uint8_t* buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
if (!buffer) return false;
*buffer = ((pointer & 0x3f) << 2);
amfpointer.buf = buffer;
amfpointer.bits_unused = 2;
*buffer = ((pointer_ & 0x3f) << 2);
amf_pointer.buf = buffer;
amf_pointer.bits_unused = 2;
return true;
}
//------------------------------------------------------------------------------
bool AMFPointer::decodefrombitstring(Ngap_AMFPointer_t& amfpointer) {
if (!amfpointer.buf) return false;
pointer = (amfpointer.buf[0] & 0xfc) >> 2; // 1111 1100
bool AMFPointer::decode(Ngap_AMFPointer_t& amf_pointer) {
if (!amf_pointer.buf) return false;
pointer_ = (amf_pointer.buf[0] & 0xfc) >> 2; // 1111 1100
return true;
}
......
......@@ -23,7 +23,7 @@
#define _AMFPOINTER_H_
#include <string>
constexpr uint8_t kAmfPointerMaxValue = 63; // 6 bits
extern "C" {
#include "Ngap_AMFPointer.h"
}
......@@ -35,15 +35,15 @@ class AMFPointer {
AMFPointer();
virtual ~AMFPointer();
void setAMFPointer(const std::string);
void getAMFPointer(std::string&);
void setAMFPointer(const uint8_t&);
bool set(const std::string&);
void get(std::string&);
bool set(const uint8_t&);
bool encode2bitstring(Ngap_AMFPointer_t&);
bool decodefrombitstring(Ngap_AMFPointer_t&);
bool encode(Ngap_AMFPointer_t&);
bool decode(Ngap_AMFPointer_t&);
private:
uint8_t pointer;
uint8_t pointer_;
};
} // namespace ngap
......
......@@ -52,7 +52,7 @@ void AMFRegionID::getAMFRegionID(std::string& charid) {
}
//------------------------------------------------------------------------------
bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t& amfregionid) {
bool AMFRegionID::encode(Ngap_AMFRegionID_t& amfregionid) {
amfregionid.size = 1;
uint8_t* buffer = (uint8_t*) calloc(1, sizeof(uint8_t));
if (!buffer) return false;
......@@ -64,7 +64,7 @@ bool AMFRegionID::encode2bitstring(Ngap_AMFRegionID_t& amfregionid) {
}
//------------------------------------------------------------------------------
bool AMFRegionID::decodefrombitstring(Ngap_AMFRegionID_t& amfregionid) {
bool AMFRegionID::decode(Ngap_AMFRegionID_t& amfregionid) {
if (!amfregionid.buf) return false;
regionid = *amfregionid.buf;
......
......@@ -40,8 +40,8 @@ class AMFRegionID {
void setAMFRegionID(const uint8_t&);
bool encode2bitstring(Ngap_AMFRegionID_t&);
bool decodefrombitstring(Ngap_AMFRegionID_t&);
bool encode(Ngap_AMFRegionID_t&);
bool decode(Ngap_AMFRegionID_t&);
private:
uint8_t regionid;
......
......@@ -29,51 +29,62 @@ namespace ngap {
//------------------------------------------------------------------------------
AMFSetID::AMFSetID() {
setId = 0;
id_ = 0;
}
//------------------------------------------------------------------------------
AMFSetID::~AMFSetID() {}
//------------------------------------------------------------------------------
void AMFSetID::setAMFSetID(const std::string& charid) {
setId = fromString<uint16_t>(charid);
bool AMFSetID::set(const std::string& id) {
uint16_t tmp = fromString<uint16_t>(id);
if (tmp > kAmfSetIdMaxValue) return false;
id_ = tmp;
return true;
}
//------------------------------------------------------------------------------
bool AMFSetID::set(const uint16_t& id) {
if (id > kAmfSetIdMaxValue) return false;
id_ = id;
return true;
}
//------------------------------------------------------------------------------
void AMFSetID::setAMFSetID(const uint16_t& set_id) {
setId = set_id;
void AMFSetID::get(std::string& id) {
id = std::to_string(id_);
}
//------------------------------------------------------------------------------
void AMFSetID::getAMFSetID(std::string& charid) {
charid = std::to_string(setId);
void AMFSetID::get(uint16_t& id) {
id = id_;
}
//------------------------------------------------------------------------------
bool AMFSetID::encode2bitstring(Ngap_AMFSetID_t& amfSetId) {
amfSetId.size = 2;
bool AMFSetID::encode(Ngap_AMFSetID_t& amf_set_id) const {
amf_set_id.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 = id_ & 0x3ff;
buffer[0] = ((id_ & 0x03fc) >> 2);
buffer[1] = ((id_ & 0x0003) << 6);
amf_set_id.buf = buffer;
amf_set_id.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::decode(const Ngap_AMFSetID_t& amf_set_id) {
if (!amf_set_id.buf) return false;
for (int i = 0; i < amf_set_id.size; i++) {
printf("%x ", amf_set_id.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 |= amf_set_id.buf[0] << 8;
temp |= amf_set_id.buf[1];
id_ = (temp & 0xffc0) >> 6; // 1111 1111 11 00 0000
return true;
}
......
......@@ -22,6 +22,7 @@
#define _AMF_SET_ID_H_
#include <string>
constexpr uint16_t kAmfSetIdMaxValue = 1023;
extern "C" {
#include "Ngap_AMFSetID.h"
......@@ -34,15 +35,16 @@ class AMFSetID {
AMFSetID();
virtual ~AMFSetID();
void setAMFSetID(const std::string&);
void setAMFSetID(const uint16_t& set_id);
void getAMFSetID(std::string&);
bool set(const std::string&);
bool set(const uint16_t&);
void get(std::string&);
void get(uint16_t&);
bool encode2bitstring(Ngap_AMFSetID_t&);
bool decodefrombitstring(Ngap_AMFSetID_t&);
bool encode(Ngap_AMFSetID_t&) const;
bool decode(const Ngap_AMFSetID_t&);
private:
uint16_t setId;
uint16_t id_;
};
} // namespace ngap
......
......@@ -34,36 +34,42 @@ AllowedNSSAI::AllowedNSSAI() {}
AllowedNSSAI::~AllowedNSSAI() {}
//------------------------------------------------------------------------------
void AllowedNSSAI::setAllowedNSSAI(const std::vector<S_NSSAI>& list) {
allowedSnssaiList = list;
void AllowedNSSAI::set(const std::vector<S_NSSAI>& list) {
// Get maximum 8 items
uint8_t number_items = (list.size() > kAllowedSNSSAIMaxItems) ?
kAllowedSNSSAIMaxItems :
list.size();
list_.insert(list_.begin(), list.begin(), list.begin() + number_items);
}
//------------------------------------------------------------------------------
void AllowedNSSAI::getAllowedNSSAI(std::vector<S_NSSAI>& list) {
list = allowedSnssaiList;
void AllowedNSSAI::get(std::vector<S_NSSAI>& list) {
list = list_;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList) {
for (std::vector<S_NSSAI>::iterator it = std::begin(allowedSnssaiList);
it < std::end(allowedSnssaiList); ++it) {
Ngap_AllowedNSSAI_Item_t* allowednssaiitem =
bool AllowedNSSAI::encode(Ngap_AllowedNSSAI_t* list) {
for (std::vector<S_NSSAI>::iterator it = std::begin(list_);
it < std::end(list_); ++it) {
Ngap_AllowedNSSAI_Item_t* item =
(Ngap_AllowedNSSAI_Item_t*) calloc(1, sizeof(Ngap_AllowedNSSAI_Item_t));
if (!allowednssaiitem) return false;
if (!it->encode2S_NSSAI(&allowednssaiitem->s_NSSAI)) return false;
if (ASN_SEQUENCE_ADD(&allowedNssaiList->list, allowednssaiitem) != 0)
return false;
if (!item) return false;
if (!it->encode(&item->s_NSSAI)) return false;
if (ASN_SEQUENCE_ADD(&list->list, item) != 0) return false;
}
return true;
}
//------------------------------------------------------------------------------
bool AllowedNSSAI::decodefromAllowedNSSAI(
Ngap_AllowedNSSAI_t* allowedNssaiList) {
for (int i = 0; i < allowedNssaiList->list.count; i++) {
bool AllowedNSSAI::decode(Ngap_AllowedNSSAI_t* list) {
list_.clear();
// Get maximum 8 items
uint8_t number_items = (list->list.count > kAllowedSNSSAIMaxItems) ?
kAllowedSNSSAIMaxItems :
list->list.count;
for (int i = 0; i < number_items; i++) {
S_NSSAI snssai = {};
if (!snssai.decodefromS_NSSAI(&allowedNssaiList->list.array[i]->s_NSSAI))
return false;
allowedSnssaiList.push_back(snssai);
if (!snssai.decode(&list->list.array[i]->s_NSSAI)) return false;
list_.push_back(snssai);
}
return true;
}
......
......@@ -24,6 +24,7 @@
#include "S-NSSAI.hpp"
#include <vector>
constexpr uint8_t kAllowedSNSSAIMaxItems = 8;
extern "C" {
#include "Ngap_AllowedNSSAI.h"
......@@ -36,14 +37,14 @@ class AllowedNSSAI {
AllowedNSSAI();
virtual ~AllowedNSSAI();
void setAllowedNSSAI(const std::vector<S_NSSAI>& list);
void getAllowedNSSAI(std::vector<S_NSSAI>& list);
void set(const std::vector<S_NSSAI>& list);
void get(std::vector<S_NSSAI>& list);
bool encode2AllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList);
bool decodefromAllowedNSSAI(Ngap_AllowedNSSAI_t* allowedNssaiList);
bool encode(Ngap_AllowedNSSAI_t* allowedNssaiList);
bool decode(Ngap_AllowedNSSAI_t* allowedNssaiList);
private:
std::vector<S_NSSAI> allowedSnssaiList;
std::vector<S_NSSAI> list_;
};
} // namespace ngap
#endif
......@@ -57,14 +57,14 @@ void BroadcastPLMNItem::getPlmnSliceSupportList(
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* plmnItem) {
if (!plmn.encode2octetstring(plmnItem->pLMNIdentity)) return false;
if (!plmn.encode(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 (!it->encode2S_NSSAI(&slice->s_NSSAI)) return false;
if (!it->encode(&slice->s_NSSAI)) return false;
if (ASN_SEQUENCE_ADD(&plmnItem->tAISliceSupportList.list, slice) != 0)
return false;
}
......@@ -74,11 +74,10 @@ bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* pdu) {
if (!plmn.decodefromoctetstring(pdu->pLMNIdentity)) return false;
if (!plmn.decode(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))
if (!snssai.decode(&pdu->tAISliceSupportList.list.array[i]->s_NSSAI))
return false;
supportedSliceList.push_back(snssai);
}
......
......@@ -20,56 +20,55 @@
*/
#include "Cause.hpp"
#include <iostream>
using namespace std;
#include "logger.hpp"
namespace ngap {
//------------------------------------------------------------------------------
Cause::Cause() {
causeValue = -1;
cause_present_ = Ngap_Cause_PR_NOTHING;
cause_value_ = -1;
}
//------------------------------------------------------------------------------
Cause::~Cause() {}
//------------------------------------------------------------------------------
void Cause::setChoiceOfCause(Ngap_Cause_PR m_causePresent) {
causePresent = m_causePresent;
void Cause::setChoiceOfCause(const Ngap_Cause_PR& cause_present) {
cause_present_ = cause_present;
}
//------------------------------------------------------------------------------
void Cause::setValue(long m_causeValue) {
causeValue = m_causeValue;
void Cause::setValue(const long& cause_value) {
cause_value_ = cause_value;
}
//------------------------------------------------------------------------------
bool Cause::encode2Cause(Ngap_Cause_t* cause) {
cause->present = causePresent;
switch (causePresent) {
bool Cause::encode(Ngap_Cause_t& cause) const {
cause.present = cause_present_;
switch (cause_present_) {
case Ngap_Cause_PR_radioNetwork: {
cause->choice.radioNetwork = causeValue;
cause.choice.radioNetwork = cause_value_;
break;
}
case Ngap_Cause_PR_transport: {
cause->choice.transport = causeValue;
cause.choice.transport = cause_value_;
break;
}
case Ngap_Cause_PR_nas: {
cause->choice.nas = causeValue;
cause.choice.nas = cause_value_;
break;
}
case Ngap_Cause_PR_protocol: {
cause->choice.protocol = causeValue;
cause.choice.protocol = cause_value_;
break;
}
case Ngap_Cause_PR_misc: {
cause->choice.misc = causeValue;
cause.choice.misc = cause_value_;
break;
}
default: {
cout << "[Warning] Cause Present error!" << endl;
Logger::ngap().warn("Cause Present error!");
return false;
break;
}
......@@ -78,26 +77,26 @@ bool Cause::encode2Cause(Ngap_Cause_t* cause) {
}
//------------------------------------------------------------------------------
bool Cause::decodefromCause(Ngap_Cause_t* pdu) {
causePresent = pdu->present;
switch (causePresent) {
bool Cause::decode(const Ngap_Cause_t& cause) {
cause_present_ = cause.present;
switch (cause_present_) {
case Ngap_Cause_PR_radioNetwork: {
causeValue = pdu->choice.radioNetwork;
cause_value_ = cause.choice.radioNetwork;
} break;
case Ngap_Cause_PR_transport: {
causeValue = pdu->choice.transport;
cause_value_ = cause.choice.transport;
} break;
case Ngap_Cause_PR_nas: {
causeValue = pdu->choice.nas;
cause_value_ = cause.choice.nas;
} break;
case Ngap_Cause_PR_protocol: {
causeValue = pdu->choice.protocol;
cause_value_ = cause.choice.protocol;
} break;
case Ngap_Cause_PR_misc: {
causeValue = pdu->choice.misc;
cause_value_ = cause.choice.misc;
} break;
default: {
cout << "[Warning] Cause Present error!" << endl;
Logger::ngap().warn("Cause Present error!");
return false;
}
}
......@@ -105,12 +104,18 @@ bool Cause::decodefromCause(Ngap_Cause_t* pdu) {
}
//------------------------------------------------------------------------------
Ngap_Cause_PR Cause::getChoiceOfCause() {
return causePresent;
Ngap_Cause_PR Cause::getChoiceOfCause() const {
return cause_present_;
}
//------------------------------------------------------------------------------
long Cause::getValue() const {
return cause_value_;
}
//------------------------------------------------------------------------------
long Cause::getValue() {
return causeValue;
void Cause::set(const long& value, const Ngap_Cause_PR& cause_present) {
cause_value_ = value;
cause_present_ = cause_present;
}
} // namespace ngap
......@@ -33,16 +33,17 @@ class Cause {
Cause();
virtual ~Cause();
bool encode2Cause(Ngap_Cause_t* cause);
bool decodefromCause(Ngap_Cause_t* pdu);
void setChoiceOfCause(Ngap_Cause_PR m_causePresent);
Ngap_Cause_PR getChoiceOfCause();
void setValue(long);
long getValue();
bool encode(Ngap_Cause_t& cause) const;
bool decode(const Ngap_Cause_t& cause);
void setChoiceOfCause(const Ngap_Cause_PR& cause_present);
Ngap_Cause_PR getChoiceOfCause() const;
void setValue(const long& value);
long getValue() const;
void set(const long& value, const Ngap_Cause_PR& cause_present);
private:
long causeValue;
Ngap_Cause_PR causePresent;
long cause_value_;
Ngap_Cause_PR cause_present_;
};
} // namespace ngap
......
......@@ -25,44 +25,41 @@ extern "C" {
#include "Ngap_TAIListForInactiveItem.h"
}
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
CoreNetworkAssistanceInfo::CoreNetworkAssistanceInfo() {
pagingDRX = nullptr;
micoModeInd = nullptr;
pagingDRX = std::nullopt;
micoModeInd = std::nullopt;
}
//------------------------------------------------------------------------------
CoreNetworkAssistanceInfo::~CoreNetworkAssistanceInfo() {}
//------------------------------------------------------------------------------
void CoreNetworkAssistanceInfo::setCoreNetworkAssistanceInfo(
const UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX* m_pagingDRX,
void CoreNetworkAssistanceInfo::set(
const UEIdentityIndexValue& ue_identity_index_value,
const DefaultPagingDRX& paging_drx,
const PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
const bool& m_micoModeInd, const std::vector<TAI>& m_tai) {
ueIdentityIndexValue = m_ueIdentityIndexValue;
pagingDRX = m_pagingDRX;
ueIdentityIndexValue = ue_identity_index_value;
pagingDRX = std::optional<DefaultPagingDRX>(paging_drx);
periodicRegUpdateTimer = m_periodicRegUpdateTimer;
if (m_micoModeInd) {
micoModeInd = new MICOModeIndication();
micoModeInd = std::make_optional<MICOModeIndication>();
}
}
//------------------------------------------------------------------------------
void CoreNetworkAssistanceInfo::getCoreNetworkAssistanceInfo(
UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX*& m_pagingDRX,
void CoreNetworkAssistanceInfo::get(
UEIdentityIndexValue& ue_identity_index_value,
std::optional<DefaultPagingDRX>& paging_drx,
PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
bool& m_micoModeInd, std::vector<TAI>& m_tai) {
m_ueIdentityIndexValue = ueIdentityIndexValue;
m_pagingDRX = pagingDRX;
ue_identity_index_value = ueIdentityIndexValue;
paging_drx = pagingDRX;
m_periodicRegUpdateTimer = periodicRegUpdateTimer;
if (micoModeInd)
if (micoModeInd.has_value())
m_micoModeInd = true;
else
m_micoModeInd = false;
......@@ -70,14 +67,14 @@ void CoreNetworkAssistanceInfo::getCoreNetworkAssistanceInfo(
}
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
bool CoreNetworkAssistanceInfo::encode(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
if (!ueIdentityIndexValue.encode2UEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
if (!ueIdentityIndexValue.encode(
coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
if (!periodicRegUpdateTimer.encode2PeriodicRegistrationUpdateTimer(
&coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
if (!periodicRegUpdateTimer.encode(
coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
return false;
for (std::vector<TAI>::iterator it = std::begin(taiList);
......@@ -86,28 +83,27 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
(Ngap_TAIListForInactiveItem_t*) calloc(
1, sizeof(Ngap_TAIListForInactiveItem_t));
if (!taiListForInactiveItem) return false;
if (!it->encode2TAI(&taiListForInactiveItem->tAI)) return false;
if (!it->encode(&taiListForInactiveItem->tAI)) return false;
if (ASN_SEQUENCE_ADD(
&coreNetworkAssistanceInformation->tAIListForInactive.list,
taiListForInactiveItem) != 0)
return false;
}
if (pagingDRX) {
Ngap_PagingDRX_t* pagingdrx =
if (pagingDRX.has_value()) {
Ngap_PagingDRX_t* paging_drx =
(Ngap_PagingDRX_t*) calloc(1, sizeof(Ngap_PagingDRX_t));
if (!pagingdrx) return false;
if (!pagingDRX->encode2DefaultPagingDRX(*pagingdrx)) return false;
coreNetworkAssistanceInformation->uESpecificDRX = pagingdrx;
if (!paging_drx) return false;
if (!pagingDRX.value().encode(*paging_drx)) return false;
coreNetworkAssistanceInformation->uESpecificDRX = paging_drx;
}
if (micoModeInd) {
if (micoModeInd.has_value()) {
Ngap_MICOModeIndication_t* micomodeindication =
(Ngap_MICOModeIndication_t*) calloc(
1, sizeof(Ngap_MICOModeIndication_t));
if (!micomodeindication) return false;
if (!micoModeInd->encode2MICOModeIndication(micomodeindication))
return false;
if (!micoModeInd.value().encode(micomodeindication)) return false;
coreNetworkAssistanceInformation->mICOModeIndication = micomodeindication;
}
......@@ -115,21 +111,21 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
}
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
bool CoreNetworkAssistanceInfo::decode(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
if (!ueIdentityIndexValue.decodefromUEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
if (!ueIdentityIndexValue.decode(
coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
if (!periodicRegUpdateTimer.decodefromPeriodicRegistrationUpdateTimer(
&coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
if (!periodicRegUpdateTimer.decode(
coreNetworkAssistanceInformation->periodicRegistrationUpdateTimer))
return false;
for (int i = 0;
i < coreNetworkAssistanceInformation->tAIListForInactive.list.count;
i++) {
TAI tai_item = {};
if (!tai_item.decodefromTAI(
if (!tai_item.decode(
&coreNetworkAssistanceInformation->tAIListForInactive.list.array[i]
->tAI))
return false;
......@@ -137,17 +133,17 @@ bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
}
if (coreNetworkAssistanceInformation->uESpecificDRX) {
if (pagingDRX == nullptr) pagingDRX = new DefaultPagingDRX();
if (!pagingDRX->decodefromDefaultPagingDRX(
*(coreNetworkAssistanceInformation->uESpecificDRX)))
DefaultPagingDRX tmp = {};
if (!tmp.decode(*(coreNetworkAssistanceInformation->uESpecificDRX)))
return false;
pagingDRX = std::optional<DefaultPagingDRX>(tmp);
}
if (coreNetworkAssistanceInformation->mICOModeIndication) {
if (micoModeInd == nullptr) micoModeInd = new MICOModeIndication();
if (!micoModeInd->decodefromMICOModeIndication(
coreNetworkAssistanceInformation->mICOModeIndication))
MICOModeIndication tmp = {};
if (!tmp.decode(coreNetworkAssistanceInformation->mICOModeIndication))
return false;
micoModeInd = std::optional<MICOModeIndication>(tmp);
}
return true;
......
......@@ -28,6 +28,8 @@
#include "TAI.hpp"
#include "UEIdentityIndexValue.hpp"
#include <optional>
extern "C" {
#include "Ngap_CoreNetworkAssistanceInformation.h"
}
......@@ -39,31 +41,29 @@ class CoreNetworkAssistanceInfo {
CoreNetworkAssistanceInfo();
virtual ~CoreNetworkAssistanceInfo();
void setCoreNetworkAssistanceInfo(
const UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX* m_pagingDRX,
const PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
const bool& m_micoModeInd, const std::vector<TAI>& m_tai);
void set(
const UEIdentityIndexValue& ue_identity_index_value,
const DefaultPagingDRX& paging_drx,
const PeriodicRegistrationUpdateTimer& periodic_reg_update_timer,
const bool& mico_mode_ind, const std::vector<TAI>& tai);
void getCoreNetworkAssistanceInfo(
UEIdentityIndexValue& m_ueIdentityIndexValue,
DefaultPagingDRX*& m_pagingDRX,
PeriodicRegistrationUpdateTimer& m_periodicRegUpdateTimer,
bool& m_micoModeInd, std::vector<TAI>& m_tai);
void get(
UEIdentityIndexValue& ue_identity_index_value,
std::optional<DefaultPagingDRX>& paging_drx,
PeriodicRegistrationUpdateTimer& periodic_reg_update_timer,
bool& mico_mode_ind, std::vector<TAI>& tai);
bool encode2CoreNetworkAssistanceInfo(Ngap_CoreNetworkAssistanceInformation_t*
coreNetworkAssistanceInformation);
bool decodefromCoreNetworkAssistanceInfo(
Ngap_CoreNetworkAssistanceInformation_t*
coreNetworkAssistanceInformation);
bool encode(Ngap_CoreNetworkAssistanceInformation_t*
core_network_assistance_information);
bool decode(Ngap_CoreNetworkAssistanceInformation_t*
core_network_assistance_information);
private:
UEIdentityIndexValue ueIdentityIndexValue; // Mandatory
DefaultPagingDRX* pagingDRX; // UE Specific DRX, Optional
std::optional<DefaultPagingDRX> pagingDRX; // UE Specific DRX, Optional
PeriodicRegistrationUpdateTimer periodicRegUpdateTimer; // Mandatory
MICOModeIndication* micoModeInd; // Optional
std::vector<TAI> taiList; // Mandatory
// int numoftai;
std::optional<MICOModeIndication> micoModeInd; // Optional
std::vector<TAI> taiList; // TAI List for RRC Inactive, Mandatory
// TODO: Expected UE Behaviour (Optional)
};
......
......@@ -121,7 +121,7 @@ int CriticalityDiagnostics::encode2pdu(Ngap_NGSetupFailure_t* ngSetupFailure) {
}
//------------------------------------------------------------------------------
bool CriticalityDiagnostics::decodefrompdu(Ngap_CriticalityDiagnostics_t* pdu) {
bool CriticalityDiagnostics::decodeFromPdu(Ngap_CriticalityDiagnostics_t* pdu) {
// timeValue = *pdu;
if (pdu->procedureCode) {
procedureCodeIsSet = true;
......@@ -141,7 +141,7 @@ bool CriticalityDiagnostics::decodefrompdu(Ngap_CriticalityDiagnostics_t* pdu) {
iEsCriticalityDiagnostics =
new IEsCriticalityDiagnostics[numberOfIEsCriticalityDiagnostics]();
for (int i = 0; i < numberOfIEsCriticalityDiagnostics; i++) {
iEsCriticalityDiagnostics[i].decodefrompdu(
iEsCriticalityDiagnostics[i].decodeFromPdu(
pdu->iEsCriticalityDiagnostics->list.array[i]);
}
}
......
......@@ -39,7 +39,7 @@ class CriticalityDiagnostics {
virtual ~CriticalityDiagnostics();
int encode2pdu(Ngap_NGSetupFailure_t*);
bool decodefrompdu(Ngap_CriticalityDiagnostics_t*);
bool decodeFromPdu(Ngap_CriticalityDiagnostics_t*);
void setProcedureCodeValue(Ngap_ProcedureCode_t);
void setTriggeringMessageValue(Ngap_TriggeringMessage_t);
void setCriticalityValue(Ngap_Criticality_t);
......
......@@ -28,32 +28,32 @@ namespace ngap {
//------------------------------------------------------------------------------
DefaultPagingDRX::DefaultPagingDRX() {
pagingDrx = 0;
paging_drx_ = 0;
}
//------------------------------------------------------------------------------
DefaultPagingDRX::~DefaultPagingDRX() {}
//------------------------------------------------------------------------------
void DefaultPagingDRX::setValue(e_Ngap_PagingDRX m_pagingDrx) {
pagingDrx = m_pagingDrx;
void DefaultPagingDRX::setValue(const e_Ngap_PagingDRX& paging_drx) {
paging_drx_ = paging_drx;
}
//------------------------------------------------------------------------------
bool DefaultPagingDRX::encode2DefaultPagingDRX(Ngap_PagingDRX_t& pagingdrx) {
pagingdrx = pagingDrx;
return true;
int DefaultPagingDRX::getValue() const {
return paging_drx_;
}
//------------------------------------------------------------------------------
bool DefaultPagingDRX::decodefromDefaultPagingDRX(Ngap_PagingDRX_t& pagingdrx) {
pagingDrx = pagingdrx;
bool DefaultPagingDRX::encode(Ngap_PagingDRX_t& paging_drx) {
paging_drx = paging_drx_;
return true;
}
//------------------------------------------------------------------------------
int DefaultPagingDRX::getValue() {
return pagingDrx;
bool DefaultPagingDRX::decode(const Ngap_PagingDRX_t& paging_drx) {
paging_drx_ = paging_drx;
return true;
}
} // namespace ngap
......@@ -33,13 +33,13 @@ class DefaultPagingDRX {
DefaultPagingDRX();
virtual ~DefaultPagingDRX();
void setValue(e_Ngap_PagingDRX m_pagingDrx);
int getValue();
bool encode2DefaultPagingDRX(Ngap_PagingDRX_t&);
bool decodefromDefaultPagingDRX(Ngap_PagingDRX_t&);
void setValue(const e_Ngap_PagingDRX& paging_drx);
int getValue() const;
bool encode(Ngap_PagingDRX_t&);
bool decode(const Ngap_PagingDRX_t&);
private:
int pagingDrx;
int paging_drx_;
};
} // namespace ngap
......
......@@ -21,51 +21,39 @@
#include "EUTRA-CGI.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
EUTRA_CGI::EUTRA_CGI() {
plmnId = NULL;
eUTRACellIdentity = NULL;
}
EUTRA_CGI::EUTRA_CGI() {}
//------------------------------------------------------------------------------
EUTRA_CGI::~EUTRA_CGI() {}
//------------------------------------------------------------------------------
void EUTRA_CGI::setEUTRA_CGI(
PlmnId* m_plmnId, EUTRACellIdentity* m_eUTRACellIdentity) {
plmnId = m_plmnId;
eUTRACellIdentity = m_eUTRACellIdentity;
void EUTRA_CGI::set(
const PlmnId& plmn_id, const EUTRACellIdentity& eUTRA_cell_identity) {
plmn_id_ = plmn_id;
eUTRA_cell_identity_ = eUTRA_cell_identity;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::encode2EUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
if (!plmnId->encode2octetstring(eutra_cgi->pLMNIdentity)) return false;
if (!eUTRACellIdentity->encode2bitstring(eutra_cgi->eUTRACellIdentity))
return false;
bool EUTRA_CGI::encode(Ngap_EUTRA_CGI_t& eutra_cgi) {
if (!plmn_id_.encode(eutra_cgi.pLMNIdentity)) return false;
if (!eUTRA_cell_identity_.encode(eutra_cgi.eUTRACellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
bool EUTRA_CGI::decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t* eutra_cgi) {
if (plmnId == nullptr) plmnId = new PlmnId();
if (eUTRACellIdentity == nullptr) eUTRACellIdentity = new EUTRACellIdentity();
if (!plmnId->decodefromoctetstring(eutra_cgi->pLMNIdentity)) return false;
if (!eUTRACellIdentity->decodefrombitstring(eutra_cgi->eUTRACellIdentity))
return false;
bool EUTRA_CGI::decode(Ngap_EUTRA_CGI_t& eutra_cgi) {
if (!plmn_id_.decode(eutra_cgi.pLMNIdentity)) return false;
if (!eUTRA_cell_identity_.decode(eutra_cgi.eUTRACellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
void EUTRA_CGI::getEUTRA_CGI(
PlmnId*& m_plmnId, EUTRACellIdentity*& m_eUTRACellIdentity) {
m_plmnId = plmnId;
m_eUTRACellIdentity = eUTRACellIdentity;
void EUTRA_CGI::get(PlmnId& plmn_id, EUTRACellIdentity& eUTRA_cell_identity) {
plmn_id = plmn_id_;
eUTRA_cell_identity = eUTRA_cell_identity_;
}
} // namespace ngap
......@@ -36,14 +36,15 @@ class EUTRA_CGI {
EUTRA_CGI();
virtual ~EUTRA_CGI();
void setEUTRA_CGI(PlmnId*, EUTRACellIdentity*);
bool encode2EUTRA_CGI(Ngap_EUTRA_CGI_t*);
bool decodefromEUTRA_CGI(Ngap_EUTRA_CGI_t*);
void getEUTRA_CGI(PlmnId*&, EUTRACellIdentity*&);
void set(const PlmnId&, const EUTRACellIdentity&);
void get(PlmnId&, EUTRACellIdentity&);
bool encode(Ngap_EUTRA_CGI_t&);
bool decode(Ngap_EUTRA_CGI_t&);
private:
PlmnId* plmnId;
EUTRACellIdentity* eUTRACellIdentity;
PlmnId plmn_id_; // Mandatory
EUTRACellIdentity eUTRA_cell_identity_; // Mandatory
};
} // namespace ngap
......
......@@ -28,47 +28,47 @@ namespace ngap {
//------------------------------------------------------------------------------
EUTRACellIdentity::EUTRACellIdentity() {
eutracellidentity = 0;
id_ = 0;
}
//------------------------------------------------------------------------------
EUTRACellIdentity::~EUTRACellIdentity() {}
//------------------------------------------------------------------------------
void EUTRACellIdentity::setEUTRACellIdentity(uint32_t m_eutracellidentity) {
eutracellidentity = m_eutracellidentity;
bool EUTRACellIdentity::set(const uint32_t& id) {
if (id > kEUTRACellIdentityMaxValue) return false;
id_ = id;
return true;
}
//------------------------------------------------------------------------------
bool EUTRACellIdentity::encode2bitstring(
Ngap_EUTRACellIdentity_t& eUTRACellIdentity) {
eUTRACellIdentity.bits_unused = 4;
eUTRACellIdentity.size = 4;
eUTRACellIdentity.buf = (uint8_t*) calloc(1, sizeof(uint32_t));
if (!eUTRACellIdentity.buf) return false;
eUTRACellIdentity.buf[3] = eutracellidentity & 0x000000ff;
eUTRACellIdentity.buf[2] = (eutracellidentity & 0x0000ff00) >> 8;
eUTRACellIdentity.buf[1] = (eutracellidentity & 0x00ff0000) >> 16;
eUTRACellIdentity.buf[0] = (eutracellidentity & 0xff000000) >> 24;
return true;
uint32_t EUTRACellIdentity::get() {
return id_;
}
//------------------------------------------------------------------------------
bool EUTRACellIdentity::decodefrombitstring(
Ngap_EUTRACellIdentity_t& eUTRACellIdentity) {
if (!eUTRACellIdentity.buf) return false;
eutracellidentity = eUTRACellIdentity.buf[0] << 24;
eutracellidentity |= eUTRACellIdentity.buf[1] << 16;
eutracellidentity |= eUTRACellIdentity.buf[2] << 8;
eutracellidentity |= eUTRACellIdentity.buf[3];
bool EUTRACellIdentity::encode(Ngap_EUTRACellIdentity_t& eUTRA_cell_identity) {
eUTRA_cell_identity.bits_unused = 4; // 28 = 4*8 - 4 bits
eUTRA_cell_identity.size = 4;
eUTRA_cell_identity.buf = (uint8_t*) calloc(1, sizeof(uint32_t));
if (!eUTRA_cell_identity.buf) return false;
eUTRA_cell_identity.buf[3] = id_ & 0x000000ff;
eUTRA_cell_identity.buf[2] = (id_ & 0x0000ff00) >> 8;
eUTRA_cell_identity.buf[1] = (id_ & 0x00ff0000) >> 16;
eUTRA_cell_identity.buf[0] = (id_ & 0xff000000) >> 24;
return true;
}
//------------------------------------------------------------------------------
uint32_t EUTRACellIdentity::getEUTRACellIdentity() {
return eutracellidentity;
bool EUTRACellIdentity::decode(Ngap_EUTRACellIdentity_t& eUTRA_cell_identity) {
if (!eUTRA_cell_identity.buf) return false;
id_ = eUTRA_cell_identity.buf[0] << 24;
id_ |= eUTRA_cell_identity.buf[1] << 16;
id_ |= eUTRA_cell_identity.buf[2] << 8;
id_ |= eUTRA_cell_identity.buf[3];
return true;
}
} // namespace ngap
......@@ -21,6 +21,9 @@
#ifndef _EUTRACellIdentity_H_
#define _EUTRACellIdentity_H_
#include <cstdint>
constexpr uint32_t kEUTRACellIdentityMaxValue = 268435455; // 2^28-1
extern "C" {
#include "Ngap_EUTRACellIdentity.h"
......@@ -33,13 +36,13 @@ class EUTRACellIdentity {
EUTRACellIdentity();
virtual ~EUTRACellIdentity();
bool encode2bitstring(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
bool decodefrombitstring(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
uint32_t getEUTRACellIdentity();
void setEUTRACellIdentity(uint32_t m_eutracellidentity);
bool encode(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
bool decode(Ngap_EUTRACellIdentity_t& eUTRACellIdentity);
uint32_t get();
bool set(const uint32_t& m_eutracellidentity);
private:
uint32_t eutracellidentity;
uint32_t id_;
};
} // namespace ngap
......
......@@ -31,47 +31,48 @@ FiveGSTmsi::FiveGSTmsi() {}
FiveGSTmsi::~FiveGSTmsi() {}
//------------------------------------------------------------------------------
bool FiveGSTmsi::decodefrompdu(Ngap_FiveG_S_TMSI_t pdu) {
amfSetid.decodefrombitstring(pdu.aMFSetID);
amfPointer.decodefrombitstring(pdu.aMFPointer);
bool FiveGSTmsi::decodeFromPdu(Ngap_FiveG_S_TMSI_t pdu) {
amf_set_id_.decode(pdu.aMFSetID);
amf_pointer_.decode(pdu.aMFPointer);
uint32_t tmsi = ntohl(*(uint32_t*) pdu.fiveG_TMSI.buf);
int size = pdu.fiveG_TMSI.size;
std::string setId, pointer;
amfSetid.getAMFSetID(setId);
amfPointer.getAMFPointer(pointer);
_5g_s_tmsi = setId + pointer + conv::tmsi_to_string(tmsi);
tmsi_value = conv::tmsi_to_string(tmsi);
amf_set_id_.get(setId);
amf_pointer_.get(pointer);
_5g_s_tmsi_ = setId + pointer + conv::tmsi_to_string(tmsi);
tmsi_value_ = conv::tmsi_to_string(tmsi);
return true;
}
//------------------------------------------------------------------------------
void FiveGSTmsi::getValue(std::string& tmsi) {
tmsi = _5g_s_tmsi;
void FiveGSTmsi::getTmsi(std::string& tmsi) {
tmsi = _5g_s_tmsi_;
}
//------------------------------------------------------------------------------
void FiveGSTmsi::getValue(
std::string& setid, std::string& pointer, std::string& tmsi) {
amfSetid.getAMFSetID(setid);
amfPointer.getAMFPointer(pointer);
tmsi = tmsi_value;
void FiveGSTmsi::get(
std::string& set_id, std::string& pointer, std::string& tmsi) {
amf_set_id_.get(set_id);
amf_pointer_.get(pointer);
tmsi = tmsi_value_;
}
//------------------------------------------------------------------------------
void FiveGSTmsi::setValue(
const std::string& setId, const std::string& pointer,
bool FiveGSTmsi::set(
const std::string& set_id, const std::string& pointer,
const std::string& tmsi) {
amfSetid.setAMFSetID(setId);
amfPointer.setAMFPointer(pointer);
_5g_s_tmsi = tmsi;
if (!amf_set_id_.set(set_id)) return false;
if (!amf_pointer_.set(pointer)) return false;
_5g_s_tmsi_ = tmsi;
return true;
}
//------------------------------------------------------------------------------
bool FiveGSTmsi::encode2pdu(Ngap_FiveG_S_TMSI_t* pdu) {
amfSetid.encode2bitstring(pdu->aMFSetID);
amfPointer.encode2bitstring(pdu->aMFPointer);
amf_set_id_.encode(pdu->aMFSetID);
amf_pointer_.encode(pdu->aMFPointer);
uint32_t tmsi = (uint32_t) std::stol(_5g_s_tmsi);
uint32_t tmsi = (uint32_t) std::stol(_5g_s_tmsi_);
uint8_t* buf = (uint8_t*) malloc(sizeof(uint32_t));
*(uint32_t*) buf = htonl(tmsi);
pdu->fiveG_TMSI.buf = buf;
......
......@@ -38,20 +38,20 @@ class FiveGSTmsi {
~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(
bool decodeFromPdu(Ngap_FiveG_S_TMSI_t pdu);
void getTmsi(std::string& value);
void get(std::string& setId, std::string& pointer, std::string& tmsi);
bool set(
const std::string& setId, const std::string& pointer,
const std::string& tmsi);
bool encode2pdu(Ngap_FiveG_S_TMSI_t* pdu);
private:
std::string _5g_s_tmsi;
std::string tmsi_value;
std::string _5g_s_tmsi_;
std::string tmsi_value_;
AMFSetID amfSetid;
AMFPointer amfPointer;
AMFSetID amf_set_id_;
AMFPointer amf_pointer_;
};
} // namespace ngap
......
......@@ -21,77 +21,96 @@
#include "GNB-ID.hpp"
#include <iostream>
using namespace std;
#include "logger.hpp"
namespace ngap {
//------------------------------------------------------------------------------
GNB_ID::GNB_ID() {
gNBId = {};
gnb_id_ = std::nullopt;
present_ = Ngap_GNB_ID_PR_NOTHING;
}
//------------------------------------------------------------------------------
GNB_ID::~GNB_ID() {}
//------------------------------------------------------------------------------
void GNB_ID::setValue(uint32_t gnbId) {
gNBId.id = gnbId;
uint8_t len = 0;
for (uint32_t i = 0x00000001; i <= 0x00000400; i = i << 1, len++) {
if ((i & gnbId)) {
gNBId.bit_length = 32 - len;
break;
}
}
if (!((gNBId.bit_length >= 22) && (gNBId.bit_length <= 32))) {
cout << "[warning][gNBID length out of range]" << endl;
void GNB_ID::setValue(const gNBId_t& gnb_id) {
gnb_id_ = std::optional<gNBId_t>(gnb_id);
present_ = Ngap_GNB_ID_PR_gNB_ID;
}
//------------------------------------------------------------------------------
bool GNB_ID::setValue(const uint32_t& id, const uint8_t& bit_length) {
if (!((bit_length >= NGAP_GNB_ID_SIZE_MIN) &&
(bit_length <= NGAP_GNB_ID_SIZE_MAX))) {
Logger::ngap().warn("gNBID length out of range!");
return false;
}
gNBId_t tmp = {};
tmp.id = id;
tmp.bit_length = bit_length;
gnb_id_ = std::optional<gNBId_t>(tmp);
present_ = Ngap_GNB_ID_PR_gNB_ID;
return true;
}
//------------------------------------------------------------------------------
void GNB_ID::setValue(uint32_t id, uint8_t bit_length) {
gNBId.id = id;
gNBId.bit_length = bit_length;
bool GNB_ID::get(gNBId_t& gnb_id) const {
if (gnb_id_.has_value()) {
gnb_id = gnb_id_.value();
return true;
}
return false;
}
//------------------------------------------------------------------------------
bool GNB_ID::encode2bitstring(Ngap_GNB_ID_t& gnbid) {
gnbid.present = Ngap_GNB_ID_PR_gNB_ID;
bool GNB_ID::get(uint32_t& id) const {
if (gnb_id_.has_value()) {
id = gnb_id_.value().id;
return true;
}
return false;
}
if (!(gNBId.bit_length % 8))
gnbid.choice.gNB_ID.size = gNBId.bit_length / 8;
else
gnbid.choice.gNB_ID.size = gNBId.bit_length / 8 + 1;
//------------------------------------------------------------------------------
bool GNB_ID::encode(Ngap_GNB_ID_t& gnbid) {
if (!gnb_id_.has_value()) {
gnbid.present = Ngap_GNB_ID_PR_NOTHING;
return true;
}
// printf("m_gNBId.size(%d)\n",m_gNBId.size);
gnbid.choice.gNB_ID.bits_unused = 32 - gNBId.bit_length;
gnbid.present = Ngap_GNB_ID_PR_gNB_ID;
gnbid.choice.gNB_ID.size = 4; // TODO: to be vefified
gnbid.choice.gNB_ID.bits_unused = 32 - gnb_id_.value().bit_length;
gnbid.choice.gNB_ID.buf = (uint8_t*) calloc(1, 4 * sizeof(uint8_t));
if (!gnbid.choice.gNB_ID.buf) return false;
gnbid.choice.gNB_ID.buf[3] = gNBId.id & 0x000000ff;
gnbid.choice.gNB_ID.buf[2] = (gNBId.id & 0x0000ff00) >> 8;
gnbid.choice.gNB_ID.buf[1] = (gNBId.id & 0x00ff0000) >> 16;
gnbid.choice.gNB_ID.buf[0] = (gNBId.id & 0xff000000) >> 24;
gnbid.choice.gNB_ID.buf[3] = gnb_id_.value().id & 0x000000ff;
gnbid.choice.gNB_ID.buf[2] = (gnb_id_.value().id & 0x0000ff00) >> 8;
gnbid.choice.gNB_ID.buf[1] = (gnb_id_.value().id & 0x00ff0000) >> 16;
gnbid.choice.gNB_ID.buf[0] = (gnb_id_.value().id & 0xff000000) >> 24;
return true;
}
//------------------------------------------------------------------------------
bool GNB_ID::decodefrombitstring(Ngap_GNB_ID_t& gnbid) {
bool GNB_ID::decode(Ngap_GNB_ID_t& gnbid) {
if (gnbid.present != Ngap_GNB_ID_PR_gNB_ID) return false;
if (!gnbid.choice.gNB_ID.buf) return false;
gNBId.id = gnbid.choice.gNB_ID.buf[0] << 24;
gNBId.id |= gnbid.choice.gNB_ID.buf[1] << 16;
gNBId.id |= gnbid.choice.gNB_ID.buf[2] << 8;
gNBId.id |= gnbid.choice.gNB_ID.buf[3];
gNBId_t tmp = {};
tmp.id = gnbid.choice.gNB_ID.buf[0] << 24;
tmp.id |= gnbid.choice.gNB_ID.buf[1] << 16;
tmp.id |= gnbid.choice.gNB_ID.buf[2] << 8;
tmp.id |= gnbid.choice.gNB_ID.buf[3];
tmp.bit_length = 32 - gnbid.choice.gNB_ID.bits_unused;
return true;
}
gnb_id_ = std::optional<gNBId_t>(tmp);
present_ = Ngap_GNB_ID_PR_gNB_ID;
//------------------------------------------------------------------------------
long GNB_ID::getValue() {
return gNBId.id;
return true;
}
} // namespace ngap
......@@ -22,29 +22,34 @@
#ifndef _GNB_ID_H_
#define _GNB_ID_H_
#include "NgapIEsStruct.hpp"
#include <optional>
extern "C" {
#include "Ngap_GNB-ID.h"
}
namespace ngap {
constexpr uint8_t NGAP_GNB_ID_SIZE_MAX = 32;
constexpr uint8_t NGAP_GNB_ID_SIZE_MIN = 22;
class GNB_ID {
public:
GNB_ID();
virtual ~GNB_ID();
bool encode2bitstring(Ngap_GNB_ID_t&);
bool decodefrombitstring(Ngap_GNB_ID_t&);
void setValue(uint32_t gnbId);
long getValue();
void setValue(uint32_t id, uint8_t bit_length);
bool encode(Ngap_GNB_ID_t&);
bool decode(Ngap_GNB_ID_t&);
void setValue(const gNBId_t& gnb_id);
bool setValue(const uint32_t& id, const uint8_t& bit_length);
// long getValue() const;
bool get(gNBId_t& gnb_id) const;
bool get(uint32_t& id) const;
private:
struct gNBId_s {
uint32_t id;
uint8_t bit_length;
} gNBId; // 22bits to 32bits
std::optional<gNBId_t> gnb_id_; // 22bits to 32bits
Ngap_GNB_ID_PR present_;
};
} // namespace ngap
......
......@@ -43,41 +43,43 @@ void GUAMI::setGUAMI(
}
//------------------------------------------------------------------------------
void GUAMI::setGUAMI(
bool 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);
plmnId.set(mcc, mnc);
aMFRegionID.setAMFRegionID(regionId);
aMFSetID.setAMFSetID(setId);
aMFPointer.setAMFPointer(pointer);
if (!aMFSetID.set(setId)) return false;
if (!aMFPointer.set(pointer)) return false;
return true;
}
//------------------------------------------------------------------------------
void GUAMI::setGUAMI(
bool 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);
plmnId.set(mcc, mnc);
aMFRegionID.setAMFRegionID(regionId);
aMFSetID.setAMFSetID(setId);
aMFPointer.setAMFPointer(pointer);
if (!aMFSetID.set(setId)) return false;
if (!aMFPointer.set(pointer)) return false;
return true;
}
//------------------------------------------------------------------------------
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.encode(guami->pLMNIdentity)) return false;
if (!aMFRegionID.encode(guami->aMFRegionID)) return false;
if (!aMFSetID.encode(guami->aMFSetID)) return false;
if (!aMFPointer.encode(guami->aMFPointer)) return false;
return true;
}
//------------------------------------------------------------------------------
bool GUAMI::decodefromGUAMI(Ngap_GUAMI_t* pdu) {
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.decode(pdu->pLMNIdentity)) return false;
if (!aMFRegionID.decode(pdu->aMFRegionID)) return false;
if (!aMFSetID.decode(pdu->aMFSetID)) return false;
if (!aMFPointer.decode(pdu->aMFPointer)) return false;
return true;
}
......@@ -98,8 +100,8 @@ void GUAMI::getGUAMI(
plmnId.getMcc(mcc);
plmnId.getMnc(mnc);
aMFRegionID.getAMFRegionID(regionId);
aMFSetID.getAMFSetID(setId);
aMFPointer.getAMFPointer(pointer);
aMFSetID.get(setId);
aMFPointer.get(pointer);
}
} // namespace ngap
......@@ -41,11 +41,11 @@ class GUAMI {
void setGUAMI(
const PlmnId& m_plmnId, const AMFRegionID& m_aMFRegionID,
const AMFSetID& m_aMFSetID, const AMFPointer& m_aMFPointer);
void setGUAMI(
bool setGUAMI(
const std::string& mcc, const std::string& mnc, const uint8_t& regionId,
const uint16_t& setId, const uint8_t& pointer);
void setGUAMI(
bool setGUAMI(
const std::string& mcc, const std::string& mnc,
const std::string& regionId, const std::string& setId,
const std::string& pointer);
......
/*
* 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 "GlobalNgENBId.hpp"
namespace ngap {
//------------------------------------------------------------------------------
GlobalNgENBId::GlobalNgENBId() {}
//------------------------------------------------------------------------------
GlobalNgENBId::~GlobalNgENBId() {}
//------------------------------------------------------------------------------
void GlobalNgENBId::set(const PlmnId& plmn_id, const NgENB_ID& ng_enb_id) {
plmn_id_ = plmn_id;
ng_enb_id_ = ng_enb_id;
}
//------------------------------------------------------------------------------
void GlobalNgENBId::get(PlmnId& plmn_id, NgENB_ID& ng_enb_id) const {
plmn_id = plmn_id_;
ng_enb_id = ng_enb_id_;
}
//------------------------------------------------------------------------------
bool GlobalNgENBId::encode(Ngap_GlobalNgENB_ID_t& global_ng_enb_id) {
if (!plmn_id_.encode(global_ng_enb_id.pLMNIdentity)) return false;
if (!ng_enb_id_.encode(global_ng_enb_id.ngENB_ID)) return false;
return true;
}
//------------------------------------------------------------------------------
bool GlobalNgENBId::decode(Ngap_GlobalNgENB_ID_t& global_ng_enb_id) {
if (!plmn_id_.decode(global_ng_enb_id.pLMNIdentity)) return false;
if (!ng_enb_id_.decode(global_ng_enb_id.ngENB_ID)) return false;
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 _GLOBAL_NG_ENB_ID_H
#define _GLOBAL_NG_ENB_ID_H
#include "NgENBId.hpp"
#include "PlmnId.hpp"
extern "C" {
#include "Ngap_GlobalNgENB-ID.h"
}
namespace ngap {
class GlobalNgENBId {
public:
GlobalNgENBId();
virtual ~GlobalNgENBId();
bool encode(Ngap_GlobalNgENB_ID_t&);
bool decode(Ngap_GlobalNgENB_ID_t&);
void set(const PlmnId& plmn, const NgENB_ID& ng_enb_id);
void get(PlmnId& plmn, NgENB_ID& ng_enb_id) const;
private:
PlmnId plmn_id_; // Mandatory
NgENB_ID ng_enb_id_; // Mandatory
};
} // namespace ngap
#endif
......@@ -25,50 +25,75 @@
namespace ngap {
//------------------------------------------------------------------------------
GlobalRanNodeId::GlobalRanNodeId() {}
GlobalRanNodeId::GlobalRanNodeId() {
global_gnb_id_ = std::nullopt;
global_ng_enb_id_ = std::nullopt;
id_present_ = Ngap_GlobalRANNodeID_PR_NOTHING;
}
//------------------------------------------------------------------------------
GlobalRanNodeId::~GlobalRanNodeId() {}
//------------------------------------------------------------------------------
void GlobalRanNodeId::setChoiceOfRanNodeId(
const Ngap_GlobalRANNodeID_PR& m_idPresent) {
idPresent = m_idPresent;
const Ngap_GlobalRANNodeID_PR& id_present) {
id_present_ = id_present;
}
//------------------------------------------------------------------------------
Ngap_GlobalRANNodeID_PR GlobalRanNodeId::getChoiceOfRanNodeId() {
return idPresent;
return id_present_;
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::set(const GlobalgNBId& global_gnb_id) {
global_gnb_id_ = std::optional<GlobalgNBId>{global_gnb_id};
id_present_ = Ngap_GlobalRANNodeID_PR_globalGNB_ID;
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::set(const GlobalNgENBId& global_ng_enb_id) {
global_ng_enb_id_ = std::optional<GlobalNgENBId>{global_ng_enb_id};
id_present_ = Ngap_GlobalRANNodeID_PR_globalNgENB_ID;
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::setGlobalgNBID(const GlobalgNBId& m_globalgNBId) {
globalgNBId = m_globalgNBId;
bool GlobalRanNodeId::get(GlobalgNBId& global_gnb_id) const {
if (global_gnb_id_.has_value()) {
global_gnb_id = global_gnb_id_.value();
return true;
}
return false;
}
//------------------------------------------------------------------------------
void GlobalRanNodeId::getGlobalgNBID(GlobalgNBId& id) {
id = globalgNBId;
bool GlobalRanNodeId::get(GlobalNgENBId& global_ng_enb_id) const {
if (global_ng_enb_id_.has_value()) {
global_ng_enb_id = global_ng_enb_id_.value();
return true;
}
return false;
}
//------------------------------------------------------------------------------
bool GlobalRanNodeId::encode2GlobalRANNodeID(
Ngap_GlobalRANNodeID_t* globalRANNodeID) {
globalRANNodeID->present = idPresent;
bool GlobalRanNodeId::encode(Ngap_GlobalRANNodeID_t* globalRANNodeID) {
globalRANNodeID->present = id_present_;
switch (idPresent) {
switch (id_present_) {
case Ngap_GlobalRANNodeID_PR_globalGNB_ID: {
Ngap_GlobalGNB_ID_t* globalGNB_ID =
globalRANNodeID->choice.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;
globalRANNodeID->choice.globalGNB_ID = globalGNB_ID;
if (!globalRANNodeID->choice.globalGNB_ID) return false;
if (!global_gnb_id_.value().encode(globalRANNodeID->choice.globalGNB_ID))
return false;
break;
}
case Ngap_GlobalRANNodeID_PR_globalNgENB_ID: {
// TODO:
break;
}
case Ngap_GlobalRANNodeID_PR_globalN3IWF_ID: {
// TODO:
break;
}
default:
......@@ -79,21 +104,23 @@ bool GlobalRanNodeId::encode2GlobalRANNodeID(
}
//------------------------------------------------------------------------------
bool GlobalRanNodeId::decodefromGlobalRANNodeID(
Ngap_GlobalRANNodeID_t* globalRANNodeID) {
idPresent = globalRANNodeID->present;
switch (idPresent) {
bool GlobalRanNodeId::decode(Ngap_GlobalRANNodeID_t* globalRANNodeID) {
id_present_ = globalRANNodeID->present;
switch (id_present_) {
case Ngap_GlobalRANNodeID_PR_globalGNB_ID: {
if (!globalgNBId.decodefromGlobalgNBId(
globalRANNodeID->choice.globalGNB_ID))
return false;
GlobalgNBId tmp = {};
if (!tmp.decode(globalRANNodeID->choice.globalGNB_ID)) return false;
global_gnb_id_ = std::optional<GlobalgNBId>(tmp);
break;
}
case Ngap_GlobalRANNodeID_PR_globalNgENB_ID: {
// TODO:
Logger::ngap().warn("GlobalRANNodeID Present is globalNgENB!");
break;
}
case Ngap_GlobalRANNodeID_PR_globalN3IWF_ID: {
// TODO:
Logger::ngap().warn("GlobalRANNodeID Present is globalN3IWF!");
break;
}
......
......@@ -27,6 +27,9 @@ extern "C" {
}
#include "GlobalgNBId.hpp"
#include "GlobalNgENBId.hpp"
#include <optional>
namespace ngap {
......@@ -35,18 +38,23 @@ class GlobalRanNodeId {
GlobalRanNodeId();
virtual ~GlobalRanNodeId();
void setChoiceOfRanNodeId(const Ngap_GlobalRANNodeID_PR& m_idPresent);
Ngap_GlobalRANNodeID_PR getChoiceOfRanNodeId();
void set(const GlobalgNBId& global_gnb_id);
void set(const GlobalNgENBId& global_ng_enb_id);
void setGlobalgNBID(const GlobalgNBId&);
void getGlobalgNBID(GlobalgNBId&);
bool get(GlobalgNBId& global_gnb_id) const;
bool get(GlobalNgENBId& global_ng_enb_id) const;
void setChoiceOfRanNodeId(const Ngap_GlobalRANNodeID_PR& id_present);
Ngap_GlobalRANNodeID_PR getChoiceOfRanNodeId();
bool encode2GlobalRANNodeID(Ngap_GlobalRANNodeID_t*);
bool decodefromGlobalRANNodeID(Ngap_GlobalRANNodeID_t*);
bool encode(Ngap_GlobalRANNodeID_t*);
bool decode(Ngap_GlobalRANNodeID_t*);
private:
GlobalgNBId globalgNBId; // Mandatory
Ngap_GlobalRANNodeID_PR idPresent;
std::optional<GlobalgNBId> global_gnb_id_;
std::optional<GlobalNgENBId> global_ng_enb_id_;
// TODO: Global N3IWF ID
Ngap_GlobalRANNodeID_PR id_present_;
};
} // namespace ngap
......
......@@ -24,36 +24,39 @@
namespace ngap {
//------------------------------------------------------------------------------
GlobalgNBId::GlobalgNBId() {}
GlobalgNBId::GlobalgNBId() {
plmnId = {};
gNB_ID = {};
}
//------------------------------------------------------------------------------
GlobalgNBId::~GlobalgNBId() {}
//------------------------------------------------------------------------------
void GlobalgNBId::setGlobalgNBId(const PlmnId& plmn, const GNB_ID& gnbid) {
void GlobalgNBId::set(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;
return true;
void GlobalgNBId::get(PlmnId& plmn, GNB_ID& gnbid) {
plmn = plmnId;
gnbid = gNB_ID;
}
//------------------------------------------------------------------------------
bool GlobalgNBId::decodefromGlobalgNBId(Ngap_GlobalGNB_ID_t* globalgnbid) {
if (!plmnId.decodefromoctetstring(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID.decodefrombitstring(globalgnbid->gNB_ID)) return false;
bool GlobalgNBId::encode(Ngap_GlobalGNB_ID_t* globalgnbid) {
if (!plmnId.encode(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID.encode(globalgnbid->gNB_ID)) return false;
return true;
}
//------------------------------------------------------------------------------
void GlobalgNBId::getGlobalgNBId(PlmnId& plmn, GNB_ID& gnbid) {
plmn = plmnId;
gnbid = gNB_ID;
bool GlobalgNBId::decode(Ngap_GlobalGNB_ID_t* globalgnbid) {
if (!plmnId.decode(globalgnbid->pLMNIdentity)) return false;
if (!gNB_ID.decode(globalgnbid->gNB_ID)) return false;
return true;
}
} // namespace ngap
......@@ -36,11 +36,11 @@ class GlobalgNBId {
GlobalgNBId();
virtual ~GlobalgNBId();
bool encode2GlobalgNBId(Ngap_GlobalGNB_ID_t*);
bool decodefromGlobalgNBId(Ngap_GlobalGNB_ID_t*);
bool encode(Ngap_GlobalGNB_ID_t*);
bool decode(Ngap_GlobalGNB_ID_t*);
void setGlobalgNBId(const PlmnId& plmn, const GNB_ID& gnbid);
void getGlobalgNBId(PlmnId& plmn, GNB_ID& gnbid);
void set(const PlmnId& plmn, const GNB_ID& gnbid);
void get(PlmnId& plmn, GNB_ID& gnbid);
private:
PlmnId plmnId; // Mandatory
......
......@@ -58,7 +58,7 @@ void IEsCriticalityDiagnostics::encode2pdu(
}
//------------------------------------------------------------------------------
void IEsCriticalityDiagnostics::decodefrompdu(
void IEsCriticalityDiagnostics::decodeFromPdu(
Ngap_CriticalityDiagnostics_IE_Item_t* pdu) {
criticality = pdu->iECriticality;
protocolIE_ID = pdu->iE_ID;
......
......@@ -34,7 +34,7 @@ class IEsCriticalityDiagnostics {
virtual ~IEsCriticalityDiagnostics();
void encode2pdu(Ngap_CriticalityDiagnostics_IE_Item_t*);
void decodefrompdu(Ngap_CriticalityDiagnostics_IE_Item_t*);
void decodeFromPdu(Ngap_CriticalityDiagnostics_IE_Item_t*);
void setIeCriticality(Ngap_Criticality_t);
void setIeId(Ngap_ProtocolIE_ID_t);
void setTypeOfError(Ngap_TypeOfError_t);
......
......@@ -28,31 +28,32 @@ namespace ngap {
//------------------------------------------------------------------------------
IndexToRFSP::IndexToRFSP() {
indexToRFSP = 0;
index_ = 0;
}
//------------------------------------------------------------------------------
IndexToRFSP::IndexToRFSP(const uint32_t& index) : index_(index) {}
//------------------------------------------------------------------------------
IndexToRFSP::~IndexToRFSP() {}
//------------------------------------------------------------------------------
void IndexToRFSP::setIndexToRFSP(uint8_t m_indexToRFSP) {
indexToRFSP = m_indexToRFSP;
void IndexToRFSP::set(const uint32_t& index) {
index_ = index;
}
//------------------------------------------------------------------------------
uint8_t IndexToRFSP::getIndexToRFSP() {
return indexToRFSP;
uint32_t IndexToRFSP::get() const {
return index_;
}
//------------------------------------------------------------------------------
bool IndexToRFSP::encode2IndexToRFSP(Ngap_IndexToRFSP_t& indextorfsp) {
indextorfsp = indexToRFSP;
bool IndexToRFSP::encode(Ngap_IndexToRFSP_t& index) {
index = index_;
return true;
}
//------------------------------------------------------------------------------
bool IndexToRFSP::decodefromIndexToRFSP(Ngap_IndexToRFSP_t& indextorfsp) {
indexToRFSP = indextorfsp;
bool IndexToRFSP::decode(Ngap_IndexToRFSP_t& index) {
index_ = index;
return true;
}
} // namespace ngap
......@@ -31,16 +31,17 @@ namespace ngap {
class IndexToRFSP {
public:
IndexToRFSP();
IndexToRFSP(const uint32_t&);
virtual ~IndexToRFSP();
void setIndexToRFSP(uint8_t);
uint8_t getIndexToRFSP();
void set(const uint32_t&);
uint32_t get() const;
bool encode2IndexToRFSP(Ngap_IndexToRFSP_t&);
bool decodefromIndexToRFSP(Ngap_IndexToRFSP_t&);
bool encode(Ngap_IndexToRFSP_t&);
bool decode(Ngap_IndexToRFSP_t&);
private:
uint8_t indexToRFSP;
uint32_t index_;
};
} // namespace ngap
......
......@@ -21,31 +21,39 @@
#include "MICOModeIndication.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
MICOModeIndication::MICOModeIndication() {}
MICOModeIndication::MICOModeIndication()
: mico_mode_indication_(Ngap_MICOModeIndication_true) {}
//------------------------------------------------------------------------------
MICOModeIndication::~MICOModeIndication() {}
//------------------------------------------------------------------------------
bool MICOModeIndication::encode2MICOModeIndication(
Ngap_MICOModeIndication_t* micoModeIndication) {
if (!micoModeIndication) return false;
*micoModeIndication = Ngap_MICOModeIndication_true;
void MICOModeIndication::set(const long& mico_mode_indication) {
mico_mode_indication_ = mico_mode_indication;
}
//------------------------------------------------------------------------------
void MICOModeIndication::get(long& mico_mode_indication) {
mico_mode_indication = mico_mode_indication_;
}
//------------------------------------------------------------------------------
bool MICOModeIndication::encode(
Ngap_MICOModeIndication_t* mico_mode_indication) {
if (!mico_mode_indication) return false;
*mico_mode_indication = mico_mode_indication_;
return true;
}
//------------------------------------------------------------------------------
bool MICOModeIndication::decodefromMICOModeIndication(
Ngap_MICOModeIndication_t* micoModeIndication) {
if (!micoModeIndication) return false;
if (*micoModeIndication != Ngap_MICOModeIndication_true) return false;
bool MICOModeIndication::decode(
Ngap_MICOModeIndication_t* mico_mode_indication) {
if (!mico_mode_indication) return false;
mico_mode_indication_ = *mico_mode_indication;
return true;
}
......
......@@ -33,12 +33,14 @@ class MICOModeIndication {
MICOModeIndication();
virtual ~MICOModeIndication();
// void setMICOModeIndication();
// bool getMICOModeIndication();
void set(const long& mico_mode_indication);
void get(long& mico_mode_indication);
bool encode2MICOModeIndication(Ngap_MICOModeIndication_t* micoModeIndication);
bool decodefromMICOModeIndication(
Ngap_MICOModeIndication_t* micoModeIndication);
bool encode(Ngap_MICOModeIndication_t* micoModeIndication);
bool decode(Ngap_MICOModeIndication_t* micoModeIndication);
private:
long mico_mode_indication_;
};
} // namespace ngap
......
......@@ -48,7 +48,7 @@ class MessageType {
void setValuePresent(Ngap_SuccessfulOutcome__value_PR m_valuePresent);
void setValuePresent(Ngap_UnsuccessfulOutcome__value_PR m_valuePresent);
// void decodefrompdu(Ngap_NGAP_PDU_t*);
// void decodeFromPdu(Ngap_NGAP_PDU_t*);
Ngap_ProcedureCode_t getProcedureCode();
Ngap_NGAP_PDU_PR getTypeOfMessage();
Ngap_Criticality getCriticality();
......
......@@ -21,9 +21,6 @@
#include "MobilityRestrictionList.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
MobilityRestrictionList::MobilityRestrictionList() {}
......@@ -31,19 +28,28 @@ MobilityRestrictionList::MobilityRestrictionList() {}
MobilityRestrictionList::~MobilityRestrictionList() {}
//------------------------------------------------------------------------------
void MobilityRestrictionList::setMobilityRestrictionList(const PlmnId& sPLMN) {
void MobilityRestrictionList::setPLMN(const PlmnId& sPLMN) {
servingPLMN = sPLMN;
}
//------------------------------------------------------------------------------
void MobilityRestrictionList::getMobilityRestrictionList(PlmnId& sPLMN) {
void MobilityRestrictionList::getPLMN(PlmnId& sPLMN) {
sPLMN = servingPLMN;
}
//------------------------------------------------------------------------------
bool MobilityRestrictionList::encodeMobilityRestrictionList(
Ngap_MobilityRestrictionList_t* mobilityrestrictionlist) {
if (!servingPLMN.encode2octetstring(mobilityrestrictionlist->servingPLMN)) {
bool MobilityRestrictionList::encode(
Ngap_MobilityRestrictionList_t* mobility_restriction_list) {
if (!servingPLMN.encode(mobility_restriction_list->servingPLMN)) {
return false;
}
return true;
}
//------------------------------------------------------------------------------
bool MobilityRestrictionList::decode(
Ngap_MobilityRestrictionList_t* mobility_restriction_list) {
if (!servingPLMN.decode(mobility_restriction_list->servingPLMN)) {
return false;
}
return true;
......
......@@ -20,7 +20,7 @@
*/
#ifndef _MOBILITY_RESTRICTION_LIST_H_
#define _MOBILITYRESTRICTION_LIST_H_
#define _MOBILITY_RESTRICTION_LIST_H_
#include "PlmnId.hpp"
extern "C" {
......@@ -32,11 +32,11 @@ class MobilityRestrictionList {
MobilityRestrictionList();
virtual ~MobilityRestrictionList();
void setMobilityRestrictionList(const PlmnId& sPlmn);
void getMobilityRestrictionList(PlmnId& sPlmn);
void setPLMN(const PlmnId& sPlmn);
void getPLMN(PlmnId& sPlmn);
bool encodeMobilityRestrictionList(
Ngap_MobilityRestrictionList_t* mobilityrestrictionlist);
bool encode(Ngap_MobilityRestrictionList_t* mobility_restriction_list);
bool decode(Ngap_MobilityRestrictionList_t* mobility_restriction_list);
private:
PlmnId servingPLMN; // Mandatory
......
......@@ -20,46 +20,77 @@
*/
#include "NAS-PDU.hpp"
#include "conversions.hpp"
namespace ngap {
//------------------------------------------------------------------------------
NAS_PDU::NAS_PDU() {
naspdubuffer = NULL;
buffersize = -1;
}
NAS_PDU::NAS_PDU() {}
//------------------------------------------------------------------------------
NAS_PDU::~NAS_PDU() {}
//------------------------------------------------------------------------------
bool NAS_PDU::encode2octetstring(Ngap_NAS_PDU_t& m_naspdu) {
int ret;
ret = OCTET_STRING_fromBuf(&m_naspdu, naspdubuffer, buffersize);
if (ret != 0) return false;
bool NAS_PDU::encode(Ngap_NAS_PDU_t& nas_pdu) {
return conv::bstring_2_octet_string(pdu_bstring, nas_pdu);
}
//------------------------------------------------------------------------------
bool NAS_PDU::decode(Ngap_NAS_PDU_t& nas_pdu) {
if (!nas_pdu.buf) return false;
return conv::octet_string_2_bstring(nas_pdu, pdu_bstring);
}
/*
//------------------------------------------------------------------------------
bool NAS_PDU::get(uint8_t*& buffer, size_t& size) const {
if (!pdu_.buf) return false;
if (pdu_.size < 0) return false;
memcpy(buffer, pdu_.buf, pdu_.size);
size = pdu_.size;
return true;
}
*/
//------------------------------------------------------------------------------
void NAS_PDU::set(uint8_t* buffer, size_t size) {
if (!buffer) return;
pdu_bstring = blk2bstr(buffer, size);
return;
}
//------------------------------------------------------------------------------
bool NAS_PDU::get(OCTET_STRING_t& pdu) const {
conv::bstring_2_octet_string(pdu_bstring, pdu);
return true;
}
//------------------------------------------------------------------------------
bool NAS_PDU::decodefromoctetstring(Ngap_NAS_PDU_t& m_naspdu) {
naspdubuffer = (char*) m_naspdu.buf;
buffersize = m_naspdu.size;
bool NAS_PDU::set(const OCTET_STRING_t& pdu) {
conv::octet_string_2_bstring(pdu, pdu_bstring);
return true;
}
//------------------------------------------------------------------------------
bool NAS_PDU::getNasPdu(uint8_t*& buffer, size_t& size) const {
buffer = (uint8_t*) naspdubuffer;
size = buffersize;
if (!naspdubuffer) return false;
if (buffersize < 0) return false;
bool NAS_PDU::get(NAS_PDU& nas_pdu) const {
return nas_pdu.set(pdu_bstring);
}
//------------------------------------------------------------------------------
bool NAS_PDU::set(const NAS_PDU& nas_pdu) {
bstring pdu = {};
if (!nas_pdu.get(pdu)) return false;
return set(pdu);
}
//------------------------------------------------------------------------------
bool NAS_PDU::get(bstring& pdu) const {
pdu = bstrcpy(pdu_bstring);
return true;
}
//------------------------------------------------------------------------------
void NAS_PDU::setNasPdu(uint8_t* buffer, size_t size) {
naspdubuffer = (char*) buffer;
buffersize = size;
bool NAS_PDU::set(const bstring& pdu) {
pdu_bstring = bstrcpy(pdu);
return true;
}
} // namespace ngap
......@@ -22,6 +22,8 @@
#ifndef _NAS_PDU_H_
#define _NAS_PDU_H_
#include "bstrlib.h"
extern "C" {
#include "Ngap_NAS-PDU.h"
}
......@@ -33,14 +35,22 @@ class NAS_PDU {
NAS_PDU();
virtual ~NAS_PDU();
bool encode2octetstring(Ngap_NAS_PDU_t&);
bool decodefromoctetstring(Ngap_NAS_PDU_t&);
bool getNasPdu(uint8_t*& buffer, size_t& size) const;
void setNasPdu(uint8_t* buffer, size_t size);
bool encode(Ngap_NAS_PDU_t&);
bool decode(Ngap_NAS_PDU_t&);
// bool get(uint8_t*& buffer, size_t& size) const;
void set(uint8_t* buffer, size_t size);
bool get(OCTET_STRING_t& pdu) const;
bool set(const OCTET_STRING_t& pdu);
bool get(bstring& pdu) const;
bool set(const bstring& pdu);
bool get(NAS_PDU& nas_pdu) const;
bool set(const NAS_PDU& nas_pdu);
private:
char* naspdubuffer;
size_t buffersize;
bstring pdu_bstring;
};
} // namespace ngap
......
......@@ -43,13 +43,13 @@ void NR_CGI::setNR_CGI(
void NR_CGI::setNR_CGI(
const std::string& mcc, const std::string& mnc,
const unsigned long& nrcellidentity) {
plmnId.setMccMnc(mcc, mnc);
plmnId.set(mcc, mnc);
nRCellIdentity.setNRCellIdentity(nrcellidentity);
}
//------------------------------------------------------------------------------
void NR_CGI::setNR_CGI(const struct NrCgi_s& cig) {
plmnId.setMccMnc(cig.mcc, cig.mnc);
plmnId.set(cig.mcc, cig.mnc);
nRCellIdentity.setNRCellIdentity(cig.nrCellID);
}
......@@ -62,16 +62,16 @@ void NR_CGI::getNR_CGI(struct NrCgi_s& cig) {
//------------------------------------------------------------------------------
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.encode(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity.encode(nr_cgi->nRCellIdentity)) return false;
return true;
}
//------------------------------------------------------------------------------
bool NR_CGI::decodefromNR_CGI(Ngap_NR_CGI_t* nr_cgi) {
if (!plmnId.decodefromoctetstring(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity.decodefrombitstring(nr_cgi->nRCellIdentity)) return false;
if (!plmnId.decode(nr_cgi->pLMNIdentity)) return false;
if (!nRCellIdentity.decode(nr_cgi->nRCellIdentity)) return false;
return true;
}
......
......@@ -40,7 +40,7 @@ void NRCellIdentity::setNRCellIdentity(unsigned long m_nrcellidentity) {
}
//------------------------------------------------------------------------------
bool NRCellIdentity::encode2bitstring(Ngap_NRCellIdentity_t& nRCellIdentity) {
bool NRCellIdentity::encode(Ngap_NRCellIdentity_t& nRCellIdentity) {
nRCellIdentity.bits_unused = 4;
nRCellIdentity.size = 5;
nRCellIdentity.buf = (uint8_t*) calloc(1, sizeof(uint32_t) + sizeof(uint8_t));
......@@ -55,8 +55,7 @@ bool NRCellIdentity::encode2bitstring(Ngap_NRCellIdentity_t& nRCellIdentity) {
}
//------------------------------------------------------------------------------
bool NRCellIdentity::decodefrombitstring(
Ngap_NRCellIdentity_t& nRCellIdentity) {
bool NRCellIdentity::decode(Ngap_NRCellIdentity_t& nRCellIdentity) {
if (!nRCellIdentity.buf) return false;
nrcellidentity = nRCellIdentity.buf[0];
......
......@@ -33,8 +33,8 @@ class NRCellIdentity {
NRCellIdentity();
virtual ~NRCellIdentity();
bool encode2bitstring(Ngap_NRCellIdentity_t& nRCellIdentity);
bool decodefrombitstring(Ngap_NRCellIdentity_t& nRCellIdentity);
bool encode(Ngap_NRCellIdentity_t& nRCellIdentity);
bool decode(Ngap_NRCellIdentity_t& nRCellIdentity);
unsigned long getNRCellIdentity();
void setNRCellIdentity(unsigned long m_nrcellidentity);
......
/*
* 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 "NgENBId.hpp"
extern "C" {
#include "conversions.h"
}
namespace ngap {
NgENB_ID::NgENB_ID() {
present_ = Ngap_NgENB_ID_PR_NOTHING;
}
//------------------------------------------------------------------------------
NgENB_ID::~NgENB_ID() {
present_ = Ngap_NgENB_ID_PR_NOTHING;
}
//------------------------------------------------------------------------------
void NgENB_ID::get(uint32_t& id, Ngap_NgENB_ID_PR& present) const {
present = present_;
switch (present_) {
case Ngap_NgENB_ID_PR_macroNgENB_ID: {
id = id_.macro_ngenb_id;
} break;
case Ngap_NgENB_ID_PR_shortMacroNgENB_ID: {
id = id_.short_macro_ngENB_id;
} break;
case Ngap_NgENB_ID_PR_longMacroNgENB_ID: {
id = id_.short_macro_ngENB_id;
} break;
default: {
present = Ngap_NgENB_ID_PR_NOTHING;
}
}
}
//------------------------------------------------------------------------------
void NgENB_ID::set(const uint32_t& id, const Ngap_NgENB_ID_PR& present) {
present_ = present;
switch (present) {
case Ngap_NgENB_ID_PR_macroNgENB_ID: {
id_.macro_ngenb_id = id;
} break;
case Ngap_NgENB_ID_PR_shortMacroNgENB_ID: {
id_.short_macro_ngENB_id = id;
} break;
case Ngap_NgENB_ID_PR_longMacroNgENB_ID: {
id_.short_macro_ngENB_id = id;
} break;
default: {
present_ = Ngap_NgENB_ID_PR_NOTHING;
}
}
}
//------------------------------------------------------------------------------
bool NgENB_ID::encode(Ngap_NgENB_ID_t& ng_enb_id) {
ng_enb_id.present = present_;
switch (present_) {
case Ngap_NgENB_ID_PR_macroNgENB_ID: {
INT24_TO_BIT_STRING(
id_.macro_ngenb_id && 0x00ffffff, &ng_enb_id.choice.macroNgENB_ID,
20);
} break;
case Ngap_NgENB_ID_PR_shortMacroNgENB_ID: {
INT24_TO_BIT_STRING(
id_.short_macro_ngENB_id && 0x00ffffff,
&ng_enb_id.choice.shortMacroNgENB_ID, 18);
} break;
case Ngap_NgENB_ID_PR_longMacroNgENB_ID: {
INT24_TO_BIT_STRING(
id_.long_macro_ngENB_id && 0x00ffffff,
&ng_enb_id.choice.longMacroNgENB_ID, 21);
} break;
default: {
present_ = Ngap_NgENB_ID_PR_NOTHING;
}
}
return true;
}
//------------------------------------------------------------------------------
bool NgENB_ID::decode(Ngap_NgENB_ID_t& ng_enb_id) {
present_ = ng_enb_id.present;
switch (present_) {
case Ngap_NgENB_ID_PR_macroNgENB_ID: {
BIT_STRING_TO_INT24(&ng_enb_id.choice.macroNgENB_ID, id_.macro_ngenb_id);
} break;
case Ngap_NgENB_ID_PR_shortMacroNgENB_ID: {
BIT_STRING_TO_INT24(
&ng_enb_id.choice.shortMacroNgENB_ID, id_.short_macro_ngENB_id);
} break;
case Ngap_NgENB_ID_PR_longMacroNgENB_ID: {
BIT_STRING_TO_INT24(
&ng_enb_id.choice.shortMacroNgENB_ID, id_.long_macro_ngENB_id);
} break;
default: {
present_ = Ngap_NgENB_ID_PR_NOTHING;
}
}
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 _NG_ENB_ID_H_
#define _NG_ENB_ID_H_
#include "PlmnId.hpp"
extern "C" {
#include "Ngap_NgENB-ID.h"
}
namespace ngap {
class NgENB_ID {
public:
NgENB_ID();
virtual ~NgENB_ID();
bool encode(Ngap_NgENB_ID_t&);
bool decode(Ngap_NgENB_ID_t&);
void get(uint32_t& id, Ngap_NgENB_ID_PR& present) const;
void set(const uint32_t& id, const Ngap_NgENB_ID_PR& present);
private:
PlmnId plmnId; // Mandatory
union {
uint32_t macro_ngenb_id;
uint32_t short_macro_ngENB_id;
uint32_t long_macro_ngENB_id;
} id_; // Mandatory
Ngap_NgENB_ID_PR present_;
};
} // namespace ngap
#endif
......@@ -22,6 +22,8 @@
#ifndef _NGAPIESSTRUCT_H_
#define _NGAPIESSTRUCT_H_
#include "bstrlib.h"
#include <optional>
#include <string>
#include <vector>
......@@ -107,17 +109,15 @@ typedef struct Guami_s {
typedef struct {
uint8_t pduSessionId;
uint8_t* pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
bstring nas_pdu;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
} PDUSessionResourceSetupRequestItem_t;
typedef struct {
uint8_t pduSessionId;
uint8_t* pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
S_Nssai s_nssai;
bstring nas_pdu;
std::optional<S_Nssai> s_nssai;
OCTET_STRING_t pduSessionResourceModifyRequestTransfer;
} PDUSessionResourceModifyRequestItem_t;
......@@ -247,6 +247,17 @@ typedef struct {
typedef struct {
long QFI;
} QosFlowToBeForwardedItem_t;
typedef struct gNBId_s {
uint32_t id;
uint8_t bit_length;
} gNBId_t; // 22bits to 32bits
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t HandoverCommandTransfer;
} PDUSessionResourceHandoverItem_t;
} // namespace ngap
#endif
......@@ -21,42 +21,35 @@
#include "PDUSessionID.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionID::PDUSessionID() {
pdusessionid = 0;
id_ = 0;
}
//------------------------------------------------------------------------------
PDUSessionID::~PDUSessionID() {}
//------------------------------------------------------------------------------
void PDUSessionID::setPDUSessionID(uint8_t m_pdusessionid) {
pdusessionid = m_pdusessionid;
void PDUSessionID::set(const uint8_t& id) {
id_ = id;
}
//------------------------------------------------------------------------------
bool PDUSessionID::getPDUSessionID(uint8_t& m_pdusessionid) {
m_pdusessionid = pdusessionid;
return true;
void PDUSessionID::get(uint8_t& id) const {
id = id_;
}
//------------------------------------------------------------------------------
bool PDUSessionID::encode2PDUSessionID(Ngap_PDUSessionID_t& pduSessionId) {
pduSessionId = pdusessionid;
bool PDUSessionID::encode(Ngap_PDUSessionID_t& pdu_session_id) const {
pdu_session_id = id_;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionID::decodefromPDUSessionID(Ngap_PDUSessionID_t pduSessionId) {
pdusessionid = pduSessionId;
bool PDUSessionID::decode(const Ngap_PDUSessionID_t& pdu_session_id) {
id_ = pdu_session_id;
return true;
}
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#ifndef _PDUSESSIONID_H_
#define _PDUSESSIONID_H_
#ifndef _PDU_SESSION_ID_H_
#define _PDU_SESSION_ID_H_
extern "C" {
#include "Ngap_PDUSessionID.h"
......@@ -33,14 +33,14 @@ class PDUSessionID {
PDUSessionID();
virtual ~PDUSessionID();
void setPDUSessionID(uint8_t m_pdusessionid);
bool getPDUSessionID(uint8_t& m_pdusessionid);
void set(const uint8_t& id);
void get(uint8_t& id) const;
bool encode2PDUSessionID(Ngap_PDUSessionID_t& pduSessionId);
bool decodefromPDUSessionID(Ngap_PDUSessionID_t pduSessionId);
bool encode(Ngap_PDUSessionID_t& pdu_session_id) const;
bool decode(const Ngap_PDUSessionID_t& pdu_session_id);
private:
uint8_t pdusessionid;
uint8_t id_;
};
} // namespace ngap
......
......@@ -47,8 +47,7 @@ void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem) {
if (!pDUSessionID.encode2PDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
if (!pDUSessionID.encode(pdUSessionResourceAdmittedItem->pDUSessionID))
return false;
pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer =
handoverRequestAckTransfer;
......@@ -59,8 +58,7 @@ bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t* pdUSessionResourceAdmittedItem) {
if (!pDUSessionID.decodefromPDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
if (!pDUSessionID.decode(pdUSessionResourceAdmittedItem->pDUSessionID))
return false;
handoverRequestAckTransfer =
pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer;
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEADMITTEDITEM_H_
#define _PDUSESSIONRESOURCEADMITTEDITEM_H_
#ifndef PDU_SESSION_RESOURCE_ADMITTED_ITEM_H_
#define PDU_SESSION_RESOURCE_ADMITTED_ITEM_H_
#include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
......
......@@ -30,42 +30,39 @@ PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList() {}
PDUSessionResourceAdmittedList::~PDUSessionResourceAdmittedList() {}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedList::setPDUSessionResourceAdmittedList(
const std::vector<PDUSessionResourceAdmittedItem>& list) {
admittedItemList = list;
void PDUSessionResourceAdmittedList::set(
const std::vector<PDUSessionResourceItem>& list) {
item_list_ = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(
std::vector<PDUSessionResourceAdmittedItem>& item) {
item = admittedItemList;
void PDUSessionResourceAdmittedList::get(
std::vector<PDUSessionResourceItem>& list) {
list = item_list_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedList::encode2PDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList) {
for (auto& item : admittedItemList) {
bool PDUSessionResourceAdmittedList::encode(
Ngap_PDUSessionResourceAdmittedList_t* list) {
for (auto& item : item_list_) {
Ngap_PDUSessionResourceAdmittedItem_t* response =
(Ngap_PDUSessionResourceAdmittedItem_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
if (!response) return false;
if (!item.encode2PDUSessionResourceAdmittedItem(response)) return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceAdmittedList->list, response) != 0)
return false;
if (!item.encode(response)) return false;
if (ASN_SEQUENCE_ADD(&list->list, response) != 0) return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceAdmittedList::decodefromPDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList) {
for (int i = 0; i < pduSessionResourceAdmittedList->list.count; i++) {
PDUSessionResourceAdmittedItem item = {};
if (!item.decodefromPDUSessionResourceAdmittedItem(
pduSessionResourceAdmittedList->list.array[i]))
return false;
admittedItemList.push_back(item);
bool PDUSessionResourceAdmittedList::decode(
Ngap_PDUSessionResourceAdmittedList_t* list) {
for (int i = 0; i < list->list.count; i++) {
PDUSessionResourceItem item = {};
if (!item.decode(list->list.array[i])) return false;
item_list_.push_back(item);
}
return true;
......
......@@ -19,10 +19,12 @@
* contact@openairinterface.org
*/
#ifndef _PDUSESSIONRESOURCEADMITTEDLIST_H_
#define _PDUSESSIONRESOURCEADMITTEDLIST_H_
#ifndef PDU_SESSION_RESOURCE_ADMITTED_LIST_H_
#define PDU_SESSION_RESOURCE_ADMITTED_LIST_H_
#include "PDUSessionResourceAdmittedItem.hpp"
#include "PDUSessionResourceItem.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceAdmittedList.h"
......@@ -35,18 +37,14 @@ class PDUSessionResourceAdmittedList {
PDUSessionResourceAdmittedList();
virtual ~PDUSessionResourceAdmittedList();
void setPDUSessionResourceAdmittedList(
const std::vector<PDUSessionResourceAdmittedItem>& list);
void getPDUSessionResourceAdmittedList(
std::vector<PDUSessionResourceAdmittedItem>& list);
void set(const std::vector<PDUSessionResourceItem>& list);
void get(std::vector<PDUSessionResourceItem>& list);
bool encode2PDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList);
bool decodefromPDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t* pduSessionResourceAdmittedList);
bool encode(Ngap_PDUSessionResourceAdmittedList_t* list);
bool decode(Ngap_PDUSessionResourceAdmittedList_t* List);
private:
std::vector<PDUSessionResourceAdmittedItem> admittedItemList;
std::vector<PDUSessionResourceItem> item_list_;
};
} // namespace ngap
......
......@@ -32,50 +32,46 @@ PDUSessionResourceFailedToSetupItemCxtFail::
~PDUSessionResourceFailedToSetupItemCxtFail() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtFail::
setPDUSessionResourceFailedToSetupItemCxtFail(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemCxtFail::set(
const PDUSessionID& pdu_session_id,
const OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) {
pdu_session_id_ = pdu_session_id;
pdu_session_resource_setup_unsuccessful_transfer_ =
pdu_session_resource_setup_unsuccessful_transfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtFail::
getPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemCxtFail::get(
PDUSessionID& pdu_session_id,
OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) const {
pdu_session_id = pdu_session_id_;
pdu_session_resource_setup_unsuccessful_transfer =
pdu_session_resource_setup_unsuccessful_transfer_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtFail::
encode2PDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail) {
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceFailedToSetupItemCxtFail->pDUSessionID))
bool PDUSessionResourceFailedToSetupItemCxtFail::encode(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pdu_session_resource_failed_to_setup_item_cxt_fail) {
if (!pdu_session_id_.encode(
pdu_session_resource_failed_to_setup_item_cxt_fail->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemCxtFail
pdu_session_resource_failed_to_setup_item_cxt_fail
->pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
pdu_session_resource_setup_unsuccessful_transfer_;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtFail::
decodefromPDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail) {
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemCxtFail->pDUSessionID))
bool PDUSessionResourceFailedToSetupItemCxtFail::decode(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pdu_session_resource_failed_to_setup_item_cxt_fail) {
if (!pdu_session_id_.decode(
pdu_session_resource_failed_to_setup_item_cxt_fail->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
pduSessionResourceFailedToSetupItemCxtFail
pdu_session_resource_setup_unsuccessful_transfer_ =
pdu_session_resource_failed_to_setup_item_cxt_fail
->pDUSessionResourceSetupUnsuccessfulTransfer;
return true;
......
......@@ -35,23 +35,22 @@ class PDUSessionResourceFailedToSetupItemCxtFail {
PDUSessionResourceFailedToSetupItemCxtFail();
virtual ~PDUSessionResourceFailedToSetupItemCxtFail();
void setPDUSessionResourceFailedToSetupItemCxtFail(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemCxtFail(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail);
bool decodefromPDUSessionResourceFailedToSetupItemCxtFail(
Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pduSessionResourceFailedToSetupItemCxtFail);
void set(
const PDUSessionID& pdu_session_id,
const OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer);
void get(
PDUSessionID& pdu_session_id,
OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) const;
bool encode(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pdu_session_resource_failed_to_setup_item_cxt_fail);
bool decode(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*
pdu_session_resource_failed_to_setup_item_cxt_fail);
private:
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer;
PDUSessionID pdu_session_id_; // Mandatory
OCTET_STRING_t
pdu_session_resource_setup_unsuccessful_transfer_; // Mandatory
};
} // namespace ngap
......
......@@ -21,9 +21,6 @@
#include "PDUSessionResourceFailedToSetupItemCxtRes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
......@@ -35,49 +32,45 @@ PDUSessionResourceFailedToSetupItemCxtRes::
~PDUSessionResourceFailedToSetupItemCxtRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtRes::
setPDUSessionResourceFailedToSetupItemCxtRes(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemCxtRes::set(
const PDUSessionID& pdu_session_id,
const OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) {
pdu_session_id_ = pdu_session_id;
pdu_session_resource_setup_unsuccessful_transfer_ =
pdu_session_resource_setup_unsuccessful_transfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemCxtRes::
getPDUSessionResourceFailedToSetupItemCxtRes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemCxtRes::get(
PDUSessionID& pdu_session_id,
OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) {
pdu_session_id = pdu_session_id_;
pdu_session_resource_setup_unsuccessful_transfer =
pdu_session_resource_setup_unsuccessful_transfer_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtRes::
encode2PDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (!pDUSessionID.encode2PDUSessionID(
bool PDUSessionResourceFailedToSetupItemCxtRes::encode(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (!pdu_session_id_.encode(
pduSessionResourceFailedToSetupItemCxtRes->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemCxtRes
->pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
pdu_session_resource_setup_unsuccessful_transfer_;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemCxtRes::
decodefromPDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (!pDUSessionID.decodefromPDUSessionID(
bool PDUSessionResourceFailedToSetupItemCxtRes::decode(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes) {
if (!pdu_session_id_.decode(
pduSessionResourceFailedToSetupItemCxtRes->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
pdu_session_resource_setup_unsuccessful_transfer_ =
pduSessionResourceFailedToSetupItemCxtRes
->pDUSessionResourceSetupUnsuccessfulTransfer;
......
......@@ -35,23 +35,22 @@ class PDUSessionResourceFailedToSetupItemCxtRes {
PDUSessionResourceFailedToSetupItemCxtRes();
virtual ~PDUSessionResourceFailedToSetupItemCxtRes();
void setPDUSessionResourceFailedToSetupItemCxtRes(
void set(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemCxtRes(
void get(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes);
bool decodefromPDUSessionResourceFailedToSetupItemCxtRes(
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes);
bool encode(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes);
bool decode(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*
pduSessionResourceFailedToSetupItemCxtRes);
private:
PDUSessionID pDUSessionID; // Mandatory
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer; // Mandatory
PDUSessionID pdu_session_id_; // Mandatory
OCTET_STRING_t
pdu_session_resource_setup_unsuccessful_transfer_; // Mandatory
};
} // namespace ngap
......
......@@ -32,50 +32,46 @@ PDUSessionResourceFailedToSetupItemSURes::
~PDUSessionResourceFailedToSetupItemSURes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemSURes::
setPDUSessionResourceFailedToSetupItemSURes(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceSetupUnsuccessfulTransfer =
m_pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemSURes::set(
const PDUSessionID& pdu_session_id,
const OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) {
pdu_session_id_ = pdu_session_id;
pdu_session_resource_setup_unsuccessful_transfer_ =
pdu_session_resource_setup_unsuccessful_transfer;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupItemSURes::
getPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
void PDUSessionResourceFailedToSetupItemSURes::get(
PDUSessionID& pdu_session_id,
OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer) {
pdu_session_id = pdu_session_id_;
pdu_session_resource_setup_unsuccessful_transfer =
pdu_session_resource_setup_unsuccessful_transfer_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemSURes::
encode2PDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes) {
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceFailedToSetupItemSURes->pDUSessionID))
bool PDUSessionResourceFailedToSetupItemSURes::encode(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pdu_session_resource_failed_to_setup_item_su_res) {
if (!pdu_session_id_.encode(
pdu_session_resource_failed_to_setup_item_su_res->pDUSessionID))
return false;
pduSessionResourceFailedToSetupItemSURes
pdu_session_resource_failed_to_setup_item_su_res
->pDUSessionResourceSetupUnsuccessfulTransfer =
pDUSessionResourceSetupUnsuccessfulTransfer;
pdu_session_resource_setup_unsuccessful_transfer_;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupItemSURes::
decodefromPDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes) {
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceFailedToSetupItemSURes->pDUSessionID))
bool PDUSessionResourceFailedToSetupItemSURes::decode(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pdu_session_resource_failed_to_setup_item_su_res) {
if (!pdu_session_id_.decode(
pdu_session_resource_failed_to_setup_item_su_res->pDUSessionID))
return false;
pDUSessionResourceSetupUnsuccessfulTransfer =
pduSessionResourceFailedToSetupItemSURes
pdu_session_resource_setup_unsuccessful_transfer_ =
pdu_session_resource_failed_to_setup_item_su_res
->pDUSessionResourceSetupUnsuccessfulTransfer;
return true;
......
......@@ -35,23 +35,21 @@ class PDUSessionResourceFailedToSetupItemSURes {
PDUSessionResourceFailedToSetupItemSURes();
virtual ~PDUSessionResourceFailedToSetupItemSURes();
void setPDUSessionResourceFailedToSetupItemSURes(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
void getPDUSessionResourceFailedToSetupItemSURes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceSetupUnsuccessfulTransfer);
bool encode2PDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes);
bool decodefromPDUSessionResourceFailedToSetupItemSURes(
Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pduSessionResourceFailedToSetupItemSURes);
void set(
const PDUSessionID& pdu_session_id,
const OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer);
void get(
PDUSessionID& pdu_session_id,
OCTET_STRING_t& pdu_session_resource_setup_unsuccessful_transfer);
bool encode(Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pdu_session_resource_failed_to_setup_item_su_res);
bool decode(Ngap_PDUSessionResourceFailedToSetupItemSURes_t*
pdu_session_resource_failed_to_setup_item_su_res);
private:
PDUSessionID pDUSessionID;
OCTET_STRING_t pDUSessionResourceSetupUnsuccessfulTransfer;
PDUSessionID pdu_session_id_;
OCTET_STRING_t pdu_session_resource_setup_unsuccessful_transfer_;
};
} // namespace ngap
......
......@@ -32,24 +32,21 @@ PDUSessionResourceFailedToSetupListCxtFail::
~PDUSessionResourceFailedToSetupListCxtFail() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtFail::
setPDUSessionResourceFailedToSetupListCxtFail(
const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
void PDUSessionResourceFailedToSetupListCxtFail::set(
const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
itemList = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtFail::
getPDUSessionResourceFailedToSetupListCxtFail(
std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
void PDUSessionResourceFailedToSetupListCxtFail::get(
std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list) {
list = itemList;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListCxtFail::
encode2PDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
bool PDUSessionResourceFailedToSetupListCxtFail::encode(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
for (std::vector<PDUSessionResourceFailedToSetupItemCxtFail>::iterator it =
std::begin(itemList);
it < std::end(itemList); ++it) {
......@@ -57,8 +54,7 @@ bool PDUSessionResourceFailedToSetupListCxtFail::
(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemCxtFail_t));
if (!failedToFailure) return false;
if (!it->encode2PDUSessionResourceFailedToSetupItemCxtFail(failedToFailure))
return false;
if (!it->encode(failedToFailure)) return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListCxtFail->list,
failedToFailure) != 0)
......@@ -69,16 +65,15 @@ bool PDUSessionResourceFailedToSetupListCxtFail::
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListCxtFail::
decodefromPDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
bool PDUSessionResourceFailedToSetupListCxtFail::decode(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail) {
itemList.reserve(pduSessionResourceFailedToSetupListCxtFail->list.count);
for (int i = 0; i < pduSessionResourceFailedToSetupListCxtFail->list.count;
i++) {
PDUSessionResourceFailedToSetupItemCxtFail itemCxtFail = {};
if (!itemCxtFail.decodefromPDUSessionResourceFailedToSetupItemCxtFail(
if (!itemCxtFail.decode(
pduSessionResourceFailedToSetupListCxtFail->list.array[i]))
return false;
itemList.push_back(itemCxtFail);
......
......@@ -36,17 +36,13 @@ class PDUSessionResourceFailedToSetupListCxtFail {
PDUSessionResourceFailedToSetupListCxtFail();
virtual ~PDUSessionResourceFailedToSetupListCxtFail();
void setPDUSessionResourceFailedToSetupListCxtFail(
const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
void getPDUSessionResourceFailedToSetupListCxtFail(
std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
bool encode2PDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail);
bool decodefromPDUSessionResourceFailedToSetupListCxtFail(
Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail);
void set(const std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
void get(std::vector<PDUSessionResourceFailedToSetupItemCxtFail>& list);
bool encode(Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail);
bool decode(Ngap_PDUSessionResourceFailedToSetupListCxtFail_t*
pduSessionResourceFailedToSetupListCxtFail);
private:
std::vector<PDUSessionResourceFailedToSetupItemCxtFail> itemList;
......
......@@ -35,34 +35,30 @@ PDUSessionResourceFailedToSetupListCxtRes::
~PDUSessionResourceFailedToSetupListCxtRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtRes::
setPDUSessionResourceFailedToSetupListCxtRes(
const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
itemList = list;
void PDUSessionResourceFailedToSetupListCxtRes::set(
const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
item_list_ = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListCxtRes::
getPDUSessionResourceFailedToSetupListCxtRes(
std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
list = itemList;
void PDUSessionResourceFailedToSetupListCxtRes::get(
std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list) {
list = item_list_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListCxtRes::
encode2PDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
bool PDUSessionResourceFailedToSetupListCxtRes::encode(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
for (std::vector<PDUSessionResourceFailedToSetupItemCxtRes>::iterator it =
std::begin(itemList);
it < std::end(itemList); ++it) {
std::begin(item_list_);
it < std::end(item_list_); ++it) {
Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t* failedToResponse =
(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemCxtRes_t));
if (!failedToResponse) return false;
if (!it->encode2PDUSessionResourceFailedToSetupItemCxtRes(failedToResponse))
return false;
if (!it->encode(failedToResponse)) return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListCxtRes->list,
failedToResponse) != 0)
......@@ -73,18 +69,16 @@ bool PDUSessionResourceFailedToSetupListCxtRes::
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListCxtRes::
decodefromPDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
itemList.reserve(pduSessionResourceFailedToSetupListCxtRes->list.count);
bool PDUSessionResourceFailedToSetupListCxtRes::decode(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes) {
item_list_.reserve(pduSessionResourceFailedToSetupListCxtRes->list.count);
for (int i = 0; i < pduSessionResourceFailedToSetupListCxtRes->list.count;
i++) {
PDUSessionResourceFailedToSetupItemCxtRes item = {};
if (!item.decodefromPDUSessionResourceFailedToSetupItemCxtRes(
pduSessionResourceFailedToSetupListCxtRes->list.array[i]))
if (!item.decode(pduSessionResourceFailedToSetupListCxtRes->list.array[i]))
return false;
itemList.push_back(item);
item_list_.push_back(item);
}
return true;
......
......@@ -36,20 +36,16 @@ class PDUSessionResourceFailedToSetupListCxtRes {
PDUSessionResourceFailedToSetupListCxtRes();
virtual ~PDUSessionResourceFailedToSetupListCxtRes();
void setPDUSessionResourceFailedToSetupListCxtRes(
const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
void getPDUSessionResourceFailedToSetupListCxtRes(
std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
bool encode2PDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes);
bool decodefromPDUSessionResourceFailedToSetupListCxtRes(
Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes);
void set(const std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
void get(std::vector<PDUSessionResourceFailedToSetupItemCxtRes>& list);
bool encode(Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes);
bool decode(Ngap_PDUSessionResourceFailedToSetupListCxtRes_t*
pduSessionResourceFailedToSetupListCxtRes);
private:
std::vector<PDUSessionResourceFailedToSetupItemCxtRes> itemList;
std::vector<PDUSessionResourceFailedToSetupItemCxtRes> item_list_;
};
} // 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 "PDUSessionResourceFailedToSetupListHOAck.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListHOAck::
PDUSessionResourceFailedToSetupListHOAck() {}
//------------------------------------------------------------------------------
PDUSessionResourceFailedToSetupListHOAck::
~PDUSessionResourceFailedToSetupListHOAck() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListHOAck::set(
const std::vector<PDUSessionResourceItem>& list) {
item_list_ = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListHOAck::get(
std::vector<PDUSessionResourceItem>& list) {
list = item_list_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListHOAck::encode(
Ngap_PDUSessionResourceFailedToSetupListHOAck_t* list) {
for (auto& item : item_list_) {
Ngap_PDUSessionResourceFailedToSetupItemHOAck_t* response =
(Ngap_PDUSessionResourceFailedToSetupItemHOAck_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemHOAck_t));
if (!response) return false;
if (!item.encode(response)) return false;
if (ASN_SEQUENCE_ADD(&list->list, response) != 0) return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListHOAck::decode(
Ngap_PDUSessionResourceFailedToSetupListHOAck_t* list) {
for (int i = 0; i < list->list.count; i++) {
PDUSessionResourceItem item = {};
if (!item.decode(list->list.array[i])) return false;
item_list_.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_FAILED_TO_SETUP_LIST_HO_ACK_H_
#define PDU_SESSION_RESOURCE_FAILED_TO_SETUP_LIST_HO_ACK_H_
#include "PDUSessionResourceItem.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceFailedToSetupListHOAck.h"
}
namespace ngap {
class PDUSessionResourceFailedToSetupListHOAck {
public:
PDUSessionResourceFailedToSetupListHOAck();
virtual ~PDUSessionResourceFailedToSetupListHOAck();
void set(const std::vector<PDUSessionResourceItem>& list);
void get(std::vector<PDUSessionResourceItem>& list);
bool encode(Ngap_PDUSessionResourceFailedToSetupListHOAck_t* list);
bool decode(Ngap_PDUSessionResourceFailedToSetupListHOAck_t* List);
private:
std::vector<PDUSessionResourceItem> item_list_;
};
} // namespace ngap
#endif
......@@ -32,33 +32,29 @@ PDUSessionResourceFailedToSetupListSURes::
~PDUSessionResourceFailedToSetupListSURes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListSURes::
setPDUSessionResourceFailedToSetupListSURes(
const std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
itemSUResList = list;
void PDUSessionResourceFailedToSetupListSURes::set(
const std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
item_list_ = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceFailedToSetupListSURes::
getPDUSessionResourceFailedToSetupListSURes(
std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
list = itemSUResList;
void PDUSessionResourceFailedToSetupListSURes::get(
std::vector<PDUSessionResourceFailedToSetupItemSURes>& list) {
list = item_list_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListSURes::
encode2PDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes) {
for (auto& item : itemSUResList) {
Ngap_PDUSessionResourceFailedToSetupItemSURes_t* failedToResponse =
bool PDUSessionResourceFailedToSetupListSURes::encode(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pdu_session_resource_failed_to_setup_list_su_res) {
for (auto& item : item_list_) {
Ngap_PDUSessionResourceFailedToSetupItemSURes_t* item_su_res =
(Ngap_PDUSessionResourceFailedToSetupItemSURes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceFailedToSetupItemSURes_t));
if (!failedToResponse) return false;
if (!item.encode2PDUSessionResourceFailedToSetupItemSURes(failedToResponse))
return false;
if (!item_su_res) return false;
if (!item.encode(item_su_res)) return false;
if (ASN_SEQUENCE_ADD(
&pduSessionResourceFailedToSetupListSURes->list,
failedToResponse) != 0)
&pdu_session_resource_failed_to_setup_list_su_res->list,
item_su_res) != 0)
return false;
}
......@@ -66,17 +62,16 @@ bool PDUSessionResourceFailedToSetupListSURes::
}
//------------------------------------------------------------------------------
bool PDUSessionResourceFailedToSetupListSURes::
decodefromPDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes) {
for (int i = 0; i < pduSessionResourceFailedToSetupListSURes->list.count;
i++) {
bool PDUSessionResourceFailedToSetupListSURes::decode(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pdu_session_resource_failed_to_setup_list_su_res) {
for (int i = 0;
i < pdu_session_resource_failed_to_setup_list_su_res->list.count; i++) {
PDUSessionResourceFailedToSetupItemSURes item = {};
if (!item.decodefromPDUSessionResourceFailedToSetupItemSURes(
pduSessionResourceFailedToSetupListSURes->list.array[i]))
if (!item.decode(
pdu_session_resource_failed_to_setup_list_su_res->list.array[i]))
return false;
itemSUResList.push_back(item);
item_list_.push_back(item);
}
return true;
......
......@@ -36,20 +36,16 @@ class PDUSessionResourceFailedToSetupListSURes {
PDUSessionResourceFailedToSetupListSURes();
virtual ~PDUSessionResourceFailedToSetupListSURes();
void setPDUSessionResourceFailedToSetupListSURes(
const std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
void getPDUSessionResourceFailedToSetupListSURes(
std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
bool encode2PDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes);
bool decodefromPDUSessionResourceFailedToSetupListSURes(
Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pduSessionResourceFailedToSetupListSURes);
void set(const std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
void get(std::vector<PDUSessionResourceFailedToSetupItemSURes>& item);
bool encode(Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pdu_session_resource_failed_to_setup_list_su_res);
bool decode(Ngap_PDUSessionResourceFailedToSetupListSURes_t*
pdu_session_resource_failed_to_setup_list_su_res);
private:
std::vector<PDUSessionResourceFailedToSetupItemSURes> itemSUResList;
std::vector<PDUSessionResourceFailedToSetupItemSURes> item_list_;
};
} // namespace ngap
......
......@@ -46,7 +46,7 @@ void PDUSessionResourceHandoverItem::getPDUSessionResourceHandoverItem(
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverItem::encode(
Ngap_PDUSessionResourceHandoverItem_t& item) {
if (!pDUSessionID.encode2PDUSessionID(item.pDUSessionID)) return false;
if (!pDUSessionID.encode(item.pDUSessionID)) return false;
item.handoverCommandTransfer = handoverCommandTransfer;
return true;
}
......@@ -54,7 +54,7 @@ bool PDUSessionResourceHandoverItem::encode(
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverItem::decode(
const Ngap_PDUSessionResourceHandoverItem_t& item) {
if (!pDUSessionID.decodefromPDUSessionID(item.pDUSessionID)) return false;
if (!pDUSessionID.decode(item.pDUSessionID)) return false;
handoverCommandTransfer = item.handoverCommandTransfer;
return true;
}
......
......@@ -30,30 +30,28 @@ PDUSessionResourceHandoverList::PDUSessionResourceHandoverList() {}
PDUSessionResourceHandoverList::~PDUSessionResourceHandoverList() {}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverList::setPDUSessionResourceHandoverList(
const std::vector<PDUSessionResourceHandoverItem>& list) {
handoverItemList = list;
void PDUSessionResourceHandoverList::set(
const std::vector<PDUSessionResourceItem>& list) {
item_list_ = list;
}
//------------------------------------------------------------------------------
void PDUSessionResourceHandoverList::getPDUSessionResourceHandoverList(
std::vector<PDUSessionResourceHandoverItem>& list) {
list = handoverItemList;
void PDUSessionResourceHandoverList::get(
std::vector<PDUSessionResourceItem>& list) {
list = item_list_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverList::encode(
Ngap_PDUSessionResourceHandoverList_t& pduSessionResourceHandoverList) {
for (auto& item : handoverItemList) {
Ngap_PDUSessionResourceHandoverList_t& list) {
for (auto& item : item_list_) {
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;
if (!item.encode(handoverItem)) return false;
if (ASN_SEQUENCE_ADD(&list.list, handoverItem) != 0) return false;
}
return true;
......@@ -61,14 +59,12 @@ bool PDUSessionResourceHandoverList::encode(
//------------------------------------------------------------------------------
bool PDUSessionResourceHandoverList::decode(
const Ngap_PDUSessionResourceHandoverList_t&
pduSessionResourceHandoverList) {
for (int i = 0; i < pduSessionResourceHandoverList.list.count; i++) {
PDUSessionResourceHandoverItem item = {};
const Ngap_PDUSessionResourceHandoverList_t& list) {
for (int i = 0; i < list.list.count; i++) {
PDUSessionResourceItem item = {};
if (!item.decode(*pduSessionResourceHandoverList.list.array[i]))
return false;
handoverItemList.push_back(item);
if (!item.decode(list.list.array[i])) return false;
item_list_.push_back(item);
}
return true;
}
......
......@@ -22,7 +22,7 @@
#ifndef _PDU_SESSION_RESOURCE_HANDOVER_LIST_H_
#define _PDU_SESSION_RESOURCE_HANDOVER_LIST_H_
#include "PDUSessionResourceHandoverItem.hpp"
#include "PDUSessionResourceItem.hpp"
#include "vector"
extern "C" {
......@@ -36,18 +36,14 @@ class PDUSessionResourceHandoverList {
PDUSessionResourceHandoverList();
virtual ~PDUSessionResourceHandoverList();
void setPDUSessionResourceHandoverList(
const std::vector<PDUSessionResourceHandoverItem>& list);
void getPDUSessionResourceHandoverList(
std::vector<PDUSessionResourceHandoverItem>& list);
void set(const std::vector<PDUSessionResourceItem>& list);
void get(std::vector<PDUSessionResourceItem>& list);
bool encode(
Ngap_PDUSessionResourceHandoverList_t& pduSessionResourceHandoverList);
bool decode(const Ngap_PDUSessionResourceHandoverList_t&
pduSessionResourceHandoverList);
bool encode(Ngap_PDUSessionResourceHandoverList_t& list);
bool decode(const Ngap_PDUSessionResourceHandoverList_t& list);
private:
std::vector<PDUSessionResourceHandoverItem> handoverItemList;
std::vector<PDUSessionResourceItem> item_list_;
};
} // 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 "PDUSessionResourceItem.hpp"
#include "conversions.hpp"
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceItem::PDUSessionResourceItem() {}
//------------------------------------------------------------------------------
PDUSessionResourceItem::~PDUSessionResourceItem() {}
//------------------------------------------------------------------------------
void PDUSessionResourceItem::set(
const PDUSessionID& pdu_session_id, const OCTET_STRING_t& resource) {
pdu_session_id_ = pdu_session_id;
// resource_ = resource;
conv::octet_string_copy(resource_, resource);
}
//------------------------------------------------------------------------------
void PDUSessionResourceItem::get(
PDUSessionID& pdu_session_id, OCTET_STRING_t& resource) const {
pdu_session_id = pdu_session_id_;
// resource = resource_;
conv::octet_string_copy(resource, resource_);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionID_t& pdu_session_id, OCTET_STRING_t& resource) const {
if (!pdu_session_id_.encode(pdu_session_id)) return false;
return conv::octet_string_copy(resource, resource_);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionID_t& pdu_session_id, const OCTET_STRING_t& resource) {
if (!pdu_session_id_.decode(pdu_session_id)) return false;
return conv::octet_string_copy(resource_, resource);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceSetupItemCxtRes_t* item) const {
return encode(
item->pDUSessionID, item->pDUSessionResourceSetupResponseTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceSetupItemCxtRes_t* const item) {
return decode(
item->pDUSessionID, item->pDUSessionResourceSetupResponseTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceItemHORqd_t* item) const {
return encode(item->pDUSessionID, item->handoverRequiredTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceItemHORqd_t* const item) {
return decode(item->pDUSessionID, item->handoverRequiredTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceHandoverItem_t* item) const {
return encode(item->pDUSessionID, item->handoverCommandTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceHandoverItem_t* const item) {
return decode(item->pDUSessionID, item->handoverCommandTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceToReleaseItemHOCmd_t* item) const {
return encode(
item->pDUSessionID, item->handoverPreparationUnsuccessfulTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceToReleaseItemHOCmd_t* const item) {
return decode(
item->pDUSessionID, item->handoverPreparationUnsuccessfulTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceAdmittedItem_t* item) const {
return encode(item->pDUSessionID, item->handoverRequestAcknowledgeTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceAdmittedItem_t* const item) {
return decode(item->pDUSessionID, item->handoverRequestAcknowledgeTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::encode(
Ngap_PDUSessionResourceFailedToSetupItemHOAck_t* item) const {
return encode(
item->pDUSessionID, item->handoverResourceAllocationUnsuccessfulTransfer);
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItem::decode(
const Ngap_PDUSessionResourceFailedToSetupItemHOAck_t* const item) {
return decode(
item->pDUSessionID, item->handoverResourceAllocationUnsuccessfulTransfer);
}
} // 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_ITEM_H_
#define _PDU_SESSION_RESOURCE_ITEM_H_
#include "PDUSessionID.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceSetupItemCxtRes.h"
#include "Ngap_PDUSessionResourceToReleaseItemHOCmd.h"
#include "Ngap_PDUSessionResourceHandoverItem.h"
#include "Ngap_PDUSessionResourceAdmittedItem.h"
#include "Ngap_PDUSessionResourceFailedToSetupItemHOAck.h"
#include "Ngap_PDUSessionResourceItemHORqd.h"
}
namespace ngap {
class PDUSessionResourceItem {
public:
PDUSessionResourceItem();
virtual ~PDUSessionResourceItem();
void set(const PDUSessionID& pdu_session_id, const OCTET_STRING_t& resource);
void get(PDUSessionID& pdu_session_id, OCTET_STRING_t& resource) const;
bool encode(
Ngap_PDUSessionID_t& pdu_session_id, OCTET_STRING_t& resource) const;
bool decode(
const Ngap_PDUSessionID_t& pdu_session_id,
const OCTET_STRING_t& resource);
// PDU SESSION RESOURCE SETUP REQUEST
// For PDU Session Resource Setup Request Item (in child class)
// PDU SESSION RESOURCE SETUP RESPONSE
// For PDU Session Resource Setup Response Item
bool encode(Ngap_PDUSessionResourceSetupItemCxtRes_t*
pdu_session_resource_setup_item_cxt_res) const;
bool decode(const Ngap_PDUSessionResourceSetupItemCxtRes_t*
pdu_session_resource_setup_item_cxt_res);
// TODO: For PDU Session Resource Failed to Setup Item
// PDU SESSION RESOURCE RELEASE COMMAND
// TODO: For PDU Session Resource to Release Item
// PDU SESSION RESOURCE RELEASE RESPONSE
// TODO: For PDU Session Resource Released Item
// PDU SESSION RESOURCE MODIFY REQUEST
// For PDU Session Resource Modify Request Item (in child class)
// PDU SESSION RESOURCE MODIFY RESPONSE
// TODO: For PDU Session Resource Modify Response Item
// TODO: For PDU Session Resource Failed to Modify Item
// PDU SESSION RESOURCE NOTIFY
// TODO: For PDU Session Resource Notify Item
// TODO: For PDU Session Resource Released Item
// PDU SESSION RESOURCE MODIFY INDICATION
// TODO: PDU Session Resource Modify Indication Item
// PDU SESSION RESOURCE MODIFY CONFIRM
// TODO: PDU Session Resource Modify Confirm Item
// TODO: PDU Session Resource Failed to Modify Item
// INITIAL CONTEXT SETUP REQUEST
// PDU Session Resource Setup Request Item (in child class)
// INITIAL CONTEXT SETUP RESPONSE
// TODO: PDU Session Resource Setup Response Item
// TODO: PDU Session Resource Failed to Setup Item
// INITIAL CONTEXT SETUP FAILURE
// TODO: PDU Session Resource Failed to Setup Item
// UE CONTEXT RELEASE REQUEST
// TODO: PDU Session Resource Item
// UE CONTEXT RELEASE COMPLETE
// TODO: PDU Session Resource Item
// HANDOVER REQUIRED
// PDU Session Resource Item
bool encode(Ngap_PDUSessionResourceItemHORqd_t* item) const;
bool decode(const Ngap_PDUSessionResourceItemHORqd_t* const item);
// HANDOVER COMMAND
// PDU Session Resource Handover Item
bool encode(Ngap_PDUSessionResourceHandoverItem_t* item) const;
bool decode(const Ngap_PDUSessionResourceHandoverItem_t* const item);
// PDU Session Resource to Release Item
bool encode(Ngap_PDUSessionResourceToReleaseItemHOCmd_t* item) const;
bool decode(const Ngap_PDUSessionResourceToReleaseItemHOCmd_t* const item);
// HANDOVER REQUEST
// PDU Session Resource Setup Item (in child class)
// HANDOVER REQUEST ACKNOWLEDGE
// TODO: PDU Session Resource Admitted Item
bool encode(Ngap_PDUSessionResourceAdmittedItem_t* item) const;
bool decode(const Ngap_PDUSessionResourceAdmittedItem_t* const item);
// TODO: PDU Session Resource Failed to Setup Item
bool encode(Ngap_PDUSessionResourceFailedToSetupItemHOAck_t* item) const;
bool decode(
const Ngap_PDUSessionResourceFailedToSetupItemHOAck_t* const item);
// PATH SWITCH REQUEST
// TODO: PDU Session Resource to be Switched in Downlink Item
// TODO: PDU Session Resource Failed to Setup Item
// PATH SWITCH REQUEST ACKNOWLEDGE
// TODO: PDU Session Resource Switched Item
// TODO: PDU Session Resource Released Item
// PATH SWITCH REQUEST FAILURE
// TODO: PDU Session Resource Released Item
// SECONDARY RAT DATA USAGE REPORT
// TODO: PDU Session Resource Secondary RAT Usage Item
private:
PDUSessionID pdu_session_id_; // Mandatory
OCTET_STRING_t resource_;
};
} // namespace ngap
#endif
......@@ -30,32 +30,30 @@ PDUSessionResourceItemCxtRelCpl::PDUSessionResourceItemCxtRelCpl() {}
PDUSessionResourceItemCxtRelCpl::~PDUSessionResourceItemCxtRelCpl() {}
//------------------------------------------------------------------------------
void PDUSessionResourceItemCxtRelCpl::setPDUSessionResourceItemCxtRelCpl(
const PDUSessionID& m_pDUSessionID) {
pDUSessionID = m_pDUSessionID;
void PDUSessionResourceItemCxtRelCpl::set(const PDUSessionID& pdu_session_id) {
pdu_session_id_ = pdu_session_id;
}
//------------------------------------------------------------------------------
void PDUSessionResourceItemCxtRelCpl::getPDUSessionResourceItemCxtRelCpl(
PDUSessionID& m_pDUSessionID) {
m_pDUSessionID = pDUSessionID;
void PDUSessionResourceItemCxtRelCpl::get(PDUSessionID& pdu_session_id) {
pdu_session_id = pdu_session_id_;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItemCxtRelCpl::encode2PDUSessionResourceItemCxtRelCpl(
Ngap_PDUSessionResourceItemCxtRelCpl_t* pduSessionResourceItemCxtRelCpl) {
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceItemCxtRelCpl->pDUSessionID))
bool PDUSessionResourceItemCxtRelCpl::encode(
Ngap_PDUSessionResourceItemCxtRelCpl_t*
pdu_session_resource_item_cxt_rel_cpl) {
if (!pdu_session_id_.encode(
pdu_session_resource_item_cxt_rel_cpl->pDUSessionID))
return false;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceItemCxtRelCpl::decodefromPDUSessionResourceItemCxtRelCpl(
Ngap_PDUSessionResourceItemCxtRelCpl_t* pduSessionResourceItemCxtRelCpl) {
pDUSessionID.setPDUSessionID(pduSessionResourceItemCxtRelCpl->pDUSessionID);
bool PDUSessionResourceItemCxtRelCpl::decode(
const Ngap_PDUSessionResourceItemCxtRelCpl_t* const
pdu_session_resource_item_cxt_rel_cpl) {
pdu_session_id_.set(pdu_session_resource_item_cxt_rel_cpl->pDUSessionID);
return true;
}
......
......@@ -19,8 +19,8 @@
* contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_ITEM_REL_CPL_H_
#define _PDU_SESSION_RESOURCE_ITEM_REL_CPL_H_
#ifndef _PDU_SESSION_RESOURCE_ITEM_CXT_REL_CPL_H_
#define _PDU_SESSION_RESOURCE_ITEM_CXT_REL_CPL_H_
#include "PDUSessionID.hpp"
......@@ -35,18 +35,18 @@ class PDUSessionResourceItemCxtRelCpl {
PDUSessionResourceItemCxtRelCpl();
virtual ~PDUSessionResourceItemCxtRelCpl();
void setPDUSessionResourceItemCxtRelCpl(const PDUSessionID& m_pDUSessionID);
void set(const PDUSessionID& pdu_session_id);
void get(PDUSessionID& pdu_session_id);
void getPDUSessionResourceItemCxtRelCpl(PDUSessionID& m_pDUSessionID);
bool encode2PDUSessionResourceItemCxtRelCpl(
Ngap_PDUSessionResourceItemCxtRelCpl_t* pduSessionResourceItemCxtRelCpl);
bool decodefromPDUSessionResourceItemCxtRelCpl(
Ngap_PDUSessionResourceItemCxtRelCpl_t* pduSessionResourceItemCxtRelCpl);
bool encode(Ngap_PDUSessionResourceItemCxtRelCpl_t*
pdu_session_resource_item_cxt_rel_cpl);
bool decode(const Ngap_PDUSessionResourceItemCxtRelCpl_t* const
pdu_session_resource_item_cxt_rel_cpl);
private:
PDUSessionID pDUSessionID;
// OCTET_STRING_t pDUSessionResourceReleaseResponseTransfer;
PDUSessionID pdu_session_id_; // Mandatory
// TODO (not defined in ASN1C) OCTET_STRING_t
// pdu_session_resource_release_response_transfer_; //Optional
};
} // namespace ngap
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the
* License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_ITEM_CXT_REL_REQ_H_
#define _PDU_SESSION_RESOURCE_ITEM_CXT_REL_REQ_H_
#include "PDUSessionID.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceItemCxtRelReq.h"
}
namespace ngap {
class PDUSessionResourceItemCxtRelReq {
public:
PDUSessionResourceItemCxtRelReq();
virtual ~PDUSessionResourceItemCxtRelReq();
void set(const PDUSessionID& pdu_session_id);
void get(PDUSessionID& pdu_session_id);
bool encode(Ngap_PDUSessionResourceItemCxtRelReq_t*
pdu_session_resource_item_cxt_rel_req);
bool decode(Ngap_PDUSessionResourceItemCxtRelReq_t*
pdu_session_resource_item_cxt_rel_req);
private:
PDUSessionID pdu_session_id_; // Mandatory
};
} // namespace ngap
#endif
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.
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