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 {
namespace ngap{
typedef struct SliceSupportItem_s {
typedef struct SliceSupportItem_s{
std::string sst;
std::string sd;
} SliceSupportItem_t;
typedef struct PlmnSliceSupport_s {
}SliceSupportItem_t;
typedef struct PlmnSliceSupport_s{
std::string mcc;
std::string mnc;
std::vector<SliceSupportItem_t> slice_list;
} PlmnSliceSupport_t;
}PlmnSliceSupport_t;
typedef struct SupportedItem_s {
typedef struct SupportedItem_s{
uint32_t tac;
std::vector<PlmnSliceSupport_t> b_plmn_list;
} SupportedItem_t;
}SupportedItem_t;
typedef struct GuamiItem_s {
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;
std::string backupAMFName;//optional
}GuamiItem_t;
typedef struct NrCgi_s {
typedef struct NrCgi_s{
std::string mcc;
std::string mnc;
unsigned long nrCellID;
} NrCgi_t;
}NrCgi_t;
typedef struct Tai_s {
typedef struct Tai_s{
std::string mcc;
std::string mnc;
uint32_t tac :24;
} Tai_t;
uint32_t tac:24;
}Tai_t;
typedef struct Guami_s {
typedef struct Guami_s{
std::string mcc;
std::string mnc;
std::string regionID;
std::string AmfSetID;
std::string AmfPointer;
} Guami_t;
}Guami_t;
typedef struct {
typedef struct{
std::string sst;
std::string sd; //可选
} S_Nssai;
std::string sd;//可选
}S_Nssai;
typedef struct {
typedef struct{
uint8_t pduSessionId;
uint8_t *pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
} PDUSessionResourceSetupRequestItem_t;
}PDUSessionResourceSetupRequestItem_t;
typedef struct {
typedef struct{
std::string ip_address;
uint32_t gtp_teid;
} GtpTunnel_t;
}GtpTunnel_t;
typedef struct {
typedef struct{
long _5QI;
long *priorityLevelQos;
long *averagingWindow;
long *maximumDataBurstVolume;
} NonDynamic5QI_t;
}NonDynamic5QI_t;
typedef struct {
typedef struct{
long pERScalar;
long pERExponent;
} PacketErrorRate_t;
}PacketErrorRate_t;
typedef struct {
typedef struct{
long priorityLevelQos;
long packetDelayBudget;
PacketErrorRate_t packetErrorRate;
......@@ -127,20 +99,20 @@ typedef struct {
e_Ngap_DelayCritical *delayCritical;
long *averagingWindow;
long *maximumDataBurstVolume;
} Dynamic5QI_t;
}Dynamic5QI_t;
typedef struct {
typedef struct{
NonDynamic5QI_t *nonDy;
Dynamic5QI_t *dy;
} QosCharacteristics_t;
}QosCharacteristics_t;
typedef struct {
typedef struct{
long priorityLevelARP;
e_Ngap_Pre_emptionCapability pre_emptionCapability;
e_Ngap_Pre_emptionVulnerability pre_emptionVulnerability;
} AllocationAndRetentionPriority_t;
}AllocationAndRetentionPriority_t;
typedef struct {
typedef struct{
long maximumFlowBitRateDL;
long maximumFlowBitRateUL;
long guaranteedFlowBitRateDL;
......@@ -148,36 +120,57 @@ typedef struct {
e_Ngap_NotificationControl *notificationControl;
long *maximumPacketLossRateDL;
long *maximumPacketLossRateUL;
} GBR_QosInformation_t;
}GBR_QosInformation_t;
typedef struct {
typedef struct{
QosCharacteristics_t qosc;
AllocationAndRetentionPriority_t arp;
GBR_QosInformation_t *gbr_qos_info;
e_Ngap_ReflectiveQosAttribute *reflectiveQosAttribute;
e_Ngap_AdditionalQosFlowInformation *additionalQosFlowInformation;
} QosFlowLevelQosParameters_t;
}QosFlowLevelQosParameters_t;
typedef struct {
typedef struct{
long qos_flow_id;
QosFlowLevelQosParameters_t qflqp;
} QosFlowSetupReq_t;
}QosFlowSetupReq_t;
typedef struct {
typedef struct{
long qosFlowIdentifier;
e_Ngap_AssociatedQosFlowItem__qosFlowMappingIndication *qosFlowMappingIndication;
} AssociatedQosFlow_t;
}AssociatedQosFlow_t;
typedef struct {
typedef struct{
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupResponseTransfer;
} PDUSessionResourceSetupResponseItem_t;
}PDUSessionResourceSetupResponseItem_t;
typedef struct {
typedef struct{
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceSetupUnsuccessfulTransfer;
} PDUSessionResourceFailedToSetupItem_t;
}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
This diff is collapsed.
#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
This diff is collapsed.
#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
This diff is collapsed.
#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
This diff is collapsed.
#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