Commit 2754a665 authored by Niuhaiwen's avatar Niuhaiwen

motify some trouble about handoverRequestAck Message Decode procedure

parent ebef4720
......@@ -45,8 +45,7 @@ PDUSessionResourceHandoverRequestAckTransfer::
(Ngap_HandoverRequestAcknowledgeTransfer_t *)calloc(
1, sizeof(Ngap_HandoverRequestAcknowledgeTransfer_t));
DL_NGU_UP_TNLInformation = NULL;
QosFlowSetupResponseItem = NULL;
numofitems = 0;
QosFlowSetupResponseList = NULL;
}
PDUSessionResourceHandoverRequestAckTransfer::
~PDUSessionResourceHandoverRequestAckTransfer() {}
......@@ -73,41 +72,46 @@ bool PDUSessionResourceHandoverRequestAckTransfer::
cout << "decoded ngap DL_NGU_UP_TNLInformation IE error" << endl;
return false;
}
numofitems = QosFlowSetupResponseList.list.count;
QosFlowSetupResponseItem = new QosFlowListWithDataForwarding[numofitems];
for (int i = 0; i < numofitems; i++) {
if (!QosFlowSetupResponseItem[i].decodeQosFlowListWithDataForwarding(
handoverRequestAcknowledegTransferIEs->qosFlowSetupResponseList.list
.array[i])) {
cout << "decoded ngap QosFlowSetupResponseList IE error" << endl;
return false;
}
QosFlowSetupResponseList = new QosFlowListWithDataForwarding;
if (!QosFlowSetupResponseList->decodeFormQosFlowListWithDataForwarding(
handoverRequestAcknowledegTransferIEs->qosFlowSetupResponseList)) {
cout << "decoded ngap QosFlowSetupResponseList IE error" << endl;
return false;
}
return true;
}
bool PDUSessionResourceHandoverRequestAckTransfer::
getUpTransportLayerInformation(GtpTunnel_t &upTnlInfo) {
if (!DL_NGU_UP_TNLInformation)
getUpTransportLayerInformation2(GtpTunnel_t *&upTnlInfo) {
if (!DL_NGU_UP_TNLInformation->decodefromUpTransportLayerInformation(
handoverRequestAcknowledegTransferIEs->dL_NGU_UP_TNLInformation))
return false;
TransportLayerAddress *m_transportLayerAddress;
GtpTeid *m_gtpTeid;
if (!DL_NGU_UP_TNLInformation->getUpTransportLayerInformation(
m_transportLayerAddress, m_gtpTeid))
return false;
if (!m_transportLayerAddress->getTransportLayerAddress(upTnlInfo.ip_address))
if (!m_transportLayerAddress->getTransportLayerAddress(upTnlInfo->ip_address))
return false;
if (!m_gtpTeid->getGtpTeid(upTnlInfo.gtp_teid))
if (!m_gtpTeid->getGtpTeid(upTnlInfo->gtp_teid))
return false;
return true;
}
bool PDUSessionResourceHandoverRequestAckTransfer::getqosFlowSetupResponseList(
QosFlowListWithDataForwarding *&m_items, int &m_numofitems) {
m_items = QosFlowSetupResponseItem;
m_numofitems = numofitems;
if (!QosFlowSetupResponseItem)
return false;
if (!numofitems)
std::vector<QosFlowLItemWithDataForwarding_t> &list) {
if (!QosFlowSetupResponseList)
return false;
QosFlowItemWithDataForWarding *m_qosflowitemwithdataforwarding;
int num = 0;
if (QosFlowSetupResponseList->getQosFlowListWithDataForwarding(
m_qosflowitemwithdataforwarding, num)) {
cout << "successful" << endl;
}
for (int i = 0; i < num; i++) {
QosFlowLItemWithDataForwarding_t response;
m_qosflowitemwithdataforwarding[i].getQosFlowItemWithDataForWarding(
response.qosFlowIdentifier);
list.push_back(response);
}
return true;
}
} // namespace ngap
\ No newline at end of file
} // namespace ngap
......@@ -43,17 +43,15 @@ public:
PDUSessionResourceHandoverRequestAckTransfer();
virtual ~PDUSessionResourceHandoverRequestAckTransfer();
bool decodefromHandoverRequestAckTransfer(uint8_t *buf, int buf_size);
bool getUpTransportLayerInformation(GtpTunnel_t &upTnlInfo);
bool getqosFlowSetupResponseList(QosFlowListWithDataForwarding *&m_items,
int &m_numofitems);
bool getUpTransportLayerInformation2(GtpTunnel_t *&upTnlInfo);
bool getqosFlowSetupResponseList(
std::vector<QosFlowLItemWithDataForwarding_t> &list);
private:
Ngap_HandoverRequestAcknowledgeTransfer_t
*handoverRequestAcknowledegTransferIEs;
UpTransportLayerInformation *DL_NGU_UP_TNLInformation;
Ngap_QosFlowSetupResponseListHOReqAck_t QosFlowSetupResponseList;
QosFlowListWithDataForwarding *QosFlowSetupResponseItem;
int numofitems;
QosFlowListWithDataForwarding *QosFlowSetupResponseList;
};
} // namespace ngap
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author niuxiansheng-niu, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "QosFlowItemWithDataForwarding.hpp"
#include <iostream>
using namespace std;
namespace ngap {
QosFlowItemWithDataForWarding::QosFlowItemWithDataForWarding() {
qosFlowIdentifier = NULL;
}
QosFlowItemWithDataForWarding::~QosFlowItemWithDataForWarding(){}
void QosFlowItemWithDataForWarding::getQosFlowItemWithDataForWarding(Ngap_QosFlowIdentifier_t m_QosFlowIdentifier) {
if (qosFlowIdentifier->getQosFlowIdentifier(value))
{
m_QosFlowIdentifier=(Ngap_QosFlowIdentifier_t)value;
}
}
bool QosFlowItemWithDataForWarding::decodeformQosFlowItemWithDataForWarding(Ngap_QosFlowSetupResponseItemHOReqAck_t* qosFlowItemWithDataForWarding) {
qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(&(qosFlowItemWithDataForWarding->qosFlowIdentifier)))
return false;
return true;
}
}
\ No newline at end of file
/*
* 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 niuxiansheng-niu, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _QOSFLOWITEMWITHDATAFORWARDING_H_
#define _QOSFLOWITEMWITHDATAFORWARDING_H_
#include "QosFlowLevelQosParameters.hpp"
#include "QosFlowIdentifier.hpp"
extern "C" {
#include "Ngap_QosFlowSetupResponseItemHOReqAck.h"
}
namespace ngap {
class QosFlowItemWithDataForWarding {
public:
QosFlowItemWithDataForWarding();
virtual ~QosFlowItemWithDataForWarding();
void getQosFlowItemWithDataForWarding(Ngap_QosFlowIdentifier_t m_QosFlowIdentifier);
bool decodeformQosFlowItemWithDataForWarding(Ngap_QosFlowSetupResponseItemHOReqAck_t* qosFlowItemWithDataForWarding);
private:
long value;
QosFlowIdentifier* qosFlowIdentifier;
};
}
#endif // !_QOSFLOWITEMWITHDATAFORWARDING_H_
......@@ -31,20 +31,28 @@
using namespace std;
namespace ngap {
QosFlowListWithDataForwarding::QosFlowListWithDataForwarding() {
qosFlowIdentifier = NULL;
qosFlowItemWithDataForwarding = NULL;
numofQosFlowItemWithDataForwarding = 0;
}
QosFlowListWithDataForwarding::~QosFlowListWithDataForwarding() {}
bool QosFlowListWithDataForwarding::decodeQosFlowListWithDataForwarding(
Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowSetupResponseList) {
qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(
&qosFlowSetupResponseList->qosFlowIdentifier))
return false;
bool QosFlowListWithDataForwarding::decodeFormQosFlowListWithDataForwarding(
Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList) {
numofQosFlowItemWithDataForwarding = qosFlowSetupResponseList.list.count;
qosFlowItemWithDataForwarding =
new QosFlowItemWithDataForWarding[numofQosFlowItemWithDataForwarding]();
for (int i = 0; i < numofQosFlowItemWithDataForwarding; i++) {
if (!qosFlowItemWithDataForwarding[i]
.decodeformQosFlowItemWithDataForWarding(
qosFlowSetupResponseList.list.array[i]))
return false;
}
return true;
}
bool QosFlowListWithDataForwarding::getQosFlowIdentifier(
QosFlowIdentifier *&m_qosFlowIdentifier) {
m_qosFlowIdentifier = qosFlowIdentifier;
bool QosFlowListWithDataForwarding::getQosFlowListWithDataForwarding(
QosFlowItemWithDataForWarding *m_QosFlowItemWithDataForwarding, int num) {
m_QosFlowItemWithDataForwarding = qosFlowItemWithDataForwarding;
num = numofQosFlowItemWithDataForwarding;
return true;
}
} // namespace ngap
} // namespace ngap
\ No newline at end of file
......@@ -29,10 +29,9 @@
#ifndef _QOSFLOWLISTWITHDATAFORWRADING_H_
#define _QOSFLOWLISTWITHDATAFORWRADING_H_
#include "QosFlowIdentifier.hpp"
#include "QosFlowItemWithDataForwarding.hpp"
#include "QosFlowLevelQosParameters.hpp"
extern "C" {
#include "Ngap_QosFlowSetupResponseItemHOReqAck.h"
#include "Ngap_QosFlowSetupResponseListHOReqAck.h"
}
namespace ngap {
......@@ -40,12 +39,15 @@ class QosFlowListWithDataForwarding {
public:
QosFlowListWithDataForwarding();
virtual ~QosFlowListWithDataForwarding();
bool decodeQosFlowListWithDataForwarding(
Ngap_QosFlowSetupResponseItemHOReqAck_t *qosFlowSetupResponseList);
bool getQosFlowIdentifier(QosFlowIdentifier *&m_qosFlowIdentifier);
bool getQosFlowListWithDataForwarding(
QosFlowItemWithDataForWarding *m_QosFlowItemWithDataForwarding, int num);
bool decodeFormQosFlowListWithDataForwarding(
Ngap_QosFlowSetupResponseListHOReqAck_t qosFlowSetupResponseList);
private:
QosFlowIdentifier *qosFlowIdentifier;
// QosFlowIdentifier *qosFlowIdentifier;
QosFlowItemWithDataForWarding *qosFlowItemWithDataForwarding;
int numofQosFlowItemWithDataForwarding;
};
} // namespace ngap
#endif
\ No newline at end of file
......@@ -83,7 +83,6 @@ bool HandoverRequestAck::getPDUSessionResourceAdmittedList(
m_pduSessionResourceAdmittedItem[i].getPDUSessionResourceAdmittedItem(
m_pDUSessionID, response.handoverRequestAcknowledgeTransfer);
m_pDUSessionID->getPDUSessionID(response.pduSessionId);
list.push_back(response);
}
......
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