Commit 3b439f04 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add IEs for PDUSessionResourceModifyRequest

parent 86f91a72
......@@ -55,7 +55,7 @@ bool NAS_PDU::decodefromoctetstring(Ngap_NAS_PDU_t& m_naspdu) {
}
//------------------------------------------------------------------------------
bool NAS_PDU::getNasPdu(uint8_t*& buffer, size_t& size) {
bool NAS_PDU::getNasPdu(uint8_t*& buffer, size_t& size) const {
buffer = (uint8_t*) naspdubuffer;
size = buffersize;
if (!naspdubuffer) return false;
......
......@@ -42,7 +42,7 @@ class NAS_PDU {
bool encode2octetstring(Ngap_NAS_PDU_t&);
bool decodefromoctetstring(Ngap_NAS_PDU_t&);
bool getNasPdu(uint8_t*& buffer, size_t& size);
bool getNasPdu(uint8_t*& buffer, size_t& size) const;
void setNasPdu(uint8_t* buffer, size_t size);
private:
......
/*
* 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
\date
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceModifyItemModReq.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceModifyItemModReq::PDUSessionResourceModifyItemModReq() {
nAS_PDU = nullptr;
}
//------------------------------------------------------------------------------
PDUSessionResourceModifyItemModReq::~PDUSessionResourceModifyItemModReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyItemModReq::setPDUSessionResourceModifyItemModReq(
const PDUSessionID& m_pDUSessionID, const NAS_PDU& m_nAS_PDU,
const OCTET_STRING_t m_pDUSessionResourceModifyRequestTransfer) {
pDUSessionID = m_pDUSessionID;
uint8_t* nas_buf = nullptr;
size_t nas_len = 0;
m_nAS_PDU.getNasPdu(nas_buf, nas_len);
if (!nAS_PDU) nAS_PDU = new NAS_PDU();
nAS_PDU->setNasPdu(nas_buf, nas_len);
pDUSessionResourceModifyRequestTransfer =
m_pDUSessionResourceModifyRequestTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyItemModReq::
encode2PDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq) {
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceModifyItemModReq.pDUSessionID))
return false;
if (nAS_PDU) {
pduSessionResourceModifyItemModReq.nAS_PDU =
(Ngap_NAS_PDU_t*) calloc(1, sizeof(Ngap_NAS_PDU_t));
if (!pduSessionResourceModifyItemModReq.nAS_PDU) return false;
if (!nAS_PDU->encode2octetstring(
*pduSessionResourceModifyItemModReq.nAS_PDU)) {
if (pduSessionResourceModifyItemModReq.nAS_PDU != nullptr)
free(pduSessionResourceModifyItemModReq.nAS_PDU);
return false;
}
}
pduSessionResourceModifyItemModReq.pDUSessionResourceModifyRequestTransfer =
pDUSessionResourceModifyRequestTransfer;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyItemModReq::
decodefromPDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq) {
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceModifyItemModReq.pDUSessionID))
return false;
if (pduSessionResourceModifyItemModReq.nAS_PDU) {
nAS_PDU = new NAS_PDU();
if (!nAS_PDU->decodefromoctetstring(
*pduSessionResourceModifyItemModReq.nAS_PDU))
return false;
}
pDUSessionResourceModifyRequestTransfer =
pduSessionResourceModifyItemModReq
.pDUSessionResourceModifyRequestTransfer;
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyItemModReq::getPDUSessionResourceModifyItemModReq(
PDUSessionID& m_pDUSessionID, NAS_PDU& m_nAS_PDU,
OCTET_STRING_t& m_pDUSessionResourceModifyRequestTransfer) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = *nAS_PDU;
m_pDUSessionResourceModifyRequestTransfer =
pDUSessionResourceModifyRequestTransfer;
}
} // 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
\date
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_MODIFY_ITEM_MOD_REQ_H_
#define _PDU_SESSION_RESOURCE_MODIFY_ITEM_MOD_REQ_H_
#include "NAS-PDU.hpp"
#include "PDUSessionID.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceModifyItemModReq.h"
}
namespace ngap {
class PDUSessionResourceModifyItemModReq {
public:
PDUSessionResourceModifyItemModReq();
virtual ~PDUSessionResourceModifyItemModReq();
void setPDUSessionResourceModifyItemModReq(
const PDUSessionID& m_pDUSessionID, const NAS_PDU& m_nAS_PDU,
const OCTET_STRING_t m_pDUSessionResourceModifyRequestTransfer);
void getPDUSessionResourceModifyItemModReq(
PDUSessionID& m_pDUSessionID, NAS_PDU& m_nAS_PDU,
OCTET_STRING_t& m_pDUSessionResourceModifyRequestTransfer);
bool encode2PDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq);
bool decodefromPDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq);
private:
PDUSessionID pDUSessionID;
NAS_PDU* nAS_PDU; // Optional
OCTET_STRING_t pDUSessionResourceModifyRequestTransfer;
};
} // namespace ngap
#endif
/*
* 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
\date
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceModifyListModReq.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceModifyListModReq::PDUSessionResourceModifyListModReq() {}
//------------------------------------------------------------------------------
PDUSessionResourceModifyListModReq::~PDUSessionResourceModifyListModReq() {}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyListModReq::setPDUSessionResourceModifyListModReq(
const std::vector<PDUSessionResourceModifyItemModReq>&
m_pduSessionResourceModifyListModReq) {
pduSessionResourceModifyListModReq = m_pduSessionResourceModifyListModReq;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyListModReq::
encode2PDUSessionResourceModifyListModReq(
// Ngap_PDUSessionResourceModifyListModReq_t*
// pduSessionResourceSetupListSUReq
Ngap_PDUSessionResourceModifyListModReq_t&
m_pduSessionResourceModifyListModReq) {
for (auto pdu : pduSessionResourceModifyListModReq) {
Ngap_PDUSessionResourceModifyItemModReq_t* request =
(Ngap_PDUSessionResourceModifyItemModReq_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceModifyItemModReq_t));
if (!request) return false;
if (!pdu.encode2PDUSessionResourceModifyItemModReq(*request)) return false;
if (ASN_SEQUENCE_ADD(&m_pduSessionResourceModifyListModReq.list, request) !=
0)
return false;
}
/*
for (int i = 0; i < numberofPDUSessions; i++) {
Ngap_PDUSessionResourceSetupItemSUReq_t* request =
(Ngap_PDUSessionResourceSetupItemSUReq_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceSetupItemSUReq_t));
if (!request) return false;
if (!pduSessionResourceModifyItemModReq[i]
.encode2PDUSessionResourceSetupItemSUReq(request))
return false;
if (ASN_SEQUENCE_ADD(&pduSessionResourceSetupListSUReq->list, request) != 0)
return false;
}
*/
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyListModReq::
decodefromPDUSessionResourceModifyListModReq(
Ngap_PDUSessionResourceModifyListModReq_t&
pduSessionResourceSetupListSUReq) {
uint32_t numberofPDUSessions = pduSessionResourceSetupListSUReq.list.count;
// pduSessionResourceModifyItemModReq = new PDUSessionResourceSetupItemSUReq
// [numberofPDUSessions]();
for (int i = 0; i < numberofPDUSessions; i++) {
PDUSessionResourceModifyItemModReq pduSessionResourceModifyItemModReq = {};
if (!pduSessionResourceModifyItemModReq
.decodefromPDUSessionResourceModifyItemModReq(
*pduSessionResourceSetupListSUReq.list.array[i]))
return false;
pduSessionResourceModifyListModReq.push_back(
pduSessionResourceModifyItemModReq);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyListModReq::getPDUSessionResourceModifyListModReq(
std::vector<PDUSessionResourceModifyItemModReq>&
m_pduSessionResourceModifyListModReq) {
m_pduSessionResourceModifyListModReq = pduSessionResourceModifyListModReq;
}
} // 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
\date
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_RESOURCE_MODIFY_LIST_MOD_REQ_H_
#define _PDU_SESSION_RESOURCE_MODIFY_LIST_MOD_REQ_H_
#include "PDUSessionResourceModifyItemModReq.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceModifyListModReq.h"
}
namespace ngap {
class PDUSessionResourceModifyListModReq {
public:
PDUSessionResourceModifyListModReq();
virtual ~PDUSessionResourceModifyListModReq();
void setPDUSessionResourceModifyListModReq(
const std::vector<PDUSessionResourceModifyItemModReq>&
m_pduSessionResourceModifyListModReq);
void getPDUSessionResourceModifyListModReq(
std::vector<PDUSessionResourceModifyItemModReq>&
m_pduSessionResourceModifyListModReq);
bool encode2PDUSessionResourceModifyListModReq(
Ngap_PDUSessionResourceModifyListModReq_t&
m_pduSessionResourceModifyListModReq);
bool decodefromPDUSessionResourceModifyListModReq(
Ngap_PDUSessionResourceModifyListModReq_t&
m_pduSessionResourceModifyListModReq);
private:
std::vector<PDUSessionResourceModifyItemModReq>
pduSessionResourceModifyListModReq;
};
} // namespace ngap
#endif
/*
* 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
\date 2021
\email: contact@openairinterface.org
*/
#ifndef PDU_SESSION_RESOURCE_MODIFY_REQUEST_H_
#define PDU_SESSION_RESOURCE_MODIFY_REQUEST_H_
#include "AMF-UE-NGAP-ID.hpp"
#include "MessageType.hpp"
#include "NAS-PDU.hpp"
#include "NgapIEsStruct.hpp"
#include "PDUSessionResourceModifyListModReq.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "RANPagingPriority.hpp"
extern "C" {
#include "Ngap_InitialContextSetupRequest.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
}
namespace ngap {
class PduSessionResourceModifyRequestMsg {
public:
PduSessionResourceModifyRequestMsg();
virtual ~PduSessionResourceModifyRequestMsg();
void setMessageType();
void setAmfUeNgapId(unsigned long id); // 40 bits
void setRanUeNgapId(uint32_t id); // 32 bits
void setRanPagingPriority(uint8_t priority);
void setNasPdu(uint8_t* nas, size_t sizeofnas);
void setPduSessionResourceSetupRequestList(
std::vector<PDUSessionResourceSetupRequestItem_t> list);
void setPduSessionAggregateMaximumBitRate(
long bit_rate_downlink, long bit_rate_uplink);
void setUEAggregateMaxBitRate(long bit_rate_downlink, long bit_rate_uplink);
int encode2buffer(uint8_t* buf, int buf_size);
void encode2buffer_new(char* buf, int& encoded_size);
bool decodefrompdu(Ngap_NGAP_PDU_t* ngap_msg_pdu);
unsigned long getAmfUeNgapId();
uint32_t getRanUeNgapId();
int getRanPagingPriority();
bool getNasPdu(uint8_t*& nas, size_t& sizeofnas);
bool getPduSessionResourceSetupRequestList(
std::vector<PDUSessionResourceSetupRequestItem_t>& list);
private:
Ngap_NGAP_PDU_t* pduSessionResourceSetupRequestPdu;
Ngap_PDUSessionResourceSetupRequest_t* pduSessionResourceSetupRequestIEs;
AMF_UE_NGAP_ID amfUeNgapId; // Mandatory
RAN_UE_NGAP_ID ranUeNgapId; // Mandatory
RANPagingPriority* ranPagingPriority; // Optional
PDUSessionResourceModifyListModReq* pduSessionResourceModifyListModReq;
};
} // namespace ngap
#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