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