Commit c6dfe333 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Apply google style format for new code

parent 210cc695
...@@ -98,11 +98,17 @@ class itti_dl_nas_transport : public itti_msg_n2 { ...@@ -98,11 +98,17 @@ class itti_dl_nas_transport : public itti_msg_n2 {
bstring nas; bstring nas;
}; };
class itti_initial_context_setup_request : public itti_msg_n2 class itti_initial_context_setup_request : public itti_msg_n2 {
{ public:
public: itti_initial_context_setup_request(const task_id_t origin,
itti_initial_context_setup_request(const task_id_t origin, const task_id_t destination) : itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {} const task_id_t destination)
itti_initial_context_setup_request(const itti_initial_context_setup_request &i) : itti_msg_n2(i) { :
itti_msg_n2(INITIAL_CONTEXT_SETUP_REQUEST, origin, destination) {
}
itti_initial_context_setup_request(
const itti_initial_context_setup_request &i)
:
itti_msg_n2(i) {
is_pdu_exist = false; is_pdu_exist = false;
isn2sm_avaliable = false; isn2sm_avaliable = false;
...@@ -114,7 +120,7 @@ public: ...@@ -114,7 +120,7 @@ public:
bool is_sr; bool is_sr;
bstring n2sm; bstring n2sm;
uint8_t pdu_session_id; uint8_t pdu_session_id;
bool is_pdu_exist; //true is no pdu context bool is_pdu_exist; //true is no pdu context
bool isn2sm_avaliable; bool isn2sm_avaliable;
}; };
...@@ -140,7 +146,7 @@ class itti_pdu_session_resource_setup_request : public itti_msg_n2 { ...@@ -140,7 +146,7 @@ class itti_pdu_session_resource_setup_request : public itti_msg_n2 {
class itti_pdu_session_resource_release_command : public itti_msg_n2 { class itti_pdu_session_resource_release_command : public itti_msg_n2 {
public: public:
itti_pdu_session_resource_release_command(const task_id_t origin, itti_pdu_session_resource_release_command(const task_id_t origin,
const task_id_t destination) const task_id_t destination)
: :
itti_msg_n2(PDU_SESSION_RESOURCE_RELEASE_COMMAND, origin, destination) { itti_msg_n2(PDU_SESSION_RESOURCE_RELEASE_COMMAND, origin, destination) {
} }
...@@ -156,7 +162,6 @@ class itti_pdu_session_resource_release_command : public itti_msg_n2 { ...@@ -156,7 +162,6 @@ class itti_pdu_session_resource_release_command : public itti_msg_n2 {
uint8_t pdu_session_id; uint8_t pdu_session_id;
}; };
class itti_ue_context_release_request : public itti_msg_n2 { class itti_ue_context_release_request : public itti_msg_n2 {
public: public:
itti_ue_context_release_request(const task_id_t origin, itti_ue_context_release_request(const task_id_t origin,
...@@ -171,55 +176,89 @@ class itti_ue_context_release_request : public itti_msg_n2 { ...@@ -171,55 +176,89 @@ class itti_ue_context_release_request : public itti_msg_n2 {
UEContextReleaseRequestMsg *ueCtxRel; UEContextReleaseRequestMsg *ueCtxRel;
}; };
class itti_ue_context_release_command : public itti_msg_n2 class itti_ue_context_release_command : public itti_msg_n2 {
{ public:
public: itti_ue_context_release_command(const task_id_t origin,
itti_ue_context_release_command(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UE_CONTEXT_RELEASE_COMMAND, origin, destination) {} const task_id_t destination)
itti_ue_context_release_command(const itti_dl_nas_transport &i) : itti_msg_n2(i) {} :
itti_msg_n2(UE_CONTEXT_RELEASE_COMMAND, origin, destination) {
}
itti_ue_context_release_command(const itti_dl_nas_transport &i)
:
itti_msg_n2(i) {
}
public: public:
uint32_t ran_ue_ngap_id; uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id; long amf_ue_ngap_id;
Cause cause; Cause cause;
}; };
class itti_ue_radio_capability_indication : public itti_msg_n2 class itti_ue_radio_capability_indication : public itti_msg_n2 {
{ public:
public: itti_ue_radio_capability_indication(const task_id_t origin,
itti_ue_radio_capability_indication(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UE_RADIO_CAP_IND, origin, destination) {} const task_id_t destination)
itti_ue_radio_capability_indication(const itti_ue_radio_capability_indication &i) : itti_msg_n2(i) {} :
itti_msg_n2(UE_RADIO_CAP_IND, origin, destination) {
}
itti_ue_radio_capability_indication(
const itti_ue_radio_capability_indication &i)
:
itti_msg_n2(i) {
}
UeRadioCapabilityInfoIndicationMsg *ueRadioCap; UeRadioCapabilityInfoIndicationMsg *ueRadioCap;
}; };
class itti_handover_required : public itti_msg_n2 class itti_handover_required : public itti_msg_n2 {
{ public:
public: itti_handover_required(const task_id_t origin, const task_id_t destination)
itti_handover_required(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_REQUIRED, origin, destination) {} :
itti_handover_required(const itti_handover_required &i) : itti_msg_n2(i) {} itti_msg_n2(HANDOVER_REQUIRED, origin, destination) {
}
itti_handover_required(const itti_handover_required &i)
:
itti_msg_n2(i) {
}
HandoverRequiredMsg *handvoerRequ; HandoverRequiredMsg *handvoerRequ;
}; };
class itti_handover_request_Ack : public itti_msg_n2 class itti_handover_request_Ack : public itti_msg_n2 {
{ public:
public: itti_handover_request_Ack(const task_id_t origin, const task_id_t destination)
itti_handover_request_Ack(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_REQUEST_ACK, origin, destination) {} :
itti_handover_request_Ack(const itti_handover_request_Ack &i) : itti_msg_n2(i) {} itti_msg_n2(HANDOVER_REQUEST_ACK, origin, destination) {
}
itti_handover_request_Ack(const itti_handover_request_Ack &i)
:
itti_msg_n2(i) {
}
HandoverRequestAck *handoverrequestAck; HandoverRequestAck *handoverrequestAck;
}; };
class itti_handover_notify : public itti_msg_n2 class itti_handover_notify : public itti_msg_n2 {
{ public:
public: itti_handover_notify(const task_id_t origin, const task_id_t destination)
itti_handover_notify(const task_id_t origin, const task_id_t destination) : itti_msg_n2(HANDOVER_NOTIFY, origin, destination) {} :
itti_handover_notify(const itti_handover_notify &i) : itti_msg_n2(i) {} itti_msg_n2(HANDOVER_NOTIFY, origin, destination) {
}
itti_handover_notify(const itti_handover_notify &i)
:
itti_msg_n2(i) {
}
HandoverNotifyMsg *handovernotify; HandoverNotifyMsg *handovernotify;
}; };
class itti_uplinkranstatsutransfer : public itti_msg_n2 class itti_uplinkranstatsutransfer : public itti_msg_n2 {
{ public:
public: itti_uplinkranstatsutransfer(const task_id_t origin,
itti_uplinkranstatsutransfer(const task_id_t origin, const task_id_t destination) : itti_msg_n2(UPLINKRANSTATUSTRANSFER, origin, destination) {} const task_id_t destination)
itti_uplinkranstatsutransfer(const itti_uplinkranstatsutransfer &i) : itti_msg_n2(i) {} :
itti_msg_n2(UPLINKRANSTATUSTRANSFER, origin, destination) {
}
itti_uplinkranstatsutransfer(const itti_uplinkranstatsutransfer &i)
:
itti_msg_n2(i) {
}
UplinkRANStatusTransfer *uplinkrantransfer; UplinkRANStatusTransfer *uplinkrantransfer;
}; };
......
...@@ -30,38 +30,35 @@ ...@@ -30,38 +30,35 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ COUNTValueForPDCP_SN18::COUNTValueForPDCP_SN18() {
COUNTValueForPDCP_SN18::COUNTValueForPDCP_SN18() pdcp = 0;
{ hfn_pdcp = 0;
pdcp = 0; }
hfn_pdcp = 0; COUNTValueForPDCP_SN18::~COUNTValueForPDCP_SN18() {
} }
COUNTValueForPDCP_SN18::~COUNTValueForPDCP_SN18() {} void COUNTValueForPDCP_SN18::setvalue(long pDCP, long hfn_PDCP) {
void COUNTValueForPDCP_SN18::setvalue(long pDCP, long hfn_PDCP) pdcp = pDCP;
{ hfn_pdcp = hfn_PDCP;
pdcp = pDCP; }
hfn_pdcp = hfn_PDCP; void COUNTValueForPDCP_SN18::getvalue(long &pDCP, long &hFN_PDCP) {
} pDCP = pdcp;
void COUNTValueForPDCP_SN18::getvalue(long &pDCP, long &hFN_PDCP) hFN_PDCP = hfn_pdcp;
{ }
pDCP = pdcp; bool COUNTValueForPDCP_SN18::encodedCOUNTValueForPDCP_SN18(
hFN_PDCP = hfn_pdcp; Ngap_COUNTValueForPDCP_SN18_t &countvalue) {
} countvalue.pDCP_SN18 = pdcp;
bool COUNTValueForPDCP_SN18::encodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countvalue) countvalue.hFN_PDCP_SN18 = hfn_pdcp;
{ cout << "the encode pdcp_sn18 is" << countvalue.pDCP_SN18 << endl;
countvalue.pDCP_SN18 = pdcp; cout << "the encode hfn_pdcp_sn18 is" << countvalue.hFN_PDCP_SN18 << endl;
countvalue.hFN_PDCP_SN18 = hfn_pdcp; return true;
cout << "the encode pdcp_sn18 is" << countvalue.pDCP_SN18 << endl; }
cout << "the encode hfn_pdcp_sn18 is" << countvalue.hFN_PDCP_SN18 << endl; bool COUNTValueForPDCP_SN18::decodedCOUNTValueForPDCP_SN18(
return true; Ngap_COUNTValueForPDCP_SN18_t &countValue) {
} pdcp = countValue.pDCP_SN18;
bool COUNTValueForPDCP_SN18::decodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countValue) hfn_pdcp = countValue.hFN_PDCP_SN18;
{ cout << "the decode pdcp_sn18 is" << countValue.pDCP_SN18 << endl;
pdcp = countValue.pDCP_SN18; cout << "the decode hfn_pdcp_sn18 is" << countValue.hFN_PDCP_SN18 << endl;
hfn_pdcp = countValue.hFN_PDCP_SN18; return true;
cout << "the decode pdcp_sn18 is" << countValue.pDCP_SN18 << endl; }
cout << "the decode hfn_pdcp_sn18 is" << countValue.hFN_PDCP_SN18 << endl; } // namespace ngap
return true;
}
} // namespace ngap
...@@ -27,27 +27,24 @@ ...@@ -27,27 +27,24 @@
*/ */
#ifndef _COUNTVALUEFORPDCP_SN18_H_ #ifndef _COUNTVALUEFORPDCP_SN18_H_
#define _COUNTVALUEFORPDCP_SN18_H_ #define _COUNTVALUEFORPDCP_SN18_H_
extern "C" extern "C" {
{
#include "Ngap_COUNTValueForPDCP-SN18.h" #include "Ngap_COUNTValueForPDCP-SN18.h"
} }
namespace ngap namespace ngap {
{ class COUNTValueForPDCP_SN18 {
class COUNTValueForPDCP_SN18 private:
{ /* data */
private: long pdcp;
/* data */ long hfn_pdcp;
long pdcp;
long hfn_pdcp;
public: public:
COUNTValueForPDCP_SN18(/* args */); COUNTValueForPDCP_SN18(/* args */);
virtual ~COUNTValueForPDCP_SN18(); virtual ~COUNTValueForPDCP_SN18();
void getvalue(long &pDCP, long &hFN_PDCP); void getvalue(long &pDCP, long &hFN_PDCP);
void setvalue(long pDCP, long hfn_PDCP); void setvalue(long pDCP, long hfn_PDCP);
bool encodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countvalue); bool encodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countvalue);
bool decodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countValue); bool decodedCOUNTValueForPDCP_SN18(Ngap_COUNTValueForPDCP_SN18_t &countValue);
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -25,48 +25,53 @@ ...@@ -25,48 +25,53 @@
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "PDUSessionResourceAdmittedItem.hpp" #include "PDUSessionResourceAdmittedItem.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
PDUSessionResourceAdmittedItem::PDUSessionResourceAdmittedItem() PDUSessionResourceAdmittedItem::PDUSessionResourceAdmittedItem() {
{ pDUSessionID = NULL;
pDUSessionID = NULL; }
} PDUSessionResourceAdmittedItem::~PDUSessionResourceAdmittedItem() {
PDUSessionResourceAdmittedItem::~PDUSessionResourceAdmittedItem(){} }
void PDUSessionResourceAdmittedItem::setPDUSessionResourceAdmittedItem(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequestAcktransfer) void PDUSessionResourceAdmittedItem::setPDUSessionResourceAdmittedItem(
{ PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequestAcktransfer) {
pDUSessionID = m_pDUSessionID; pDUSessionID = m_pDUSessionID;
handoverrequestAcktransfer = m_handoverrequestAcktransfer; handoverrequestAcktransfer = m_handoverrequestAcktransfer;
} }
bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem) bool PDUSessionResourceAdmittedItem::encode2PDUSessionResourceAdmittedItem(
{ Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem) {
if(!pDUSessionID) return false; if (!pDUSessionID)
if(!pDUSessionID->encode2PDUSessionID(pdUSessionResourceAdmittedItem->pDUSessionID)) return false; return false;
pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer = handoverrequestAcktransfer; if (!pDUSessionID->encode2PDUSessionID(
pdUSessionResourceAdmittedItem->pDUSessionID))
return true; return false;
} pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer =
//...... handoverrequestAcktransfer;
bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem)
{ return true;
pDUSessionID = new PDUSessionID(); }
if(!pDUSessionID->decodefromPDUSessionID(pdUSessionResourceAdmittedItem->pDUSessionID)) return false; //�����......
handoverrequestAcktransfer = pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer; bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem) {
return true; pDUSessionID = new PDUSessionID();
} if (!pDUSessionID->decodefromPDUSessionID(
void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t&m_handoverrequestAcktransfer) pdUSessionResourceAdmittedItem->pDUSessionID))
{ return false;
m_pDUSessionID = pDUSessionID; handoverrequestAcktransfer = pdUSessionResourceAdmittedItem
m_handoverrequestAcktransfer = handoverrequestAcktransfer; ->handoverRequestAcknowledgeTransfer;
}
return true;
}
void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(
PDUSessionID *&m_pDUSessionID,
OCTET_STRING_t &m_handoverrequestAcktransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverrequestAcktransfer = handoverrequestAcktransfer;
} }
}
...@@ -30,32 +30,34 @@ ...@@ -30,32 +30,34 @@
#include "PDUSessionID.hpp" #include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp" #include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceAdmittedItem.h" #include "Ngap_PDUSessionResourceAdmittedItem.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceAdmittedItem { class PDUSessionResourceAdmittedItem {
public: public:
PDUSessionResourceAdmittedItem(); PDUSessionResourceAdmittedItem();
virtual ~PDUSessionResourceAdmittedItem(); virtual ~PDUSessionResourceAdmittedItem();
void setPDUSessionResourceAdmittedItem(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequestAcktransfer); void setPDUSessionResourceAdmittedItem(
void getPDUSessionResourceAdmittedItem(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t&m_handoverrequestAcktransfer); PDUSessionID *m_pDUSessionID,
OCTET_STRING_t m_handoverrequestAcktransfer);
bool encode2PDUSessionResourceAdmittedItem(Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem); void getPDUSessionResourceAdmittedItem(
bool decodefromPDUSessionResourceAdmittedItem(Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem); PDUSessionID *&m_pDUSessionID,
private: OCTET_STRING_t &m_handoverrequestAcktransfer);
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequestAcktransfer; bool encode2PDUSessionResourceAdmittedItem(
}; Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem);
bool decodefromPDUSessionResourceAdmittedItem(
Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequestAcktransfer;
};
} }
#endif #endif
#include "PDUSessionResourceAdmittedList.hpp" #include "PDUSessionResourceAdmittedList.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList()
{
pduSessionResourceAdmittedItem = NULL;
numofSessionResourceAdmittedItem = 0;
}
PDUSessionResourceAdmittedList::~PDUSessionResourceAdmittedList(){}
void PDUSessionResourceAdmittedList::setPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem,int num)
{
pduSessionResourceAdmittedItem = m_pduSessionResourceAdmittedItem;
numofSessionResourceAdmittedItem = num;
}
bool PDUSessionResourceAdmittedList::encode2PDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList)
{
for(int i=0;i< numofSessionResourceAdmittedItem;i++)
{
Ngap_PDUSessionResourceAdmittedItem_t *response = (Ngap_PDUSessionResourceAdmittedItem_t *)calloc(1,sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
if(!response) return false;
if(!pduSessionResourceAdmittedItem[i].encode2PDUSessionResourceAdmittedItem(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceAdmittedList->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceAdmittedList::decodefromPDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList)
{
numofSessionResourceAdmittedItem = pduSessionResourceAdmittedList->list.count;
pduSessionResourceAdmittedItem = new PDUSessionResourceAdmittedItem[numofSessionResourceAdmittedItem]();
for(int i=0;i< numofSessionResourceAdmittedItem;i++)
{
if(!pduSessionResourceAdmittedItem[i].decodefromPDUSessionResourceAdmittedItem(pduSessionResourceAdmittedList->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *&m_pduSessionResourceAdmittedItem,int &num)
{
m_pduSessionResourceAdmittedItem = pduSessionResourceAdmittedItem;
num = numofSessionResourceAdmittedItem;
}
}
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList() {
pduSessionResourceAdmittedItem = NULL;
numofSessionResourceAdmittedItem = 0;
}
PDUSessionResourceAdmittedList::~PDUSessionResourceAdmittedList() {
}
void PDUSessionResourceAdmittedList::setPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem, int num) {
pduSessionResourceAdmittedItem = m_pduSessionResourceAdmittedItem;
numofSessionResourceAdmittedItem = num;
}
bool PDUSessionResourceAdmittedList::encode2PDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList) {
for (int i = 0; i < numofSessionResourceAdmittedItem; i++) {
Ngap_PDUSessionResourceAdmittedItem_t *response =
(Ngap_PDUSessionResourceAdmittedItem_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
if (!response)
return false;
if (!pduSessionResourceAdmittedItem[i].encode2PDUSessionResourceAdmittedItem(
response))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceAdmittedList->list, response) != 0)
return false;
}
return true;
}
bool PDUSessionResourceAdmittedList::decodefromPDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList) {
numofSessionResourceAdmittedItem = pduSessionResourceAdmittedList->list.count;
pduSessionResourceAdmittedItem =
new PDUSessionResourceAdmittedItem[numofSessionResourceAdmittedItem]();
for (int i = 0; i < numofSessionResourceAdmittedItem; i++) {
if (!pduSessionResourceAdmittedItem[i]
.decodefromPDUSessionResourceAdmittedItem(
pduSessionResourceAdmittedList->list.array[i]))
return false;
}
return true;
}
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(
PDUSessionResourceAdmittedItem *&m_pduSessionResourceAdmittedItem,
int &num) {
m_pduSessionResourceAdmittedItem = pduSessionResourceAdmittedItem;
num = numofSessionResourceAdmittedItem;
}
}
...@@ -3,26 +3,32 @@ ...@@ -3,26 +3,32 @@
#include "PDUSessionResourceAdmittedItem.hpp" #include "PDUSessionResourceAdmittedItem.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceAdmittedList.h" #include "Ngap_PDUSessionResourceAdmittedList.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceAdmittedList { class PDUSessionResourceAdmittedList {
public: public:
PDUSessionResourceAdmittedList(); PDUSessionResourceAdmittedList();
virtual ~PDUSessionResourceAdmittedList(); virtual ~PDUSessionResourceAdmittedList();
void setPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem,int num); void setPDUSessionResourceAdmittedList(
void getPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *&m_pduSessionResourceAdmittedItem,int &num); PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem,
int num);
bool encode2PDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList); void getPDUSessionResourceAdmittedList(
bool decodefromPDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList); PDUSessionResourceAdmittedItem *&m_pduSessionResourceAdmittedItem,
private: int &num);
PDUSessionResourceAdmittedItem *pduSessionResourceAdmittedItem;
int numofSessionResourceAdmittedItem; bool encode2PDUSessionResourceAdmittedList(
}; Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList);
bool decodefromPDUSessionResourceAdmittedList(
Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList);
private:
PDUSessionResourceAdmittedItem *pduSessionResourceAdmittedItem;
int numofSessionResourceAdmittedItem;
};
} }
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "PDUSessionResourceHandoverCommandTransfer.hpp" #include "PDUSessionResourceHandoverCommandTransfer.hpp"
extern "C" extern "C" {
{
#include "constr_TYPE.h" #include "constr_TYPE.h"
#include "asn_codecs.h" #include "asn_codecs.h"
#include "per_encoder.h" #include "per_encoder.h"
...@@ -36,78 +35,81 @@ extern "C" ...@@ -36,78 +35,81 @@ extern "C"
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ PDUSessionResourceHandoverCommandTransfer::PDUSessionResourceHandoverCommandTransfer() {
PDUSessionResourceHandoverCommandTransfer::PDUSessionResourceHandoverCommandTransfer() handovercommandtransferIE = (Ngap_HandoverCommandTransfer_t*) calloc(
{ 1, sizeof(Ngap_HandoverCommandTransfer_t));
handovercommandtransferIE = (Ngap_HandoverCommandTransfer_t *)calloc(1, sizeof(Ngap_HandoverCommandTransfer_t)); dLForwardingUP_TNLInformation = NULL;
dLForwardingUP_TNLInformation = NULL; qosFlowToBeForwardedList = NULL;
qosFlowToBeForwardedList = NULL; }
PDUSessionResourceHandoverCommandTransfer::~PDUSessionResourceHandoverCommandTransfer() {
}
void PDUSessionResourceHandoverCommandTransfer::setQosFlowToBeForwardedList(
std::vector<QosFlowToBeForwardedItem_t> list) {
if (!qosFlowToBeForwardedList)
qosFlowToBeForwardedList = new QosFlowToBeForwardedList();
QosFlowToBeForwardedItem *m_item =
new QosFlowToBeForwardedItem[list.size()]();
for (int i = 0; i < list.size(); i++) {
QosFlowIdentifier *m_qosFlowIdentifier = new QosFlowIdentifier();
m_qosFlowIdentifier->setQosFlowIdentifier(list[i].QFI);
m_item[i].setQosFlowIdentifier(m_qosFlowIdentifier);
}
qosFlowToBeForwardedList->setQosFlowToBeForwardedItem(m_item, list.size());
int ret = qosFlowToBeForwardedList->encodeQosFlowToBeForwardedList(
handovercommandtransferIE->qosFlowToBeForwardedList);
cout << "QFI in list "
<< handovercommandtransferIE->qosFlowToBeForwardedList->list.count
<< endl;
if (handovercommandtransferIE->qosFlowToBeForwardedList->list.array) {
cout << "array OK" << endl;
if (handovercommandtransferIE->qosFlowToBeForwardedList->list.array[0]) {
cout << "QFI in list "
<< handovercommandtransferIE->qosFlowToBeForwardedList->list.array[0]
->qosFlowIdentifier << endl;
} else {
cout << "error1" << endl;
} }
PDUSessionResourceHandoverCommandTransfer::~PDUSessionResourceHandoverCommandTransfer() {} } else {
void PDUSessionResourceHandoverCommandTransfer::setQosFlowToBeForwardedList(std::vector<QosFlowToBeForwardedItem_t> list) cout << "error2" << endl;
{ }
if (!qosFlowToBeForwardedList)
qosFlowToBeForwardedList = new QosFlowToBeForwardedList();
QosFlowToBeForwardedItem *m_item = new QosFlowToBeForwardedItem[list.size()]();
for (int i = 0; i < list.size(); i++)
{
QosFlowIdentifier *m_qosFlowIdentifier = new QosFlowIdentifier();
m_qosFlowIdentifier->setQosFlowIdentifier(list[i].QFI);
m_item[i].setQosFlowIdentifier(m_qosFlowIdentifier);
}
qosFlowToBeForwardedList->setQosFlowToBeForwardedItem(m_item, list.size());
int ret = qosFlowToBeForwardedList->encodeQosFlowToBeForwardedList(handovercommandtransferIE->qosFlowToBeForwardedList);
cout << "QFI in list " << handovercommandtransferIE->qosFlowToBeForwardedList->list.count << endl;
if (handovercommandtransferIE->qosFlowToBeForwardedList->list.array)
{
cout << "array OK" << endl;
if (handovercommandtransferIE->qosFlowToBeForwardedList->list.array[0])
{
cout << "QFI in list " << handovercommandtransferIE->qosFlowToBeForwardedList->list.array[0]->qosFlowIdentifier << endl;
}
else
{
cout << "error1" << endl;
}
}
else
{
cout << "error2" << endl;
}
if (!ret) if (!ret) {
{ cout << "encode QosFlowToBeForwardedList IE error" << endl;
cout << "encode QosFlowToBeForwardedList IE error" << endl; return;
return; }
} }
} void PDUSessionResourceHandoverCommandTransfer::setUPTransportLayerInformation(
void PDUSessionResourceHandoverCommandTransfer::setUPTransportLayerInformation(GtpTunnel_t uptlinfo) GtpTunnel_t uptlinfo) {
{ if (!dLForwardingUP_TNLInformation) {
if (!dLForwardingUP_TNLInformation) dLForwardingUP_TNLInformation = new UpTransportLayerInformation();
{ }
dLForwardingUP_TNLInformation = new UpTransportLayerInformation(); TransportLayerAddress *m_transportLayerAddress = new TransportLayerAddress();
} GtpTeid *m_gtpTeid = new GtpTeid();
TransportLayerAddress *m_transportLayerAddress = new TransportLayerAddress(); m_transportLayerAddress->setTransportLayerAddress(uptlinfo.ip_address);
GtpTeid *m_gtpTeid = new GtpTeid(); m_gtpTeid->setGtpTeid(uptlinfo.gtp_teid);
m_transportLayerAddress->setTransportLayerAddress(uptlinfo.ip_address); dLForwardingUP_TNLInformation->setUpTransportLayerInformation(
m_gtpTeid->setGtpTeid(uptlinfo.gtp_teid); m_transportLayerAddress, m_gtpTeid);
dLForwardingUP_TNLInformation->setUpTransportLayerInformation(m_transportLayerAddress, m_gtpTeid); Ngap_UPTransportLayerInformation *test =
Ngap_UPTransportLayerInformation *test = (Ngap_UPTransportLayerInformation *)calloc(1, sizeof(Ngap_UPTransportLayerInformation)); (Ngap_UPTransportLayerInformation*) calloc(
handovercommandtransferIE->dLForwardingUP_TNLInformation = test; 1, sizeof(Ngap_UPTransportLayerInformation));
int ret = dLForwardingUP_TNLInformation->encode2UpTransportLayerInformation(*test); handovercommandtransferIE->dLForwardingUP_TNLInformation = test;
if (!ret) int ret = dLForwardingUP_TNLInformation->encode2UpTransportLayerInformation(
{ *test);
cout << "encode dLForwardingUP_TNLInformation IE error"; if (!ret) {
return; cout << "encode dLForwardingUP_TNLInformation IE error";
} return;
} }
int PDUSessionResourceHandoverCommandTransfer::encodePDUSessionResourceHandoverCommandTransfer(uint8_t *buf, int buf_size) }
{ int PDUSessionResourceHandoverCommandTransfer::encodePDUSessionResourceHandoverCommandTransfer(
asn_fprint(stderr, &asn_DEF_Ngap_HandoverCommandTransfer, handovercommandtransferIE); uint8_t *buf, int buf_size) {
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_HandoverCommandTransfer, NULL, handovercommandtransferIE, buf, buf_size); asn_fprint(stderr, &asn_DEF_Ngap_HandoverCommandTransfer,
cout << "er.encoded(" << er.encoded << ")" << endl; handovercommandtransferIE);
return er.encoded; asn_enc_rval_t er = aper_encode_to_buffer(
} &asn_DEF_Ngap_HandoverCommandTransfer, NULL, handovercommandtransferIE,
buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
} // namespace ngap } // namespace ngap
...@@ -31,28 +31,27 @@ ...@@ -31,28 +31,27 @@
#include "UPTransportLayerInformation.hpp" #include "UPTransportLayerInformation.hpp"
#include "QosFlowToBeForwardedList.hpp" #include "QosFlowToBeForwardedList.hpp"
#include "NgapIEsStruct.hpp" #include "NgapIEsStruct.hpp"
extern "C" extern "C" {
{
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverCommandTransfer.h" #include "Ngap_HandoverCommandTransfer.h"
} }
namespace ngap namespace ngap {
{ class PDUSessionResourceHandoverCommandTransfer {
class PDUSessionResourceHandoverCommandTransfer private:
{ /* data */
private: Ngap_HandoverCommandTransfer_t *handovercommandtransferIE;
/* data */ UpTransportLayerInformation *dLForwardingUP_TNLInformation;
Ngap_HandoverCommandTransfer_t *handovercommandtransferIE; QosFlowToBeForwardedList *qosFlowToBeForwardedList;
UpTransportLayerInformation *dLForwardingUP_TNLInformation;
QosFlowToBeForwardedList *qosFlowToBeForwardedList;
public: public:
PDUSessionResourceHandoverCommandTransfer(/* args */); PDUSessionResourceHandoverCommandTransfer(/* args */);
virtual ~PDUSessionResourceHandoverCommandTransfer(); virtual ~PDUSessionResourceHandoverCommandTransfer();
void setUPTransportLayerInformation(GtpTunnel_t uptlinfo); void setUPTransportLayerInformation(GtpTunnel_t uptlinfo);
void setQosFlowToBeForwardedList(std::vector<QosFlowToBeForwardedItem_t> list); void setQosFlowToBeForwardedList(
int encodePDUSessionResourceHandoverCommandTransfer(uint8_t *buf, int buf_size); std::vector<QosFlowToBeForwardedItem_t> list);
}; int encodePDUSessionResourceHandoverCommandTransfer(uint8_t *buf,
int buf_size);
};
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -20,15 +20,14 @@ ...@@ -20,15 +20,14 @@
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp" #include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern "C" extern "C" {
{
#include "constr_TYPE.h" #include "constr_TYPE.h"
#include "asn_codecs.h" #include "asn_codecs.h"
#include "per_encoder.h" #include "per_encoder.h"
...@@ -39,78 +38,79 @@ extern "C" ...@@ -39,78 +38,79 @@ extern "C"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ PDUSessionResourceHandoverRequestAckTransfer::PDUSessionResourceHandoverRequestAckTransfer() {
PDUSessionResourceHandoverRequestAckTransfer::PDUSessionResourceHandoverRequestAckTransfer() handoverRequestAcknowledegTransferIEs =
{ (Ngap_HandoverRequestAcknowledgeTransfer_t*) calloc(
handoverRequestAcknowledegTransferIEs = (Ngap_HandoverRequestAcknowledgeTransfer_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeTransfer_t)); 1, sizeof(Ngap_HandoverRequestAcknowledgeTransfer_t));
dLForwardingUP_TNLInformation = NULL; dLForwardingUP_TNLInformation = NULL;
QosFlowSetupResponseList = NULL; QosFlowSetupResponseList = NULL;
} }
PDUSessionResourceHandoverRequestAckTransfer::~PDUSessionResourceHandoverRequestAckTransfer() {} PDUSessionResourceHandoverRequestAckTransfer::~PDUSessionResourceHandoverRequestAckTransfer() {
bool PDUSessionResourceHandoverRequestAckTransfer::decodefromHandoverRequestAckTransfer(uint8_t *buf, int buf_size) }
{ bool PDUSessionResourceHandoverRequestAckTransfer::decodefromHandoverRequestAckTransfer(
asn_dec_rval_t rc = asn_decode(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_Ngap_HandoverRequestAcknowledgeTransfer, (void **)&handoverRequestAcknowledegTransferIEs, buf, buf_size); uint8_t *buf, int buf_size) {
if (rc.code == RC_OK) asn_dec_rval_t rc = asn_decode(
{ NULL, ATS_ALIGNED_CANONICAL_PER,
cout << "Decoded handoverRequestAcknowledegTransfer successfully" << endl; &asn_DEF_Ngap_HandoverRequestAcknowledgeTransfer,
} (void**) &handoverRequestAcknowledegTransferIEs, buf, buf_size);
else if (rc.code == RC_WMORE) if (rc.code == RC_OK) {
{ cout << "Decoded handoverRequestAcknowledegTransfer successfully" << endl;
cout << "More data expected, call again" << endl; } else if (rc.code == RC_WMORE) {
return false; cout << "More data expected, call again" << endl;
} return false;
else } else {
{ cout << "Failure to decode handoverRequestAcknowledegTransfer data" << endl;
cout << "Failure to decode handoverRequestAcknowledegTransfer data" << endl; //return false;
//return false; }
} cout << "rc.consumed to decode = " << rc.consumed << endl;
cout << "rc.consumed to decode = " << rc.consumed << endl; cout << endl;
cout << endl; dLForwardingUP_TNLInformation = new UpTransportLayerInformation();
dLForwardingUP_TNLInformation = new UpTransportLayerInformation(); if (!dLForwardingUP_TNLInformation->decodefromUpTransportLayerInformation(
if (!dLForwardingUP_TNLInformation->decodefromUpTransportLayerInformation(*handoverRequestAcknowledegTransferIEs->dLForwardingUP_TNLInformation)) *handoverRequestAcknowledegTransferIEs->dLForwardingUP_TNLInformation)) {
{ cout << "decoded ngap DL_NGU_UP_TNLInformation IE error" << endl;
cout << "decoded ngap DL_NGU_UP_TNLInformation IE error" << endl; return false;
return false; }
} QosFlowSetupResponseList = new QosFlowListWithDataForwarding();
QosFlowSetupResponseList = new QosFlowListWithDataForwarding(); if (!QosFlowSetupResponseList->decodeFormQosFlowListWithDataForwarding(
if (!QosFlowSetupResponseList->decodeFormQosFlowListWithDataForwarding(handoverRequestAcknowledegTransferIEs->qosFlowSetupResponseList)) handoverRequestAcknowledegTransferIEs->qosFlowSetupResponseList)) {
{ cout << "decoded ngap QosFlowSetupResponseList IE error" << endl;
cout << "decoded ngap QosFlowSetupResponseList IE error" << endl; return false;
return false; }
} return true;
return true; }
} bool PDUSessionResourceHandoverRequestAckTransfer::getUpTransportLayerInformation2(
bool PDUSessionResourceHandoverRequestAckTransfer::getUpTransportLayerInformation2(GtpTunnel_t *&upTnlInfo) GtpTunnel_t *&upTnlInfo) {
{ if (!dLForwardingUP_TNLInformation->decodefromUpTransportLayerInformation(
if (!dLForwardingUP_TNLInformation->decodefromUpTransportLayerInformation(*handoverRequestAcknowledegTransferIEs->dLForwardingUP_TNLInformation)) *handoverRequestAcknowledegTransferIEs->dLForwardingUP_TNLInformation))
return false; return false;
TransportLayerAddress *m_transportLayerAddress; TransportLayerAddress *m_transportLayerAddress;
GtpTeid *m_gtpTeid; GtpTeid *m_gtpTeid;
if (!dLForwardingUP_TNLInformation->getUpTransportLayerInformation(m_transportLayerAddress, m_gtpTeid)) if (!dLForwardingUP_TNLInformation->getUpTransportLayerInformation(
return false; m_transportLayerAddress, m_gtpTeid))
if (!m_transportLayerAddress->getTransportLayerAddress(upTnlInfo->ip_address)) return false;
return false; if (!m_transportLayerAddress->getTransportLayerAddress(upTnlInfo->ip_address))
if (!m_gtpTeid->getGtpTeid(upTnlInfo->gtp_teid)) return false;
return false; if (!m_gtpTeid->getGtpTeid(upTnlInfo->gtp_teid))
return true; return false;
} return true;
bool PDUSessionResourceHandoverRequestAckTransfer::getqosFlowSetupResponseList(std::vector<QosFlowLItemWithDataForwarding_t> &list) }
{ bool PDUSessionResourceHandoverRequestAckTransfer::getqosFlowSetupResponseList(
if (!QosFlowSetupResponseList) std::vector<QosFlowLItemWithDataForwarding_t> &list) {
return false; if (!QosFlowSetupResponseList)
QosFlowItemWithDataForWarding *m_qosflowitemwithdataforwarding; return false;
int num = 0; QosFlowItemWithDataForWarding *m_qosflowitemwithdataforwarding;
if (QosFlowSetupResponseList->getQosFlowListWithDataForwarding(m_qosflowitemwithdataforwarding, num)) int num = 0;
{ if (QosFlowSetupResponseList->getQosFlowListWithDataForwarding(
cout << "successful decode QosFlowList" << endl; m_qosflowitemwithdataforwarding, num)) {
} cout << "successful decode QosFlowList" << endl;
for (int i = 0; i < num; i++) }
{ for (int i = 0; i < num; i++) {
QosFlowLItemWithDataForwarding_t response; QosFlowLItemWithDataForwarding_t response;
m_qosflowitemwithdataforwarding[i].getQosFlowItemWithDataForWarding(response.qosFlowIdentifier); m_qosflowitemwithdataforwarding[i].getQosFlowItemWithDataForWarding(
list.push_back(response); response.qosFlowIdentifier);
} list.push_back(response);
return true; }
} return true;
} // namespace ngap }
} // namespace ngap
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#ifndef _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_ #ifndef _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
#define _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_ #define _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
...@@ -33,27 +33,25 @@ ...@@ -33,27 +33,25 @@
#include "DLQoSFlowPerTNLInformation.hpp" #include "DLQoSFlowPerTNLInformation.hpp"
#include "SecurityResult.hpp" #include "SecurityResult.hpp"
#include "QosFlowListWithDataForwarding.hpp" #include "QosFlowListWithDataForwarding.hpp"
extern "C" extern "C" {
{
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverRequestAcknowledgeTransfer.h" #include "Ngap_HandoverRequestAcknowledgeTransfer.h"
} }
namespace ngap namespace ngap {
{ class PDUSessionResourceHandoverRequestAckTransfer {
class PDUSessionResourceHandoverRequestAckTransfer public:
{ PDUSessionResourceHandoverRequestAckTransfer();
public: virtual ~PDUSessionResourceHandoverRequestAckTransfer();
PDUSessionResourceHandoverRequestAckTransfer(); bool decodefromHandoverRequestAckTransfer(uint8_t *buf, int buf_size);
virtual ~PDUSessionResourceHandoverRequestAckTransfer(); bool getUpTransportLayerInformation2(GtpTunnel_t *&upTnlInfo);
bool decodefromHandoverRequestAckTransfer(uint8_t *buf, int buf_size); bool getqosFlowSetupResponseList(
bool getUpTransportLayerInformation2(GtpTunnel_t *&upTnlInfo); std::vector<QosFlowLItemWithDataForwarding_t> &list);
bool getqosFlowSetupResponseList(std::vector<QosFlowLItemWithDataForwarding_t> &list);
private: private:
Ngap_HandoverRequestAcknowledgeTransfer_t *handoverRequestAcknowledegTransferIEs; Ngap_HandoverRequestAcknowledgeTransfer_t *handoverRequestAcknowledegTransferIEs;
UpTransportLayerInformation *dLForwardingUP_TNLInformation; UpTransportLayerInformation *dLForwardingUP_TNLInformation;
QosFlowListWithDataForwarding *QosFlowSetupResponseList; QosFlowListWithDataForwarding *QosFlowSetupResponseList;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
\ No newline at end of file
#include "PDUSessionResourceHandoverRequiredTransfer.hpp" #include "PDUSessionResourceHandoverRequiredTransfer.hpp"
extern "C"{ extern "C" {
#include "constr_TYPE.h" #include "constr_TYPE.h"
#include "asn_codecs.h" #include "asn_codecs.h"
#include "per_encoder.h" #include "per_encoder.h"
#include "per_decoder.h" #include "per_decoder.h"
#include "constraints.h" #include "constraints.h"
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
PDUSessionResourceHandoverRequiredTransfer::PDUSessionResourceHandoverRequiredTransfer() PDUSessionResourceHandoverRequiredTransfer::PDUSessionResourceHandoverRequiredTransfer() {
{ handoverrquiredTransferIEs = (Ngap_HandoverRequiredTransfer_t*) calloc(
handoverrquiredTransferIEs = (Ngap_HandoverRequiredTransfer_t *)calloc(1,sizeof(Ngap_HandoverRequiredTransfer_t)); 1, sizeof(Ngap_HandoverRequiredTransfer_t));
DirectForwardingPathAvailability = NULL; DirectForwardingPathAvailability = NULL;
} }
PDUSessionResourceHandoverRequiredTransfer::~PDUSessionResourceHandoverRequiredTransfer(){} PDUSessionResourceHandoverRequiredTransfer::~PDUSessionResourceHandoverRequiredTransfer() {
}
void PDUSessionResourceHandoverRequiredTransfer::setDirectForwardingPathAvailability(
Ngap_DirectForwardingPathAvailability_t directForwardingPathAvailability) {
if (!DirectForwardingPathAvailability)
DirectForwardingPathAvailability =
new Ngap_DirectForwardingPathAvailability_t();
*DirectForwardingPathAvailability = directForwardingPathAvailability;
}
void PDUSessionResourceHandoverRequiredTransfer::setDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directForwardingPathAvailability) int PDUSessionResourceHandoverRequiredTransfer::encode2buffer(uint8_t *buf,
{ int buf_size) {
if(!DirectForwardingPathAvailability) asn_fprint(stderr, &asn_DEF_Ngap_HandoverRequiredTransfer,
DirectForwardingPathAvailability = new Ngap_DirectForwardingPathAvailability_t(); handoverrquiredTransferIEs);
*DirectForwardingPathAvailability = directForwardingPathAvailability; asn_enc_rval_t er = aper_encode_to_buffer(
} &asn_DEF_Ngap_HandoverRequiredTransfer, NULL, handoverrquiredTransferIEs,
buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
//Decapsulation
bool PDUSessionResourceHandoverRequiredTransfer::decodefromIE(uint8_t *buf,
int buf_size) {
asn_dec_rval_t rc = asn_decode(NULL, ATS_ALIGNED_CANONICAL_PER,
&asn_DEF_Ngap_HandoverRequiredTransfer,
(void**) &handoverrquiredTransferIEs, buf,
buf_size);
if (rc.code == RC_OK) {
cout << "Decoded successfully" << endl;
} else if (rc.code == RC_WMORE) {
cout << "More data expected, call again" << endl;
return false;
} else {
cout << "Failure to decode data" << endl;
return false;
}
cout << "rc.consumed to decode = " << rc.consumed << endl;
cout << endl;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, pduSessionResourceSetupResponseTransferIEs);
if (handoverrquiredTransferIEs->directForwardingPathAvailability) {
Ngap_DirectForwardingPathAvailability_t *directForwardingPathAvailability =
new Ngap_DirectForwardingPathAvailability_t;
directForwardingPathAvailability = handoverrquiredTransferIEs
->directForwardingPathAvailability;
}
return true;
}
int PDUSessionResourceHandoverRequiredTransfer::encode2buffer(uint8_t *buf, int buf_size) bool PDUSessionResourceHandoverRequiredTransfer::getDirectForwardingPathAvailability(
{ long *directForwardingPathAvailability) {
asn_fprint(stderr, &asn_DEF_Ngap_HandoverRequiredTransfer, handoverrquiredTransferIEs); directForwardingPathAvailability = DirectForwardingPathAvailability;
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_HandoverRequiredTransfer, NULL, handoverrquiredTransferIEs, buf, buf_size); return true;
cout<<"er.encoded("<<er.encoded<<")"<<endl; }
return er.encoded;
}
//Decapsulation
bool PDUSessionResourceHandoverRequiredTransfer::decodefromIE(uint8_t *buf, int buf_size)
{
asn_dec_rval_t rc = asn_decode(NULL,ATS_ALIGNED_CANONICAL_PER,&asn_DEF_Ngap_HandoverRequiredTransfer,(void**)&handoverrquiredTransferIEs,buf,buf_size);
if(rc.code == RC_OK)
{
cout<<"Decoded successfully"<<endl;
}
else if(rc.code == RC_WMORE)
{
cout<<"More data expected, call again"<<endl;
return false;
}
else
{
cout<<"Failure to decode data"<<endl;
return false;
}
cout<<"rc.consumed to decode = "<<rc.consumed<<endl;
cout<<endl;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, pduSessionResourceSetupResponseTransferIEs);
if(handoverrquiredTransferIEs->directForwardingPathAvailability)
{
Ngap_DirectForwardingPathAvailability_t *directForwardingPathAvailability=new Ngap_DirectForwardingPathAvailability_t;
directForwardingPathAvailability = handoverrquiredTransferIEs->directForwardingPathAvailability;
}
return true;
}
bool PDUSessionResourceHandoverRequiredTransfer::getDirectForwardingPathAvailability(long *directForwardingPathAvailability)
{
directForwardingPathAvailability = DirectForwardingPathAvailability;
return true;
}
} }
...@@ -6,30 +6,30 @@ ...@@ -6,30 +6,30 @@
#include "DLQoSFlowPerTNLInformation.hpp" #include "DLQoSFlowPerTNLInformation.hpp"
#include "SecurityResult.hpp" #include "SecurityResult.hpp"
extern "C"{ extern "C" {
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverRequiredTransfer.h" #include "Ngap_HandoverRequiredTransfer.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceHandoverRequiredTransfer { class PDUSessionResourceHandoverRequiredTransfer {
public: public:
PDUSessionResourceHandoverRequiredTransfer(); PDUSessionResourceHandoverRequiredTransfer();
virtual ~PDUSessionResourceHandoverRequiredTransfer(); virtual ~PDUSessionResourceHandoverRequiredTransfer();
void setDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directForwardingPathAvailability); void setDirectForwardingPathAvailability(
int encode2buffer(uint8_t *buf, int buf_size); Ngap_DirectForwardingPathAvailability_t directForwardingPathAvailability);
//Decapsulation int encode2buffer(uint8_t *buf, int buf_size);
bool decodefromIE(uint8_t *buf, int buf_size); //Decapsulation
bool getDirectForwardingPathAvailability(long *directForwardingPathAvailability); bool decodefromIE(uint8_t *buf, int buf_size);
private: bool getDirectForwardingPathAvailability(
Ngap_HandoverRequiredTransfer_t *handoverrquiredTransferIEs; long *directForwardingPathAvailability);
Ngap_DirectForwardingPathAvailability_t *DirectForwardingPathAvailability; private:
}; Ngap_HandoverRequiredTransfer_t *handoverrquiredTransferIEs;
Ngap_DirectForwardingPathAvailability_t *DirectForwardingPathAvailability;
};
} }
#endif #endif
...@@ -25,47 +25,51 @@ ...@@ -25,47 +25,51 @@
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "PDUSessionResourceItemHORqd.hpp" #include "PDUSessionResourceItemHORqd.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
PDUSessionResourceItemHORqd::PDUSessionResourceItemHORqd() PDUSessionResourceItemHORqd::PDUSessionResourceItemHORqd() {
{ pDUSessionID = NULL;
pDUSessionID = NULL; }
} PDUSessionResourceItemHORqd::~PDUSessionResourceItemHORqd() {
PDUSessionResourceItemHORqd::~PDUSessionResourceItemHORqd(){} }
void PDUSessionResourceItemHORqd::setPDUSessionResourceItemHORqd(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer) void PDUSessionResourceItemHORqd::setPDUSessionResourceItemHORqd(
{ PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer) {
pDUSessionID = m_pDUSessionID; pDUSessionID = m_pDUSessionID;
handoverrequiredtransfer = m_handoverrequiredtransfer; handoverrequiredtransfer = m_handoverrequiredtransfer;
} }
bool PDUSessionResourceItemHORqd::encode2PDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd) bool PDUSessionResourceItemHORqd::encode2PDUSessionResourceItemHORqd(
{ Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd) {
if(!pDUSessionID) return false; if (!pDUSessionID)
if(!pDUSessionID->encode2PDUSessionID(pdUSessionResourceItemHORqd->pDUSessionID)) return false; return false;
pdUSessionResourceItemHORqd->handoverRequiredTransfer = handoverrequiredtransfer; if (!pDUSessionID->encode2PDUSessionID(
pdUSessionResourceItemHORqd->pDUSessionID))
return true; return false;
} pdUSessionResourceItemHORqd->handoverRequiredTransfer =
bool PDUSessionResourceItemHORqd::decodefromPDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd) handoverrequiredtransfer;
{
pDUSessionID = new PDUSessionID(); return true;
if(!pDUSessionID->decodefromPDUSessionID(pdUSessionResourceItemHORqd->pDUSessionID)) return false; }
handoverrequiredtransfer = pdUSessionResourceItemHORqd->handoverRequiredTransfer; bool PDUSessionResourceItemHORqd::decodefromPDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd) {
return true; pDUSessionID = new PDUSessionID();
} if (!pDUSessionID->decodefromPDUSessionID(
void PDUSessionResourceItemHORqd::getPDUSessionResourceItemHORqd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t&m_handoverrequiredtransfer) pdUSessionResourceItemHORqd->pDUSessionID))
{ return false;
m_pDUSessionID = pDUSessionID; handoverrequiredtransfer = pdUSessionResourceItemHORqd
m_handoverrequiredtransfer = handoverrequiredtransfer; ->handoverRequiredTransfer;
}
return true;
}
void PDUSessionResourceItemHORqd::getPDUSessionResourceItemHORqd(
PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_handoverrequiredtransfer) {
m_pDUSessionID = pDUSessionID;
m_handoverrequiredtransfer = handoverrequiredtransfer;
} }
}
...@@ -30,32 +30,33 @@ ...@@ -30,32 +30,33 @@
#include "PDUSessionID.hpp" #include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp" #include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceItemHORqd.h" #include "Ngap_PDUSessionResourceItemHORqd.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceItemHORqd{
public:
PDUSessionResourceItemHORqd();
virtual ~PDUSessionResourceItemHORqd();
void setPDUSessionResourceItemHORqd(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer);
void getPDUSessionResourceItemHORqd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t&m_handoverrequiredtransfer);
bool encode2PDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
bool decodefromPDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequiredtransfer;
};
} class PDUSessionResourceItemHORqd {
public:
#endif PDUSessionResourceItemHORqd();
virtual ~PDUSessionResourceItemHORqd();
void setPDUSessionResourceItemHORqd(
PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer);
void getPDUSessionResourceItemHORqd(
PDUSessionID *&m_pDUSessionID,
OCTET_STRING_t &m_handoverrequiredtransfer);
bool encode2PDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
bool decodefromPDUSessionResourceItemHORqd(
Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequiredtransfer;
};
}
#endif
#include "PDUSessionResourceListHORqd.hpp" #include "PDUSessionResourceListHORqd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceListHORqd::PDUSessionResourceListHORqd()
{
pduSessionResourceItemHORqd = NULL;
numofpduSessionResourceItemHORqd = 0;
}
PDUSessionResourceListHORqd::~PDUSessionResourceListHORqd(){}
void PDUSessionResourceListHORqd::setPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd,int num)
{
pduSessionResourceItemHORqd = m_pduSessionResourceItemHORqd;
numofpduSessionResourceItemHORqd = num;
}
bool PDUSessionResourceListHORqd::encode2PDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd)
{
for(int i=0;i<numofpduSessionResourceItemHORqd;i++)
{
Ngap_PDUSessionResourceItemHORqd_t *response = (Ngap_PDUSessionResourceItemHORqd_t *)calloc(1,sizeof(Ngap_PDUSessionResourceItemHORqd_t));
if(!response) return false;
if(!pduSessionResourceItemHORqd[i].encode2PDUSessionResourceItemHORqd(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceListHORQqd->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceListHORqd::decodefromPDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd)
{
numofpduSessionResourceItemHORqd = pduSessionResourceListHORQqd->list.count;
pduSessionResourceItemHORqd = new PDUSessionResourceItemHORqd[numofpduSessionResourceItemHORqd]();
for(int i=0;i< numofpduSessionResourceItemHORqd;i++)
{
if(!pduSessionResourceItemHORqd[i].decodefromPDUSessionResourceItemHORqd(pduSessionResourceListHORQqd->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceListHORqd::getPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *&m_pduSessionResourceItemHORqd,int &num)
{
m_pduSessionResourceItemHORqd = pduSessionResourceItemHORqd;
num = numofpduSessionResourceItemHORqd;
}
}
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceListHORqd::PDUSessionResourceListHORqd() {
pduSessionResourceItemHORqd = NULL;
numofpduSessionResourceItemHORqd = 0;
}
PDUSessionResourceListHORqd::~PDUSessionResourceListHORqd() {
}
void PDUSessionResourceListHORqd::setPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd, int num) {
pduSessionResourceItemHORqd = m_pduSessionResourceItemHORqd;
numofpduSessionResourceItemHORqd = num;
}
bool PDUSessionResourceListHORqd::encode2PDUSessionResourceListHORqd(
Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd) {
for (int i = 0; i < numofpduSessionResourceItemHORqd; i++) {
Ngap_PDUSessionResourceItemHORqd_t *response =
(Ngap_PDUSessionResourceItemHORqd_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceItemHORqd_t));
if (!response)
return false;
if (!pduSessionResourceItemHORqd[i].encode2PDUSessionResourceItemHORqd(
response))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceListHORQqd->list, response) != 0)
return false;
}
return true;
}
bool PDUSessionResourceListHORqd::decodefromPDUSessionResourceListHORqd(
Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd) {
numofpduSessionResourceItemHORqd = pduSessionResourceListHORQqd->list.count;
pduSessionResourceItemHORqd =
new PDUSessionResourceItemHORqd[numofpduSessionResourceItemHORqd]();
for (int i = 0; i < numofpduSessionResourceItemHORqd; i++) {
if (!pduSessionResourceItemHORqd[i].decodefromPDUSessionResourceItemHORqd(
pduSessionResourceListHORQqd->list.array[i]))
return false;
}
return true;
}
void PDUSessionResourceListHORqd::getPDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd *&m_pduSessionResourceItemHORqd, int &num) {
m_pduSessionResourceItemHORqd = pduSessionResourceItemHORqd;
num = numofpduSessionResourceItemHORqd;
}
}
...@@ -3,26 +3,30 @@ ...@@ -3,26 +3,30 @@
#include "PDUSessionResourceItemHORqd.hpp" #include "PDUSessionResourceItemHORqd.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceListHORqd.h" #include "Ngap_PDUSessionResourceListHORqd.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceListHORqd { class PDUSessionResourceListHORqd {
public: public:
PDUSessionResourceListHORqd(); PDUSessionResourceListHORqd();
virtual ~PDUSessionResourceListHORqd(); virtual ~PDUSessionResourceListHORqd();
void setPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd,int num); void setPDUSessionResourceListHORqd(
void getPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *&m_pduSessionResourceItemHORqd,int &num); PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd, int num);
void getPDUSessionResourceListHORqd(
bool encode2PDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd); PDUSessionResourceItemHORqd *&m_pduSessionResourceItemHORqd, int &num);
bool decodefromPDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd);
private: bool encode2PDUSessionResourceListHORqd(
PDUSessionResourceItemHORqd *pduSessionResourceItemHORqd; Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd);
int numofpduSessionResourceItemHORqd; bool decodefromPDUSessionResourceListHORqd(
}; Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd);
private:
PDUSessionResourceItemHORqd *pduSessionResourceItemHORqd;
int numofpduSessionResourceItemHORqd;
};
} }
......
...@@ -39,143 +39,146 @@ extern "C" { ...@@ -39,143 +39,146 @@ extern "C" {
using namespace std; using namespace std;
namespace ngap { namespace ngap {
PDUSessionResourceReleaseCommandTransfer::PDUSessionResourceReleaseCommandTransfer() PDUSessionResourceReleaseCommandTransfer::PDUSessionResourceReleaseCommandTransfer() {
{ pduSessionResourceReleaseCommandTransferIEs =
pduSessionResourceReleaseCommandTransferIEs = (Ngap_PDUSessionResourceReleaseCommandTransfer_t *)calloc(1, sizeof(Ngap_PDUSessionResourceReleaseCommandTransfer_t)); (Ngap_PDUSessionResourceReleaseCommandTransfer_t*) calloc(
causeValue = NULL; 1, sizeof(Ngap_PDUSessionResourceReleaseCommandTransfer_t));
} causeValue = NULL;
PDUSessionResourceReleaseCommandTransfer::~PDUSessionResourceReleaseCommandTransfer() { }
//if(pduSessionResourceReleaseCommandTransferIEs) ASN_STRUCT_FREE(asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,pduSessionResourceReleaseCommandTransferIEs); PDUSessionResourceReleaseCommandTransfer::~PDUSessionResourceReleaseCommandTransfer() {
if (causeValue) delete causeValue; //if(pduSessionResourceReleaseCommandTransferIEs) ASN_STRUCT_FREE(asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,pduSessionResourceReleaseCommandTransferIEs);
//if (pduSessionResourceReleaseCommandTransferIEs) free(pduSessionResourceReleaseCommandTransferIEs); if (causeValue)
} delete causeValue;
//if (pduSessionResourceReleaseCommandTransferIEs) free(pduSessionResourceReleaseCommandTransferIEs);
void PDUSessionResourceReleaseCommandTransfer::setCauseRadioNetwork(e_Ngap_CauseRadioNetwork cause_value) }
{
if (!causeValue) void PDUSessionResourceReleaseCommandTransfer::setCauseRadioNetwork(
causeValue = new Cause(); e_Ngap_CauseRadioNetwork cause_value) {
if (!causeValue)
causeValue->setChoiceOfCause(Ngap_Cause_PR_radioNetwork); causeValue = new Cause();
causeValue->setValue(cause_value);
causeValue->setChoiceOfCause(Ngap_Cause_PR_radioNetwork);
int ret = causeValue->encode2Cause(&pduSessionResourceReleaseCommandTransferIEs->cause); causeValue->setValue(cause_value);
if (!ret)
{ int ret = causeValue->encode2Cause(
cout << "encode CauseRadioNetwork IE error" << endl; &pduSessionResourceReleaseCommandTransferIEs->cause);
return; if (!ret) {
} cout << "encode CauseRadioNetwork IE error" << endl;
} return;
void PDUSessionResourceReleaseCommandTransfer::setCauseTransport(e_Ngap_CauseTransport cause_value) }
{ }
if (!causeValue) void PDUSessionResourceReleaseCommandTransfer::setCauseTransport(
causeValue = new Cause(); e_Ngap_CauseTransport cause_value) {
if (!causeValue)
causeValue->setChoiceOfCause(Ngap_Cause_PR_transport); causeValue = new Cause();
causeValue->setValue(cause_value);
causeValue->setChoiceOfCause(Ngap_Cause_PR_transport);
int ret = causeValue->encode2Cause(&pduSessionResourceReleaseCommandTransferIEs->cause); causeValue->setValue(cause_value);
if (!ret)
{ int ret = causeValue->encode2Cause(
cout << "encode CauseTransport IE error" << endl; &pduSessionResourceReleaseCommandTransferIEs->cause);
return; if (!ret) {
} cout << "encode CauseTransport IE error" << endl;
} return;
void PDUSessionResourceReleaseCommandTransfer::setCauseNas(e_Ngap_CauseNas cause_value) }
{ }
if (!causeValue) void PDUSessionResourceReleaseCommandTransfer::setCauseNas(
causeValue = new Cause(); e_Ngap_CauseNas cause_value) {
if (!causeValue)
causeValue->setChoiceOfCause(Ngap_Cause_PR_nas); causeValue = new Cause();
causeValue->setValue(cause_value);
causeValue->setChoiceOfCause(Ngap_Cause_PR_nas);
int ret = causeValue->encode2Cause(&pduSessionResourceReleaseCommandTransferIEs->cause); causeValue->setValue(cause_value);
if (!ret)
{ int ret = causeValue->encode2Cause(
cout << "encode CauseNas IE error" << endl; &pduSessionResourceReleaseCommandTransferIEs->cause);
return; if (!ret) {
} cout << "encode CauseNas IE error" << endl;
} return;
void PDUSessionResourceReleaseCommandTransfer::setCauseProtocol(e_Ngap_CauseProtocol cause_value) }
{ }
if (!causeValue) void PDUSessionResourceReleaseCommandTransfer::setCauseProtocol(
causeValue = new Cause(); e_Ngap_CauseProtocol cause_value) {
if (!causeValue)
causeValue->setChoiceOfCause(Ngap_Cause_PR_protocol); causeValue = new Cause();
causeValue->setValue(cause_value);
causeValue->setChoiceOfCause(Ngap_Cause_PR_protocol);
int ret = causeValue->encode2Cause(&pduSessionResourceReleaseCommandTransferIEs->cause); causeValue->setValue(cause_value);
if (!ret)
{ int ret = causeValue->encode2Cause(
cout << "encode CauseProtocol IE error" << endl; &pduSessionResourceReleaseCommandTransferIEs->cause);
return; if (!ret) {
} cout << "encode CauseProtocol IE error" << endl;
} return;
void PDUSessionResourceReleaseCommandTransfer::setCauseMisc(e_Ngap_CauseMisc cause_value) }
{ }
if (!causeValue) void PDUSessionResourceReleaseCommandTransfer::setCauseMisc(
causeValue = new Cause(); e_Ngap_CauseMisc cause_value) {
if (!causeValue)
causeValue->setChoiceOfCause(Ngap_Cause_PR_misc); causeValue = new Cause();
causeValue->setValue(cause_value);
causeValue->setChoiceOfCause(Ngap_Cause_PR_misc);
int ret = causeValue->encode2Cause(&pduSessionResourceReleaseCommandTransferIEs->cause); causeValue->setValue(cause_value);
if (!ret)
{ int ret = causeValue->encode2Cause(
cout << "encode CauseMisc IE error" << endl; &pduSessionResourceReleaseCommandTransferIEs->cause);
return; if (!ret) {
} cout << "encode CauseMisc IE error" << endl;
} return;
}
int PDUSessionResourceReleaseCommandTransfer::encode2buffer(uint8_t *buf, int buf_size) }
{
asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer, pduSessionResourceReleaseCommandTransferIEs); int PDUSessionResourceReleaseCommandTransfer::encode2buffer(uint8_t *buf,
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer, NULL, pduSessionResourceReleaseCommandTransferIEs, buf, buf_size); int buf_size) {
cout << "er.encoded(" << er.encoded << ")" << endl; asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,
return er.encoded; pduSessionResourceReleaseCommandTransferIEs);
} asn_enc_rval_t er = aper_encode_to_buffer(
//Decapsulation &asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer, NULL,
bool PDUSessionResourceReleaseCommandTransfer::decodefromIE(uint8_t *buf, int buf_size) pduSessionResourceReleaseCommandTransferIEs, buf, buf_size);
{ cout << "er.encoded(" << er.encoded << ")" << endl;
asn_dec_rval_t rc = asn_decode(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer, (void**)&pduSessionResourceReleaseCommandTransferIEs, buf, buf_size); return er.encoded;
}
if (rc.code == RC_OK) //Decapsulation
{ bool PDUSessionResourceReleaseCommandTransfer::decodefromIE(uint8_t *buf,
cout << "Decoded successfully" << endl; int buf_size) {
} asn_dec_rval_t rc = asn_decode(
else if (rc.code == RC_WMORE) NULL, ATS_ALIGNED_CANONICAL_PER,
{ &asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,
cout << "More data expected, call again" << endl; (void**) &pduSessionResourceReleaseCommandTransferIEs, buf, buf_size);
return false;
} if (rc.code == RC_OK) {
else cout << "Decoded successfully" << endl;
{ } else if (rc.code == RC_WMORE) {
cout << "Failure to decode data" << endl; cout << "More data expected, call again" << endl;
return false; return false;
} } else {
cout << "rc.consumed to decode = " << rc.consumed << endl; cout << "Failure to decode data" << endl;
cout << endl; return false;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, pduSessionResourceSetupUnsuccessfulTransferIEs); }
cout << "rc.consumed to decode = " << rc.consumed << endl;
causeValue = new Cause(); cout << endl;
if (!causeValue->decodefromCause(&pduSessionResourceReleaseCommandTransferIEs->cause)) //asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, pduSessionResourceSetupUnsuccessfulTransferIEs);
{
cout << "decoded ngap Cause IE error" << endl; causeValue = new Cause();
return false; if (!causeValue->decodefromCause(
} &pduSessionResourceReleaseCommandTransferIEs->cause)) {
cout << "decoded ngap Cause IE error" << endl;
return true; return false;
} }
long PDUSessionResourceReleaseCommandTransfer::getChoiceOfCause() return true;
{ }
if (!causeValue) return -1;
long PDUSessionResourceReleaseCommandTransfer::getChoiceOfCause() {
return causeValue->getChoiceOfCause(); if (!causeValue)
} return -1;
long PDUSessionResourceReleaseCommandTransfer::getCause()
{ return causeValue->getChoiceOfCause();
if (!causeValue) return -1; }
long PDUSessionResourceReleaseCommandTransfer::getCause() {
return causeValue->getValue(); if (!causeValue)
} return -1;
return causeValue->getValue();
}
} }
...@@ -5,39 +5,37 @@ ...@@ -5,39 +5,37 @@
#include "Cause.hpp" #include "Cause.hpp"
extern "C" {
extern "C"{ #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_PDUSessionResourceReleaseCommandTransfer.h"
#include "Ngap_PDUSessionResourceReleaseCommandTransfer.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceReleaseCommandTransfer {
class PDUSessionResourceReleaseCommandTransfer { public:
PDUSessionResourceReleaseCommandTransfer();
public: virtual ~PDUSessionResourceReleaseCommandTransfer();
PDUSessionResourceReleaseCommandTransfer();
virtual ~PDUSessionResourceReleaseCommandTransfer();
void setCauseRadioNetwork(e_Ngap_CauseRadioNetwork cause_value);
void setCauseTransport(e_Ngap_CauseTransport cause_value);
void setCauseNas(e_Ngap_CauseNas cause_value);
void setCauseProtocol(e_Ngap_CauseProtocol cause_value);
void setCauseMisc(e_Ngap_CauseMisc cause_value);
int encode2buffer(uint8_t *buf, int buf_size);
//Decapsulation
bool decodefromIE(uint8_t *buf, int buf_size);
long getChoiceOfCause();
long getCause();
private: void setCauseRadioNetwork(e_Ngap_CauseRadioNetwork cause_value);
Ngap_PDUSessionResourceReleaseCommandTransfer_t *pduSessionResourceReleaseCommandTransferIEs; void setCauseTransport(e_Ngap_CauseTransport cause_value);
void setCauseNas(e_Ngap_CauseNas cause_value);
void setCauseProtocol(e_Ngap_CauseProtocol cause_value);
void setCauseMisc(e_Ngap_CauseMisc cause_value);
int encode2buffer(uint8_t *buf, int buf_size);
//Decapsulation
bool decodefromIE(uint8_t *buf, int buf_size);
long getChoiceOfCause();
long getCause();
Cause *causeValue; private:
Ngap_PDUSessionResourceReleaseCommandTransfer_t *pduSessionResourceReleaseCommandTransferIEs;
}; Cause *causeValue;
};
} }
#endif #endif
...@@ -25,48 +25,57 @@ ...@@ -25,48 +25,57 @@
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "PDUSessionResourceReleaseItemCmd.hpp" #include "PDUSessionResourceReleaseItemCmd.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap{ namespace ngap {
PDUSessionResourceReleaseItemCmd::PDUSessionResourceReleaseItemCmd() PDUSessionResourceReleaseItemCmd::PDUSessionResourceReleaseItemCmd() {
{ pDUSessionID = NULL;
pDUSessionID = NULL; }
} PDUSessionResourceReleaseItemCmd::~PDUSessionResourceReleaseItemCmd() {
PDUSessionResourceReleaseItemCmd::~PDUSessionResourceReleaseItemCmd(){ if (pDUSessionID)
if (pDUSessionID) delete pDUSessionID; delete pDUSessionID;
} }
void PDUSessionResourceReleaseItemCmd::setPDUSessionResourceReleaseItemCmd(PDUSessionID *m_pDUSessionID,OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer) void PDUSessionResourceReleaseItemCmd::setPDUSessionResourceReleaseItemCmd(
{ PDUSessionID *m_pDUSessionID,
pDUSessionID = m_pDUSessionID; OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer) {
pDUSessionResourceReleaseCommandTransfer = m_pDUSessionResourceReleaseCommandTransfer; pDUSessionID = m_pDUSessionID;
} pDUSessionResourceReleaseCommandTransfer =
bool PDUSessionResourceReleaseItemCmd::encode2PDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer) m_pDUSessionResourceReleaseCommandTransfer;
{ }
if(!pDUSessionID->encode2PDUSessionID(pduSessionResourceReleaseCommandTransfer->pDUSessionID)) return false; bool PDUSessionResourceReleaseItemCmd::encode2PDUSessionResourceReleaseItemCmd(
pduSessionResourceReleaseCommandTransfer->pDUSessionResourceReleaseCommandTransfer = pDUSessionResourceReleaseCommandTransfer; Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer) {
if (!pDUSessionID->encode2PDUSessionID(
return true; pduSessionResourceReleaseCommandTransfer->pDUSessionID))
} return false;
bool PDUSessionResourceReleaseItemCmd::decodefromPDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer) pduSessionResourceReleaseCommandTransfer
{ ->pDUSessionResourceReleaseCommandTransfer =
pDUSessionID = new PDUSessionID(); pDUSessionResourceReleaseCommandTransfer;
if(!pDUSessionID->decodefromPDUSessionID(pduSessionResourceReleaseCommandTransfer->pDUSessionID)) return false;
pDUSessionResourceReleaseCommandTransfer = pduSessionResourceReleaseCommandTransfer->pDUSessionResourceReleaseCommandTransfer; return true;
}
return true; bool PDUSessionResourceReleaseItemCmd::decodefromPDUSessionResourceReleaseItemCmd(
} Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer) {
void PDUSessionResourceReleaseItemCmd::getPDUSessionResourceReleaseItemCmd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_pDUSessionResourceReleaseCommandTransfer) pDUSessionID = new PDUSessionID();
{ if (!pDUSessionID->decodefromPDUSessionID(
m_pDUSessionID = pDUSessionID; pduSessionResourceReleaseCommandTransfer->pDUSessionID))
m_pDUSessionResourceReleaseCommandTransfer = pDUSessionResourceReleaseCommandTransfer; return false;
} pDUSessionResourceReleaseCommandTransfer =
pduSessionResourceReleaseCommandTransfer
->pDUSessionResourceReleaseCommandTransfer;
return true;
}
void PDUSessionResourceReleaseItemCmd::getPDUSessionResourceReleaseItemCmd(
PDUSessionID *&m_pDUSessionID,
OCTET_STRING_t &m_pDUSessionResourceReleaseCommandTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceReleaseCommandTransfer =
pDUSessionResourceReleaseCommandTransfer;
} }
}
...@@ -33,32 +33,34 @@ ...@@ -33,32 +33,34 @@
#include "S-NSSAI.hpp" #include "S-NSSAI.hpp"
#include "PDUSessionResourceReleaseCommandTransfer.hpp" #include "PDUSessionResourceReleaseCommandTransfer.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceToReleaseItemRelCmd.h" #include "Ngap_PDUSessionResourceToReleaseItemRelCmd.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceReleaseItemCmd { class PDUSessionResourceReleaseItemCmd {
public: public:
PDUSessionResourceReleaseItemCmd(); PDUSessionResourceReleaseItemCmd();
virtual ~PDUSessionResourceReleaseItemCmd(); virtual ~PDUSessionResourceReleaseItemCmd();
void setPDUSessionResourceReleaseItemCmd(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer);
void getPDUSessionResourceReleaseItemCmd(PDUSessionID *&m_pDUSessionID,OCTET_STRING_t &m_pDUSessionResourceReleaseCommandTransfer);
bool encode2PDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
bool decodefromPDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t pDUSessionResourceReleaseCommandTransfer;
};
}
#endif
void setPDUSessionResourceReleaseItemCmd(
PDUSessionID *m_pDUSessionID,
OCTET_STRING_t m_pDUSessionResourceReleaseCommandTransfer);
void getPDUSessionResourceReleaseItemCmd(
PDUSessionID *&m_pDUSessionID,
OCTET_STRING_t &m_pDUSessionResourceReleaseCommandTransfer);
bool encode2PDUSessionResourceReleaseItemCmd(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
bool decodefromPDUSessionResourceReleaseItemCmd(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t pDUSessionResourceReleaseCommandTransfer;
};
}
#endif
#include "PDUSessionResourceReleaseListCmd.hpp" #include "PDUSessionResourceReleaseListCmd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceReleaseListCmd::PDUSessionResourceReleaseListCmd()
{
pduSessionResourceReleaseItemCmd = NULL;
numofpduSessionResourceReleaseItemCmd = 0;
}
PDUSessionResourceReleaseListCmd::~PDUSessionResourceReleaseListCmd(){
if (pduSessionResourceReleaseItemCmd) delete[] pduSessionResourceReleaseItemCmd;
}
void PDUSessionResourceReleaseListCmd::setPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *m_pduSessionResourceReleaseItemCmd,int num)
{
pduSessionResourceReleaseItemCmd = m_pduSessionResourceReleaseItemCmd;
numofpduSessionResourceReleaseItemCmd = num;
}
bool PDUSessionResourceReleaseListCmd::encode2PDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd)
{
for(int i=0;i< numofpduSessionResourceReleaseItemCmd;i++)
{
Ngap_PDUSessionResourceToReleaseItemRelCmd_t *response = (Ngap_PDUSessionResourceToReleaseItemRelCmd_t *)calloc(1,sizeof(Ngap_PDUSessionResourceToReleaseItemRelCmd_t));
if(!response) return false;
if(!pduSessionResourceReleaseItemCmd[i].encode2PDUSessionResourceReleaseItemCmd(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceReleaseListCmd->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceReleaseListCmd::decodefromPDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd)
{
numofpduSessionResourceReleaseItemCmd = pduSessionResourceReleaseListCmd->list.count;
pduSessionResourceReleaseItemCmd = new PDUSessionResourceReleaseItemCmd[numofpduSessionResourceReleaseItemCmd]();
for(int i=0;i< numofpduSessionResourceReleaseItemCmd;i++)
{
if(!pduSessionResourceReleaseItemCmd[i].decodefromPDUSessionResourceReleaseItemCmd(pduSessionResourceReleaseListCmd->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceReleaseListCmd::getPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *&m_pduSessionResourceReleaseItemCmd,int &num)
{
m_pduSessionResourceReleaseItemCmd = pduSessionResourceReleaseItemCmd;
num = numofpduSessionResourceReleaseItemCmd;
}
}
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceReleaseListCmd::PDUSessionResourceReleaseListCmd() {
pduSessionResourceReleaseItemCmd = NULL;
numofpduSessionResourceReleaseItemCmd = 0;
}
PDUSessionResourceReleaseListCmd::~PDUSessionResourceReleaseListCmd() {
if (pduSessionResourceReleaseItemCmd)
delete[] pduSessionResourceReleaseItemCmd;
}
void PDUSessionResourceReleaseListCmd::setPDUSessionResourceReleaseListCmd(
PDUSessionResourceReleaseItemCmd *m_pduSessionResourceReleaseItemCmd,
int num) {
pduSessionResourceReleaseItemCmd = m_pduSessionResourceReleaseItemCmd;
numofpduSessionResourceReleaseItemCmd = num;
}
bool PDUSessionResourceReleaseListCmd::encode2PDUSessionResourceReleaseListCmd(
Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd) {
for (int i = 0; i < numofpduSessionResourceReleaseItemCmd; i++) {
Ngap_PDUSessionResourceToReleaseItemRelCmd_t *response =
(Ngap_PDUSessionResourceToReleaseItemRelCmd_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceToReleaseItemRelCmd_t));
if (!response)
return false;
if (!pduSessionResourceReleaseItemCmd[i]
.encode2PDUSessionResourceReleaseItemCmd(response))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceReleaseListCmd->list, response)
!= 0)
return false;
}
return true;
}
bool PDUSessionResourceReleaseListCmd::decodefromPDUSessionResourceReleaseListCmd(
Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd) {
numofpduSessionResourceReleaseItemCmd = pduSessionResourceReleaseListCmd->list
.count;
pduSessionResourceReleaseItemCmd =
new PDUSessionResourceReleaseItemCmd[numofpduSessionResourceReleaseItemCmd]();
for (int i = 0; i < numofpduSessionResourceReleaseItemCmd; i++) {
if (!pduSessionResourceReleaseItemCmd[i]
.decodefromPDUSessionResourceReleaseItemCmd(
pduSessionResourceReleaseListCmd->list.array[i]))
return false;
}
return true;
}
void PDUSessionResourceReleaseListCmd::getPDUSessionResourceReleaseListCmd(
PDUSessionResourceReleaseItemCmd *&m_pduSessionResourceReleaseItemCmd,
int &num) {
m_pduSessionResourceReleaseItemCmd = pduSessionResourceReleaseItemCmd;
num = numofpduSessionResourceReleaseItemCmd;
}
}
...@@ -3,26 +3,32 @@ ...@@ -3,26 +3,32 @@
#include "PDUSessionResourceReleaseItemCmd.hpp" #include "PDUSessionResourceReleaseItemCmd.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceToReleaseListRelCmd.h" #include "Ngap_PDUSessionResourceToReleaseListRelCmd.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceReleaseListCmd { class PDUSessionResourceReleaseListCmd {
public: public:
PDUSessionResourceReleaseListCmd(); PDUSessionResourceReleaseListCmd();
virtual ~PDUSessionResourceReleaseListCmd(); virtual ~PDUSessionResourceReleaseListCmd();
void setPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *m_pduSessionResourceReleaseItemCmd,int num); void setPDUSessionResourceReleaseListCmd(
void getPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *&m_pduSessionResourceReleaseItemCmd,int &num); PDUSessionResourceReleaseItemCmd *m_pduSessionResourceReleaseItemCmd,
int num);
bool encode2PDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd); void getPDUSessionResourceReleaseListCmd(
bool decodefromPDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd); PDUSessionResourceReleaseItemCmd *&m_pduSessionResourceReleaseItemCmd,
private: int &num);
PDUSessionResourceReleaseItemCmd *pduSessionResourceReleaseItemCmd;
int numofpduSessionResourceReleaseItemCmd; bool encode2PDUSessionResourceReleaseListCmd(
}; Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd);
bool decodefromPDUSessionResourceReleaseListCmd(
Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd);
private:
PDUSessionResourceReleaseItemCmd *pduSessionResourceReleaseItemCmd;
int numofpduSessionResourceReleaseItemCmd;
};
} }
......
...@@ -53,7 +53,8 @@ void PDUSessionResourceReleasedItemRelRes::getPDUSessionResourceReleasedItemRelR ...@@ -53,7 +53,8 @@ void PDUSessionResourceReleasedItemRelRes::getPDUSessionResourceReleasedItemRelR
PDUSessionID *&m_pDUSessionID, PDUSessionID *&m_pDUSessionID,
OCTET_STRING_t &m_pDUSessionResourceReleaseResponseTransfer) { OCTET_STRING_t &m_pDUSessionResourceReleaseResponseTransfer) {
m_pDUSessionID = pDUSessionID; m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceReleaseResponseTransfer = pDUSessionResourceReleaseResponseTransfer; m_pDUSessionResourceReleaseResponseTransfer =
pDUSessionResourceReleaseResponseTransfer;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -65,7 +66,7 @@ bool PDUSessionResourceReleasedItemRelRes::encode2PDUSessionResourceReleasedItem ...@@ -65,7 +66,7 @@ bool PDUSessionResourceReleasedItemRelRes::encode2PDUSessionResourceReleasedItem
pduSessionResourceReleasedItemRelRes pduSessionResourceReleasedItemRelRes
->pDUSessionResourceReleaseResponseTransfer = ->pDUSessionResourceReleaseResponseTransfer =
pDUSessionResourceReleaseResponseTransfer; pDUSessionResourceReleaseResponseTransfer;
return true; return true;
} }
......
...@@ -44,8 +44,7 @@ PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() { ...@@ -44,8 +44,7 @@ PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() {
void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelRes( void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes *m_pduSessionResourceReleasedItemRelRes, PDUSessionResourceReleasedItemRelRes *m_pduSessionResourceReleasedItemRelRes,
int num) { int num) {
pduSessionResourceReleasedItemRelRes = pduSessionResourceReleasedItemRelRes = m_pduSessionResourceReleasedItemRelRes;
m_pduSessionResourceReleasedItemRelRes;
maxnoofPDUSessions = num; maxnoofPDUSessions = num;
} }
...@@ -53,8 +52,7 @@ void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelR ...@@ -53,8 +52,7 @@ void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelR
void PDUSessionResourceReleasedListRelRes::getPDUSessionResourceReleasedListRelRes( void PDUSessionResourceReleasedListRelRes::getPDUSessionResourceReleasedListRelRes(
PDUSessionResourceReleasedItemRelRes *&m_pduSessionResourceReleasedItemRelRes, PDUSessionResourceReleasedItemRelRes *&m_pduSessionResourceReleasedItemRelRes,
int &num) { int &num) {
m_pduSessionResourceReleasedItemRelRes = m_pduSessionResourceReleasedItemRelRes = pduSessionResourceReleasedItemRelRes;
pduSessionResourceReleasedItemRelRes;
num = maxnoofPDUSessions; num = maxnoofPDUSessions;
} }
...@@ -70,8 +68,7 @@ bool PDUSessionResourceReleasedListRelRes::encode2PDUSessionResourceReleasedList ...@@ -70,8 +68,7 @@ bool PDUSessionResourceReleasedListRelRes::encode2PDUSessionResourceReleasedList
if (!pduSessionResourceReleasedItemRelRes[i] if (!pduSessionResourceReleasedItemRelRes[i]
.encode2PDUSessionResourceReleasedItemRelRes(rel)) .encode2PDUSessionResourceReleasedItemRelRes(rel))
return false; return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceReleasedListRelRes->list, rel) if (ASN_SEQUENCE_ADD(&pduSessionResourceReleasedListRelRes->list, rel) != 0)
!= 0)
return false; return false;
} }
return true; return true;
...@@ -86,7 +83,7 @@ bool PDUSessionResourceReleasedListRelRes::decodefromPDUSessionResourceReleasedL ...@@ -86,7 +83,7 @@ bool PDUSessionResourceReleasedListRelRes::decodefromPDUSessionResourceReleasedL
for (int i = 0; i < maxnoofPDUSessions; i++) { for (int i = 0; i < maxnoofPDUSessions; i++) {
if (!pduSessionResourceReleasedItemRelRes[i] if (!pduSessionResourceReleasedItemRelRes[i]
.decodefromPDUSessionResourceReleasedItemRelRes( .decodefromPDUSessionResourceReleasedItemRelRes(
pduSessionResourceReleasedListRelRes->list.array[i])) pduSessionResourceReleasedListRelRes->list.array[i]))
return false; return false;
} }
return true; return true;
......
#include "PDUSessionResourceSetupItemHOReq.hpp" #include "PDUSessionResourceSetupItemHOReq.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceSetupItemHOReq::PDUSessionResourceSetupItemHOReq()
{
pDUSessionID = NULL;
s_NSSAI = NULL;
}
PDUSessionResourceSetupItemHOReq::~PDUSessionResourceSetupItemHOReq(){}
void PDUSessionResourceSetupItemHOReq::setPDUSessionResourceSetupItemHOReq(PDUSessionID *m_pDUSessionID,S_NSSAI *m_s_NSSAI,OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer)
{
pDUSessionID = m_pDUSessionID;
s_NSSAI = m_s_NSSAI;
pDUSessionResourceSetupRequestTransfer = m_pDUSessionResourceSetupRequestTransfer;
}
bool PDUSessionResourceSetupItemHOReq::encode2PDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq)
{
if(!pDUSessionID->encode2PDUSessionID(pduSessionResourceSetupItemHOReq->pDUSessionID)) return false;
if(!s_NSSAI->encode2S_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI)) return false;
pduSessionResourceSetupItemHOReq->handoverRequestTransfer = pDUSessionResourceSetupRequestTransfer;
return true;
}
bool PDUSessionResourceSetupItemHOReq::decodefromPDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq)
{
pDUSessionID = new PDUSessionID();
s_NSSAI = new S_NSSAI();
if(!pDUSessionID->decodefromPDUSessionID(pduSessionResourceSetupItemHOReq->pDUSessionID)) return false;
if(!s_NSSAI->decodefromS_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI)) return false;
pDUSessionResourceSetupRequestTransfer = pduSessionResourceSetupItemHOReq->handoverRequestTransfer;
return true;
}
void PDUSessionResourceSetupItemHOReq::getPDUSessionResourceSetupItemHOReq(PDUSessionID *&m_pDUSessionID, S_NSSAI *&m_s_NSSAI,OCTET_STRING_t &m_pDUSessionResourceSetupRequestTransfer)
{
m_pDUSessionID = pDUSessionID;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer = pDUSessionResourceSetupRequestTransfer;
}
}
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceSetupItemHOReq::PDUSessionResourceSetupItemHOReq() {
pDUSessionID = NULL;
s_NSSAI = NULL;
}
PDUSessionResourceSetupItemHOReq::~PDUSessionResourceSetupItemHOReq() {
}
void PDUSessionResourceSetupItemHOReq::setPDUSessionResourceSetupItemHOReq(
PDUSessionID *m_pDUSessionID, S_NSSAI *m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer) {
pDUSessionID = m_pDUSessionID;
s_NSSAI = m_s_NSSAI;
pDUSessionResourceSetupRequestTransfer =
m_pDUSessionResourceSetupRequestTransfer;
}
bool PDUSessionResourceSetupItemHOReq::encode2PDUSessionResourceSetupItemHOReq(
Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq) {
if (!pDUSessionID->encode2PDUSessionID(
pduSessionResourceSetupItemHOReq->pDUSessionID))
return false;
if (!s_NSSAI->encode2S_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI))
return false;
pduSessionResourceSetupItemHOReq->handoverRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
return true;
}
bool PDUSessionResourceSetupItemHOReq::decodefromPDUSessionResourceSetupItemHOReq(
Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq) {
pDUSessionID = new PDUSessionID();
s_NSSAI = new S_NSSAI();
if (!pDUSessionID->decodefromPDUSessionID(
pduSessionResourceSetupItemHOReq->pDUSessionID))
return false;
if (!s_NSSAI->decodefromS_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI))
return false;
pDUSessionResourceSetupRequestTransfer = pduSessionResourceSetupItemHOReq
->handoverRequestTransfer;
return true;
}
void PDUSessionResourceSetupItemHOReq::getPDUSessionResourceSetupItemHOReq(
PDUSessionID *&m_pDUSessionID, S_NSSAI *&m_s_NSSAI,
OCTET_STRING_t &m_pDUSessionResourceSetupRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer =
pDUSessionResourceSetupRequestTransfer;
}
}
...@@ -6,33 +6,35 @@ ...@@ -6,33 +6,35 @@
#include "S-NSSAI.hpp" #include "S-NSSAI.hpp"
#include "PDUSessionResourceSetupRequestTransfer.hpp" #include "PDUSessionResourceSetupRequestTransfer.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceSetupItemHOReq.h" #include "Ngap_PDUSessionResourceSetupItemHOReq.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceSetupItemHOReq{ class PDUSessionResourceSetupItemHOReq {
public: public:
PDUSessionResourceSetupItemHOReq(); PDUSessionResourceSetupItemHOReq();
virtual ~PDUSessionResourceSetupItemHOReq(); virtual ~PDUSessionResourceSetupItemHOReq();
void setPDUSessionResourceSetupItemHOReq(PDUSessionID *m_pDUSessionID, S_NSSAI *m_s_NSSAI,OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer); void setPDUSessionResourceSetupItemHOReq(
void getPDUSessionResourceSetupItemHOReq(PDUSessionID *&m_pDUSessionID,S_NSSAI *&m_s_NSSAI,OCTET_STRING_t &m_pDUSessionResourceSetupRequestTransfer); PDUSessionID *m_pDUSessionID, S_NSSAI *m_s_NSSAI,
OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer);
bool encode2PDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq); void getPDUSessionResourceSetupItemHOReq(
bool decodefromPDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq); PDUSessionID *&m_pDUSessionID, S_NSSAI *&m_s_NSSAI,
private: OCTET_STRING_t &m_pDUSessionResourceSetupRequestTransfer);
PDUSessionID *pDUSessionID;
S_NSSAI *s_NSSAI; bool encode2PDUSessionResourceSetupItemHOReq(
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer; Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq);
}; bool decodefromPDUSessionResourceSetupItemHOReq(
Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq);
private:
PDUSessionID *pDUSessionID;
S_NSSAI *s_NSSAI;
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer;
};
} }
#endif #endif
#include "PDUSessionResourceSetupListHOReq.hpp" #include "PDUSessionResourceSetupListHOReq.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceSetupListHOReq::PDUSessionResourceSetupListHOReq()
{
pduSessionResourceSetupItemHOReq = NULL;
numofpduSessionResourceSetupItemHOReq = 0;
}
PDUSessionResourceSetupListHOReq::~PDUSessionResourceSetupListHOReq(){}
void PDUSessionResourceSetupListHOReq::setPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *m_pduSessionResourceSetupItemHOReq,int num)
{
pduSessionResourceSetupItemHOReq = m_pduSessionResourceSetupItemHOReq;
numofpduSessionResourceSetupItemHOReq = num;
}
bool PDUSessionResourceSetupListHOReq::encode2PDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq)
{
for(int i=0;i<numofpduSessionResourceSetupItemHOReq;i++)
{
Ngap_PDUSessionResourceSetupItemHOReq_t *request = (Ngap_PDUSessionResourceSetupItemHOReq_t *)calloc(1,sizeof(Ngap_PDUSessionResourceSetupItemHOReq_t));
if(!request) return false;
if(!pduSessionResourceSetupItemHOReq[i].encode2PDUSessionResourceSetupItemHOReq(request)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceSetupListHOReq->list, request) != 0) return false;
}
return true;
}
bool PDUSessionResourceSetupListHOReq::decodefromPDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq)
{
numofpduSessionResourceSetupItemHOReq = pduSessionResourceSetupListHOReq->list.count;
pduSessionResourceSetupItemHOReq = new PDUSessionResourceSetupItemHOReq[numofpduSessionResourceSetupItemHOReq]();
for(int i=0;i<numofpduSessionResourceSetupItemHOReq;i++)
{
if(!pduSessionResourceSetupItemHOReq[i].decodefromPDUSessionResourceSetupItemHOReq(pduSessionResourceSetupListHOReq->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceSetupListHOReq::getPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *&m_pduSessionResourceSetupItemHOReq,int &num)
{
m_pduSessionResourceSetupItemHOReq = pduSessionResourceSetupItemHOReq;
num = numofpduSessionResourceSetupItemHOReq;
}
}
#include <iostream>
using namespace std;
namespace ngap {
PDUSessionResourceSetupListHOReq::PDUSessionResourceSetupListHOReq() {
pduSessionResourceSetupItemHOReq = NULL;
numofpduSessionResourceSetupItemHOReq = 0;
}
PDUSessionResourceSetupListHOReq::~PDUSessionResourceSetupListHOReq() {
}
void PDUSessionResourceSetupListHOReq::setPDUSessionResourceSetupListHOReq(
PDUSessionResourceSetupItemHOReq *m_pduSessionResourceSetupItemHOReq,
int num) {
pduSessionResourceSetupItemHOReq = m_pduSessionResourceSetupItemHOReq;
numofpduSessionResourceSetupItemHOReq = num;
}
bool PDUSessionResourceSetupListHOReq::encode2PDUSessionResourceSetupListHOReq(
Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq) {
for (int i = 0; i < numofpduSessionResourceSetupItemHOReq; i++) {
Ngap_PDUSessionResourceSetupItemHOReq_t *request =
(Ngap_PDUSessionResourceSetupItemHOReq_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemHOReq_t));
if (!request)
return false;
if (!pduSessionResourceSetupItemHOReq[i]
.encode2PDUSessionResourceSetupItemHOReq(request))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListHOReq->list, request) != 0)
return false;
}
return true;
}
bool PDUSessionResourceSetupListHOReq::decodefromPDUSessionResourceSetupListHOReq(
Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq) {
numofpduSessionResourceSetupItemHOReq = pduSessionResourceSetupListHOReq->list
.count;
pduSessionResourceSetupItemHOReq =
new PDUSessionResourceSetupItemHOReq[numofpduSessionResourceSetupItemHOReq]();
for (int i = 0; i < numofpduSessionResourceSetupItemHOReq; i++) {
if (!pduSessionResourceSetupItemHOReq[i]
.decodefromPDUSessionResourceSetupItemHOReq(
pduSessionResourceSetupListHOReq->list.array[i]))
return false;
}
return true;
}
void PDUSessionResourceSetupListHOReq::getPDUSessionResourceSetupListHOReq(
PDUSessionResourceSetupItemHOReq *&m_pduSessionResourceSetupItemHOReq,
int &num) {
m_pduSessionResourceSetupItemHOReq = pduSessionResourceSetupItemHOReq;
num = numofpduSessionResourceSetupItemHOReq;
}
}
...@@ -3,27 +3,33 @@ ...@@ -3,27 +3,33 @@
#include "PDUSessionResourceSetupItemHOReq.hpp" #include "PDUSessionResourceSetupItemHOReq.hpp"
extern "C"{ extern "C" {
#include "Ngap_PDUSessionResourceSetupListHOReq.h" #include "Ngap_PDUSessionResourceSetupListHOReq.h"
} }
namespace ngap{ namespace ngap {
class PDUSessionResourceSetupListHOReq{ class PDUSessionResourceSetupListHOReq {
public: public:
PDUSessionResourceSetupListHOReq(); PDUSessionResourceSetupListHOReq();
virtual ~PDUSessionResourceSetupListHOReq(); virtual ~PDUSessionResourceSetupListHOReq();
void setPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *m_pduSessionResourceSetupItemHOReq,int num); void setPDUSessionResourceSetupListHOReq(
void getPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *&m_pduSessionResourceSetupItemHOReq,int &num); PDUSessionResourceSetupItemHOReq *m_pduSessionResourceSetupItemHOReq,
int num);
bool encode2PDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq); void getPDUSessionResourceSetupListHOReq(
bool decodefromPDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq); PDUSessionResourceSetupItemHOReq *&m_pduSessionResourceSetupItemHOReq,
private: int &num);
PDUSessionResourceSetupItemHOReq *pduSessionResourceSetupItemHOReq;
int numofpduSessionResourceSetupItemHOReq; bool encode2PDUSessionResourceSetupListHOReq(
}; Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq);
bool decodefromPDUSessionResourceSetupListHOReq(
Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq);
private:
PDUSessionResourceSetupItemHOReq *pduSessionResourceSetupItemHOReq;
int numofpduSessionResourceSetupItemHOReq;
};
} }
......
...@@ -20,42 +20,40 @@ ...@@ -20,42 +20,40 @@
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "QosFlowItemWithDataForwarding.hpp" #include "QosFlowItemWithDataForwarding.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ QosFlowItemWithDataForWarding::QosFlowItemWithDataForWarding() {
QosFlowItemWithDataForWarding::QosFlowItemWithDataForWarding() qosFlowIdentifier = NULL;
{ }
qosFlowIdentifier = NULL; QosFlowItemWithDataForWarding::~QosFlowItemWithDataForWarding() {
} }
QosFlowItemWithDataForWarding::~QosFlowItemWithDataForWarding() {} void QosFlowItemWithDataForWarding::getQosFlowItemWithDataForWarding(
void QosFlowItemWithDataForWarding::getQosFlowItemWithDataForWarding(Ngap_QosFlowIdentifier_t &m_QosFlowIdentifier) Ngap_QosFlowIdentifier_t &m_QosFlowIdentifier) {
{ if (!qosFlowIdentifier)
if (!qosFlowIdentifier) printf("qosFlowIdentifier null\n");
printf("qosFlowIdentifier null\n"); else
else printf("qosFlowIdentifier \n");
printf("qosFlowIdentifier \n"); if (qosFlowIdentifier->getQosFlowIdentifier(value)) {
if (qosFlowIdentifier->getQosFlowIdentifier(value)) m_QosFlowIdentifier = (Ngap_QosFlowIdentifier_t) value;
{ }
m_QosFlowIdentifier = (Ngap_QosFlowIdentifier_t)value; }
} bool QosFlowItemWithDataForWarding::decodeformQosFlowItemWithDataForWarding(
} Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowItemWithDataForWarding) {
bool QosFlowItemWithDataForWarding::decodeformQosFlowItemWithDataForWarding(Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowItemWithDataForWarding) qosFlowIdentifier = new QosFlowIdentifier();
{ if (!qosFlowIdentifier->decodefromQosFlowIdentifier(
qosFlowIdentifier = new QosFlowIdentifier(); &(qosFlowItemWithDataForWarding->qosFlowIdentifier))) {
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(&(qosFlowItemWithDataForWarding->qosFlowIdentifier))) printf("false\n");
{ return false;
printf("false\n"); }
return false; printf("true\n");
} return true;
printf("true\n"); }
return true; } // namespace ngap
}
} // namespace ngap
...@@ -20,35 +20,34 @@ ...@@ -20,35 +20,34 @@
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#ifndef _QOSFLOWITEMWITHDATAFORWARDING_H_ #ifndef _QOSFLOWITEMWITHDATAFORWARDING_H_
#define _QOSFLOWITEMWITHDATAFORWARDING_H_ #define _QOSFLOWITEMWITHDATAFORWARDING_H_
#include "QosFlowLevelQosParameters.hpp" #include "QosFlowLevelQosParameters.hpp"
#include "QosFlowIdentifier.hpp" #include "QosFlowIdentifier.hpp"
extern "C" extern "C" {
{
#include "Ngap_QosFlowSetupResponseItemHOReqAck.h" #include "Ngap_QosFlowSetupResponseItemHOReqAck.h"
} }
namespace ngap namespace ngap {
{ class QosFlowItemWithDataForWarding {
class QosFlowItemWithDataForWarding public:
{ QosFlowItemWithDataForWarding();
public: virtual ~QosFlowItemWithDataForWarding();
QosFlowItemWithDataForWarding();
virtual ~QosFlowItemWithDataForWarding();
void getQosFlowItemWithDataForWarding(Ngap_QosFlowIdentifier_t &m_QosFlowIdentifier); void getQosFlowItemWithDataForWarding(
bool decodeformQosFlowItemWithDataForWarding(Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowItemWithDataForWarding); Ngap_QosFlowIdentifier_t &m_QosFlowIdentifier);
bool decodeformQosFlowItemWithDataForWarding(
Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowItemWithDataForWarding);
private: private:
long value; long value;
QosFlowIdentifier *qosFlowIdentifier; QosFlowIdentifier *qosFlowIdentifier;
}; };
} // namespace ngap } // namespace ngap
#endif // !_QOSFLOWITEMWITHDATAFORWARDING_H_ #endif // !_QOSFLOWITEMWITHDATAFORWARDING_H_
...@@ -19,36 +19,41 @@ ...@@ -19,36 +19,41 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "QosFlowListWithDataForwarding.hpp" #include "QosFlowListWithDataForwarding.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap { namespace ngap {
QosFlowListWithDataForwarding::QosFlowListWithDataForwarding() QosFlowListWithDataForwarding::QosFlowListWithDataForwarding() {
{ qosFlowItemWithDataForwarding = NULL;
qosFlowItemWithDataForwarding = NULL; numofQosFlowItemWithDataForwarding = 0;
numofQosFlowItemWithDataForwarding = 0; }
} QosFlowListWithDataForwarding::~QosFlowListWithDataForwarding() {
QosFlowListWithDataForwarding::~QosFlowListWithDataForwarding(){} }
bool QosFlowListWithDataForwarding::decodeFormQosFlowListWithDataForwarding(Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList) { bool QosFlowListWithDataForwarding::decodeFormQosFlowListWithDataForwarding(
numofQosFlowItemWithDataForwarding = qosFlowSetupResponseList.list.count; Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList) {
qosFlowItemWithDataForwarding = new QosFlowItemWithDataForWarding[numofQosFlowItemWithDataForwarding](); numofQosFlowItemWithDataForwarding = qosFlowSetupResponseList.list.count;
for (int i = 0; i < numofQosFlowItemWithDataForwarding; i++) { qosFlowItemWithDataForwarding =
if (!qosFlowItemWithDataForwarding[i].decodeformQosFlowItemWithDataForWarding(qosFlowSetupResponseList.list.array[i])) new QosFlowItemWithDataForWarding[numofQosFlowItemWithDataForwarding]();
return false; for (int i = 0; i < numofQosFlowItemWithDataForwarding; i++) {
} if (!qosFlowItemWithDataForwarding[i]
return true; .decodeformQosFlowItemWithDataForWarding(
} qosFlowSetupResponseList.list.array[i]))
bool QosFlowListWithDataForwarding::getQosFlowListWithDataForwarding(QosFlowItemWithDataForWarding *&m_QosFlowItemWithDataForwarding, int &num){ return false;
m_QosFlowItemWithDataForwarding = qosFlowItemWithDataForwarding; }
num = numofQosFlowItemWithDataForwarding; return true;
return true; }
} bool QosFlowListWithDataForwarding::getQosFlowListWithDataForwarding(
QosFlowItemWithDataForWarding *&m_QosFlowItemWithDataForwarding, int &num) {
m_QosFlowItemWithDataForwarding = qosFlowItemWithDataForwarding;
num = numofQosFlowItemWithDataForwarding;
return true;
}
} }
...@@ -19,33 +19,35 @@ ...@@ -19,33 +19,35 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file /*! \file
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#ifndef _QOSFLOWLISTWITHDATAFORWRADING_H_ #ifndef _QOSFLOWLISTWITHDATAFORWRADING_H_
#define _QOSFLOWLISTWITHDATAFORWRADING_H_ #define _QOSFLOWLISTWITHDATAFORWRADING_H_
#include "QosFlowLevelQosParameters.hpp" #include "QosFlowLevelQosParameters.hpp"
#include "QosFlowItemWithDataForwarding.hpp" #include "QosFlowItemWithDataForwarding.hpp"
extern "C" extern "C" {
{ #include "Ngap_QosFlowSetupResponseListHOReqAck.h"
#include "Ngap_QosFlowSetupResponseListHOReqAck.h"
} }
namespace ngap { namespace ngap {
class QosFlowListWithDataForwarding { class QosFlowListWithDataForwarding {
public: public:
QosFlowListWithDataForwarding(); QosFlowListWithDataForwarding();
virtual ~QosFlowListWithDataForwarding(); virtual ~QosFlowListWithDataForwarding();
bool getQosFlowListWithDataForwarding(QosFlowItemWithDataForWarding *&m_QosFlowItemWithDataForwarding, int &num); bool getQosFlowListWithDataForwarding(
bool decodeFormQosFlowListWithDataForwarding(Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList); QosFlowItemWithDataForWarding *&m_QosFlowItemWithDataForwarding,
private: int &num);
//QosFlowIdentifier *qosFlowIdentifier; bool decodeFormQosFlowListWithDataForwarding(
QosFlowItemWithDataForWarding* qosFlowItemWithDataForwarding; Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList);
int numofQosFlowItemWithDataForwarding; private:
}; //QosFlowIdentifier *qosFlowIdentifier;
QosFlowItemWithDataForWarding *qosFlowItemWithDataForwarding;
int numofQosFlowItemWithDataForwarding;
};
} }
#endif #endif
...@@ -26,31 +26,29 @@ ...@@ -26,31 +26,29 @@
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#include "QosFlowToBeForwardedItem.hpp" #include "QosFlowToBeForwardedItem.hpp"
extern "C" extern "C" {
{
} }
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ QosFlowToBeForwardedItem::QosFlowToBeForwardedItem() {
QosFlowToBeForwardedItem::QosFlowToBeForwardedItem() qosflowidentifier = NULL;
{ }
qosflowidentifier = NULL; QosFlowToBeForwardedItem::~QosFlowToBeForwardedItem() {
} }
QosFlowToBeForwardedItem::~QosFlowToBeForwardedItem() {} void QosFlowToBeForwardedItem::setQosFlowIdentifier(
void QosFlowToBeForwardedItem::setQosFlowIdentifier(QosFlowIdentifier *m_qosflowidentifier) QosFlowIdentifier *m_qosflowidentifier) {
{ qosflowidentifier = m_qosflowidentifier;
qosflowidentifier = m_qosflowidentifier; }
} bool QosFlowToBeForwardedItem::encodeQosFlowToBeForwardedItem(
bool QosFlowToBeForwardedItem::encodeQosFlowToBeForwardedItem(Ngap_QosFlowToBeForwardedItem_t *qosflowtobeforwardeditem) Ngap_QosFlowToBeForwardedItem_t *qosflowtobeforwardeditem) {
{ if (!qosflowidentifier)
if (!qosflowidentifier) return false;
return false; if (!qosflowidentifier->encode2QosFlowIdentifier(
if (!qosflowidentifier->encode2QosFlowIdentifier(&qosflowtobeforwardeditem->qosFlowIdentifier)) &qosflowtobeforwardeditem->qosFlowIdentifier)) {
{ cout << "encode QFI error" << endl;
cout << "encode QFI error" << endl; return false;
return false; }
} return true;
return true; }
} } // namespace ngap
} // namespace ngap
...@@ -28,22 +28,20 @@ ...@@ -28,22 +28,20 @@
#ifndef _QOSFLOWTOBEFORWARDEDITEM_H_ #ifndef _QOSFLOWTOBEFORWARDEDITEM_H_
#define _QOSFLOWTOBEFORWARDEDITEM_H_ #define _QOSFLOWTOBEFORWARDEDITEM_H_
#include "QosFlowIdentifier.hpp" #include "QosFlowIdentifier.hpp"
extern "C" extern "C" {
{
#include "Ngap_QosFlowToBeForwardedItem.h" #include "Ngap_QosFlowToBeForwardedItem.h"
} }
namespace ngap namespace ngap {
{ class QosFlowToBeForwardedItem {
class QosFlowToBeForwardedItem public:
{ QosFlowToBeForwardedItem();
public: virtual ~QosFlowToBeForwardedItem();
QosFlowToBeForwardedItem(); void setQosFlowIdentifier(QosFlowIdentifier *m_qosflowidentifier);
virtual ~QosFlowToBeForwardedItem(); bool encodeQosFlowToBeForwardedItem(
void setQosFlowIdentifier(QosFlowIdentifier *m_qosflowidentifier); Ngap_QosFlowToBeForwardedItem_t *qosflowtobeforwardeditem);
bool encodeQosFlowToBeForwardedItem(Ngap_QosFlowToBeForwardedItem_t *qosflowtobeforwardeditem);
private: private:
QosFlowIdentifier *qosflowidentifier; QosFlowIdentifier *qosflowidentifier;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -28,40 +28,40 @@ ...@@ -28,40 +28,40 @@
#include "QosFlowToBeForwardedList.hpp" #include "QosFlowToBeForwardedList.hpp"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ QosFlowToBeForwardedList::QosFlowToBeForwardedList() {
QosFlowToBeForwardedList::QosFlowToBeForwardedList() Qosflowtobeforwardeditem = NULL;
{ numofqosflowtobeforwardeditem = 0;
Qosflowtobeforwardeditem = NULL; }
numofqosflowtobeforwardeditem = 0; QosFlowToBeForwardedList::~QosFlowToBeForwardedList() {
}
void QosFlowToBeForwardedList::setQosFlowToBeForwardedItem(
QosFlowToBeForwardedItem *m_qosflowtobeforwardeditem, int num) {
Qosflowtobeforwardeditem = m_qosflowtobeforwardeditem;
numofqosflowtobeforwardeditem = num;
}
bool QosFlowToBeForwardedList::encodeQosFlowToBeForwardedList(
Ngap_QosFlowToBeForwardedList *&m_ngap_qosflowtobeforwardedlist) {
m_ngap_qosflowtobeforwardedlist = (Ngap_QosFlowToBeForwardedList_t*) calloc(
1, sizeof(Ngap_QosFlowToBeForwardedList_t));
for (int i = 0; i < numofqosflowtobeforwardeditem; i++) {
cout << "encoding list..." << endl;
Ngap_QosFlowToBeForwardedItem_t *response =
(Ngap_QosFlowToBeForwardedItem_t*) calloc(
1, sizeof(Ngap_QosFlowToBeForwardedItem_t));
if (!response)
return false;
if (!Qosflowtobeforwardeditem[i].encodeQosFlowToBeForwardedItem(response)) {
cout << "encode QosFlowTowardedItem error" << endl;
return false;
} }
QosFlowToBeForwardedList::~QosFlowToBeForwardedList() {} cout << "QFI is " << response->qosFlowIdentifier << endl;
void QosFlowToBeForwardedList::setQosFlowToBeForwardedItem(QosFlowToBeForwardedItem *m_qosflowtobeforwardeditem, int num) if (ASN_SEQUENCE_ADD(&m_ngap_qosflowtobeforwardedlist->list, response)
{ != 0) {
Qosflowtobeforwardeditem = m_qosflowtobeforwardeditem; cout << "encode QosFlowTowardedList error" << endl;
numofqosflowtobeforwardeditem = num; return false;
} }
bool QosFlowToBeForwardedList::encodeQosFlowToBeForwardedList(Ngap_QosFlowToBeForwardedList *&m_ngap_qosflowtobeforwardedlist) }
{ return true;
m_ngap_qosflowtobeforwardedlist = (Ngap_QosFlowToBeForwardedList_t *)calloc(1, sizeof(Ngap_QosFlowToBeForwardedList_t)); }
for (int i = 0; i < numofqosflowtobeforwardeditem; i++) } // namespace ngap
{
cout << "encoding list..." << endl;
Ngap_QosFlowToBeForwardedItem_t *response = (Ngap_QosFlowToBeForwardedItem_t *)calloc(1, sizeof(Ngap_QosFlowToBeForwardedItem_t));
if (!response)
return false;
if (!Qosflowtobeforwardeditem[i].encodeQosFlowToBeForwardedItem(response))
{
cout << "encode QosFlowTowardedItem error" << endl;
return false;
}
cout << "QFI is " << response->qosFlowIdentifier << endl;
if (ASN_SEQUENCE_ADD(&m_ngap_qosflowtobeforwardedlist->list, response) != 0)
{
cout << "encode QosFlowTowardedList error" << endl;
return false;
}
}
return true;
}
} // namespace ngap
...@@ -29,23 +29,22 @@ ...@@ -29,23 +29,22 @@
#define _QOSFLOWTOBEFORWARDEDLIST_H_ #define _QOSFLOWTOBEFORWARDEDLIST_H_
#include "QosFlowToBeForwardedItem.hpp" #include "QosFlowToBeForwardedItem.hpp"
extern "C" extern "C" {
{
#include "Ngap_QosFlowToBeForwardedList.h" #include "Ngap_QosFlowToBeForwardedList.h"
} }
namespace ngap namespace ngap {
{ class QosFlowToBeForwardedList {
class QosFlowToBeForwardedList public:
{ QosFlowToBeForwardedList();
public: virtual ~QosFlowToBeForwardedList();
QosFlowToBeForwardedList(); void setQosFlowToBeForwardedItem(
virtual ~QosFlowToBeForwardedList(); QosFlowToBeForwardedItem *m_qosflowtobeforwardeditem, int num);
void setQosFlowToBeForwardedItem(QosFlowToBeForwardedItem *m_qosflowtobeforwardeditem, int num); bool encodeQosFlowToBeForwardedList(
bool encodeQosFlowToBeForwardedList(Ngap_QosFlowToBeForwardedList *&m_ngap_qosflowtobeforwardedlist); Ngap_QosFlowToBeForwardedList *&m_ngap_qosflowtobeforwardedlist);
private: private:
QosFlowToBeForwardedItem *Qosflowtobeforwardeditem; QosFlowToBeForwardedItem *Qosflowtobeforwardeditem;
int numofqosflowtobeforwardeditem; int numofqosflowtobeforwardeditem;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -30,38 +30,37 @@ ...@@ -30,38 +30,37 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ RANStatusTransferTransparentContainer::RANStatusTransferTransparentContainer() {
RANStatusTransferTransparentContainer::RANStatusTransferTransparentContainer() drb_sub_list = NULL;
{ }
drb_sub_list = NULL; RANStatusTransferTransparentContainer::~RANStatusTransferTransparentContainer() {
} }
RANStatusTransferTransparentContainer::~RANStatusTransferTransparentContainer() {} void RANStatusTransferTransparentContainer::getdRBSubject_list(
void RANStatusTransferTransparentContainer::getdRBSubject_list(dRBSubjectList *&drblist) dRBSubjectList *&drblist) {
{ drblist = drb_sub_list;
drblist = drb_sub_list; }
} void RANStatusTransferTransparentContainer::setdRBSubject_list(
void RANStatusTransferTransparentContainer::setdRBSubject_list(dRBSubjectList *drblist) dRBSubjectList *drblist) {
{ drb_sub_list = drblist;
drb_sub_list = drblist; }
} bool RANStatusTransferTransparentContainer::encoderanstatustransfer_transparentcontainer(
bool RANStatusTransferTransparentContainer::encoderanstatustransfer_transparentcontainer(Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer) Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer) {
{ if (!drb_sub_list->encodefromdRBSubjectlist(
if (!drb_sub_list->encodefromdRBSubjectlist(ranstatustransfer_transparentcontainer->dRBsSubjectToStatusTransferList)) ranstatustransfer_transparentcontainer->dRBsSubjectToStatusTransferList)) {
{ cout << "encoderanstatustransfer_transparentcontainer error" << endl;
cout << "encoderanstatustransfer_transparentcontainer error" << endl; return false;
return false; }
} return true;
return true; }
} bool RANStatusTransferTransparentContainer::decoderanstatustransfer_transparentcontainer(
bool RANStatusTransferTransparentContainer::decoderanstatustransfer_transparentcontainer(Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer) Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer) {
{ drb_sub_list = new dRBSubjectList();
drb_sub_list = new dRBSubjectList(); if (!drb_sub_list->decodefromdRBSubjectlist(
if (!drb_sub_list->decodefromdRBSubjectlist(ranstatustransfer_transparentcontainer->dRBsSubjectToStatusTransferList)) ranstatustransfer_transparentcontainer->dRBsSubjectToStatusTransferList)) {
{ cout << "decoderanstatustransfer_transparentcontainer error" << endl;
cout << "decoderanstatustransfer_transparentcontainer error" << endl; return false;
return false; }
} return true;
return true; }
} } // namespace ngap
} // namespace ngap
...@@ -29,26 +29,25 @@ ...@@ -29,26 +29,25 @@
#define _RANSTATUSTRANSFERTRANSPATENTCONTAINER_H_ #define _RANSTATUSTRANSFERTRANSPATENTCONTAINER_H_
#include "dRBsSubjectToStatusTransferList.hpp" #include "dRBsSubjectToStatusTransferList.hpp"
#include "dRBsSubjectToStatusTransferItem.hpp" #include "dRBsSubjectToStatusTransferItem.hpp"
extern "C" extern "C" {
{
#include "Ngap_RANStatusTransfer-TransparentContainer.h" #include "Ngap_RANStatusTransfer-TransparentContainer.h"
} }
namespace ngap namespace ngap {
{ class RANStatusTransferTransparentContainer {
class RANStatusTransferTransparentContainer private:
{ /* data */
private: dRBSubjectList *drb_sub_list;
/* data */
dRBSubjectList *drb_sub_list;
public: public:
RANStatusTransferTransparentContainer(/* args */); RANStatusTransferTransparentContainer(/* args */);
virtual ~RANStatusTransferTransparentContainer(); virtual ~RANStatusTransferTransparentContainer();
void getdRBSubject_list(dRBSubjectList *&drblist); void getdRBSubject_list(dRBSubjectList *&drblist);
void setdRBSubject_list(dRBSubjectList *drblist); void setdRBSubject_list(dRBSubjectList *drblist);
bool encoderanstatustransfer_transparentcontainer(Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer); bool encoderanstatustransfer_transparentcontainer(
bool decoderanstatustransfer_transparentcontainer(Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer); Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer);
}; bool decoderanstatustransfer_transparentcontainer(
Ngap_RANStatusTransfer_TransparentContainer_t *ranstatustransfer_transparentcontainer);
};
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -29,40 +29,33 @@ ...@@ -29,40 +29,33 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ dRBStatusDL::dRBStatusDL() {
dRBStatusDL::dRBStatusDL() dl18 = (DRBStatusDL18*) calloc(1, sizeof(DRBStatusDL18));
{ }
dl18 = (DRBStatusDL18 *)calloc(1, sizeof(DRBStatusDL18)); dRBStatusDL::~dRBStatusDL() {
} }
dRBStatusDL::~dRBStatusDL() {} void dRBStatusDL::setDRBStatusDL18(DRBStatusDL18 *dL18) {
void dRBStatusDL::setDRBStatusDL18(DRBStatusDL18 *dL18) dl18 = dL18;
{ }
dl18 = dL18; void dRBStatusDL::getDRBStatusDL18(DRBStatusDL18 *&dL18) {
} dL18 = dl18;
void dRBStatusDL::getDRBStatusDL18(DRBStatusDL18 *&dL18) }
{ bool dRBStatusDL::encodedRBStatusDL(Ngap_DRBStatusDL_t *dL) {
dL18 = dl18; if (!dl18->encodeddRBStatusDL18(dL->choice.dRBStatusDL18)) {
} cout << "encodedRBStatusDL error" << endl;
bool dRBStatusDL::encodedRBStatusDL(Ngap_DRBStatusDL_t *dL) return false;
{ }
if (!dl18->encodeddRBStatusDL18(dL->choice.dRBStatusDL18)) cout << "encodedRBStatusDL successfully" << endl;
{ return true;
cout << "encodedRBStatusDL error" << endl; }
return false; bool dRBStatusDL::decodedRBStatusDL(Ngap_DRBStatusDL_t *dL) {
} dl18 = new DRBStatusDL18();
cout << "encodedRBStatusDL successfully" << endl; if (!dl18->decodeddRBStatusDL18(dL->choice.dRBStatusDL18)) {
return true; cout << "decodedRBStatusDL error" << endl;
} return false;
bool dRBStatusDL::decodedRBStatusDL(Ngap_DRBStatusDL_t *dL) }
{ cout << "decodedRBStatusDL successfully" << endl;
dl18 = new DRBStatusDL18(); return true;
if (!dl18->decodeddRBStatusDL18(dL->choice.dRBStatusDL18)) }
{ } // namespace ngap
cout << "decodedRBStatusDL error" << endl;
return false;
}
cout << "decodedRBStatusDL successfully" << endl;
return true;
}
} // namespace ngap
...@@ -28,27 +28,24 @@ ...@@ -28,27 +28,24 @@
#ifndef _DRBSTATUSDL_H_ #ifndef _DRBSTATUSDL_H_
#define _DRBSTATUSDL_H_ #define _DRBSTATUSDL_H_
#include "dRBStatusDL18.hpp" #include "dRBStatusDL18.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBStatusDL.h" #include "Ngap_DRBStatusDL.h"
#include "Ngap_DRBStatusDL18.h" #include "Ngap_DRBStatusDL18.h"
} }
namespace ngap namespace ngap {
{ class dRBStatusDL {
class dRBStatusDL private:
{ /* data */
private: DRBStatusDL18 *dl18;
/* data */
DRBStatusDL18 *dl18;
public: public:
dRBStatusDL(); dRBStatusDL();
virtual ~dRBStatusDL(); virtual ~dRBStatusDL();
void getDRBStatusDL18(DRBStatusDL18 *&dL18); void getDRBStatusDL18(DRBStatusDL18 *&dL18);
void setDRBStatusDL18(DRBStatusDL18 *dL18); void setDRBStatusDL18(DRBStatusDL18 *dL18);
bool encodedRBStatusDL(Ngap_DRBStatusDL_t *dL); bool encodedRBStatusDL(Ngap_DRBStatusDL_t *dL);
bool decodedRBStatusDL(Ngap_DRBStatusDL_t *dL); bool decodedRBStatusDL(Ngap_DRBStatusDL_t *dL);
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -29,38 +29,31 @@ ...@@ -29,38 +29,31 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ DRBStatusDL18::DRBStatusDL18() {
DRBStatusDL18::DRBStatusDL18() pdcp_value = NULL;
{ }
pdcp_value = NULL; DRBStatusDL18::~DRBStatusDL18() {
} }
DRBStatusDL18::~DRBStatusDL18() {} void DRBStatusDL18::getcountvalue(COUNTValueForPDCP_SN18 *&count_value) {
void DRBStatusDL18::getcountvalue(COUNTValueForPDCP_SN18 *&count_value) count_value = pdcp_value;
{ }
count_value = pdcp_value; void DRBStatusDL18::setcountvalue(COUNTValueForPDCP_SN18 *count_value) {
} pdcp_value = count_value;
void DRBStatusDL18::setcountvalue(COUNTValueForPDCP_SN18 *count_value) }
{ bool DRBStatusDL18::encodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18) {
pdcp_value = count_value; if (!pdcp_value->encodedCOUNTValueForPDCP_SN18(DL18->dL_COUNTValue)) {
} cout << "encodeddRBStatusDL18 error" << endl;
bool DRBStatusDL18::encodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18) return false;
{ }
if (!pdcp_value->encodedCOUNTValueForPDCP_SN18(DL18->dL_COUNTValue)) return true;
{ }
cout << "encodeddRBStatusDL18 error" << endl; bool DRBStatusDL18::decodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18) {
return false; pdcp_value = new COUNTValueForPDCP_SN18();
} if (!pdcp_value->decodedCOUNTValueForPDCP_SN18(DL18->dL_COUNTValue)) {
return true; cout << "decodeddRBStatusDL18 error" << endl;
} return false;
bool DRBStatusDL18::decodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18) }
{ return true;
pdcp_value = new COUNTValueForPDCP_SN18(); }
if (!pdcp_value->decodedCOUNTValueForPDCP_SN18(DL18->dL_COUNTValue)) } // namespace ngap
{
cout << "decodeddRBStatusDL18 error" << endl;
return false;
}
return true;
}
} // namespace ngap
...@@ -28,25 +28,22 @@ ...@@ -28,25 +28,22 @@
#ifndef _DRBSTATUSDL18_H_ #ifndef _DRBSTATUSDL18_H_
#define _DRBSTATUSDL18_H_ #define _DRBSTATUSDL18_H_
#include "COUNTValueForPDCP_SN18.hpp" #include "COUNTValueForPDCP_SN18.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBStatusDL18.h" #include "Ngap_DRBStatusDL18.h"
} }
namespace ngap namespace ngap {
{ class DRBStatusDL18 {
class DRBStatusDL18 private:
{ /* data */
private: COUNTValueForPDCP_SN18 *pdcp_value;
/* data */
COUNTValueForPDCP_SN18 *pdcp_value;
public: public:
DRBStatusDL18(/* args */); DRBStatusDL18(/* args */);
virtual ~DRBStatusDL18(); virtual ~DRBStatusDL18();
void getcountvalue(COUNTValueForPDCP_SN18 *&count_value); void getcountvalue(COUNTValueForPDCP_SN18 *&count_value);
void setcountvalue(COUNTValueForPDCP_SN18 *count_value); void setcountvalue(COUNTValueForPDCP_SN18 *count_value);
bool encodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18); bool encodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18);
bool decodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18); bool decodeddRBStatusDL18(Ngap_DRBStatusDL18_t *DL18);
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -30,40 +30,33 @@ ...@@ -30,40 +30,33 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ dRBStatusUL::dRBStatusUL() {
dRBStatusUL::dRBStatusUL() ul18 = (dRBStatusUL18*) calloc(1, sizeof(dRBStatusUL18));
{ }
ul18 = (dRBStatusUL18 *)calloc(1, sizeof(dRBStatusUL18)); dRBStatusUL::~dRBStatusUL() {
} }
dRBStatusUL::~dRBStatusUL() {} void dRBStatusUL::setdRBStatusUL(dRBStatusUL18 *uL18) {
void dRBStatusUL::setdRBStatusUL(dRBStatusUL18 *uL18) ul18 = uL18;
{ }
ul18 = uL18; void dRBStatusUL::getdRBStatusUL(dRBStatusUL18 *&uL18) {
} uL18 = ul18;
void dRBStatusUL::getdRBStatusUL(dRBStatusUL18 *&uL18) }
{ bool dRBStatusUL::encodedRBStatusUL(Ngap_DRBStatusUL_t *uL) {
uL18 = ul18; if (ul18->encodeddRBStatusUL18(uL->choice.dRBStatusUL18)) {
} cout << "encodeddRBStatusUL18 error" << endl;
bool dRBStatusUL::encodedRBStatusUL(Ngap_DRBStatusUL_t *uL) return false;
{ }
if (ul18->encodeddRBStatusUL18(uL->choice.dRBStatusUL18)) cout << "encodedRBStatusUL successfully" << endl;
{ return true;
cout << "encodeddRBStatusUL18 error" << endl; }
return false; bool dRBStatusUL::decodedRBStatusUL(Ngap_DRBStatusUL_t *uL) {
} ul18 = new dRBStatusUL18();
cout << "encodedRBStatusUL successfully" << endl; if (!ul18->decodeddRBStatusUL18(uL->choice.dRBStatusUL18)) {
return true; cout << "decodeddRBStatusUL18 error" << endl;
} return false;
bool dRBStatusUL::decodedRBStatusUL(Ngap_DRBStatusUL_t *uL) }
{ cout << "decodedRBStatusUL successfully" << endl;
ul18 = new dRBStatusUL18(); return true;
if (!ul18->decodeddRBStatusUL18(uL->choice.dRBStatusUL18)) }
{ } // namespace ngap
cout << "decodeddRBStatusUL18 error" << endl;
return false;
}
cout << "decodedRBStatusUL successfully" << endl;
return true;
}
} // namespace ngap
...@@ -28,25 +28,22 @@ ...@@ -28,25 +28,22 @@
#ifndef _DRBSTATUSUL_H_ #ifndef _DRBSTATUSUL_H_
#define _DRBSTATUSUL_H_ #define _DRBSTATUSUL_H_
#include "dRBStatusUL18.hpp" #include "dRBStatusUL18.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBStatusUL.h" #include "Ngap_DRBStatusUL.h"
} }
namespace ngap namespace ngap {
{ class dRBStatusUL {
class dRBStatusUL private:
{ /* data */
private: dRBStatusUL18 *ul18;
/* data */
dRBStatusUL18 *ul18;
public: public:
dRBStatusUL(/* args */); dRBStatusUL(/* args */);
virtual ~dRBStatusUL(); virtual ~dRBStatusUL();
void setdRBStatusUL(dRBStatusUL18 *uL18); void setdRBStatusUL(dRBStatusUL18 *uL18);
void getdRBStatusUL(dRBStatusUL18 *&uL18); void getdRBStatusUL(dRBStatusUL18 *&uL18);
bool encodedRBStatusUL(Ngap_DRBStatusUL_t *uL); bool encodedRBStatusUL(Ngap_DRBStatusUL_t *uL);
bool decodedRBStatusUL(Ngap_DRBStatusUL_t *uL); bool decodedRBStatusUL(Ngap_DRBStatusUL_t *uL);
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -29,38 +29,31 @@ ...@@ -29,38 +29,31 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ dRBStatusUL18::dRBStatusUL18() {
dRBStatusUL18::dRBStatusUL18() pdcp_value = NULL;
{ }
pdcp_value = NULL; dRBStatusUL18::~dRBStatusUL18() {
} }
dRBStatusUL18::~dRBStatusUL18() {} void dRBStatusUL18::getcountvalue(COUNTValueForPDCP_SN18 *&count_value) {
void dRBStatusUL18::getcountvalue(COUNTValueForPDCP_SN18 *&count_value) count_value = pdcp_value;
{ }
count_value = pdcp_value; void dRBStatusUL18::setcountvalue(COUNTValueForPDCP_SN18 *count_value) {
} pdcp_value = count_value;
void dRBStatusUL18::setcountvalue(COUNTValueForPDCP_SN18 *count_value) }
{ bool dRBStatusUL18::encodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18) {
pdcp_value = count_value; if (!pdcp_value->encodedCOUNTValueForPDCP_SN18(UL18->uL_COUNTValue)) {
} cout << "encodeddRBStatusUL18 error" << endl;
bool dRBStatusUL18::encodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18) return false;
{ }
if (!pdcp_value->encodedCOUNTValueForPDCP_SN18(UL18->uL_COUNTValue)) return true;
{ }
cout << "encodeddRBStatusUL18 error" << endl; bool dRBStatusUL18::decodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18) {
return false; pdcp_value = new COUNTValueForPDCP_SN18();
} if (!pdcp_value->decodedCOUNTValueForPDCP_SN18(UL18->uL_COUNTValue)) {
return true; cout << "decodeddRBStatusUL18 error" << endl;
} return false;
bool dRBStatusUL18::decodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18) }
{ return true;
pdcp_value = new COUNTValueForPDCP_SN18(); }
if (!pdcp_value->decodedCOUNTValueForPDCP_SN18(UL18->uL_COUNTValue)) } // namespace ngap
{
cout << "decodeddRBStatusUL18 error" << endl;
return false;
}
return true;
}
} // namespace ngap
...@@ -28,26 +28,23 @@ ...@@ -28,26 +28,23 @@
#ifndef _DRBSTATUSUL18_H_ #ifndef _DRBSTATUSUL18_H_
#define _DRBSTATUSUL18_H_ #define _DRBSTATUSUL18_H_
#include "COUNTValueForPDCP_SN18.hpp" #include "COUNTValueForPDCP_SN18.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBStatusUL18.h" #include "Ngap_DRBStatusUL18.h"
} }
namespace ngap namespace ngap {
{ class dRBStatusUL18 {
class dRBStatusUL18 private:
{ /* data */
private: COUNTValueForPDCP_SN18 *pdcp_value;
/* data */
COUNTValueForPDCP_SN18 *pdcp_value;
public: public:
dRBStatusUL18(/* args */); dRBStatusUL18(/* args */);
virtual ~dRBStatusUL18(); virtual ~dRBStatusUL18();
void getcountvalue(COUNTValueForPDCP_SN18 *&count_value); void getcountvalue(COUNTValueForPDCP_SN18 *&count_value);
void setcountvalue(COUNTValueForPDCP_SN18 *count_value); void setcountvalue(COUNTValueForPDCP_SN18 *count_value);
bool encodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18); bool encodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18);
bool decodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18); bool decodeddRBStatusUL18(Ngap_DRBStatusUL18_t *UL18);
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -31,67 +31,62 @@ ...@@ -31,67 +31,62 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ dRBSubjectItem::dRBSubjectItem() {
dRBSubjectItem::dRBSubjectItem() drb_id = NULL;
{ drb_ul = NULL;
drb_id = NULL; drb_dl = NULL;
drb_ul = NULL; }
drb_dl = NULL; dRBSubjectItem::~dRBSubjectItem() {
} }
dRBSubjectItem::~dRBSubjectItem() {} void dRBSubjectItem::setdRBSubjectItem(Ngap_DRB_ID_t *dRB_ID,
void dRBSubjectItem::setdRBSubjectItem(Ngap_DRB_ID_t *dRB_ID, dRBStatusUL *dRB_UL, dRBStatusDL *dRB_DL) dRBStatusUL *dRB_UL,
{ dRBStatusDL *dRB_DL) {
drb_id = dRB_ID; drb_id = dRB_ID;
drb_ul = dRB_UL; drb_ul = dRB_UL;
drb_dl = dRB_DL; drb_dl = dRB_DL;
} }
void dRBSubjectItem::getdRBSubjectItem(Ngap_DRB_ID_t *&dRB_ID, dRBStatusUL *&dRB_UL, dRBStatusDL *&dRB_DL) void dRBSubjectItem::getdRBSubjectItem(Ngap_DRB_ID_t *&dRB_ID,
{ dRBStatusUL *&dRB_UL,
dRB_ID = drb_id; dRBStatusDL *&dRB_DL) {
dRB_UL = drb_ul; dRB_ID = drb_id;
dRB_DL = drb_dl; dRB_UL = drb_ul;
} dRB_DL = drb_dl;
bool dRBSubjectItem::decodefromdRBSubjectItem(Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item) }
{ bool dRBSubjectItem::decodefromdRBSubjectItem(
if (dRB_item->dRB_ID) Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item) {
{ if (dRB_item->dRB_ID) {
drb_id = &dRB_item->dRB_ID; drb_id = &dRB_item->dRB_ID;
cout << "the decode drb_id is" << *drb_id << endl; cout << "the decode drb_id is" << *drb_id << endl;
} }
drb_ul = new dRBStatusUL(); drb_ul = new dRBStatusUL();
if (!drb_ul->decodedRBStatusUL(&dRB_item->dRBStatusUL)) if (!drb_ul->decodedRBStatusUL(&dRB_item->dRBStatusUL)) {
{ cout << "decode from dRBSubjectItem dRBStatusUL error" << endl;
cout << "decode from dRBSubjectItem dRBStatusUL error" << endl; return false;
return false; }
} drb_dl = new dRBStatusDL();
drb_dl = new dRBStatusDL(); if (!drb_dl->decodedRBStatusDL(&dRB_item->dRBStatusDL)) {
if (!drb_dl->decodedRBStatusDL(&dRB_item->dRBStatusDL)) cout << "decode from dRBSubjectItem dRBStatusDL error" << endl;
{ return false;
cout << "decode from dRBSubjectItem dRBStatusDL error" << endl; }
return false; cout << "decode from dRBSubjectItem successfully" << endl;
} return true;
cout << "decode from dRBSubjectItem successfully" << endl; }
return true; bool dRBSubjectItem::encodedRBSubjectItem(
} Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item) {
bool dRBSubjectItem::encodedRBSubjectItem(Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item) if (drb_id) {
{ dRB_item->dRB_ID = *drb_id;
if (drb_id) cout << "the encode drb_id is" << *drb_id << endl;
{ }
dRB_item->dRB_ID = *drb_id; if (!drb_ul->encodedRBStatusUL(&dRB_item->dRBStatusUL)) {
cout << "the encode drb_id is" << *drb_id << endl; cout << "encode from dRBSubjectItem dRBStatusUL error" << endl;
} return false;
if (!drb_ul->encodedRBStatusUL(&dRB_item->dRBStatusUL)) }
{ if (!drb_dl->encodedRBStatusDL(&dRB_item->dRBStatusDL)) {
cout << "encode from dRBSubjectItem dRBStatusUL error" << endl; cout << "encode from dRBSubjectItem dRBStatusDL error" << endl;
return false; return false;
} }
if (!drb_dl->encodedRBStatusDL(&dRB_item->dRBStatusDL)) cout << "encode from dRBSubjectItem successfully" << endl;
{ return true;
cout << "encode from dRBSubjectItem dRBStatusDL error" << endl; }
return false; } // namespace ngap
}
cout << "encode from dRBSubjectItem successfully" << endl;
return true;
}
} // namespace ngap
...@@ -29,26 +29,26 @@ ...@@ -29,26 +29,26 @@
#define _DRBSSUBJECTTOSTATUSTRANSFERITEM_H_ #define _DRBSSUBJECTTOSTATUSTRANSFERITEM_H_
#include "dRBStatusUL.hpp" #include "dRBStatusUL.hpp"
#include "dRBStatusDL.hpp" #include "dRBStatusDL.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBsSubjectToStatusTransferItem.h" #include "Ngap_DRBsSubjectToStatusTransferItem.h"
} }
namespace ngap namespace ngap {
{ class dRBSubjectItem {
class dRBSubjectItem public:
{ dRBSubjectItem();
public: virtual ~dRBSubjectItem();
dRBSubjectItem(); void getdRBSubjectItem(Ngap_DRB_ID_t *&dRB_ID, dRBStatusUL *&dRB_UL,
virtual ~dRBSubjectItem(); dRBStatusDL *&dRB_DL);
void getdRBSubjectItem(Ngap_DRB_ID_t *&dRB_ID, dRBStatusUL *&dRB_UL, dRBStatusDL *&dRB_DL); void setdRBSubjectItem(Ngap_DRB_ID_t *dRB_ID, dRBStatusUL *dRB_UL,
void setdRBSubjectItem(Ngap_DRB_ID_t *dRB_ID, dRBStatusUL *dRB_UL, dRBStatusDL *dRB_DL); dRBStatusDL *dRB_DL);
bool decodefromdRBSubjectItem(Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item); bool decodefromdRBSubjectItem(
bool encodedRBSubjectItem(Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item); Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item);
bool encodedRBSubjectItem(Ngap_DRBsSubjectToStatusTransferItem_t *dRB_item);
private: private:
Ngap_DRB_ID_t *drb_id; Ngap_DRB_ID_t *drb_id;
dRBStatusUL *drb_ul; dRBStatusUL *drb_ul;
dRBStatusDL *drb_dl; dRBStatusDL *drb_dl;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -29,58 +29,55 @@ ...@@ -29,58 +29,55 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
using namespace std; using namespace std;
namespace ngap namespace ngap {
{ dRBSubjectList::dRBSubjectList() {
dRBSubjectList::dRBSubjectList() drbsubjectitem = NULL;
{ numofitem = 0;
drbsubjectitem = NULL; }
numofitem = 0; dRBSubjectList::~dRBSubjectList() {
}
void dRBSubjectList::setdRBSubjectItem(dRBSubjectItem *m_item, int num) {
drbsubjectitem = m_item;
numofitem = num;
}
void dRBSubjectList::getdRBSubjectItem(dRBSubjectItem *&m_item, int &num) {
m_item = drbsubjectitem;
num = numofitem;
}
bool dRBSubjectList::encodefromdRBSubjectlist(
Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList) {
for (int i = 0; i < numofitem; i++) {
Ngap_DRBsSubjectToStatusTransferItem_t *ie =
(Ngap_DRBsSubjectToStatusTransferItem_t*) calloc(
1, sizeof(Ngap_DRBsSubjectToStatusTransferItem_t));
if (!ie)
return false;
if (!drbsubjectitem[i].encodedRBSubjectItem(ie)) {
cout << "encodefromdRBSubjectlist error" << endl;
return false;
} }
dRBSubjectList::~dRBSubjectList() {} if (ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) != 0) {
void dRBSubjectList::setdRBSubjectItem(dRBSubjectItem *m_item, int num) cout
{ << "ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) error"
drbsubjectitem = m_item; << endl;
numofitem = num; return false;
} }
void dRBSubjectList::getdRBSubjectItem(dRBSubjectItem *&m_item, int &num) }
{ cout << "encodefromdRBSubjectlist successfully" << endl;
m_item = drbsubjectitem; return true;
num = numofitem; }
bool dRBSubjectList::decodefromdRBSubjectlist(
Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList) {
numofitem = DRBsSubjectToStatusTransferList.list.count;
drbsubjectitem = new dRBSubjectItem[numofitem]();
for (int i = 0; i < numofitem; i++) {
if (!drbsubjectitem[i].decodefromdRBSubjectItem(
DRBsSubjectToStatusTransferList.list.array[i])) {
cout << "decodefromdRBSubjectlist error" << endl;
return false;
} }
bool dRBSubjectList::encodefromdRBSubjectlist(Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList) }
{ cout << "decodefromdRBSubjectlist successfully" << endl;
for (int i = 0; i < numofitem; i++) return true;
{ }
Ngap_DRBsSubjectToStatusTransferItem_t *ie = (Ngap_DRBsSubjectToStatusTransferItem_t *)calloc(1, sizeof(Ngap_DRBsSubjectToStatusTransferItem_t)); } // namespace ngap
if (!ie)
return false;
if (!drbsubjectitem[i].encodedRBSubjectItem(ie))
{
cout << "encodefromdRBSubjectlist error" << endl;
return false;
}
if (ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) != 0)
{
cout << "ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) error" << endl;
return false;
}
}
cout << "encodefromdRBSubjectlist successfully" << endl;
return true;
}
bool dRBSubjectList::decodefromdRBSubjectlist(Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList)
{
numofitem = DRBsSubjectToStatusTransferList.list.count;
drbsubjectitem = new dRBSubjectItem[numofitem]();
for (int i = 0; i < numofitem; i++)
{
if (!drbsubjectitem[i].decodefromdRBSubjectItem(DRBsSubjectToStatusTransferList.list.array[i]))
{
cout << "decodefromdRBSubjectlist error" << endl;
return false;
}
}
cout << "decodefromdRBSubjectlist successfully" << endl;
return true;
}
} // namespace ngap
...@@ -28,26 +28,25 @@ ...@@ -28,26 +28,25 @@
#ifndef _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_ #ifndef _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#define _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_ #define _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#include "dRBsSubjectToStatusTransferItem.hpp" #include "dRBsSubjectToStatusTransferItem.hpp"
extern "C" extern "C" {
{
#include "Ngap_DRBsSubjectToStatusTransferList.h" #include "Ngap_DRBsSubjectToStatusTransferList.h"
#include "asn_SEQUENCE_OF.h" #include "asn_SEQUENCE_OF.h"
} }
namespace ngap namespace ngap {
{ class dRBSubjectList {
class dRBSubjectList public:
{ dRBSubjectList();
public: virtual ~dRBSubjectList();
dRBSubjectList(); void setdRBSubjectItem(dRBSubjectItem *m_item, int num);
virtual ~dRBSubjectList(); void getdRBSubjectItem(dRBSubjectItem *&m_item, int &num);
void setdRBSubjectItem(dRBSubjectItem *m_item, int num); bool decodefromdRBSubjectlist(
void getdRBSubjectItem(dRBSubjectItem *&m_item, int &num); Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList);
bool decodefromdRBSubjectlist(Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList); bool encodefromdRBSubjectlist(
bool encodefromdRBSubjectlist(Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList); Ngap_DRBsSubjectToStatusTransferList_t &DRBsSubjectToStatusTransferList);
private: private:
dRBSubjectItem *drbsubjectitem; dRBSubjectItem *drbsubjectitem;
int numofitem; int numofitem;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
#include "MessageType.hpp" #include "MessageType.hpp"
#include "RANStatusTransferTransparentContainer.hpp" #include "RANStatusTransferTransparentContainer.hpp"
#include "dRBStatusDL18.hpp" #include "dRBStatusDL18.hpp"
extern "C" extern "C" {
{
#include "Ngap_UplinkRANStatusTransfer.h" #include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h" #include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_NGAP-PDU.h" #include "Ngap_NGAP-PDU.h"
...@@ -43,23 +42,23 @@ extern "C" ...@@ -43,23 +42,23 @@ extern "C"
} }
namespace ngap namespace ngap
{ {
class DownlinkRANStatusTransfer class DownlinkRANStatusTransfer
{ {
public: public:
DownlinkRANStatusTransfer(); DownlinkRANStatusTransfer();
virtual ~DownlinkRANStatusTransfer(); virtual ~DownlinkRANStatusTransfer();
void setmessagetype(); void setmessagetype();
void setAmfUeNgapId(unsigned long id); //40 bits void setAmfUeNgapId(unsigned long id); //40 bits
void setRanUeNgapId(uint32_t id); // 32 bits void setRanUeNgapId(uint32_t id);// 32 bits
void setRANStatusTransfer_TransparentContainer(long drb_id, long ul_pcdp, long ul_hfn_pdcp, long dl_pcdp, long dl_hfn_pdcp); void setRANStatusTransfer_TransparentContainer(long drb_id, long ul_pcdp, long ul_hfn_pdcp, long dl_pcdp, long dl_hfn_pdcp);
int encodetobuffer(uint8_t *buf, int buf_size); int encodetobuffer(uint8_t *buf, int buf_size);
private: private:
Ngap_NGAP_PDU_t *DownlinkranstatustransferPDU; Ngap_NGAP_PDU_t *DownlinkranstatustransferPDU;
Ngap_DownlinkRANStatusTransfer_t *DownlinkranstatustransferIEs; Ngap_DownlinkRANStatusTransfer_t *DownlinkranstatustransferIEs;
AMF_UE_NGAP_ID *amfUeNgapId; AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId; RAN_UE_NGAP_ID *ranUeNgapId;
RANStatusTransferTransparentContainer *ranStatusTransfer_TransparentContainer; RANStatusTransferTransparentContainer *ranStatusTransfer_TransparentContainer;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
This diff is collapsed.
...@@ -11,60 +11,56 @@ ...@@ -11,60 +11,56 @@
#include "AMF-UE-NGAP-ID.hpp" #include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp" #include "RAN-UE-NGAP-ID.hpp"
#include "Cause.hpp" #include "Cause.hpp"
extern "C"{ extern "C" {
#include "Ngap_NGAP-PDU.h" #include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h" #include "Ngap_ProtocolIE-Field.h"
#include "Ngap_NGSetupRequest.h" #include "Ngap_NGSetupRequest.h"
} }
namespace ngap{ namespace ngap {
typedef struct {
typedef struct { uint8_t pduSessionId;
uint8_t pduSessionId; OCTET_STRING_t HandoverCommandTransfer;
OCTET_STRING_t HandoverCommandTransfer; }PDUSessionResourceHandoverItem_t;
}PDUSessionResourceHandoverItem_t;
class HandoverCommandMsg {
public:
class HandoverCommandMsg{ HandoverCommandMsg();
public: virtual ~HandoverCommandMsg();
HandoverCommandMsg();
virtual ~HandoverCommandMsg(); void setMessageType(); //Initialize the PDU and populate the MessageType;
void setAmfUeNgapId(unsigned long id);//40 bits
void setMessageType(); //Initialize the PDU and populate the MessageType; void setRanUeNgapId(uint32_t id);// 32 bits
void setAmfUeNgapId(unsigned long id);//40 bits
void setRanUeNgapId(uint32_t id);// 32 bits void setHandoverType(long type);
void setPduSessionResourceHandoverList(std::vector<PDUSessionResourceHandoverItem_t> list);
void setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource);
void setHandoverType(long type);
void setPduSessionResourceHandoverList(std::vector<PDUSessionResourceHandoverItem_t> list); int encode2buffer(uint8_t *buf, int buf_size);
void setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource); bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
unsigned long getAmfUeNgapId();//return -1;(不存在)
uint32_t getRanUeNgapId();//return -1;(不存在)
int encode2buffer(uint8_t *buf, int buf_size); /*void getHandoverType(Ngap_HandoverType_t &handovertype);
bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu); void getCause(Cause cause);
unsigned long getAmfUeNgapId();//return -1;(不存在) void getTargetID(Ngap_TargetID_t targetID);
uint32_t getRanUeNgapId();//return -1;(不存在) void getDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directpathavailable);
/*void getHandoverType(Ngap_HandoverType_t &handovertype); void getPDUSessionResourceList(Ngap_PDUSessionResourceHandoverList_t pdusessionresourcelist);
void getCause(Cause cause); void getSourceToTargetTransparentContainer();*/
void getTargetID(Ngap_TargetID_t targetID); private:
void getDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directpathavailable); Ngap_NGAP_PDU_t *handoverCommandPdu;
void getPDUSessionResourceList(Ngap_PDUSessionResourceHandoverList_t pdusessionresourcelist); Ngap_HandoverCommand_t *handoverCommandIEs;
void getSourceToTargetTransparentContainer();*/ /***************** for decoding ****************/
private: AMF_UE_NGAP_ID *amfUeNgapId;
Ngap_NGAP_PDU_t *handoverCommandPdu; RAN_UE_NGAP_ID *ranUeNgapId;
Ngap_HandoverCommand_t *handoverCommandIEs; Ngap_HandoverType_t *ngap_handovertype;
/***************** for decoding ****************/ Ngap_NASSecurityParametersFromNGRAN_t *NASSecurityParametersFromNGRAN;
AMF_UE_NGAP_ID *amfUeNgapId; Ngap_PDUSessionResourceHandoverList_t *PDUSessionResourceHandoverList;
RAN_UE_NGAP_ID *ranUeNgapId; Ngap_PDUSessionResourceToReleaseListHOCmd_t *PDUSessionResourceToReleaseListHOCmd;
Ngap_HandoverType_t *ngap_handovertype; Ngap_TargetToSource_TransparentContainer_t *TargetToSource_TransparentContainer;
Ngap_NASSecurityParametersFromNGRAN_t *NASSecurityParametersFromNGRAN; Ngap_CriticalityDiagnostics_t *CriticalityDiagnostics;
Ngap_PDUSessionResourceHandoverList_t *PDUSessionResourceHandoverList;
Ngap_PDUSessionResourceToReleaseListHOCmd_t *PDUSessionResourceToReleaseListHOCmd; };
Ngap_TargetToSource_TransparentContainer_t *TargetToSource_TransparentContainer;
Ngap_CriticalityDiagnostics_t *CriticalityDiagnostics;
};
} }
......
This diff is collapsed.
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file HandoverNotifyMsg.hpp /*! \file HandoverNotifyMsg.hpp
\brief \brief
\author niuxiansheng-niu, BUPT \author niuxiansheng-niu, BUPT
\date 2020 \date 2020
\email: contact@openairinterface.org \email: contact@openairinterface.org
*/ */
#ifndef _HANDOVERNOTIFYMSG_H_ #ifndef _HANDOVERNOTIFYMSG_H_
#define _HANDOVERNOTIFYMSG_H_ #define _HANDOVERNOTIFYMSG_H_
...@@ -42,24 +42,24 @@ extern "C" { ...@@ -42,24 +42,24 @@ extern "C" {
} }
namespace ngap { namespace ngap {
class HandoverNotifyMsg{ class HandoverNotifyMsg {
public: public:
HandoverNotifyMsg(); HandoverNotifyMsg();
virtual ~HandoverNotifyMsg(); virtual ~HandoverNotifyMsg();
int encode2buffer(uint8_t* buf, int buf_size); int encode2buffer(uint8_t *buf, int buf_size);
bool decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu); bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
void setUserLocationInfoNR(struct NrCgi_s cig, struct Tai_s tai); void setUserLocationInfoNR(struct NrCgi_s cig, struct Tai_s tai);
unsigned long getAmfUeNgapId();//return -1;() unsigned long getAmfUeNgapId(); //return -1;(������)
uint32_t getRanUeNgapId();//return -1;() uint32_t getRanUeNgapId(); //return -1;(������)
bool getUserLocationInfoNR(struct NrCgi_s& cig, struct Tai_s& tai); bool getUserLocationInfoNR(struct NrCgi_s &cig, struct Tai_s &tai);
private: private:
Ngap_NGAP_PDU_t* handoverNotifyPdu; Ngap_NGAP_PDU_t *handoverNotifyPdu;
Ngap_HandoverNotify_t* handoverNotifyIEs; Ngap_HandoverNotify_t *handoverNotifyIEs;
AMF_UE_NGAP_ID* amfUeNgapId; AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID* ranUeNgapId; RAN_UE_NGAP_ID *ranUeNgapId;
UserLocationInformation* userLocationInformation; UserLocationInformation *userLocationInformation;
}; };
} }
#endif #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.
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
#include "RAN-UE-NGAP-ID.hpp" #include "RAN-UE-NGAP-ID.hpp"
#include "NgapIEsStruct.hpp" #include "NgapIEsStruct.hpp"
#include "RANStatusTransferTransparentContainer.hpp" #include "RANStatusTransferTransparentContainer.hpp"
extern "C" extern "C" {
{
#include "Ngap_UplinkRANStatusTransfer.h" #include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h" #include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_NGAP-PDU.h" #include "Ngap_NGAP-PDU.h"
...@@ -41,23 +40,23 @@ extern "C" ...@@ -41,23 +40,23 @@ extern "C"
} }
namespace ngap namespace ngap
{ {
class UplinkRANStatusTransfer class UplinkRANStatusTransfer
{ {
public: public:
UplinkRANStatusTransfer(); UplinkRANStatusTransfer();
virtual ~UplinkRANStatusTransfer(); virtual ~UplinkRANStatusTransfer();
unsigned long getAmfUeNgapId(); //return -1;(不存在) unsigned long getAmfUeNgapId(); //return -1;(不存在)
uint32_t getRanUeNgapId(); //return -1;(不存在) uint32_t getRanUeNgapId();//return -1;(不存在)
void getRANStatusTransfer_TransparentContainer(RANStatusTransferTransparentContainer *&ranstatustransfer_transparentcontainer); void getRANStatusTransfer_TransparentContainer(RANStatusTransferTransparentContainer *&ranstatustransfer_transparentcontainer);
bool defromPDU(Ngap_NGAP_PDU_t *ngap_msg_pdu); bool defromPDU(Ngap_NGAP_PDU_t *ngap_msg_pdu);
private: private:
Ngap_NGAP_PDU_t *UplinkRANStatusTransferPDU; Ngap_NGAP_PDU_t *UplinkRANStatusTransferPDU;
Ngap_UplinkRANStatusTransfer_t *UplinkRANStatusTransferIEs; Ngap_UplinkRANStatusTransfer_t *UplinkRANStatusTransferIEs;
AMF_UE_NGAP_ID *amfUeNgapId; AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId; RAN_UE_NGAP_ID *ranUeNgapId;
RANStatusTransferTransparentContainer *ranStatusTransfer_TransparentContainer; RANStatusTransferTransparentContainer *ranStatusTransfer_TransparentContainer;
}; };
} // namespace ngap } // namespace ngap
#endif #endif
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