Commit bf70df85 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'pdu_session_resource_modify' into 'develop'

Pdu session resource modify

See merge request oai/cn5g/oai-cn5g-amf!59
parents 8b4d798a 092e65ab
......@@ -155,8 +155,8 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
protected_nas);
if (itti_msg.is_n2sm_set) {
// PDU Session Resource Release Command
if (itti_msg.n2sm_info_type.compare("PDU_RES_REL_CMD") == 0) {
// PDU SESSION RESOURCE RELEASE COMMAND
itti_pdu_session_resource_release_command* release_command =
new itti_pdu_session_resource_release_command(
TASK_AMF_N1, TASK_AMF_N2);
......@@ -174,6 +174,46 @@ void amf_n1::handle_itti_message(itti_downlink_nas_transfer& itti_msg) {
"Could not send ITTI message %s to task TASK_AMF_N2",
i->get_msg_name());
}
// PDU Session Resource Modify Request
} else if (itti_msg.n2sm_info_type.compare("PDU_RES_MOD_REQ") == 0) {
std::shared_ptr<itti_pdu_session_resource_modify_request>
itti_modify_request_msg =
std::make_shared<itti_pdu_session_resource_modify_request>(
TASK_AMF_N1, TASK_AMF_N2);
itti_modify_request_msg->nas = protected_nas;
itti_modify_request_msg->n2sm = itti_msg.n2sm;
itti_modify_request_msg->amf_ue_ngap_id = amf_ue_ngap_id;
itti_modify_request_msg->ran_ue_ngap_id = ran_ue_ngap_id;
itti_modify_request_msg->pdu_session_id = itti_msg.pdu_session_id;
// Get NSSAI
std::shared_ptr<nas_context> nc = {};
if (!is_amf_ue_id_2_nas_context(amf_ue_ngap_id)) {
Logger::amf_n1().warn(
"No existed NAS context for UE with amf_ue_ngap_id (0x%x)",
amf_ue_ngap_id);
return;
}
nc = amf_ue_id_2_nas_context(amf_ue_ngap_id);
std::shared_ptr<pdu_session_context> psc = {};
if (!amf_app_inst->find_pdu_session_context(
nc->imsi, itti_msg.pdu_session_id, psc)) {
Logger::amf_n1().error(
"Cannot get pdu_session_context with SUPI (%s)", nc->imsi.c_str());
return;
}
itti_modify_request_msg->s_NSSAI.setSd(psc->snssai.sD);
itti_modify_request_msg->s_NSSAI.setSst(std::to_string(psc->snssai.sST));
int ret = itti_inst->send_msg(itti_modify_request_msg);
if (0 != ret) {
Logger::amf_n1().error(
"Could not send ITTI message %s to task TASK_AMF_N2",
itti_modify_request_msg->get_msg_name());
}
} else {
string ue_context_key = "app_ue_ranid_" + to_string(ran_ue_ngap_id) +
":amfid_" + to_string(amf_ue_ngap_id);
......
......@@ -40,6 +40,7 @@
#include "PDUSessionResourceHandoverCommandTransfer.hpp"
#include "PduSessionResourceReleaseCommand.hpp"
#include "PduSessionResourceSetupRequest.hpp"
#include "PduSessionResourceModifyRequest.hpp"
#include "UEContextReleaseCommand.hpp"
#include "HandoverPreparationFailure.hpp"
#include "Paging.hpp"
......@@ -132,6 +133,13 @@ void amf_n2_task(void* args_p) {
dynamic_cast<itti_pdu_session_resource_setup_request*>(msg);
amf_n2_inst->handle_itti_message(ref(*m));
} break;
case PDU_SESSION_RESOURCE_MODIFY_REQUEST: {
Logger::amf_n2().info(
"Received PDU_SESSION_RESOURCE_MODIFY_REQUEST message, handling");
itti_pdu_session_resource_modify_request* m =
dynamic_cast<itti_pdu_session_resource_modify_request*>(msg);
amf_n2_inst->handle_itti_message(ref(*m));
} break;
case INITIAL_CONTEXT_SETUP_REQUEST: {
Logger::amf_n2().info(
"Encoding INITIAL CONTEXT SETUP REQUEST message, sending");
......@@ -1028,6 +1036,81 @@ void amf_n2::handle_itti_message(
free_wrapper((void**) &buffer);
}
//------------------------------------------------------------------------------
void amf_n2::handle_itti_message(
itti_pdu_session_resource_modify_request& itti_msg) {
Logger::amf_n2().debug("Handle PDU Session Resource Modify Request ...");
if (!amf_n2_inst->is_ran_ue_id_2_ue_ngap_context(itti_msg.ran_ue_ngap_id)) {
Logger::amf_n2().error(
"No UE NGAP context with ran_ue_ngap_id (%d)", itti_msg.ran_ue_ngap_id);
return;
}
std::shared_ptr<ue_ngap_context> unc = {};
unc = ran_ue_id_2_ue_ngap_context(itti_msg.ran_ue_ngap_id);
if (unc.get() == nullptr) {
Logger::amf_n2().error(
"Illegal UE with ran_ue_ngap_id (0x%x)", itti_msg.ran_ue_ngap_id);
return;
}
std::shared_ptr<gnb_context> gc = {};
if (!is_assoc_id_2_gnb_context(unc.get()->gnb_assoc_id)) {
Logger::amf_n2().error(
"No existing gNG context with assoc_id (%d)", unc.get()->gnb_assoc_id);
return;
}
gc = assoc_id_2_gnb_context(unc.get()->gnb_assoc_id);
if (gc.get() == nullptr) {
Logger::amf_n2().error(
"Illegal gNB with assoc id (0x%x)", unc.get()->gnb_assoc_id);
return;
}
std::unique_ptr<PduSessionResourceModifyRequestMsg> modify_request_msg =
std::make_unique<PduSessionResourceModifyRequestMsg>();
modify_request_msg->setAmfUeNgapId(itti_msg.amf_ue_ngap_id);
modify_request_msg->setRanUeNgapId(itti_msg.ran_ue_ngap_id);
std::vector<PDUSessionResourceModifyRequestItem_t> list;
PDUSessionResourceModifyRequestItem_t item = {};
item.pduSessionId = itti_msg.pdu_session_id;
item.pduSessionResourceModifyRequestTransfer.buf =
(uint8_t*) bdata(itti_msg.n2sm);
item.pduSessionResourceModifyRequestTransfer.size = blength(itti_msg.n2sm);
item.s_nssai.sd = itti_msg.s_NSSAI.getSd();
item.s_nssai.sst = itti_msg.s_NSSAI.getSst();
uint8_t* nas_pdu = (uint8_t*) calloc(1, blength(itti_msg.nas) + 1);
memcpy(nas_pdu, (uint8_t*) bdata(itti_msg.nas), blength(itti_msg.nas));
nas_pdu[blength(itti_msg.nas)] = '\0';
item.pduSessionNAS_PDU = nas_pdu;
item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas);
list.push_back(item);
modify_request_msg->setPduSessionResourceModifyRequestList(list);
size_t buffer_size = BUFFER_SIZE_512;
char* buffer = (char*) calloc(1, buffer_size);
int encoded_size = 0;
modify_request_msg->encode2buffer_new(buffer, encoded_size);
#if DEBUG_IS_ON
Logger::amf_n2().debug("N2 SM buffer data: ");
for (int i = 0; i < encoded_size; i++) printf("%02x ", (char) buffer[i]);
#endif
Logger::amf_n2().debug(" (%d bytes) \n", encoded_size);
bstring b = blk2bstr(buffer, encoded_size);
sctp_s_38412.sctp_send_msg(
gc.get()->sctp_assoc_id, unc.get()->sctp_stream_send, &b);
// free memory
free_wrapper((void**) &nas_pdu);
free_wrapper((void**) &buffer);
}
//------------------------------------------------------------------------------
void amf_n2::handle_itti_message(
itti_pdu_session_resource_release_command& itti_msg) {
......
......@@ -32,7 +32,6 @@
#include "DownlinkRANStatusTransfer.hpp"
#include "HandoverCommandMsg.hpp"
#include "HandoverRequest.hpp"
#include "PduSessionResourceReleaseCommand.hpp"
#include "amf.hpp"
#include "itti_msg_n2.hpp"
#include "ngap_app.hpp"
......@@ -53,11 +52,12 @@ class amf_n2 : public ngap::ngap_app {
void handle_itti_message(itti_dl_nas_transport& dl_nas_transport);
void handle_itti_message(itti_initial_context_setup_request& itti_msg);
void handle_itti_message(itti_pdu_session_resource_setup_request& itti_msg);
void handle_itti_message(itti_pdu_session_resource_modify_request& itti_msg);
void handle_itti_message(itti_pdu_session_resource_release_command& itti_msg);
void handle_itti_message(itti_ue_context_release_request& itti_msg);
void handle_itti_message(itti_ue_context_release_complete& itti_msg);
void handle_itti_message(itti_ue_radio_capability_indication& itti_msg);
void handle_itti_message(itti_ue_context_release_command& itti_msg);
void handle_itti_message(itti_pdu_session_resource_release_command& itti_msg);
bool handle_itti_message(itti_handover_required& itti_msg);
void handle_itti_message(itti_handover_request_Ack& itti_msg);
void handle_itti_message(itti_handover_notify& itti_msg);
......
......@@ -70,6 +70,7 @@ typedef enum {
ITTI_DL_NAS_TRANSPORT,
INITIAL_CONTEXT_SETUP_REQUEST,
PDU_SESSION_RESOURCE_SETUP_REQUEST,
PDU_SESSION_RESOURCE_MODIFY_REQUEST,
PDU_SESSION_RESOURCE_RELEASE_COMMAND,
UE_CONTEXT_RELEASE_REQUEST,
UE_CONTEXT_RELEASE_COMPLETE,
......
......@@ -67,9 +67,13 @@ class itti_n1n2_message_transfer_request : public itti_msg_amf_app {
itti_n1n2_message_transfer_request(
const task_id_t origin, const task_id_t destination)
: itti_msg_amf_app(N1N2_MESSAGE_TRANSFER_REQ, origin, destination) {
is_n2sm_set = false;
is_n1sm_set = false;
is_ppi_set = false;
is_n2sm_set = false;
is_n1sm_set = false;
is_ppi_set = false;
supi = {};
n2sm_info_type = {};
pdu_session_id = 0;
ppi = 0;
}
itti_n1n2_message_transfer_request(
const itti_n1n2_message_transfer_request& i)
......
......@@ -160,6 +160,22 @@ class itti_pdu_session_resource_setup_request : public itti_msg_n2 {
uint8_t pdu_session_id;
};
class itti_pdu_session_resource_modify_request : public itti_msg_n2 {
public:
itti_pdu_session_resource_modify_request(
const task_id_t origin, const task_id_t destination)
: itti_msg_n2(PDU_SESSION_RESOURCE_MODIFY_REQUEST, origin, destination) {}
itti_pdu_session_resource_modify_request(
const itti_pdu_session_resource_modify_request& i)
: itti_msg_n2(i) {}
bstring nas;
bstring n2sm;
uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id;
uint8_t pdu_session_id;
S_NSSAI s_NSSAI;
};
class itti_pdu_session_resource_release_command : public itti_msg_n2 {
public:
itti_pdu_session_resource_release_command(
......
......@@ -53,8 +53,8 @@ asn_TYPE_member_t asn_MBR_Ngap_PDUSessionResourceModifyItemModRes_1[] = {
0,
0, /* No default value */
"pDUSessionID"},
{ATF_POINTER,
2,
{ATF_NOFLAGS,
0,
offsetof(
struct Ngap_PDUSessionResourceModifyItemModRes,
pDUSessionResourceModifyResponseTransfer),
......@@ -80,8 +80,7 @@ asn_TYPE_member_t asn_MBR_Ngap_PDUSessionResourceModifyItemModRes_1[] = {
0, /* No default value */
"iE-Extensions"},
};
static const int asn_MAP_Ngap_PDUSessionResourceModifyItemModRes_oms_1[] = {1,
2};
static const int asn_MAP_Ngap_PDUSessionResourceModifyItemModRes_oms_1[] = {2};
static const ber_tlv_tag_t
asn_DEF_Ngap_PDUSessionResourceModifyItemModRes_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};
......@@ -100,7 +99,7 @@ asn_SEQUENCE_specifics_t
3, /* Count of tags in the map */
asn_MAP_Ngap_PDUSessionResourceModifyItemModRes_oms_1, /* Optional
members */
2,
1,
0, /* Root/Additions */
3, /* First extension addition */
};
......
......@@ -26,8 +26,8 @@ struct Ngap_ProtocolExtensionContainer;
/* Ngap_PDUSessionResourceModifyItemModRes */
typedef struct Ngap_PDUSessionResourceModifyItemModRes {
Ngap_PDUSessionID_t pDUSessionID;
OCTET_STRING_t* pDUSessionResourceModifyResponseTransfer; /* OPTIONAL */
struct Ngap_ProtocolExtensionContainer* iE_Extensions; /* OPTIONAL */
OCTET_STRING_t pDUSessionResourceModifyResponseTransfer;
struct Ngap_ProtocolExtensionContainer* iE_Extensions; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
......
......@@ -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:
......
......@@ -102,6 +102,20 @@ typedef struct {
OCTET_STRING_t pduSessionResourceSetupRequestTransfer;
} PDUSessionResourceSetupRequestItem_t;
typedef struct {
uint8_t pduSessionId;
uint8_t* pduSessionNAS_PDU;
size_t sizeofpduSessionNAS_PDU;
S_Nssai s_nssai;
OCTET_STRING_t pduSessionResourceModifyRequestTransfer;
} PDUSessionResourceModifyRequestItem_t;
typedef struct {
uint8_t pduSessionId;
OCTET_STRING_t pduSessionResourceModifyResponseTransfer;
OCTET_STRING_t pduSessionResourceModifyUnsuccessfulTransfer;
} PDUSessionResourceModifyResponseItem_t;
// section 9.2.1.3 PDU Session Resource Release Command (3GPP TS 38.413 V16.0.0
// (2019-12))
typedef struct {
......
/*
* 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,
const S_NSSAI& m_s_NSSAI) {
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;
s_NSSAI->setSd(m_s_NSSAI.getSd());
s_NSSAI->setSst(m_s_NSSAI.getSst());
}
//------------------------------------------------------------------------------
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,
S_NSSAI& m_s_NSSAI) {
m_pDUSessionID = pDUSessionID;
m_nAS_PDU = *nAS_PDU;
m_pDUSessionResourceModifyRequestTransfer =
pDUSessionResourceModifyRequestTransfer;
m_s_NSSAI = *s_NSSAI;
}
} // 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"
#include "S-NSSAI.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,
const S_NSSAI& m_s_NSSAI);
void getPDUSessionResourceModifyItemModReq(
PDUSessionID& m_pDUSessionID, NAS_PDU& m_nAS_PDU,
OCTET_STRING_t& m_pDUSessionResourceModifyRequestTransfer,
S_NSSAI& m_s_NSSAI);
bool encode2PDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq);
bool decodefromPDUSessionResourceModifyItemModReq(
Ngap_PDUSessionResourceModifyItemModReq_t&
pduSessionResourceModifyItemModReq);
private:
PDUSessionID pDUSessionID;
NAS_PDU* nAS_PDU; // Optional
OCTET_STRING_t pDUSessionResourceModifyRequestTransfer;
S_NSSAI* s_NSSAI; // Optional
};
} // 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 "PDUSessionResourceModifyItemModRes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceModifyItemModRes::PDUSessionResourceModifyItemModRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceModifyItemModRes::~PDUSessionResourceModifyItemModRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyItemModRes::setPDUSessionResourceModifyItemModRes(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t m_pDUSessionResourceModifyResponseTransfer) {
pDUSessionID = m_pDUSessionID;
pDUSessionResourceModifyResponseTransfer =
m_pDUSessionResourceModifyResponseTransfer;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyItemModRes::
encode2PDUSessionResourceModifyItemModRes(
Ngap_PDUSessionResourceModifyItemModRes_t&
pduSessionResourceModifyItemModReq) {
if (!pDUSessionID.encode2PDUSessionID(
pduSessionResourceModifyItemModReq.pDUSessionID))
return false;
pduSessionResourceModifyItemModReq.pDUSessionResourceModifyResponseTransfer =
pDUSessionResourceModifyResponseTransfer;
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyItemModRes::
decodefromPDUSessionResourceModifyItemModRes(
Ngap_PDUSessionResourceModifyItemModRes_t&
pduSessionResourceModifyItemModReq) {
if (!pDUSessionID.decodefromPDUSessionID(
pduSessionResourceModifyItemModReq.pDUSessionID))
return false;
pDUSessionResourceModifyResponseTransfer =
pduSessionResourceModifyItemModReq
.pDUSessionResourceModifyResponseTransfer;
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyItemModRes::getPDUSessionResourceModifyItemModRes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceModifyResponseTransfer) {
m_pDUSessionID = pDUSessionID;
m_pDUSessionResourceModifyResponseTransfer =
pDUSessionResourceModifyResponseTransfer;
}
} // 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_RES_H_
#define _PDU_SESSION_RESOURCE_MODIFY_ITEM_MOD_RES_H_
#include "NAS-PDU.hpp"
#include "PDUSessionID.hpp"
#include "S-NSSAI.hpp"
extern "C" {
#include "Ngap_PDUSessionResourceModifyItemModRes.h"
}
namespace ngap {
class PDUSessionResourceModifyItemModRes {
public:
PDUSessionResourceModifyItemModRes();
virtual ~PDUSessionResourceModifyItemModRes();
void setPDUSessionResourceModifyItemModRes(
const PDUSessionID& m_pDUSessionID,
const OCTET_STRING_t m_pDUSessionResourceModifyResponseTransfer);
void getPDUSessionResourceModifyItemModRes(
PDUSessionID& m_pDUSessionID,
OCTET_STRING_t& m_pDUSessionResourceModifyResponseTransfer);
bool encode2PDUSessionResourceModifyItemModRes(
Ngap_PDUSessionResourceModifyItemModRes_t&
pduSessionResourceModifyItemModRes);
bool decodefromPDUSessionResourceModifyItemModRes(
Ngap_PDUSessionResourceModifyItemModRes_t&
pduSessionResourceModifyItemModRes);
private:
PDUSessionID pDUSessionID;
OCTET_STRING_t pDUSessionResourceModifyResponseTransfer; // Optional
};
} // 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&
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;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyListModReq::
decodefromPDUSessionResourceModifyListModReq(
Ngap_PDUSessionResourceModifyListModReq_t&
pduSessionResourceSetupListSUReq) {
uint32_t numberofPDUSessions = pduSessionResourceSetupListSUReq.list.count;
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
\email: contact@openairinterface.org
*/
#include "PDUSessionResourceModifyListModRes.hpp"
#include <iostream>
using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
PDUSessionResourceModifyListModRes::PDUSessionResourceModifyListModRes() {}
//------------------------------------------------------------------------------
PDUSessionResourceModifyListModRes::~PDUSessionResourceModifyListModRes() {}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyListModRes::setPDUSessionResourceModifyListModRes(
const std::vector<PDUSessionResourceModifyItemModRes>&
m_pduSessionResourceModifyListModRes) {
pduSessionResourceModifyListModRes = m_pduSessionResourceModifyListModRes;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyListModRes::
encode2PDUSessionResourceModifyListModRes(
Ngap_PDUSessionResourceModifyListModRes_t&
m_pduSessionResourceModifyListModRes) {
for (auto pdu : pduSessionResourceModifyListModRes) {
Ngap_PDUSessionResourceModifyItemModRes_t* request =
(Ngap_PDUSessionResourceModifyItemModRes_t*) calloc(
1, sizeof(Ngap_PDUSessionResourceModifyItemModRes_t));
if (!request) return false;
if (!pdu.encode2PDUSessionResourceModifyItemModRes(*request)) return false;
if (ASN_SEQUENCE_ADD(&m_pduSessionResourceModifyListModRes.list, request) !=
0)
return false;
}
return true;
}
//------------------------------------------------------------------------------
bool PDUSessionResourceModifyListModRes::
decodefromPDUSessionResourceModifyListModRes(
Ngap_PDUSessionResourceModifyListModRes_t&
pduSessionResourceSetupListSURes) {
uint32_t numberofPDUSessions = pduSessionResourceSetupListSURes.list.count;
for (int i = 0; i < numberofPDUSessions; i++) {
PDUSessionResourceModifyItemModRes pduSessionResourceModifyItemModRes = {};
if (!pduSessionResourceModifyItemModRes
.decodefromPDUSessionResourceModifyItemModRes(
*pduSessionResourceSetupListSURes.list.array[i]))
return false;
pduSessionResourceModifyListModRes.push_back(
pduSessionResourceModifyItemModRes);
}
return true;
}
//------------------------------------------------------------------------------
void PDUSessionResourceModifyListModRes::getPDUSessionResourceModifyListModRes(
std::vector<PDUSessionResourceModifyItemModRes>&
m_pduSessionResourceModifyListModRes) {
m_pduSessionResourceModifyListModRes = pduSessionResourceModifyListModRes;
}
} // 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_RES_H_
#define _PDU_SESSION_RESOURCE_MODIFY_LIST_MOD_RES_H_
#include "PDUSessionResourceModifyItemModRes.hpp"
#include <vector>
extern "C" {
#include "Ngap_PDUSessionResourceModifyListModRes.h"
}
namespace ngap {
class PDUSessionResourceModifyListModRes {
public:
PDUSessionResourceModifyListModRes();
virtual ~PDUSessionResourceModifyListModRes();
void setPDUSessionResourceModifyListModRes(
const std::vector<PDUSessionResourceModifyItemModRes>&
m_pduSessionResourceModifyListModRes);
void getPDUSessionResourceModifyListModRes(
std::vector<PDUSessionResourceModifyItemModRes>&
m_pduSessionResourceModifyListModRes);
bool encode2PDUSessionResourceModifyListModRes(
Ngap_PDUSessionResourceModifyListModRes_t&
m_pduSessionResourceModifyListModRes);
bool decodefromPDUSessionResourceModifyListModRes(
Ngap_PDUSessionResourceModifyListModRes_t&
m_pduSessionResourceModifyListModRes);
private:
std::vector<PDUSessionResourceModifyItemModRes>
pduSessionResourceModifyListModRes;
};
} // namespace ngap
#endif
......@@ -86,10 +86,15 @@ void S_NSSAI::setSst(const std::string charSst) {
}
//------------------------------------------------------------------------------
void S_NSSAI::getSst(std::string& charSst) {
void S_NSSAI::getSst(std::string& charSst) const {
charSst = to_string((int) sst);
}
//------------------------------------------------------------------------------
std::string S_NSSAI::getSst() const {
return to_string((int) sst);
}
//------------------------------------------------------------------------------
void S_NSSAI::setSd(const std::string charSd) {
sdIsSet = true;
......@@ -97,7 +102,7 @@ void S_NSSAI::setSd(const std::string charSd) {
}
//------------------------------------------------------------------------------
bool S_NSSAI::getSd(std::string& s_nssaiSd) {
bool S_NSSAI::getSd(std::string& s_nssaiSd) const {
if (sdIsSet) {
s_nssaiSd = to_string(sd);
} else
......@@ -106,6 +111,13 @@ bool S_NSSAI::getSd(std::string& s_nssaiSd) {
return sdIsSet;
}
//------------------------------------------------------------------------------
std::string S_NSSAI::getSd() const {
if (sdIsSet) {
return to_string(sd);
} else
return "None";
}
//------------------------------------------------------------------------------
bool S_NSSAI::encode2S_NSSAI(Ngap_S_NSSAI_t* s_NSSAI) {
if (!sSTEncode2OctetString(s_NSSAI->sST)) return false;
......
......@@ -48,14 +48,16 @@ class S_NSSAI {
bool sDEncode2OctetString(Ngap_SD_t*);
bool sDdecodefromOctetString(Ngap_SD_t*);
void setSst(const std::string charSst);
void getSst(std::string& charSst);
void getSst(std::string& charSst) const;
std::string getSst() const;
void setSd(const std::string charSd);
bool getSd(std::string& s_nssaiSd);
bool getSd(std::string& s_nssaiSd) const;
std::string getSd() const;
bool encode2S_NSSAI(Ngap_S_NSSAI_t*);
bool decodefromS_NSSAI(Ngap_S_NSSAI_t*);
private:
uint8_t sst; // mandotory OCTET_STRING(SIZE(1))
uint8_t sst; // mandatory OCTET_STRING(SIZE(1))
uint32_t sd; // OCTET_STRING(SIZE(3))
bool sdIsSet;
};
......
This diff is collapsed.
/*
* 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 "NgapIEsStruct.hpp"
#include "PDUSessionResourceModifyListModReq.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "RANPagingPriority.hpp"
extern "C" {
#include "Ngap_InitialContextSetupRequest.h"
#include "Ngap_PDUSessionResourceModifyRequest.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 setPduSessionResourceModifyRequestList(
std::vector<PDUSessionResourceModifyRequestItem_t> list);
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 getPduSessionResourceModifyRequestList(
std::vector<PDUSessionResourceModifyRequestItem_t>& list);
private:
Ngap_NGAP_PDU_t* pduSessionResourceModifyRequestPdu;
Ngap_PDUSessionResourceModifyRequest_t* pduSessionResourceModifyRequestIEs;
AMF_UE_NGAP_ID amfUeNgapId; // Mandatory
RAN_UE_NGAP_ID ranUeNgapId; // Mandatory
RANPagingPriority* ranPagingPriority; // Optional
PDUSessionResourceModifyListModReq* pduSessionResourceModifyList;
};
} // namespace ngap
#endif
This diff is collapsed.
/*
* 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_RESPONSE_H_
#define PDU_SESSION_RESOURCE_MODIFY_RESPONSE_H_
#include "AMF-UE-NGAP-ID.hpp"
#include "MessageType.hpp"
#include "NgapIEsStruct.hpp"
#include "PDUSessionResourceModifyListModRes.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "RANPagingPriority.hpp"
extern "C" {
#include "Ngap_InitialContextSetupRequest.h"
#include "Ngap_PDUSessionResourceModifyResponse.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
}
namespace ngap {
class PduSessionResourceModifyResponseMsg {
public:
PduSessionResourceModifyResponseMsg();
virtual ~PduSessionResourceModifyResponseMsg();
void setMessageType();
void setAmfUeNgapId(unsigned long id); // 40 bits
void setRanUeNgapId(uint32_t id); // 32 bits
void setPduSessionResourceModifyResponseList(
std::vector<PDUSessionResourceModifyResponseItem_t> list);
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();
bool getPduSessionResourceModifyResponseList(
std::vector<PDUSessionResourceModifyResponseItem_t>& list);
private:
Ngap_NGAP_PDU_t* pduSessionResourceModifyResponsePdu;
Ngap_PDUSessionResourceModifyResponse_t* pduSessionResourceModifyResponseIEs;
AMF_UE_NGAP_ID amfUeNgapId; // Mandatory
RAN_UE_NGAP_ID ranUeNgapId; // Mandatory
PDUSessionResourceModifyListModRes pduSessionResourceModifyList; // Mandatory
// PDUSessionResourceFailedToModifyListModRes*
// pduSessionResourceFailedToModifyListModRes;
};
} // namespace ngap
#endif
......@@ -35,6 +35,7 @@
#include "PDUSessionResourceSetupUnsuccessfulTransfer.hpp"
#include "PduSessionResourceReleaseResponse.hpp"
#include "PduSessionResourceSetupResponse.hpp"
#include "PduSessionResourceModifyResponse.hpp"
#include "amf_app.hpp"
#include "amf_n1.hpp"
#include "amf_n11.hpp"
......@@ -284,6 +285,7 @@ int ngap_amf_handle_ue_context_release_complete(
return 0;
}
//------------------------------------------------------------------------------
int ngap_amf_handle_pdu_session_resource_release_response(
const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream,
struct Ngap_NGAP_PDU* message_p) {
......@@ -466,6 +468,64 @@ int ngap_amf_handle_pdu_session_resource_setup_response(
return 0;
}
//------------------------------------------------------------------------------
int ngap_amf_handle_pdu_session_resource_modify_response(
const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream,
struct Ngap_NGAP_PDU* message_p) {
Logger::ngap().debug("Handle PDU Session Resource Modify Response");
std::unique_ptr<PduSessionResourceModifyResponseMsg> response_msg =
std::make_unique<PduSessionResourceModifyResponseMsg>();
if (!response_msg->decodefrompdu(message_p)) {
Logger::ngap().error(
"Decoding PduSessionResourceModifyResponseMsg message error");
return -1;
}
// Transfer pduSessionResourceModifyResponseTransfer to SMF
std::vector<PDUSessionResourceModifyResponseItem_t> list;
if (!response_msg->getPduSessionResourceModifyResponseList(list)) {
Logger::ngap().error(
"Decoding PduSessionResourceModifyResponseMsg "
"getPduSessionResourceModifyResponseList IE error");
return -1;
}
for (auto response_item : list) {
uint8_t buf[BUFFER_SIZE_512];
memcpy(
buf, response_item.pduSessionResourceModifyResponseTransfer.buf,
response_item.pduSessionResourceModifyResponseTransfer.size);
bstring n2sm = blk2bstr(
buf, response_item.pduSessionResourceModifyResponseTransfer.size);
Logger::ngap().debug(
"Sending ITTI PDUSessionResourceModifyResponseTransfer to "
"TASK_AMF_N11");
std::shared_ptr<itti_nsmf_pdusession_update_sm_context> itti_msg =
std::make_shared<itti_nsmf_pdusession_update_sm_context>(
TASK_NGAP, TASK_AMF_N11);
itti_msg->pdu_session_id = response_item.pduSessionId;
itti_msg->n2sm = n2sm;
itti_msg->is_n2sm_set = true;
itti_msg->n2sm_info_type = "PDU_RES_MOD_RSP";
itti_msg->amf_ue_ngap_id = response_msg->getAmfUeNgapId();
itti_msg->ran_ue_ngap_id = response_msg->getRanUeNgapId();
int ret = itti_inst->send_msg(itti_msg);
if (0 != ret) {
Logger::ngap().error(
"Could not send ITTI message %s to task TASK_AMF_N11",
itti_msg->get_msg_name());
}
}
// TODO:for PDUSessionResourceFailedToModifyListModRes
// TODO: process User Location Information if available
return 0;
}
//------------------------------------------------------------------------------
int ngap_amf_handle_error_indication(
const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream,
......@@ -735,15 +795,6 @@ int ngap_amf_handle_path_switch_request(
return 0;
}
//------------------------------------------------------------------------------
int pdu_session_resource_modify(
const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream,
struct Ngap_NGAP_PDU* message_p) {
Logger::ngap().debug(
"Sending ITTI PDU Session Resource Modify to TASK_AMF_N2");
return 0;
}
//------------------------------------------------------------------------------
int pdu_session_resource_modify_indication(
const sctp_assoc_id_t assoc_id, const sctp_stream_id_t stream,
......@@ -970,8 +1021,8 @@ ngap_message_decoded_callback messages_callback[][3] = {
{paging, paging, paging}, /*Paging*/
{ngap_amf_handle_path_switch_request, ngap_amf_handle_path_switch_request,
ngap_amf_handle_path_switch_request}, /*PathSwitchRequest*/
{pdu_session_resource_modify, pdu_session_resource_modify,
pdu_session_resource_modify}, /*PDUSessionResourceModify*/
{0, ngap_amf_handle_pdu_session_resource_modify_response,
0}, /*PDUSessionResourceModify*/
{pdu_session_resource_modify_indication,
pdu_session_resource_modify_indication,
pdu_session_resource_modify_indication}, /*PDUSessionResourceModifyIndication*/
......
......@@ -112,6 +112,11 @@ void N1N2MessageCollectionDocumentApiImpl::n1_n2_message_transfer(
itti_msg->is_n2sm_set = true;
itti_msg->pdu_session_id =
(uint8_t) n1N2MessageTransferReqData.getPduSessionId();
itti_msg->n2sm_info_type = n1N2MessageTransferReqData.getN2InfoContainer()
.getSmInfo()
.getN2InfoContent()
.getNgapIeType()
.get_value();
// For Paging
if (n1N2MessageTransferReqData.ppiIsSet()) {
......
......@@ -25,11 +25,22 @@ void NgapIeType::validate() {
// TODO: implement validation
}
std::string NgapIeType::get_value() const {
return value;
}
void NgapIeType::set_value(std::string v) {
value = v;
}
void to_json(nlohmann::json& j, const NgapIeType& o) {
j = nlohmann::json();
j = o.get_value();
}
void from_json(const nlohmann::json& j, NgapIeType& o) {}
void from_json(const nlohmann::json& j, NgapIeType& o) {
o.set_value(j.get<std::string>());
}
} // namespace model
} // namespace amf
......
......@@ -35,6 +35,8 @@ class NgapIeType {
void validate();
std::string get_value() const;
void set_value(std::string v);
/////////////////////////////////////////////
/// NgapIeType members
......@@ -42,6 +44,7 @@ class NgapIeType {
friend void from_json(const nlohmann::json& j, NgapIeType& o);
protected:
std::string value;
};
} // namespace model
......
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