Commit 16d34637 authored by Niuhaiwen's avatar Niuhaiwen

10.3

parent 8341c820
......@@ -110,6 +110,7 @@ typedef enum Ngap_InitiatingMessage__value_PR {
Ngap_InitiatingMessage__value_PR_HandoverRequired,
Ngap_InitiatingMessage__value_PR_HandoverRequest,
Ngap_InitiatingMessage__value_PR_InitialContextSetupRequest,
Ngap_InitiatingMessage__value_PR_HandoverRequestAcknowledge,
Ngap_InitiatingMessage__value_PR_NGReset,
Ngap_InitiatingMessage__value_PR_NGSetupRequest,
Ngap_InitiatingMessage__value_PR_PathSwitchRequest,
......@@ -170,6 +171,7 @@ typedef struct Ngap_InitiatingMessage {
Ngap_HandoverCancel_t HandoverCancel;
Ngap_HandoverRequired_t HandoverRequired;
Ngap_HandoverRequest_t HandoverRequest;
Ngap_HandoverRequestAcknowledge_t HandoverRequestAcknowledge;
Ngap_InitialContextSetupRequest_t InitialContextSetupRequest;
Ngap_NGReset_t NGReset;
Ngap_NGSetupRequest_t NGSetupRequest;
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _NGAPIESSTRUCT_H_
#define _NGAPIESSTRUCT_H_
#include <vector>
#include <string>
extern "C" {
#include <OCTET_STRING.h>
#include "Ngap_DelayCritical.h"
#include "Ngap_Pre-emptionCapability.h"
#include "Ngap_Pre-emptionVulnerability.h"
#include "Ngap_NotificationControl.h"
#include "Ngap_ReflectiveQosAttribute.h"
#include "Ngap_AdditionalQosFlowInformation.h"
#include "Ngap_AssociatedQosFlowItem.h"
extern "C"{
#include <OCTET_STRING.h>
#include "Ngap_DelayCritical.h"
#include "Ngap_Pre-emptionCapability.h"
#include "Ngap_Pre-emptionVulnerability.h"
#include "Ngap_NotificationControl.h"
#include "Ngap_ReflectiveQosAttribute.h"
#include "Ngap_AdditionalQosFlowInformation.h"
#include "Ngap_AssociatedQosFlowItem.h"
}
namespace ngap {
typedef struct SliceSupportItem_s {
std::string sst;
std::string sd;
} SliceSupportItem_t;
typedef struct PlmnSliceSupport_s {
std::string mcc;
std::string mnc;
std::vector<SliceSupportItem_t> slice_list;
} PlmnSliceSupport_t;
typedef struct SupportedItem_s {
uint32_t tac;
std::vector<PlmnSliceSupport_t> b_plmn_list;
} SupportedItem_t;
typedef struct GuamiItem_s {
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
std::string backupAMFName; //optional
} GuamiItem_t;
typedef struct NrCgi_s {
std::string mcc;
std::string mnc;
unsigned long nrCellID;
} NrCgi_t;
typedef struct Tai_s {
std::string mcc;
std::string mnc;
uint32_t tac :24;
} Tai_t;
typedef struct Guami_s {
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
} Guami_t;
typedef struct {
std::string sst;
std::string sd; //可选
} S_Nssai;
typedef struct {
uint8_t pduSessionId;
uint8_t *pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
} PDUSessionResourceSetupRequestItem_t;
typedef struct {
std::string ip_address;
uint32_t gtp_teid;
} GtpTunnel_t;
typedef struct {
long _5QI;
long *priorityLevelQos;
long *averagingWindow;
long *maximumDataBurstVolume;
} NonDynamic5QI_t;
typedef struct {
long pERScalar;
long pERExponent;
} PacketErrorRate_t;
typedef struct {
long priorityLevelQos;
long packetDelayBudget;
PacketErrorRate_t packetErrorRate;
long *_5QI;
e_Ngap_DelayCritical *delayCritical;
long *averagingWindow;
long *maximumDataBurstVolume;
} Dynamic5QI_t;
typedef struct {
NonDynamic5QI_t *nonDy;
Dynamic5QI_t *dy;
} QosCharacteristics_t;
typedef struct {
long priorityLevelARP;
e_Ngap_Pre_emptionCapability pre_emptionCapability;
e_Ngap_Pre_emptionVulnerability pre_emptionVulnerability;
} AllocationAndRetentionPriority_t;
typedef struct {
long maximumFlowBitRateDL;
long maximumFlowBitRateUL;
long guaranteedFlowBitRateDL;
long guaranteedFlowBitRateUL;
e_Ngap_NotificationControl *notificationControl;
long *maximumPacketLossRateDL;
long *maximumPacketLossRateUL;
} GBR_QosInformation_t;
typedef struct {
QosCharacteristics_t qosc;
AllocationAndRetentionPriority_t arp;
GBR_QosInformation_t *gbr_qos_info;
e_Ngap_ReflectiveQosAttribute *reflectiveQosAttribute;
e_Ngap_AdditionalQosFlowInformation *additionalQosFlowInformation;
} QosFlowLevelQosParameters_t;
typedef struct {
long qos_flow_id;
QosFlowLevelQosParameters_t qflqp;
} QosFlowSetupReq_t;
typedef struct {
long qosFlowIdentifier;
e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication *qosFlowMappingIndication;
} AssociatedQosFlow_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupResponseTransfer;
} PDUSessionResourceSetupResponseItem_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupUnsuccessfulTransfer;
} PDUSessionResourceFailedToSetupItem_t;
namespace ngap{
typedef struct SliceSupportItem_s{
std::string sst;
std::string sd;
}SliceSupportItem_t;
typedef struct PlmnSliceSupport_s{
std::string mcc;
std::string mnc;
std::vector<SliceSupportItem_t> slice_list;
}PlmnSliceSupport_t;
typedef struct SupportedItem_s{
uint32_t tac;
std::vector<PlmnSliceSupport_t> b_plmn_list;
}SupportedItem_t;
typedef struct GuamiItem_s{
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
std::string backupAMFName;//optional
}GuamiItem_t;
typedef struct NrCgi_s{
std::string mcc;
std::string mnc;
unsigned long nrCellID;
}NrCgi_t;
typedef struct Tai_s{
std::string mcc;
std::string mnc;
uint32_t tac:24;
}Tai_t;
typedef struct Guami_s{
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
}Guami_t;
typedef struct{
std::string sst;
std::string sd;//可选
}S_Nssai;
typedef struct{
uint8_t pduSessionId;
uint8_t *pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
}PDUSessionResourceSetupRequestItem_t;
typedef struct{
std::string ip_address;
uint32_t gtp_teid;
}GtpTunnel_t;
typedef struct{
long _5QI;
long *priorityLevelQos;
long *averagingWindow;
long *maximumDataBurstVolume;
}NonDynamic5QI_t;
typedef struct{
long pERScalar;
long pERExponent;
}PacketErrorRate_t;
typedef struct{
long priorityLevelQos;
long packetDelayBudget;
PacketErrorRate_t packetErrorRate;
long *_5QI;
e_Ngap_DelayCritical *delayCritical;
long *averagingWindow;
long *maximumDataBurstVolume;
}Dynamic5QI_t;
typedef struct{
NonDynamic5QI_t *nonDy;
Dynamic5QI_t *dy;
}QosCharacteristics_t;
typedef struct{
long priorityLevelARP;
e_Ngap_Pre_emptionCapability pre_emptionCapability;
e_Ngap_Pre_emptionVulnerability pre_emptionVulnerability;
}AllocationAndRetentionPriority_t;
typedef struct{
long maximumFlowBitRateDL;
long maximumFlowBitRateUL;
long guaranteedFlowBitRateDL;
long guaranteedFlowBitRateUL;
e_Ngap_NotificationControl *notificationControl;
long *maximumPacketLossRateDL;
long *maximumPacketLossRateUL;
}GBR_QosInformation_t;
typedef struct{
QosCharacteristics_t qosc;
AllocationAndRetentionPriority_t arp;
GBR_QosInformation_t *gbr_qos_info;
e_Ngap_ReflectiveQosAttribute *reflectiveQosAttribute;
e_Ngap_AdditionalQosFlowInformation *additionalQosFlowInformation;
}QosFlowLevelQosParameters_t;
typedef struct{
long qos_flow_id;
QosFlowLevelQosParameters_t qflqp;
}QosFlowSetupReq_t;
typedef struct{
long qosFlowIdentifier;
e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication *qosFlowMappingIndication;
}AssociatedQosFlow_t;
typedef struct{
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupResponseTransfer;
}PDUSessionResourceSetupResponseItem_t;
typedef struct{
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupUnsuccessfulTransfer;
}PDUSessionResourceFailedToSetupItem_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceReleaseCommandTransfer;
}PDUSessionResourceReleaseCommandItem_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t HandoverRequiredTransfer;
}PDUSessionResourceItem_t;
typedef struct {
uint8_t pduSessionId;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
}PDUSessionResourceSetupItem_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t handoverRequestAcknowledgeTransfer;
}PDUSessionResourceAdmittedItem_t;
}
#endif
#include "PDUSessionResourceAdmittedItem.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceAdmittedItem::PDUSessionResourceAdmittedItem()
{
pDUSessionID = NULL;
}
PDUSessionResourceAdmittedItem::~PDUSessionResourceAdmittedItem(){}
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;
return true;
}
bool PDUSessionResourceAdmittedItem::decodefromPDUSessionResourceAdmittedItem(Ngap_PDUSessionResourceAdmittedItem_t *pdUSessionResourceAdmittedItem)
{
pDUSessionID = new PDUSessionID();
if(!pDUSessionID->decodefromPDUSessionID(pdUSessionResourceAdmittedItem->pDUSessionID)) return false;
handoverrequestAcktransfer = pdUSessionResourceAdmittedItem->handoverRequestAcknowledgeTransfer;
return true;
}
void PDUSessionResourceAdmittedItem::getPDUSessionResourceAdmittedItem(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_handoverrequestAcktransfer)
{
m_pDUSessionID = pDUSessionID;
m_handoverrequestAcktransfer = handoverrequestAcktransfer;
}
}
#ifndef _PDUSESSIONRESOURCEADMITTEDITEM_H_
#define _PDUSESSIONRESOURCEADMITTEDITEM_H_
#include "PDUSessionID.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceAdmittedItem.h"
}
namespace ngap{
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);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequestAcktransfer;
};
}
#endif
#include "PDUSessionResourceAdmittedList.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceAdmittedList::PDUSessionResourceAdmittedList()
{
pduSessionResourceAdmittedItem = NULL;
numofSessionResourceAdmittedItem = 0;
}
PDUSessionResourceAdmittedList::~PDUSessionResourceAdmittedList(){}
void PDUSessionResourceAdmittedList::setPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem,int num)
{
pduSessionResourceAdmittedItem = m_pduSessionResourceAdmittedItem;
numofSessionResourceAdmittedItem = num;
}
bool PDUSessionResourceAdmittedList::encode2PDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList)
{
for(int i=0;i< numofSessionResourceAdmittedItem;i++)
{
Ngap_PDUSessionResourceAdmittedItem_t *response = (Ngap_PDUSessionResourceAdmittedItem_t *)calloc(1,sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
if(!response) return false;
if(!pduSessionResourceAdmittedItem[i].encode2PDUSessionResourceAdmittedItem(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceAdmittedList->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceAdmittedList::decodefromPDUSessionResourceAdmittedList(Ngap_PDUSessionResourceAdmittedList_t *pduSessionResourceAdmittedList)
{
numofSessionResourceAdmittedItem = pduSessionResourceAdmittedList->list.count;
pduSessionResourceAdmittedItem = new PDUSessionResourceAdmittedItem[numofSessionResourceAdmittedItem]();
for(int i=0;i< numofSessionResourceAdmittedItem;i++)
{
if(!pduSessionResourceAdmittedItem[i].decodefromPDUSessionResourceAdmittedItem(pduSessionResourceAdmittedList->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceAdmittedList::getPDUSessionResourceAdmittedList(PDUSessionResourceAdmittedItem *&m_pduSessionResourceAdmittedItem,int &num)
{
m_pduSessionResourceAdmittedItem = pduSessionResourceAdmittedItem;
num = numofSessionResourceAdmittedItem;
}
}
#ifndef _PDUSESSIONRESOURCEADMITTEDLIST_H_
#define _PDUSESSIONRESOURCEADMITTEDLIST_H_
#include "PDUSessionResourceAdmittedItem.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceAdmittedList.h"
}
namespace ngap{
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);
private:
PDUSessionResourceAdmittedItem *pduSessionResourceAdmittedItem;
int numofSessionResourceAdmittedItem;
};
}
#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"
}
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceHandoverRequiredTransfer::PDUSessionResourceHandoverRequiredTransfer()
{
handoverrquiredTransferIEs = (Ngap_HandoverRequiredTransfer_t *)calloc(1,sizeof(Ngap_HandoverRequiredTransfer_t));
DirectForwardingPathAvailability = NULL;
}
PDUSessionResourceHandoverRequiredTransfer::~PDUSessionResourceHandoverRequiredTransfer(){}
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;
return er.encoded;
}
//Decapsulation
bool PDUSessionResourceHandoverRequiredTransfer::decodefromIE(uint8_t *buf, int buf_size)
{
asn_dec_rval_t rc = asn_decode(NULL,ATS_ALIGNED_CANONICAL_PER,&asn_DEF_Ngap_HandoverRequiredTransfer,(void**)&handoverrquiredTransferIEs,buf,buf_size);
if(rc.code == RC_OK)
{
cout<<"Decoded successfully"<<endl;
}
else if(rc.code == RC_WMORE)
{
cout<<"More data expected, call again"<<endl;
return false;
}
else
{
cout<<"Failure to decode data"<<endl;
return false;
}
cout<<"rc.consumed to decode = "<<rc.consumed<<endl;
cout<<endl;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, pduSessionResourceSetupResponseTransferIEs);
if(handoverrquiredTransferIEs->directForwardingPathAvailability)
{
Ngap_DirectForwardingPathAvailability_t *directForwardingPathAvailability=new Ngap_DirectForwardingPathAvailability_t;
directForwardingPathAvailability = handoverrquiredTransferIEs->directForwardingPathAvailability;
}
return true;
}
bool PDUSessionResourceHandoverRequiredTransfer::getDirectForwardingPathAvailability(long *directForwardingPathAvailability)
{
directForwardingPathAvailability = DirectForwardingPathAvailability;
return true;
}
}
#ifndef _PDUSESSIONRESOURCEHANDOVERREQUIREDTRANSFER_H_
#define _PDUSESSIONRESOURCEHANDOVERREQUIREDTRANSFER_H_
#include "NgapIEsStruct.hpp"
#include "DLQoSFlowPerTNLInformation.hpp"
#include "SecurityResult.hpp"
extern "C"{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverRequiredTransfer.h"
}
namespace ngap{
class PDUSessionResourceHandoverRequiredTransfer {
public:
PDUSessionResourceHandoverRequiredTransfer();
virtual ~PDUSessionResourceHandoverRequiredTransfer();
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);
private:
Ngap_HandoverRequiredTransfer_t *handoverrquiredTransferIEs;
Ngap_DirectForwardingPathAvailability_t *DirectForwardingPathAvailability;
};
}
#endif
#include "PDUSessionResourceItemHORqd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceItemHORqd::PDUSessionResourceItemHORqd()
{
pDUSessionID = NULL;
}
PDUSessionResourceItemHORqd::~PDUSessionResourceItemHORqd(){}
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;
return true;
}
bool PDUSessionResourceItemHORqd::decodefromPDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd)
{
pDUSessionID = new PDUSessionID();
if(!pDUSessionID->decodefromPDUSessionID(pdUSessionResourceItemHORqd->pDUSessionID)) return false;
handoverrequiredtransfer = pdUSessionResourceItemHORqd->handoverRequiredTransfer;
return true;
}
void PDUSessionResourceItemHORqd::getPDUSessionResourceItemHORqd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_handoverrequiredtransfer)
{
m_pDUSessionID = pDUSessionID;
m_handoverrequiredtransfer = handoverrequiredtransfer;
}
}
#ifndef _PDUSESSIONRESOURCEITEMHORQD_H_
#define _PDUSESSIONRESOURCEITEMHQRQD_H_
#include "PDUSessionID.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceItemHORqd.h"
}
namespace ngap{
class PDUSessionResourceItemHORqd{
public:
PDUSessionResourceItemHORqd();
virtual ~PDUSessionResourceItemHORqd();
void setPDUSessionResourceItemHORqd(PDUSessionID *m_pDUSessionID, OCTET_STRING_t m_handoverrequiredtransfer);
void getPDUSessionResourceItemHORqd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_handoverrequiredtransfer);
bool encode2PDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
bool decodefromPDUSessionResourceItemHORqd(Ngap_PDUSessionResourceItemHORqd_t *pdUSessionResourceItemHORqd);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t handoverrequiredtransfer;
};
}
#endif
#include "PDUSessionResourceListHORqd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceListHORqd::PDUSessionResourceListHORqd()
{
pduSessionResourceItemHORqd = NULL;
numofpduSessionResourceItemHORqd = 0;
}
PDUSessionResourceListHORqd::~PDUSessionResourceListHORqd(){}
void PDUSessionResourceListHORqd::setPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd,int num)
{
pduSessionResourceItemHORqd = m_pduSessionResourceItemHORqd;
numofpduSessionResourceItemHORqd = num;
}
bool PDUSessionResourceListHORqd::encode2PDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd)
{
for(int i=0;i<numofpduSessionResourceItemHORqd;i++)
{
Ngap_PDUSessionResourceItemHORqd_t *response = (Ngap_PDUSessionResourceItemHORqd_t *)calloc(1,sizeof(Ngap_PDUSessionResourceItemHORqd_t));
if(!response) return false;
if(!pduSessionResourceItemHORqd[i].encode2PDUSessionResourceItemHORqd(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceListHORQqd->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceListHORqd::decodefromPDUSessionResourceListHORqd(Ngap_PDUSessionResourceListHORqd_t *pduSessionResourceListHORQqd)
{
numofpduSessionResourceItemHORqd = pduSessionResourceListHORQqd->list.count;
pduSessionResourceItemHORqd = new PDUSessionResourceItemHORqd[numofpduSessionResourceItemHORqd]();
for(int i=0;i< numofpduSessionResourceItemHORqd;i++)
{
if(!pduSessionResourceItemHORqd[i].decodefromPDUSessionResourceItemHORqd(pduSessionResourceListHORQqd->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceListHORqd::getPDUSessionResourceListHORqd(PDUSessionResourceItemHORqd *&m_pduSessionResourceItemHORqd,int &num)
{
m_pduSessionResourceItemHORqd = pduSessionResourceItemHORqd;
num = numofpduSessionResourceItemHORqd;
}
}
#ifndef _PDUSESSIONRESOURCELISTHORqd_H_
#define _PDUSESSIONRESOURCELISTHORqd_H_
#include "PDUSessionResourceItemHORqd.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceListHORqd.h"
}
namespace ngap{
class PDUSessionResourceListHORqd {
public:
PDUSessionResourceListHORqd();
virtual ~PDUSessionResourceListHORqd();
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);
private:
PDUSessionResourceItemHORqd *pduSessionResourceItemHORqd;
int numofpduSessionResourceItemHORqd;
};
}
#endif
#include "PDUSessionResourceReleaseCommandTransfer.hpp"
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 {
PDUSessionResourceReleaseCommandTransfer::PDUSessionResourceReleaseCommandTransfer()
{
pduSessionResourceReleaseCommandTransferIEs = (Ngap_PDUSessionResourceReleaseCommandTransfer_t *)calloc(1, sizeof(Ngap_PDUSessionResourceReleaseCommandTransfer_t));
causeValue = NULL;
}
PDUSessionResourceReleaseCommandTransfer::~PDUSessionResourceReleaseCommandTransfer() {}
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)
{
cout << "encode CauseRadioNetwork IE error" << endl;
return;
}
}
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)
{
cout << "encode CauseTransport IE error" << endl;
return;
}
}
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)
{
cout << "encode CauseNas IE error" << endl;
return;
}
}
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)
{
cout << "encode CauseProtocol IE error" << endl;
return;
}
}
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)
{
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);
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)
{
cout << "Decoded successfully" << endl;
}
else if (rc.code == RC_WMORE)
{
cout << "More data expected, call again" << endl;
return false;
}
else
{
cout << "Failure to decode data" << endl;
return false;
}
cout << "rc.consumed to decode = " << rc.consumed << endl;
cout << endl;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, pduSessionResourceSetupUnsuccessfulTransferIEs);
causeValue = new Cause();
if (!causeValue->decodefromCause(&pduSessionResourceReleaseCommandTransferIEs->cause))
{
cout << "decoded ngap Cause IE error" << endl;
return false;
}
return true;
}
long PDUSessionResourceReleaseCommandTransfer::getChoiceOfCause()
{
if (!causeValue) return -1;
return causeValue->getChoiceOfCause();
}
long PDUSessionResourceReleaseCommandTransfer::getCause()
{
if (!causeValue) return -1;
return causeValue->getValue();
}
}
#ifndef _PDUSESSIONRESOURCERELEASECOMMANDTRANSFER_H_
#define _PDUSESSIONRESOURCERELEASECOMMANDTRANSFER_H_
#include "NgapIEsStruct.hpp"
#include "Cause.hpp"
extern "C"{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_PDUSessionResourceReleaseCommandTransfer.h"
}
namespace ngap{
class PDUSessionResourceReleaseCommandTransfer {
public:
PDUSessionResourceReleaseCommandTransfer();
virtual ~PDUSessionResourceReleaseCommandTransfer();
void setCauseRadioNetwork(e_Ngap_CauseRadioNetwork cause_value);
void setCauseTransport(e_Ngap_CauseTransport cause_value);
void setCauseNas(e_Ngap_CauseNas cause_value);
void setCauseProtocol(e_Ngap_CauseProtocol cause_value);
void setCauseMisc(e_Ngap_CauseMisc cause_value);
int encode2buffer(uint8_t *buf, int buf_size);
//Decapsulation
bool decodefromIE(uint8_t *buf, int buf_size);
long getChoiceOfCause();
long getCause();
private:
Ngap_PDUSessionResourceReleaseCommandTransfer_t *pduSessionResourceReleaseCommandTransferIEs;
Cause *causeValue;
};
}
#endif
#include "PDUSessionResourceReleaseItemCmd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceReleaseItemCmd::PDUSessionResourceReleaseItemCmd()
{
pDUSessionID = NULL;
}
PDUSessionResourceReleaseItemCmd::~PDUSessionResourceReleaseItemCmd(){}
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;
return true;
}
bool PDUSessionResourceReleaseItemCmd::decodefromPDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer)
{
pDUSessionID = new PDUSessionID();
if(!pDUSessionID->decodefromPDUSessionID(pduSessionResourceReleaseCommandTransfer->pDUSessionID)) return false;
pDUSessionResourceReleaseCommandTransfer = pduSessionResourceReleaseCommandTransfer->pDUSessionResourceReleaseCommandTransfer;
return true;
}
void PDUSessionResourceReleaseItemCmd::getPDUSessionResourceReleaseItemCmd(PDUSessionID *&m_pDUSessionID, OCTET_STRING_t &m_pDUSessionResourceReleaseCommandTransfer)
{
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceReleaseCommandTransfer = pDUSessionResourceReleaseCommandTransfer;
}
}
#ifndef _PDUSESSIONRESOURCERELEASEITEMCMD_H_
#define _PDUSESSIONRESOURCERELEASEITEMCMD_H_
#include "PDUSessionID.hpp"
#include "NAS-PDU.hpp"
#include "S-NSSAI.hpp"
#include "PDUSessionResourceReleaseCommandTransfer.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceToReleaseItemRelCmd.h"
}
namespace ngap{
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);
bool encode2PDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
bool decodefromPDUSessionResourceReleaseItemCmd(Ngap_PDUSessionResourceToReleaseItemRelCmd_t *pduSessionResourceReleaseCommandTransfer);
private:
PDUSessionID *pDUSessionID;
OCTET_STRING_t pDUSessionResourceReleaseCommandTransfer;
};
}
#endif
#include "PDUSessionResourceReleaseListCmd.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceReleaseListCmd::PDUSessionResourceReleaseListCmd()
{
pduSessionResourceReleaseItemCmd = NULL;
numofpduSessionResourceReleaseItemCmd = 0;
}
PDUSessionResourceReleaseListCmd::~PDUSessionResourceReleaseListCmd(){}
void PDUSessionResourceReleaseListCmd::setPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *m_pduSessionResourceReleaseItemCmd,int num)
{
pduSessionResourceReleaseItemCmd = m_pduSessionResourceReleaseItemCmd;
numofpduSessionResourceReleaseItemCmd = num;
}
bool PDUSessionResourceReleaseListCmd::encode2PDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd)
{
for(int i=0;i< numofpduSessionResourceReleaseItemCmd;i++)
{
Ngap_PDUSessionResourceToReleaseItemRelCmd_t *response = (Ngap_PDUSessionResourceToReleaseItemRelCmd_t *)calloc(1,sizeof(Ngap_PDUSessionResourceToReleaseItemRelCmd_t));
if(!response) return false;
if(!pduSessionResourceReleaseItemCmd[i].encode2PDUSessionResourceReleaseItemCmd(response)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceReleaseListCmd->list, response) != 0) return false;
}
return true;
}
bool PDUSessionResourceReleaseListCmd::decodefromPDUSessionResourceReleaseListCmd(Ngap_PDUSessionResourceToReleaseListRelCmd_t *pduSessionResourceReleaseListCmd)
{
numofpduSessionResourceReleaseItemCmd = pduSessionResourceReleaseListCmd->list.count;
pduSessionResourceReleaseItemCmd = new PDUSessionResourceReleaseItemCmd[numofpduSessionResourceReleaseItemCmd]();
for(int i=0;i< numofpduSessionResourceReleaseItemCmd;i++)
{
if(!pduSessionResourceReleaseItemCmd[i].decodefromPDUSessionResourceReleaseItemCmd(pduSessionResourceReleaseListCmd->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceReleaseListCmd::getPDUSessionResourceReleaseListCmd(PDUSessionResourceReleaseItemCmd *&m_pduSessionResourceReleaseItemCmd,int &num)
{
m_pduSessionResourceReleaseItemCmd = pduSessionResourceReleaseItemCmd;
num = numofpduSessionResourceReleaseItemCmd;
}
}
#ifndef _PDUSESSIONRESOURCERELEASELISTCMD_H_
#define _PDUSESSIONRESOURCERELEASELISTCMD_H_
#include "PDUSessionResourceReleaseItemCmd.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceToReleaseListRelCmd.h"
}
namespace ngap{
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);
private:
PDUSessionResourceReleaseItemCmd *pduSessionResourceReleaseItemCmd;
int numofpduSessionResourceReleaseItemCmd;
};
}
#endif
#include "PDUSessionResourceSetupItemHOReq.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceSetupItemHOReq::PDUSessionResourceSetupItemHOReq()
{
pDUSessionID = NULL;
s_NSSAI = NULL;
}
PDUSessionResourceSetupItemHOReq::~PDUSessionResourceSetupItemHOReq(){}
void PDUSessionResourceSetupItemHOReq::setPDUSessionResourceSetupItemHOReq(PDUSessionID *m_pDUSessionID,S_NSSAI *m_s_NSSAI,OCTET_STRING_t m_pDUSessionResourceSetupRequestTransfer)
{
pDUSessionID = m_pDUSessionID;
s_NSSAI = m_s_NSSAI;
pDUSessionResourceSetupRequestTransfer = m_pDUSessionResourceSetupRequestTransfer;
}
bool PDUSessionResourceSetupItemHOReq::encode2PDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq)
{
if(!pDUSessionID->encode2PDUSessionID(pduSessionResourceSetupItemHOReq->pDUSessionID)) return false;
if(!s_NSSAI->encode2S_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI)) return false;
pduSessionResourceSetupItemHOReq->handoverRequestTransfer = pDUSessionResourceSetupRequestTransfer;
return true;
}
bool PDUSessionResourceSetupItemHOReq::decodefromPDUSessionResourceSetupItemHOReq(Ngap_PDUSessionResourceSetupItemHOReq_t *pduSessionResourceSetupItemHOReq)
{
pDUSessionID = new PDUSessionID();
s_NSSAI = new S_NSSAI();
if(!pDUSessionID->decodefromPDUSessionID(pduSessionResourceSetupItemHOReq->pDUSessionID)) return false;
if(!s_NSSAI->decodefromS_NSSAI(&pduSessionResourceSetupItemHOReq->s_NSSAI)) return false;
pDUSessionResourceSetupRequestTransfer = pduSessionResourceSetupItemHOReq->handoverRequestTransfer;
return true;
}
void PDUSessionResourceSetupItemHOReq::getPDUSessionResourceSetupItemHOReq(PDUSessionID *&m_pDUSessionID, S_NSSAI *&m_s_NSSAI,OCTET_STRING_t &m_pDUSessionResourceSetupRequestTransfer)
{
m_pDUSessionID = pDUSessionID;
m_s_NSSAI = s_NSSAI;
m_pDUSessionResourceSetupRequestTransfer = pDUSessionResourceSetupRequestTransfer;
}
}
#ifndef _PDUSESSIONRESOURCESETUPITEMHOREQ_H_
#define _PDUSESSIONRESOURCESETUPITEMHOREQ_H_
#include "PDUSessionID.hpp"
#include "NAS-PDU.hpp"
#include "S-NSSAI.hpp"
#include "PDUSessionResourceSetupRequestTransfer.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceSetupItemHOReq.h"
}
namespace ngap{
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);
private:
PDUSessionID *pDUSessionID;
S_NSSAI *s_NSSAI;
OCTET_STRING_t pDUSessionResourceSetupRequestTransfer;
};
}
#endif
#include "PDUSessionResourceSetupListHOReq.hpp"
#include <iostream>
using namespace std;
namespace ngap{
PDUSessionResourceSetupListHOReq::PDUSessionResourceSetupListHOReq()
{
pduSessionResourceSetupItemHOReq = NULL;
numofpduSessionResourceSetupItemHOReq = 0;
}
PDUSessionResourceSetupListHOReq::~PDUSessionResourceSetupListHOReq(){}
void PDUSessionResourceSetupListHOReq::setPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *m_pduSessionResourceSetupItemHOReq,int num)
{
pduSessionResourceSetupItemHOReq = m_pduSessionResourceSetupItemHOReq;
numofpduSessionResourceSetupItemHOReq = num;
}
bool PDUSessionResourceSetupListHOReq::encode2PDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq)
{
for(int i=0;i<numofpduSessionResourceSetupItemHOReq;i++)
{
Ngap_PDUSessionResourceSetupItemHOReq_t *request = (Ngap_PDUSessionResourceSetupItemHOReq_t *)calloc(1,sizeof(Ngap_PDUSessionResourceSetupItemHOReq_t));
if(!request) return false;
if(!pduSessionResourceSetupItemHOReq[i].encode2PDUSessionResourceSetupItemHOReq(request)) return false;
if(ASN_SEQUENCE_ADD(&pduSessionResourceSetupListHOReq->list, request) != 0) return false;
}
return true;
}
bool PDUSessionResourceSetupListHOReq::decodefromPDUSessionResourceSetupListHOReq(Ngap_PDUSessionResourceSetupListHOReq_t *pduSessionResourceSetupListHOReq)
{
numofpduSessionResourceSetupItemHOReq = pduSessionResourceSetupListHOReq->list.count;
pduSessionResourceSetupItemHOReq = new PDUSessionResourceSetupItemHOReq[numofpduSessionResourceSetupItemHOReq]();
for(int i=0;i<numofpduSessionResourceSetupItemHOReq;i++)
{
if(!pduSessionResourceSetupItemHOReq[i].decodefromPDUSessionResourceSetupItemHOReq(pduSessionResourceSetupListHOReq->list.array[i])) return false;
}
return true;
}
void PDUSessionResourceSetupListHOReq::getPDUSessionResourceSetupListHOReq(PDUSessionResourceSetupItemHOReq *&m_pduSessionResourceSetupItemHOReq,int &num)
{
m_pduSessionResourceSetupItemHOReq = pduSessionResourceSetupItemHOReq;
num = numofpduSessionResourceSetupItemHOReq;
}
}
#ifndef _PDUSESSIONRESOURCESETUPLISTHOREQ_H_
#define _PDUSESSIONRESOURCESETUPLISTHOREQ_H_
#include "PDUSessionResourceSetupItemHOReq.hpp"
extern "C"{
#include "Ngap_PDUSessionResourceSetupListHOReq.h"
}
namespace ngap{
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);
private:
PDUSessionResourceSetupItemHOReq *pduSessionResourceSetupItemHOReq;
int numofpduSessionResourceSetupItemHOReq;
};
}
#endif
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
#include "HandoverCommandMsg.hpp"
extern "C"{
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "Ngap_PDUSessionResourceHandoverItem.h"
}
#include <iostream>
#include <vector>
using namespace std;
namespace ngap{
HandoverCommandMsg::HandoverCommandMsg()
{
amfUeNgapId = NULL;
ranUeNgapId = NULL;
ngap_handovertype = NULL;
NASSecurityParametersFromNGRAN = NULL;
PDUSessionResourceHandoverList = NULL;
PDUSessionResourceToReleaseListHOCmd = NULL;
TargetToSource_TransparentContainer = NULL;
CriticalityDiagnostics = NULL;
handoverCommandPdu = NULL;
handoverCommandIEs = NULL;
}
HandoverCommandMsg::~HandoverCommandMsg() {}
unsigned long HandoverCommandMsg::getAmfUeNgapId()
{
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
uint32_t HandoverCommandMsg::getRanUeNgapId()
{
return ranUeNgapId->getRanUeNgapId();
}
bool HandoverCommandMsg::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
handoverCommandPdu = ngap_msg_pdu;
if (handoverCommandPdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
{
if (handoverCommandPdu->choice.successfulOutcome && handoverCommandPdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverCommandPdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && handoverCommandPdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_HandoverCommand)
{
handoverCommandIEs = &handoverCommandPdu->choice.successfulOutcome->value.choice.HandoverCommand;
}
else
{
cout << "Check HandoverCommand message error!!!" << endl;
return false;
}
}
else
{
cout << "HandoverRequired MessageType error!!!" << endl;
return false;
}
for (int i = 0; i < handoverCommandIEs->protocolIEs.list.count; i++)
{
switch (handoverCommandIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_HandoverType: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_HandoverType)
{
ngap_handovertype = new Ngap_HandoverType_t();
*ngap_handovertype = handoverCommandIEs->protocolIEs.list.array[i]->value.choice.HandoverType;
}
else
{
cout << "decoded ngap Handover Type IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList)
{
}
else
{
cout << "decoded ngap PDUSessionResourceHandoverList IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd)
{
}
else
{
cout << "decoded ngap PDUSessionResourceToReleaseListHOCmd IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer)
{
}
else
{
cout << "decoded ngap TargetToSource_TransparentContainer IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_CriticalityDiagnostics: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics)
{
}
else
{
cout << "decoded ngap CriticalityDiagnostics IE error" << endl;
return false;
}
}break;
default: {
cout << "decoded ngap message pdu error" << endl;
return false;
}
}
}
return true;
}
int HandoverCommandMsg::encode2buffer(uint8_t *buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverCommandPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, handoverCommandPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
void HandoverCommandMsg::setMessageType()
{
if (!handoverCommandPdu) handoverCommandPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
MessageType HandoverCommandMessageTypeIE;
HandoverCommandMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverPreparation);
HandoverCommandMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_successfulOutcome);
HandoverCommandMessageTypeIE.setCriticality(Ngap_Criticality_reject);
HandoverCommandMessageTypeIE.setValuePresent(Ngap_SuccessfulOutcome__value_PR_HandoverCommand);
if (HandoverCommandMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverPreparation && HandoverCommandMessageTypeIE.getTypeOfMessage() == Ngap_NGAP_PDU_PR_successfulOutcome)
{
HandoverCommandMessageTypeIE.encode2pdu(handoverCommandPdu);
handoverCommandIEs = &(handoverCommandPdu->choice.successfulOutcome->value.choice.HandoverCommand);
}
else
{
cout << "[warning] This information doesn't refer to HandoverCommand Message!!!" << endl;
}
}
void HandoverCommandMsg::setAmfUeNgapId(unsigned long id)
{
if (!amfUeNgapId)
amfUeNgapId = new AMF_UE_NGAP_ID();
amfUeNgapId->setAMF_UE_NGAP_ID(id);
Ngap_HandoverCommandIEs_t *ie = (Ngap_HandoverCommandIEs_t *)calloc(1, sizeof(Ngap_HandoverCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID;
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
if (!ret)
{
cout << "encode AMF_UE_NGAP_ID IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverCommandIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode AMF_UE_NGAP_ID IE error" << endl;
}
void HandoverCommandMsg::setRanUeNgapId(uint32_t ran_ue_ngap_id)
{
if (!ranUeNgapId)
ranUeNgapId = new RAN_UE_NGAP_ID();
ranUeNgapId->setRanUeNgapId(ran_ue_ngap_id);
Ngap_HandoverCommandIEs_t *ie = (Ngap_HandoverCommandIEs_t *)calloc(1, sizeof(Ngap_HandoverCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID;
int ret = ranUeNgapId->encode2RAN_UE_NGAP_ID(ie->value.choice.RAN_UE_NGAP_ID);
if (!ret)
{
cout << "encode RAN_UE_NGAP_ID IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverCommandIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode RAN_UE_NGAP_ID IE error" << endl;
}
void HandoverCommandMsg::setHandoverType(long type)
{
if (!ngap_handovertype)
ngap_handovertype = new Ngap_HandoverType_t();
Ngap_HandoverCommandIEs_t *ie = (Ngap_HandoverCommandIEs_t *)calloc(1, sizeof(Ngap_HandoverCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_HandoverType;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverCommandIEs__value_PR_HandoverType;
ie->value.choice.HandoverType = type;
int ret = ASN_SEQUENCE_ADD(&handoverCommandIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode HandoverType IE error" << endl;
}
void HandoverCommandMsg::setPduSessionResourceHandoverList(std::vector<PDUSessionResourceHandoverItem_t> list)
{
if (!PDUSessionResourceHandoverList)
PDUSessionResourceHandoverList = new Ngap_PDUSessionResourceHandoverList_t();
Ngap_HandoverCommandIEs_t *ie = (Ngap_HandoverCommandIEs_t *)calloc(1, sizeof(Ngap_HandoverCommandIEs_t));
for (int i = 0; i < list.size(); i++)
{
Ngap_PDUSessionResourceHandoverItem_t *item = (Ngap_PDUSessionResourceHandoverItem_t *)calloc(1, sizeof(Ngap_PDUSessionResourceHandoverItem_t));
item->pDUSessionID = list[i].pduSessionId;
item->handoverCommandTransfer = list[i].HandoverCommandTransfer;
int ret = ASN_SEQUENCE_ADD(&PDUSessionResourceHandoverList->list, item);
if (ret != 0) cout << "encode PDUSessionResourceHandoverListItem IE error" << endl;
}
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList;
ie->value.choice.PDUSessionResourceHandoverList = *PDUSessionResourceHandoverList;
int ret = ASN_SEQUENCE_ADD(&handoverCommandIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode PDUSessionResourceHandoverList IE error" << endl;
}
void HandoverCommandMsg::setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource)
{
if (!TargetToSource_TransparentContainer)
TargetToSource_TransparentContainer = new Ngap_TargetToSource_TransparentContainer_t();
Ngap_HandoverCommandIEs_t *ie = (Ngap_HandoverCommandIEs_t *)calloc(1, sizeof(Ngap_HandoverCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer;
ie->value.choice.TargetToSource_TransparentContainer = targetTosource;
int ret = ASN_SEQUENCE_ADD(&handoverCommandIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode HandoverType IE error" << endl;
}
}
#ifndef _HANDOVERCOMMAND_H_
#define _HANDOVERCOMMAND_H_
#include "NgapIEsStruct.hpp"
#include "MessageType.hpp"
#include "GlobalRanNodeId.hpp"
#include "RanNodeName.hpp"
#include "DefaultPagingDRX.hpp"
#include "SupportedTAList.hpp"
#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"
}
namespace ngap{
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t HandoverCommandTransfer;
}PDUSessionResourceHandoverItem_t;
class HandoverCommandMsg{
public:
HandoverCommandMsg();
virtual ~HandoverCommandMsg();
void setMessageType(); //Initialize the PDU and populate the MessageType;
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;(不存在)
uint32_t getRanUeNgapId();//return -1;(不存在)
/*void getHandoverType(Ngap_HandoverType_t &handovertype);
void getCause(Cause cause);
void getTargetID(Ngap_TargetID_t targetID);
void getDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directpathavailable);
void getPDUSessionResourceList(Ngap_PDUSessionResourceHandoverList_t pdusessionresourcelist);
void getSourceToTargetTransparentContainer();*/
private:
Ngap_NGAP_PDU_t *handoverCommandPdu;
Ngap_HandoverCommand_t *handoverCommandIEs;
/***************** for decoding ****************/
AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId;
Ngap_HandoverType_t *ngap_handovertype;
Ngap_NASSecurityParametersFromNGRAN_t *NASSecurityParametersFromNGRAN;
Ngap_PDUSessionResourceHandoverList_t *PDUSessionResourceHandoverList;
Ngap_PDUSessionResourceToReleaseListHOCmd_t *PDUSessionResourceToReleaseListHOCmd;
Ngap_TargetToSource_TransparentContainer_t *TargetToSource_TransparentContainer;
Ngap_CriticalityDiagnostics_t *CriticalityDiagnostics;
};
}
#endif
#include "HandoverNotifyMsg.hpp"
extern "C" {
#include "constr_TYPE.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "constraints.h"
}
#include <iostream>
#include <vector>
using namespace std;
namespace ngap {
HandoverNotifyMsg::HandoverNotifyMsg()
{
amfUeNgapId = NULL;
ranUeNgapId = NULL;
userLocationInformation = NULL;
}
HandoverNotifyMsg::~HandoverNotifyMsg() {};
unsigned long HandoverNotifyMsg::getAmfUeNgapId()
{
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
int HandoverNotifyMsg::encode2buffer(uint8_t* buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverNotifyPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, handoverNotifyPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
bool HandoverNotifyMsg::decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu)
{
handoverNotifyPdu = ngap_msg_pdu;
if (handoverNotifyPdu->present == Ngap_NGAP_PDU_PR_initiatingMessage)
{
if (handoverNotifyPdu->choice.initiatingMessage && handoverNotifyPdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverNotifyPdu->choice.initiatingMessage->criticality == Ngap_Criticality_reject && handoverNotifyPdu->choice.initiatingMessage->value.present == Ngap_InitiatingMessage__value_PR_HandoverRequired)
{
handoverNotifyIEs = &handoverNotifyPdu->choice.initiatingMessage->value.choice.HandoverNotify;
}
else
{
cout << "Check HandoverNotify message error!!!" << endl;
return false;
}
}
else
{
cout << "HandoverNotify MessageType error!!!" << endl;
return false;
}
for (int i = 0; i < handoverNotifyIEs->protocolIEs.list.count; i++)
{
switch (handoverNotifyIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
if (handoverNotifyIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverNotifyIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverNotifyIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverNotifyIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID:{
if (handoverNotifyIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverNotifyIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverNotifyIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverNotifyIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
case Ngap_ProtocolIE_ID_id_UserLocationInformation: {
if (handoverNotifyIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverNotifyIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation)
{
userLocationInformation = new UserLocationInformation();
if (!userLocationInformation->decodefromUserLocationInformation(&handoverNotifyIEs->protocolIEs.list.array[i]->value.choice.UserLocationInformation))
{
cout << "decoded ngap UserLocationInformation IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap UserLocationInformation IE error" << endl;
return false;
}
}break;
}
}
return true;
}
void HandoverNotifyMsg::setUserLocationInfoNR(struct NrCgi_s cig, struct Tai_s tai)
{
if (!userLocationInformation)
userLocationInformation = new UserLocationInformation();
//userLocationInformation->setInformation(UserLocationInformationEUTRA * informationEUTRA);
UserLocationInformationNR* informationNR = new UserLocationInformationNR();
NR_CGI* nR_CGI = new NR_CGI();
PlmnId* plmnId_cgi = new PlmnId();
NRCellIdentity* nRCellIdentity = new NRCellIdentity();
plmnId_cgi->setMccMnc(cig.mcc, cig.mnc);
nRCellIdentity->setNRCellIdentity(cig.nrCellID);
nR_CGI->setNR_CGI(plmnId_cgi, nRCellIdentity);
TAI* tai_nr = new TAI();
PlmnId* plmnId_tai = new PlmnId();
plmnId_tai->setMccMnc(tai.mcc, tai.mnc);
TAC* tac = new TAC();
tac->setTac(tai.tac);
tai_nr->setTAI(plmnId_tai, tac);
informationNR->setInformationNR(nR_CGI, tai_nr);
userLocationInformation->setInformation(informationNR);
Ngap_HandoverNotifyIEs_t* ie = (Ngap_HandoverNotifyIEs_t*)calloc(1, sizeof(Ngap_HandoverNotifyIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_UserLocationInformation;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation;
int ret = userLocationInformation->encodefromUserLocationInformation(&ie->value.choice.UserLocationInformation);
if (!ret)
{
cout << "encode UserLocationInformation IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverNotifyIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode UserLocationInformation IE error" << endl;
}
uint32_t HandoverNotifyMsg::getRanUeNgapId()
{
return ranUeNgapId->getRanUeNgapId();
}
bool HandoverNotifyMsg::getUserLocationInfoNR(struct NrCgi_s& cig, struct Tai_s& tai)
{
UserLocationInformationNR* informationNR;
userLocationInformation->getInformation(informationNR);
if (userLocationInformation->getChoiceOfUserLocationInformation() != Ngap_UserLocationInformation_PR_userLocationInformationNR) return false;
NR_CGI* nR_CGI;
TAI* nR_TAI;
informationNR->getInformationNR(nR_CGI, nR_TAI);
PlmnId* cgi_plmnId;
NRCellIdentity* nRCellIdentity;
nR_CGI->getNR_CGI(cgi_plmnId, nRCellIdentity);
cgi_plmnId->getMcc(cig.mcc);
cgi_plmnId->getMnc(cig.mnc);
cig.nrCellID = nRCellIdentity->getNRCellIdentity();
PlmnId* tai_plmnId;
TAC* tac;
nR_TAI->getTAI(tai_plmnId, tac);
tai_plmnId->getMcc(tai.mcc);
tai_plmnId->getMnc(tai.mnc);
tai.tac = tac->getTac();
return true;
}
}
\ No newline at end of file
#ifndef _HANDOVERNOTIFYMSG_H_
#define _HANDOVERNOTIFYMSG_H_
#include "NgapIEsStruct.hpp"
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "MessageType.hpp"
#include "UserLocationInformation.hpp"
extern "C" {
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverNotify.h"
}
namespace ngap {
class HandoverNotifyMsg{
public:
HandoverNotifyMsg();
virtual ~HandoverNotifyMsg();
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);
private:
Ngap_NGAP_PDU_t* handoverNotifyPdu;
Ngap_HandoverNotify_t* handoverNotifyIEs;
AMF_UE_NGAP_ID* amfUeNgapId;
RAN_UE_NGAP_ID* ranUeNgapId;
UserLocationInformation* userLocationInformation;
};
}
#endif
#include "HandoverRequest.hpp"
extern "C"{
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "constraints.h"
}
#include <iostream>
#include <vector>
using namespace std;
namespace ngap{
HandoverRequest::HandoverRequest()
{
amfUeNgapId=NULL;
handovertype = NULL;
cause = NULL;
ueAggregateMaximumBitRate = NULL;
ueSecurityCapabilities = NULL;
SecurityContext = NULL;
PDUSessionResourceSetupList = NULL;
allowedNSSAI = NULL;
SourceToTarget_TransparentContainer = NULL;
guami = NULL;
handoverRequestPdu = NULL;
handoverRequestIEs = NULL;
}
HandoverRequest::~HandoverRequest() {}
unsigned long HandoverRequest::getAmfUeNgapId()
{
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
/*bool HandoverRequest::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
handoverCommandPdu = ngap_msg_pdu;
if (handoverCommandPdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
{
if (handoverCommandPdu->choice.successfulOutcome && handoverCommandPdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverCommandPdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && handoverRequiredPdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_HandoverCommand)
{
handoverCommandIEs = &handoverCommandIEs->choice.successfulOutcome->value.choice.HandoverCommand;
}
else
{
cout << "Check HandoverCommand message error!!!" << endl;
return false;
}
}
else
{
cout << "HandoverRequired MessageType error!!!" << endl;
return false;
}
for (int i = 0; i < handoverCommandIEs->protocolIEs.list.count; i++)
{
switch (handoverCommandIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_HandoverType: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_HandoverType)
{
ngap_handovertype = new Ngap_HandoverType_t();
ngap_handovertype = handoverCommandIEs->protocolIEs.list.array[i]->value.choice.HandoverType;
}
else
{
cout << "decoded ngap Handover Type IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList)
{
}
else
{
cout << "decoded ngap PDUSessionResourceHandoverList IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd)
{
}
else
{
cout << "decoded ngap PDUSessionResourceToReleaseListHOCmd IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer)
{
}
else
{
cout << "decoded ngap TargetToSource_TransparentContainer IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_CriticalityDiagnostics: {
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics)
{
}
else
{
cout << "decoded ngap CriticalityDiagnostics IE error" << endl;
return false;
}
}break;
default: {
cout << "decoded ngap message pdu error" << endl;
return false;
}
}
}
return true;
}*/
int HandoverRequest::encode2buffer(uint8_t *buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequestPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequestPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
void HandoverRequest::setMessageType()
{
if (!handoverRequestPdu) handoverRequestPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
MessageType handoverRequestMessageTypeIE;
handoverRequestMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverResourceAllocation);
handoverRequestMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_initiatingMessage);
handoverRequestMessageTypeIE.setCriticality(Ngap_Criticality_reject);
handoverRequestMessageTypeIE.setValuePresent(Ngap_InitiatingMessage__value_PR_HandoverRequest);
if (handoverRequestMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverResourceAllocation && handoverRequestMessageTypeIE.getTypeOfMessage() ==Ngap_NGAP_PDU_PR_initiatingMessage)
{
handoverRequestMessageTypeIE.encode2pdu(handoverRequestPdu);
handoverRequestIEs = &(handoverRequestPdu->choice.initiatingMessage->value.choice.HandoverRequest);
}
else
{
cout << "[warning] This information doesn't refer to HandoverRequest Message!!!" << endl;
}
}
void HandoverRequest::setAmfUeNgapId(unsigned long id)
{
if (!amfUeNgapId)
amfUeNgapId = new AMF_UE_NGAP_ID();
amfUeNgapId->setAMF_UE_NGAP_ID(id);
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_AMF_UE_NGAP_ID;
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
if (!ret)
{
cout << "encode AMF_UE_NGAP_ID IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode AMF_UE_NGAP_ID IE error" << endl;
}
void HandoverRequest::setHandoverType(long type)//0--intra5gs
{
if (!handovertype)
handovertype = new Ngap_HandoverType_t();
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_HandoverType;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_HandoverType;
ie->value.choice.HandoverType = type;
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode HandoverType IE error" << endl;
}
void HandoverRequest::setCause(Ngap_Cause_PR m_causePresent,long value)//
{
if (!cause)
cause = new Cause;
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_Cause;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_Cause;
cause->setChoiceOfCause(m_causePresent);
cause->setValue(value);
cause->encode2Cause(&(ie->value.choice.Cause));
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode Cause IE error" << endl;
}
void HandoverRequest::setUEAggregateMaximumBitRate(long bit_rate_downlink,long bit_rate_uplink)
{
if (!ueAggregateMaximumBitRate)
ueAggregateMaximumBitRate = new UEAggregateMaxBitRate;
ueAggregateMaximumBitRate->setUEAggregateMaxBitRate(bit_rate_downlink,bit_rate_uplink);
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_UEAggregateMaximumBitRate;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_UEAggregateMaximumBitRate;
ueAggregateMaximumBitRate->encode2UEAggregateMaxBitRate(ie->value.choice.UEAggregateMaximumBitRate);
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode UEAggregateMaximumBitRate IE error" << endl;
}
void HandoverRequest::setUESecurityCapabilities(uint16_t m_NR_EncryptionAlgs, uint16_t m_NR_IntegrityProtectionAlgs, uint16_t m_E_UTRA_EncryptionAlgs, uint16_t m_E_UTRA_IntegrityProtectionAlgs)
{
if (!ueSecurityCapabilities)
ueSecurityCapabilities = new UESecurityCapabilities;
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_UESecurityCapabilities;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_UESecurityCapabilities;
ueSecurityCapabilities->setUESecurityCapabilities( m_NR_EncryptionAlgs, m_NR_IntegrityProtectionAlgs, m_E_UTRA_EncryptionAlgs, m_E_UTRA_IntegrityProtectionAlgs);
ueSecurityCapabilities->encode2UESecurityCapabilities((ie->value.choice.UESecurityCapabilities));
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode UESecurityCapabilities IE error" << endl;
}
void HandoverRequest::setGUAMI(PlmnId* m_plmnId, AMFRegionID* m_aMFRegionID, AMFSetID* m_aMFSetID, AMFPointer* m_aMFPointer)
{
if (!guami)
guami = new GUAMI;
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_GUAMI;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_GUAMI;
guami->setGUAMI( m_plmnId, m_aMFRegionID, m_aMFSetID, m_aMFPointer);
guami->encode2GUAMI(&(ie->value.choice.GUAMI));
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode GUAMI IE error" << endl;
}
void HandoverRequest::setAllowedNSSAI(std::vector<S_NSSAI> list)
{
if (!allowedNSSAI)
allowedNSSAI = new Ngap_AllowedNSSAI_t();
for (int i = 0; i < list.size(); i++)
{
Ngap_AllowedNSSAI_Item_t *item = (Ngap_AllowedNSSAI_Item_t *)calloc(1, sizeof(Ngap_AllowedNSSAI_Item_t));
//item->s_NSSAI = list[i].s_NSSAI;
//S_NSSAI *s_NSSAI = new S_NSSAI();
list[i].encode2S_NSSAI(&item->s_NSSAI);
int ret = ASN_SEQUENCE_ADD(&allowedNSSAI->list, item);
if (ret != 0) cout << "encode PDUSessionResourceHandoverListItem IE error" << endl;
}
asn_fprint(stderr, &asn_DEF_Ngap_AllowedNSSAI, allowedNSSAI);
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_AllowedNSSAI;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_AllowedNSSAI;
ie->value.choice.AllowedNSSAI = *allowedNSSAI;
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode AllowedNSSAI IE error" << endl;
}
void HandoverRequest::setSecurityContext(long count, uint8_t* buffer)
{
if (!SecurityContext)
SecurityContext = new Ngap_SecurityContext_t();
SecurityKey securitykey;
securitykey.setSecurityKey(buffer);
securitykey.encode2bitstring(SecurityContext->nextHopNH);
SecurityContext->nextHopChainingCount = count;
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_SecurityContext;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_SecurityContext;
ie->value.choice.SecurityContext = *SecurityContext;
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode SecurityContext IE error" << endl;
}
void HandoverRequest::setPduSessionResourceSetupList(std::vector<PDUSessionResourceSetupRequestItem_t>list)
{
if (!PDUSessionResourceSetupList)
PDUSessionResourceSetupList = new PDUSessionResourceSetupListHOReq();
PDUSessionResourceSetupItemHOReq * m_pduSessionResourceSetupItemHOReq = new PDUSessionResourceSetupItemHOReq[list.size()]();
for (int i = 0; i < list.size(); i++)
{
PDUSessionID * m_pDUSessionID = new PDUSessionID();
m_pDUSessionID->setPDUSessionID(list[i].pduSessionId);
S_NSSAI * m_s_NSSAI = new S_NSSAI();
m_s_NSSAI->setSst(list[i].s_nssai.sst);
if (list[i].s_nssai.sd.size())
m_s_NSSAI->setSd(list[i].s_nssai.sd);
m_pduSessionResourceSetupItemHOReq[i].setPDUSessionResourceSetupItemHOReq(m_pDUSessionID, m_s_NSSAI, list[i].pduSessionResourceSetupRequestTransfer);
}
PDUSessionResourceSetupList->setPDUSessionResourceSetupListHOReq(m_pduSessionResourceSetupItemHOReq, list.size());
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceSetupListHOReq;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_PDUSessionResourceSetupListHOReq;
int ret = PDUSessionResourceSetupList->encode2PDUSessionResourceSetupListHOReq(&ie->value.choice.PDUSessionResourceSetupListHOReq);
if (!ret)
{
cout << "encode PDUSessionResourceSetupListSUReq IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode PDUSessionResourceSetupListSUReq IE error" << endl;
}
void HandoverRequest::setSourceToTarget_TransparentContainer(OCTET_STRING_t sourceTotarget)
{
if (!SourceToTarget_TransparentContainer)
SourceToTarget_TransparentContainer = new Ngap_SourceToTarget_TransparentContainer_t();
Ngap_HandoverRequestIEs_t *ie = (Ngap_HandoverRequestIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestIEs__value_PR_SourceToTarget_TransparentContainer;
ie->value.choice.SourceToTarget_TransparentContainer = sourceTotarget;
int ret = ASN_SEQUENCE_ADD(&handoverRequestIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode SourceToTarget_TransparentContainer IE error" << endl;
}
}
#ifndef _HANDOVERREQUEST_H_
#define _HANDOVERREQUEST_H_
#include "NgapIEsStruct.hpp"
#include "MessageType.hpp"
#include "GlobalRanNodeId.hpp"
#include "RanNodeName.hpp"
#include "DefaultPagingDRX.hpp"
#include "SupportedTAList.hpp"
#include "AMF-UE-NGAP-ID.hpp"
#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"
}
#include "UESecurityCapabilities.hpp"
#include "PDUSessionResourceSetupListHOReq.hpp"
#include "GUAMI.hpp"
#include "S-NSSAI.hpp"
#include "SecurityKey.hpp"
namespace ngap{
class HandoverRequest{
public:
HandoverRequest();
virtual ~HandoverRequest();
void setMessageType(); //Initialize the PDU and populate the MessageType;
void setAmfUeNgapId(unsigned long id);//40 bits
void setHandoverType(long type);
void setCause(Ngap_Cause_PR m_causePresent,long value);
void setUEAggregateMaximumBitRate(long bit_rate_downlink,long bit_rate_uplink);
void setUESecurityCapabilities(uint16_t m_NR_EncryptionAlgs, uint16_t m_NR_IntegrityProtectionAlgs, uint16_t m_E_UTRA_EncryptionAlgs, uint16_t m_E_UTRA_IntegrityProtectionAlgs);
void setSecurityContext(long count, uint8_t* buffer);
void setPduSessionResourceSetupList(std::vector<PDUSessionResourceSetupRequestItem_t>list);
void setSourceToTarget_TransparentContainer(OCTET_STRING_t sourceTotarget);
void setAllowedNSSAI(std::vector<S_NSSAI> list);
void setGUAMI(PlmnId* m_plmnId, AMFRegionID* m_aMFRegionID, AMFSetID* m_aMFSetID, AMFPointer* m_aMFPointer);
int encode2buffer(uint8_t *buf, int buf_size);
//bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
unsigned long getAmfUeNgapId();//return -1;(不存在)
private:
Ngap_NGAP_PDU_t *handoverRequestPdu;
Ngap_HandoverRequest_t *handoverRequestIEs;
/***************** for decoding ****************/
AMF_UE_NGAP_ID *amfUeNgapId;
Ngap_HandoverType_t *handovertype;
Cause *cause;
UEAggregateMaxBitRate *ueAggregateMaximumBitRate;
//Core Network Assistance Information for RRC INACTIVE
UESecurityCapabilities *ueSecurityCapabilities;
Ngap_SecurityContext_t *SecurityContext;
//New Security Context Indicator
//NASC
PDUSessionResourceSetupListHOReq *PDUSessionResourceSetupList;
Ngap_AllowedNSSAI_t *allowedNSSAI;
//Trace Activation
//Masked IMEISV
Ngap_SourceToTarget_TransparentContainer_t *SourceToTarget_TransparentContainer;
//Mobility Restriction List
//Location Reporting Request Type
//RRC Inactive Transition Report Request
GUAMI *guami;
//Redirection for Voice EPS Fallback
//CN Assisted RAN Parameters Tuning
};
}
#endif
#include "HandoverRequestAck.hpp"
#include "TransportLayerAddress.hpp"
#include "String2Value.hpp"
#include "GTP-TEID.hpp"
extern "C" {
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "Ngap_GTPTunnel.h"
}
#include <iostream>
#include <vector>
using namespace std;
namespace ngap {
HandoverRequestAck::HandoverRequestAck()
{
amfUeNgapId = NULL;
ranUeNgapId = NULL;
pduSessionResourceAdmittedList = NULL;
PDUSessionResourceFailedToSetupList = NULL;
TargetToSource_TransparentContainer = NULL;
CriticalityDiagnostics = NULL;
}
HandoverRequestAck::~HandoverRequestAck() {}
unsigned long HandoverRequestAck::getAmfUeNgapId()
{
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
void HandoverRequestAck::setMessageType()
{
if (!handoverRequestAckPdu) handoverRequestAckPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
MessageType handoverRequestMessageTypeIE;
handoverRequestMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverResourceAllocation);
handoverRequestMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_initiatingMessage);
handoverRequestMessageTypeIE.setCriticality(Ngap_Criticality_reject);
handoverRequestMessageTypeIE.setValuePresent(Ngap_InitiatingMessage__value_PR_HandoverRequest);
if (handoverRequestMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverResourceAllocation && handoverRequestMessageTypeIE.getTypeOfMessage() == Ngap_NGAP_PDU_PR_initiatingMessage)
{
handoverRequestMessageTypeIE.encode2pdu(handoverRequestAckPdu);
handoverRequestAckIEs = &(handoverRequestAckPdu->choice.initiatingMessage->value.choice.HandoverRequestAcknowledge);
}
else
{
cout << "[warning] This information doesn't refer to HandoverRequest Message!!!" << endl;
}
}
uint32_t HandoverRequestAck::getRanUeNgapId()
{
return ranUeNgapId->getRanUeNgapId();
}
OCTET_STRING_t HandoverRequestAck::getTargetToSource_TransparentContainer()
{
return *TargetToSource_TransparentContainer;
}
bool HandoverRequestAck::getPDUSessionResourceAdmittedList(std::vector<PDUSessionResourceAdmittedItem_t> &list)
{
if (!pduSessionResourceAdmittedList) return false;
PDUSessionResourceAdmittedItem *m_pduSessionResourceAdmittedItem;
int num = 0;
pduSessionResourceAdmittedList->getPDUSessionResourceAdmittedList(m_pduSessionResourceAdmittedItem, num);
for (int i = 0; i < num; i++)
{
PDUSessionResourceAdmittedItem_t response;
PDUSessionID *m_pDUSessionID;
m_pduSessionResourceAdmittedItem[i].getPDUSessionResourceAdmittedItem(m_pDUSessionID, response.handoverRequestAcknowledgeTransfer);
m_pDUSessionID->getPDUSessionID(response.pduSessionId);
list.push_back(response);
}
return true;
}
bool HandoverRequestAck::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
handoverRequestAckPdu = ngap_msg_pdu;
if (handoverRequestAckPdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
{
if (handoverRequestAckPdu->choice.successfulOutcome && handoverRequestAckPdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_HandoverResourceAllocation && handoverRequestAckPdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && handoverRequestAckPdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge)
{
handoverRequestAckIEs = &handoverRequestAckPdu->choice.successfulOutcome->value.choice.HandoverRequestAcknowledge;
}
else
{
cout << "Check handoverRequestAck message error!!!" << endl;
return false;
}
}
else
{
cout << "handoverRequestAck MessageType error!!!" << endl;
return false;
}
for (int i = 0; i < handoverRequestAckIEs->protocolIEs.list.count; i++)
{
switch (handoverRequestAckIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
if (handoverRequestAckIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverRequestAckIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverRequestAckIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
if (handoverRequestAckIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverRequestAckIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverRequestAckIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList: {
if (handoverRequestAckIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverRequestAckIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList)
{
pduSessionResourceAdmittedList = new PDUSessionResourceAdmittedList();
if (!pduSessionResourceAdmittedList->decodefromPDUSessionResourceAdmittedList(&handoverRequestAckIEs->protocolIEs.list.array[i]->value.choice.PDUSessionResourceAdmittedList))
{
cout << "decoded ngap PDUSessionResourceAdmittedList IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap PDUSessionResourceAdmittedList Type IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer: {
if (handoverRequestAckIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequestAckIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer)
{
TargetToSource_TransparentContainer = new Ngap_TargetToSource_TransparentContainer_t();
*TargetToSource_TransparentContainer = handoverRequestAckIEs->protocolIEs.list.array[i]->value.choice.TargetToSource_TransparentContainer;
}
else
{
cout << "decoded ngap TargetToSource_TransparentContainer IE error" << endl;
return false;
}
}break;
default: {
cout << "decoded ngap message pdu error" << endl;
return false;
}
}
}
return true;
}
int HandoverRequestAck::encode2buffer(uint8_t *buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequestAckPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequestAckPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
/* void HandoverRequestAck::setMessageType()
{
if (!handoverRequestAckPdu) handoverRequestAckPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
MessageType HandoverRequestAckMessageTypeIE;
HandoverRequestAckMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverResourceAllocation);
HandoverRequestAckMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_successfulOutcome);
HandoverRequestAckMessageTypeIE.setCriticality(Ngap_Criticality_reject);
HandoverRequestAckMessageTypeIE.setValuePresent(Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge);
if (HandoverRequestAckMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverResourceAllocation && HandoverRequestAckMessageTypeIE.getTypeOfMessage() == Ngap_NGAP_PDU_PR_successfulOutcome)
{
HandoverRequestAckMessageTypeIE.encode2pdu(handoverRequestAckPdu);
handoverRequestAckIEs = &(handoverRequestAckPdu->choice.successfulOutcome->value.choice.HandoverRequestAcknowledge);
}
else
{
cout << "[warning] This information doesn't refer to HandoverRequestAcknowledge Message!!!" << endl;
}
}
*/
/* void HandoverRequestAck::setAmfUeNgapId(unsigned long id)
{
if (!amfUeNgapId)
amfUeNgapId = new AMF_UE_NGAP_ID();
amfUeNgapId->setAMF_UE_NGAP_ID(id);
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID;
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
if (!ret)
{
cout << "encode AMF_UE_NGAP_ID IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode AMF_UE_NGAP_ID IE error" << endl;
}
*/
/* void HandoverRequestAck::setRanUeNgapId(uint32_t ran_ue_ngap_id)
{
if (!ranUeNgapId)
ranUeNgapId = new RAN_UE_NGAP_ID();
ranUeNgapId->setRanUeNgapId(ran_ue_ngap_id);
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID;
int ret = ranUeNgapId->encode2RAN_UE_NGAP_ID(ie->value.choice.RAN_UE_NGAP_ID);
if (!ret)
{
cout << "encode RAN_UE_NGAP_ID IE error" << endl;
return;
}
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode RAN_UE_NGAP_ID IE error" << endl;
}
*/
/* void HandoverRequestAck::setPDUSessionResourceAdmittedList(std::vector<Ngap_PDUSessionResourceAdmittedItem_t> list)
{
if (!PDUSessionResourceAdmittedList)
PDUSessionResourceAdmittedList = new Ngap_PDUSessionResourceAdmittedList_t();
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
for (int i = 0; i < list.size(); i++)
{
Ngap_PDUSessionResourceAdmittedItem_t *item = (Ngap_PDUSessionResourceAdmittedItem_t *)calloc(1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
item->pDUSessionID = list[i].pDUSessionID;
Ngap_HandoverRequestAcknowledgeTransfer_t *handoverrequestacknowledgetransfer;
handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.present = Ngap_UPTransportLayerInformation_PR_gTPTunnel;
TransportLayerAddress transportlayeraddress;
transportlayeraddress.setTransportLayerAddress("127.0.1.1");
transportlayeraddress.encode2TransportLayerAddress((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation).choice.gTPTunnel->transportLayerAddress);
GtpTeid gtpteid;
gtpteid.setGtpTeid(159);
gtpteid.encode2GtpTeid((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.choice.gTPTunnel->gTP_TEID));
item->handoverRequestAcknowledgeTransfer = list[i].handoverRequestAcknowledgeTransfer;
int ret = ASN_SEQUENCE_ADD(&PDUSessionResourceAdmittedList->list, item);
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
}
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList;
ie->value.choice.PDUSessionResourceAdmittedList = *PDUSessionResourceAdmittedList;
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
}
*/
/* void HandoverRequestAck::setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource)
{
if (!TargetToSource_TransparentContainer)
TargetToSource_TransparentContainer = new Ngap_TargetToSource_TransparentContainer_t();
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer;
ie->value.choice.TargetToSource_TransparentContainer = targetTosource;
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode TargetToSource_TransparentContainer IE error" << endl;
}
*/
}
#ifndef _HANDOVERREQUESTACK_H_
#define _HANDOVERREQUESTACK_H_
#include "NgapIEsStruct.hpp"
#include "PDUSessionResourceAdmittedItem.hpp"
#include "PDUSessionResourceAdmittedList.hpp"
#include "MessageType.hpp"
#include "GlobalRanNodeId.hpp"
#include "RanNodeName.hpp"
#include "DefaultPagingDRX.hpp"
#include "SupportedTAList.hpp"
#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"
#include "Ngap_PDUSessionResourceAdmittedItem.h"
#include "Ngap_HandoverRequestAcknowledgeTransfer.h"
#include <netinet/in.h>
#include <arpa/inet.h>
}
namespace ngap {
class HandoverRequestAck {
public:
HandoverRequestAck();
virtual ~HandoverRequestAck();
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;(不存在)
void setMessageType(); //Initialize the PDU and populate the MessageType;
OCTET_STRING_t getTargetToSource_TransparentContainer();
bool getPDUSessionResourceAdmittedList(std::vector<PDUSessionResourceAdmittedItem_t>& list);
// void setMessageType(); //Initialize the PDU and populate the MessageType;
// void setAmfUeNgapId(unsigned long id);//40 bits
// void setRanUeNgapId(uint32_t id);// 32 bits
// void setPDUSessionResourceAdmittedList(std::vector<Ngap_PDUSessionResourceAdmittedItem_t> list);
// void setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource);
private:
Ngap_NGAP_PDU_t *handoverRequestAckPdu;
Ngap_HandoverRequestAcknowledge_t *handoverRequestAckIEs;
/***************** for decoding ****************/
AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId;
Ngap_HandoverType_t* handovertype;
PDUSessionResourceAdmittedList *pduSessionResourceAdmittedList;
Ngap_PDUSessionResourceFailedToSetupListHOAck_t *PDUSessionResourceFailedToSetupList;
Ngap_TargetToSource_TransparentContainer_t *TargetToSource_TransparentContainer;
Ngap_CriticalityDiagnostics_t *CriticalityDiagnostics;
};
}
#endif
#include "HandoverRequiredMsg.hpp"
extern "C"{
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "constraints.h"
}
#include "TAI.hpp"
#include <iostream>
#include <vector>
using namespace std;
namespace ngap{
HandoverRequiredMsg::HandoverRequiredMsg()
{
amfUeNgapId = NULL;
ranUeNgapId = NULL;
handovertype = NULL;
cause = NULL;
targetid = NULL;
directforwardingPathAvailability = NULL;
PDUSessionResourceList = NULL;
SourceToTarget_TransparentContainer = NULL;
}
HandoverRequiredMsg::~HandoverRequiredMsg() {}
unsigned long HandoverRequiredMsg::getAmfUeNgapId()
{
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
uint32_t HandoverRequiredMsg::getRanUeNgapId()
{
return ranUeNgapId->getRanUeNgapId();
}
Ngap_HandoverType_t HandoverRequiredMsg::getHandoverType()
{
return *handovertype;
}
Ngap_Cause_PR HandoverRequiredMsg::getChoiceOfCause()
{
return cause->getChoiceOfCause();
}
long HandoverRequiredMsg::getCauseValue()
{
return cause->getValue();
}
void HandoverRequiredMsg::getGlobalRanNodeId(GlobalgNBId *&ptr)
{
ptr->decodefromGlobalgNBId(targetid->choice.targetRANNodeID->globalRANNodeID.choice.globalGNB_ID);
}
void HandoverRequiredMsg::getTAI(TAI *&ptr)
{
ptr->decodefromTAI(&(targetid->choice.targetRANNodeID->selectedTAI));
}
OCTET_STRING_t HandoverRequiredMsg::getSourceToTarget_TransparentContainer()
{
return *SourceToTarget_TransparentContainer;
}
bool HandoverRequiredMsg::getPDUSessionResourceList(std::vector<PDUSessionResourceItem_t> &list)
{
if (!PDUSessionResourceList) return false;
PDUSessionResourceItemHORqd *m_pduSessionResourceItemHORqd;
int num = 0;
PDUSessionResourceList->getPDUSessionResourceListHORqd(m_pduSessionResourceItemHORqd, num);
for (int i = 0; i < num; i++)
{
PDUSessionResourceItem_t response;
PDUSessionID *m_pDUSessionID;
m_pduSessionResourceItemHORqd[i].getPDUSessionResourceItemHORqd(m_pDUSessionID, response.HandoverRequiredTransfer);
m_pDUSessionID->getPDUSessionID(response.pduSessionId);
list.push_back(response);
}
return true;
}
long HandoverRequiredMsg::getDirectForwardingPathAvailability()
{
return *directforwardingPathAvailability;
}
bool HandoverRequiredMsg::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
handoverRequiredPdu = ngap_msg_pdu;
if (handoverRequiredPdu->present == Ngap_NGAP_PDU_PR_initiatingMessage)
{
if (handoverRequiredPdu->choice.initiatingMessage && handoverRequiredPdu->choice.initiatingMessage->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverRequiredPdu->choice.initiatingMessage->criticality == Ngap_Criticality_reject && handoverRequiredPdu->choice.initiatingMessage->value.present == Ngap_InitiatingMessage__value_PR_HandoverRequired)
{
handoverRequiredIEs = &handoverRequiredPdu->choice.initiatingMessage->value.choice.HandoverRequired;
}
else
{
cout << "Check HandoverRequired message error!!!" << endl;
return false;
}
}
else
{
cout << "HandoverRequired MessageType error!!!" << endl;
return false;
}
for (int i = 0; i < handoverRequiredIEs->protocolIEs.list.count; i++)
{
switch (handoverRequiredIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_HandoverType: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_HandoverType)
{
handovertype = new Ngap_HandoverType_t();
*handovertype = handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.HandoverType;
}
else
{
cout << "decoded ngap Handover Type IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_Cause: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_Cause)
{
cause = new Cause();
if(!cause->decodefromCause(&handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.Cause))
{
cout << "decoded ngap Cause IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap Cause IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_TargetID: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_TargetID)
{
targetid = new Ngap_TargetID_t();
*targetid = handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.TargetID;
}
else
{
cout << "decoded ngap TargetID IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_DirectForwardingPathAvailability: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_DirectForwardingPathAvailability)
{
directforwardingPathAvailability = new Ngap_DirectForwardingPathAvailability_t();
*directforwardingPathAvailability = handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.DirectForwardingPathAvailability;
}
else
{
cout << "decoded ngap DirectForwardingPathAvailability IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceListHORqd: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_PDUSessionResourceListHORqd)
{
PDUSessionResourceList = new PDUSessionResourceListHORqd();
if (!PDUSessionResourceList->decodefromPDUSessionResourceListHORqd(&handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.PDUSessionResourceListHORqd))
{
cout << "decoded ngap PDUSessionResourceSetupListCxtRes IE error" << endl;
return false;
}
}
else
{
cout << "decoded ngap PDUSessionResourceListHORqd IE error" << endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer: {
if (handoverRequiredIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverRequiredIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverRequiredIEs__value_PR_SourceToTarget_TransparentContainer)
{
SourceToTarget_TransparentContainer = new Ngap_SourceToTarget_TransparentContainer_t();
*SourceToTarget_TransparentContainer = handoverRequiredIEs->protocolIEs.list.array[i]->value.choice.SourceToTarget_TransparentContainer;
}
else
{
cout << "decoded ngap SourceToTarget_TransparentContainer IE error" << endl;
return false;
}
}break;
default: {
cout << "decoded ngap message pdu error" << endl;
return false;
}
}
}
return true;
}
int HandoverRequiredMsg::encode2buffer(uint8_t *buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, handoverRequiredPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, handoverRequiredPdu, buf, buf_size);
cout << "er.encoded(" << er.encoded << ")" << endl;
return er.encoded;
}
}
#ifndef _HANDOVERREQUIRED_H_
#define _HANDOVERREQUIRED_H_
#include "NgapIEsStruct.hpp"
#include "MessageType.hpp"
#include "GlobalRanNodeId.hpp"
#include "RanNodeName.hpp"
#include "DefaultPagingDRX.hpp"
#include "SupportedTAList.hpp"
#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"
}
#include "TAI.hpp"
#include "NgapIEsStruct.hpp"
#include "PDUSessionResourceListHORqd.hpp"
namespace ngap{
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;(不存在)
uint32_t getRanUeNgapId();//return -1;(不存在)
Ngap_HandoverType_t getHandoverType();
Ngap_Cause_PR getChoiceOfCause();
long getCauseValue();
OCTET_STRING_t getSourceToTarget_TransparentContainer();
void getGlobalRanNodeId(GlobalgNBId *&ptr);
void getTAI(TAI *&ptr);
bool getPDUSessionResourceList(std::vector<PDUSessionResourceItem_t> &list);
long getDirectForwardingPathAvailability();
private:
Ngap_NGAP_PDU_t *handoverRequiredPdu;
Ngap_HandoverRequired_t *handoverRequiredIEs;
/***************** for decoding ****************/
AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId;
Ngap_HandoverType_t *handovertype;
Cause *cause;
Ngap_TargetID_t *targetid;
Ngap_DirectForwardingPathAvailability_t *directforwardingPathAvailability;
PDUSessionResourceListHORqd *PDUSessionResourceList;
Ngap_SourceToTarget_TransparentContainer_t *SourceToTarget_TransparentContainer;
};
}
#endif
#include "PduSessionResourceReleaseCommand.hpp"
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{
PduSessionResourceReleaseCommand::PduSessionResourceReleaseCommand()
{
pduSessionResourceReleaseCommandPdu = NULL;
pduSessionResourceReleaseCommandIEs = NULL;
amfUeNgapId = NULL;
ranUeNgapId = NULL;
pduSessionResourceReleaseCommandList = NULL;
}
PduSessionResourceReleaseCommand::~PduSessionResourceReleaseCommand(){}
void PduSessionResourceReleaseCommand::setMessageType()
{
if(!pduSessionResourceReleaseCommandPdu) pduSessionResourceReleaseCommandPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
MessageType pduSessionResourceToReleasePduTypeIE;
pduSessionResourceToReleasePduTypeIE.setProcedureCode(Ngap_ProcedureCode_id_PDUSessionResourceRelease);
pduSessionResourceToReleasePduTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_initiatingMessage);
pduSessionResourceToReleasePduTypeIE.setCriticality(Ngap_Criticality_reject);
pduSessionResourceToReleasePduTypeIE.setValuePresent(Ngap_InitiatingMessage__value_PR_PDUSessionResourceReleaseCommand);
if(pduSessionResourceToReleasePduTypeIE.getProcedureCode()== Ngap_ProcedureCode_id_PDUSessionResourceRelease && pduSessionResourceToReleasePduTypeIE.getTypeOfMessage()== Ngap_NGAP_PDU_PR_initiatingMessage && pduSessionResourceToReleasePduTypeIE.getCriticality()==Ngap_Criticality_reject)
{
pduSessionResourceToReleasePduTypeIE.encode2pdu(pduSessionResourceReleaseCommandPdu);
pduSessionResourceReleaseCommandIEs = &(pduSessionResourceReleaseCommandPdu->choice.initiatingMessage->value.choice.PDUSessionResourceReleaseCommand);
}
else
{
cout<<"[warning] This information doesn't refer to PDUSessionResourceSetupResponse Message!!!"<<endl;
}
}
void PduSessionResourceReleaseCommand::setAmfUeNgapId(unsigned long id)
{
if(!amfUeNgapId)
amfUeNgapId = new AMF_UE_NGAP_ID();
amfUeNgapId->setAMF_UE_NGAP_ID(id);
Ngap_PDUSessionResourceReleaseCommandIEs_t *ie = (Ngap_PDUSessionResourceReleaseCommandIEs_t *)calloc(1,sizeof(Ngap_PDUSessionResourceReleaseCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_AMF_UE_NGAP_ID;
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
if(!ret)
{
cout<<"encode AMF_UE_NGAP_ID IE error"<<endl;
return ;
}
ret = ASN_SEQUENCE_ADD(&pduSessionResourceReleaseCommandIEs->protocolIEs.list, ie);
if( ret != 0) cout<<"encode AMF_UE_NGAP_ID IE error"<<endl;
}
void PduSessionResourceReleaseCommand::setRanUeNgapId(uint32_t ran_ue_ngap_id)
{
if(!ranUeNgapId)
ranUeNgapId = new RAN_UE_NGAP_ID();
ranUeNgapId->setRanUeNgapId(ran_ue_ngap_id);
Ngap_PDUSessionResourceReleaseCommandIEs_t *ie = (Ngap_PDUSessionResourceReleaseCommandIEs_t *)calloc(1,sizeof(Ngap_PDUSessionResourceReleaseCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_RAN_UE_NGAP_ID;
int ret = ranUeNgapId->encode2RAN_UE_NGAP_ID(ie->value.choice.RAN_UE_NGAP_ID);
if(!ret)
{
cout<<"encode RAN_UE_NGAP_ID IE error"<<endl;
return ;
}
ret = ASN_SEQUENCE_ADD(&pduSessionResourceReleaseCommandIEs->protocolIEs.list, ie);
if( ret != 0) cout<<"encode RAN_UE_NGAP_ID IE error"<<endl;
}
void PduSessionResourceReleaseCommand::setPduSessionResourceToReleaseList(std::vector<PDUSessionResourceReleaseCommandItem_t>list)
{
if(!pduSessionResourceReleaseCommandList)
pduSessionResourceReleaseCommandList = new PDUSessionResourceReleaseListCmd();
PDUSessionResourceReleaseItemCmd * m_pduSessionResourceReleaseItemRelCmd = new PDUSessionResourceReleaseItemCmd[list.size()]();
for(int i=0;i<list.size();i++)
{
PDUSessionID * m_pDUSessionID = new PDUSessionID();
m_pDUSessionID->setPDUSessionID(list[i].pduSessionId);
m_pduSessionResourceReleaseItemRelCmd[i].setPDUSessionResourceReleaseItemCmd(m_pDUSessionID,list[i].pduSessionResourceReleaseCommandTransfer);
}
pduSessionResourceReleaseCommandList->setPDUSessionResourceReleaseListCmd(m_pduSessionResourceReleaseItemRelCmd, list.size());
Ngap_PDUSessionResourceReleaseCommandIEs_t *ie = (Ngap_PDUSessionResourceReleaseCommandIEs_t *)calloc(1,sizeof(Ngap_PDUSessionResourceReleaseCommandIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListRelCmd;
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_PDUSessionResourceToReleaseListRelCmd;
int ret = pduSessionResourceReleaseCommandList->encode2PDUSessionResourceReleaseListCmd(&ie->value.choice.PDUSessionResourceToReleaseListRelCmd);
if(!ret)
{
cout<<"encode PDUSessionResourceToReleaseListRelCmd IE error"<<endl;
return ;
}
ret = ASN_SEQUENCE_ADD(&pduSessionResourceReleaseCommandIEs->protocolIEs.list, ie);
if( ret != 0) cout<<"encode PDUSessionResourceToReleaseListRelCmd IE error"<<endl;
}
int PduSessionResourceReleaseCommand::encode2buffer(uint8_t *buf, int buf_size)
{
asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pduSessionResourceReleaseCommandPdu);
asn_enc_rval_t er = aper_encode_to_buffer(&asn_DEF_Ngap_NGAP_PDU, NULL, pduSessionResourceReleaseCommandPdu, buf, buf_size);
cout<<"er.encoded("<<er.encoded<<")"<<endl;
return er.encoded;
}
//Decapsulation
/*bool PduSessionResourceReleaseCommand::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
pduSessionResourceSetupResponsePdu = ngap_msg_pdu;
//asn_fprint(stderr, &asn_DEF_Ngap_NGAP_PDU, pduSessionResourceSetupResponsePdu);
if(pduSessionResourceSetupResponsePdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
{
if(pduSessionResourceSetupResponsePdu->choice.successfulOutcome && pduSessionResourceSetupResponsePdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_PDUSessionResourceSetup && pduSessionResourceSetupResponsePdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && pduSessionResourceSetupResponsePdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse)
{
pduSessionResourceSetupResponseIEs = &pduSessionResourceSetupResponsePdu->choice.successfulOutcome->value.choice.PDUSessionResourceSetupResponse;
}
else
{
cout<<"Check PDUSessionResourceSetupResponse message error!!!"<<endl;
return false;
}
}
else
{
cout<<"MessageType error!!!"<<endl;
return false;
}
for(int i=0; i< pduSessionResourceSetupResponseIEs->protocolIEs.list.count; i++)
{
switch(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->id)
{
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID:{
if(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.present == Ngap_PDUSessionResourceSetupResponseIEs__value_PR_AMF_UE_NGAP_ID)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
if(!amfUeNgapId->decodefromAMF_UE_NGAP_ID(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
{
cout<<"decoded ngap AMF_UE_NGAP_ID IE error"<<endl;
return false;
}
}
else
{
cout<<"decoded ngap AMF_UE_NGAP_ID IE error"<<endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID:{
if(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.present == Ngap_PDUSessionResourceSetupResponseIEs__value_PR_RAN_UE_NGAP_ID)
{
ranUeNgapId = new RAN_UE_NGAP_ID();
if(!ranUeNgapId->decodefromRAN_UE_NGAP_ID(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
{
cout<<"decoded ngap RAN_UE_NGAP_ID IE error"<<endl;
return false;
}
}
else
{
cout<<"decoded ngap RAN_UE_NGAP_ID IE error"<<endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceSetupListSURes:{
if(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.present == Ngap_PDUSessionResourceSetupResponseIEs__value_PR_PDUSessionResourceSetupListSURes)
{
pduSessionResourceSetupResponseList = new PDUSessionResourceSetupListSURes();
if(!pduSessionResourceSetupResponseList->decodefromPDUSessionResourceSetupListSURes(&pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.choice.PDUSessionResourceSetupListSURes))
{
cout<<"decoded ngap PDUSessionResourceSetupListSURes IE error"<<endl;
return false;
}
}
else
{
cout<<"decoded ngap PDUSessionResourceSetupListSURes IE error"<<endl;
return false;
}
}break;
case Ngap_ProtocolIE_ID_id_PDUSessionResourceFailedToSetupListSURes:{
if(pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.present == Ngap_PDUSessionResourceSetupResponseIEs__value_PR_PDUSessionResourceFailedToSetupListSURes)
{
pduSessionResourceFailedToSetupResponseList = new PDUSessionResourceFailedToSetupListSURes();
if(!pduSessionResourceFailedToSetupResponseList->decodefromPDUSessionResourceFailedToSetupListSURes(&pduSessionResourceSetupResponseIEs->protocolIEs.list.array[i]->value.choice.PDUSessionResourceFailedToSetupListSURes))
{
cout<<"decoded ngap PDUSessionResourceFailedToSetupListSURes IE error"<<endl;
return false;
}
}
else
{
cout<<"decoded ngap PDUSessionResourceFailedToSetupListSURes IE error!"<<endl;
return false;
}
}break;
default:{
cout<<"decoded ngap message pdu error"<<endl;
return false;
}
}
}
return true;
}*/
unsigned long PduSessionResourceReleaseCommand::getAmfUeNgapId()
{
if(!amfUeNgapId) return -1;
return amfUeNgapId->getAMF_UE_NGAP_ID();
}
uint32_t PduSessionResourceReleaseCommand::getRanUeNgapId()
{
if(!ranUeNgapId) return -1;
return ranUeNgapId->getRanUeNgapId();
}
/*bool PduSessionResourceReleaseCommand::getPduSessionResourceSetupResponseList(std::vector<PDUSessionResourceSetupResponseItem_t> &list)
{
if(!pduSessionResourceSetupResponseList) return false;
PDUSessionResourceSetupItemSURes *m_pduSessionResourceSetupItemSURes;
int num = 0;
pduSessionResourceSetupResponseList->getPDUSessionResourceSetupListSURes(m_pduSessionResourceSetupItemSURes,num);
for(int i=0;i<num;i++)
{
PDUSessionResourceSetupResponseItem_t response;
PDUSessionID *m_pDUSessionID;
m_pduSessionResourceSetupItemSURes[i].getPDUSessionResourceSetupItemSURes(m_pDUSessionID,response.pduSessionResourceSetupResponseTransfer);
m_pDUSessionID->getPDUSessionID(response.pduSessionId);
list.push_back(response);
}
return true;
}
*/
}
#ifndef _PDUSESSIONRESOURCERELEASECOMMAND_H_
#define _PDUSESSIONRESOURCERELEASECOMMAND_H_
#include "NgapIEsStruct.hpp"
#include "MessageType.hpp"
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "PDUSessionResourceReleaseListCmd.hpp"
extern "C"{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_PDUSessionResourceReleaseCommand.h"
}
namespace ngap{
class PduSessionResourceReleaseCommand {
public:
PduSessionResourceReleaseCommand();
virtual ~PduSessionResourceReleaseCommand();
void setMessageType();
void setAmfUeNgapId(unsigned long id);//40 bits
void setRanUeNgapId(uint32_t id);// 32 bits
void setPduSessionResourceToReleaseList(std::vector<PDUSessionResourceReleaseCommandItem_t>list);
int encode2buffer(uint8_t *buf, int buf_size);
//Decapsulation
bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
unsigned long getAmfUeNgapId();
uint32_t getRanUeNgapId();
bool getPduSessionResourceToReleaseList(std::vector<PDUSessionResourceReleaseCommandItem_t> &list);
private:
Ngap_NGAP_PDU_t * pduSessionResourceReleaseCommandPdu;
Ngap_PDUSessionResourceReleaseCommand_t *pduSessionResourceReleaseCommandIEs;
AMF_UE_NGAP_ID *amfUeNgapId;
RAN_UE_NGAP_ID *ranUeNgapId;
PDUSessionResourceReleaseListCmd *pduSessionResourceReleaseCommandList;
};
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment