Merge branch 'develop_SA_SIM' into develop_SA_L3
Conflicts: openair2/RRC/NR/nr_rrc_proto.h openair2/RRC/NR/rrc_gNB.c openair2/RRC/NR_UE/rrc_UE.c openair2/RRC/NR_UE/rrc_defs.h openair3/NGAP/ngap_gNB_nas_procedures.c
This commit is contained in:
@@ -48,6 +48,7 @@ typedef enum {
|
|||||||
MSC_MAC_ENB,
|
MSC_MAC_ENB,
|
||||||
MSC_RLC_ENB,
|
MSC_RLC_ENB,
|
||||||
MSC_PDCP_ENB,
|
MSC_PDCP_ENB,
|
||||||
|
MSC_PDCP_GNB,
|
||||||
MSC_RRC_ENB,
|
MSC_RRC_ENB,
|
||||||
MSC_RRC_GNB,
|
MSC_RRC_GNB,
|
||||||
MSC_IP_ENB,
|
MSC_IP_ENB,
|
||||||
|
|||||||
@@ -30,4 +30,7 @@ MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_dat
|
|||||||
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
|
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
|
||||||
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
|
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
|
||||||
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
|
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
|
||||||
|
|
||||||
|
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
|
||||||
|
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
|
||||||
MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
|
MESSAGE_DEF(GTPV1U_GNB_NG_REQ, MESSAGE_PRIORITY_MED, Gtpv1uNGReq, gtpv1uNGReq)
|
||||||
|
|||||||
@@ -40,7 +40,10 @@
|
|||||||
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
|
#define GTPV1U_ENB_END_MARKER_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uEndMarkerInd
|
||||||
|
|
||||||
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
|
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
|
||||||
#define GTPV1U_GNB_NG_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uNGReq
|
|
||||||
|
#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
|
||||||
|
#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
|
||||||
|
#define GTPV1U_GNB_NG_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uNGReq
|
||||||
|
|
||||||
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
||||||
|
|
||||||
@@ -195,4 +198,16 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s {
|
|||||||
transport_layer_addr_t gnb_addr;
|
transport_layer_addr_t gnb_addr;
|
||||||
} gtpv1u_gnb_create_tunnel_resp_t;
|
} gtpv1u_gnb_create_tunnel_resp_t;
|
||||||
|
|
||||||
|
typedef struct gtpv1u_gnb_delete_tunnel_req_s {
|
||||||
|
rnti_t rnti;
|
||||||
|
uint8_t num_pdusession;
|
||||||
|
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
|
||||||
|
} gtpv1u_gnb_delete_tunnel_req_t;
|
||||||
|
|
||||||
|
typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
|
||||||
|
rnti_t rnti;
|
||||||
|
uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0)
|
||||||
|
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
|
||||||
|
} gtpv1u_gnb_delete_tunnel_resp_t;
|
||||||
|
|
||||||
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
||||||
|
|||||||
@@ -741,6 +741,10 @@ typedef struct ngap_ue_release_command_s {
|
|||||||
typedef struct pdusession_release_s {
|
typedef struct pdusession_release_s {
|
||||||
/* Unique pdusession_id for the UE. */
|
/* Unique pdusession_id for the UE. */
|
||||||
uint8_t pdusession_id;
|
uint8_t pdusession_id;
|
||||||
|
/* Octet string data */
|
||||||
|
uint8_t *transfer_buffer;
|
||||||
|
/* Length of the octet string */
|
||||||
|
uint32_t transfer_length;
|
||||||
} pdusession_release_t;
|
} pdusession_release_t;
|
||||||
|
|
||||||
typedef struct ngap_ue_release_req_s {
|
typedef struct ngap_ue_release_req_s {
|
||||||
|
|||||||
@@ -523,6 +523,7 @@ typedef struct gNB_MAC_INST_s {
|
|||||||
|
|
||||||
/// UL handle
|
/// UL handle
|
||||||
uint32_t ul_handle;
|
uint32_t ul_handle;
|
||||||
|
UE_info_t UE_info;
|
||||||
|
|
||||||
// MAC function execution peformance profiler
|
// MAC function execution peformance profiler
|
||||||
/// processing time of eNB scheduler
|
/// processing time of eNB scheduler
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
#include "NR_RRCReconfigurationComplete.h"
|
#include "NR_RRCReconfigurationComplete.h"
|
||||||
#include "NR_RRCReconfigurationComplete-IEs.h"
|
#include "NR_RRCReconfigurationComplete-IEs.h"
|
||||||
#include "NR_DLInformationTransfer.h"
|
#include "NR_DLInformationTransfer.h"
|
||||||
|
#include "NR_RRCReestablishmentRequest.h"
|
||||||
#if defined(NR_Rel16)
|
#if defined(NR_Rel16)
|
||||||
#include "NR_SCS-SpecificCarrier.h"
|
#include "NR_SCS-SpecificCarrier.h"
|
||||||
#include "NR_TDD-UL-DL-ConfigCommon.h"
|
#include "NR_TDD-UL-DL-ConfigCommon.h"
|
||||||
@@ -652,7 +653,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
|
|||||||
int CC_id,
|
int CC_id,
|
||||||
uint8_t *const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t transaction_id,
|
const uint8_t transaction_id,
|
||||||
NR_SRB_ToAddModList_t *SRB_configList)
|
NR_SRB_ToAddModList_t **SRB_configList)
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
asn_enc_rval_t enc_rval;;
|
asn_enc_rval_t enc_rval;;
|
||||||
@@ -684,19 +685,19 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
|
|||||||
|
|
||||||
/****************************** radioBearerConfig ******************************/
|
/****************************** radioBearerConfig ******************************/
|
||||||
/* Configure SRB1 */
|
/* Configure SRB1 */
|
||||||
if (SRB_configList) {
|
if (*SRB_configList) {
|
||||||
free(SRB_configList);
|
free(*SRB_configList);
|
||||||
}
|
}
|
||||||
|
|
||||||
SRB_configList = calloc(1, sizeof(NR_SRB_ToAddModList_t));
|
*SRB_configList = calloc(1, sizeof(NR_SRB_ToAddModList_t));
|
||||||
// SRB1
|
// SRB1
|
||||||
/* TODO */
|
/* TODO */
|
||||||
SRB1_config = calloc(1, sizeof(NR_SRB_ToAddMod_t));
|
SRB1_config = calloc(1, sizeof(NR_SRB_ToAddMod_t));
|
||||||
SRB1_config->srb_Identity = 1;
|
SRB1_config->srb_Identity = 1;
|
||||||
// pdcp_Config->t_Reordering
|
// pdcp_Config->t_Reordering
|
||||||
SRB1_config->pdcp_Config = pdcp_Config;
|
SRB1_config->pdcp_Config = pdcp_Config;
|
||||||
ie->radioBearerConfig.srb_ToAddModList = SRB_configList;
|
ie->radioBearerConfig.srb_ToAddModList = *SRB_configList;
|
||||||
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB1_config);
|
ASN_SEQUENCE_ADD(&(*SRB_configList)->list, SRB1_config);
|
||||||
|
|
||||||
ie->radioBearerConfig.srb3_ToRelease = NULL;
|
ie->radioBearerConfig.srb3_ToRelease = NULL;
|
||||||
ie->radioBearerConfig.drb_ToAddModList = NULL;
|
ie->radioBearerConfig.drb_ToAddModList = NULL;
|
||||||
@@ -954,26 +955,25 @@ uint8_t do_NR_RRCRelease(uint8_t *buffer,
|
|||||||
return((enc_rval.encoded+7)/8);
|
return((enc_rval.encoded+7)/8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
uint16_t do_RRCReconfiguration(
|
uint16_t do_RRCReconfiguration(
|
||||||
const protocol_ctxt_t *const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint8_t Transaction_id,
|
uint8_t Transaction_id,
|
||||||
gNB_RRC_INST *gnb_rrc_inst
|
NR_SRB_ToAddModList_t *SRB_configList,
|
||||||
)
|
NR_DRB_ToAddModList_t *DRB_configList,
|
||||||
|
NR_DRB_ToReleaseList_t *DRB_releaseList,
|
||||||
|
NR_SecurityConfig_t *security_config,
|
||||||
|
NR_SDAP_Config_t *sdap_config,
|
||||||
|
NR_MeasConfig_t *meas_config,
|
||||||
|
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList
|
||||||
|
*dedicatedNAS_MessageList,
|
||||||
|
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig)
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
NR_DL_DCCH_Message_t dl_dcch_msg;
|
NR_DL_DCCH_Message_t dl_dcch_msg;
|
||||||
asn_enc_rval_t enc_rval;
|
asn_enc_rval_t enc_rval;
|
||||||
NR_RRCReconfiguration_IEs_t *ie;
|
NR_RRCReconfiguration_IEs_t *ie;
|
||||||
NR_SRB_ToAddModList_t *SRB_configList = NULL;
|
|
||||||
NR_SRB_ToAddModList_t *SRB_configList2 = NULL;
|
|
||||||
NR_SRB_ToAddMod_t *SRB2_config = NULL;
|
|
||||||
NR_DRB_ToAddModList_t *DRB_configList = NULL;
|
|
||||||
NR_DRB_ToAddModList_t *DRB_configList2 = NULL;
|
|
||||||
NR_DRB_ToAddMod_t *DRB_config = NULL;
|
|
||||||
NR_SDAP_Config_t *sdap_config = NULL;
|
|
||||||
NR_SecurityConfig_t *security_config = NULL;
|
|
||||||
NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL;
|
|
||||||
|
|
||||||
memset(&dl_dcch_msg, 0, sizeof(NR_DL_DCCH_Message_t));
|
memset(&dl_dcch_msg, 0, sizeof(NR_DL_DCCH_Message_t));
|
||||||
dl_dcch_msg.message.present = NR_DL_DCCH_MessageType_PR_c1;
|
dl_dcch_msg.message.present = NR_DL_DCCH_MessageType_PR_c1;
|
||||||
@@ -985,73 +985,6 @@ uint16_t do_RRCReconfiguration(
|
|||||||
dl_dcch_msg.message.choice.c1->choice.rrcReconfiguration->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
dl_dcch_msg.message.choice.c1->choice.rrcReconfiguration->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
||||||
|
|
||||||
/******************** Radio Bearer Config ********************/
|
/******************** Radio Bearer Config ********************/
|
||||||
/* Configure SRB2 */
|
|
||||||
SRB_configList2 = ue_context_pP->ue_context.SRB_configList2[Transaction_id];
|
|
||||||
SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
|
||||||
SRB_configList = CALLOC(1, sizeof(*SRB_configList));
|
|
||||||
memset(SRB_configList, 0, sizeof(*SRB_configList));
|
|
||||||
|
|
||||||
if (SRB_configList2) {
|
|
||||||
free(SRB_configList2);
|
|
||||||
}
|
|
||||||
|
|
||||||
SRB_configList2 = CALLOC(1, sizeof(*SRB_configList2));
|
|
||||||
memset(SRB_configList2, 0, sizeof(*SRB_configList2));
|
|
||||||
SRB2_config = CALLOC(1, sizeof(*SRB2_config));
|
|
||||||
SRB2_config->srb_Identity = 2;
|
|
||||||
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config);
|
|
||||||
ASN_SEQUENCE_ADD(&SRB_configList2->list, SRB2_config);
|
|
||||||
|
|
||||||
/* Configure DRB */
|
|
||||||
DRB_configList = ue_context_pP->ue_context.DRB_configList;
|
|
||||||
if (DRB_configList) {
|
|
||||||
free(DRB_configList);
|
|
||||||
}
|
|
||||||
|
|
||||||
DRB_configList = CALLOC(1, sizeof(*DRB_configList));
|
|
||||||
memset(DRB_configList, 0, sizeof(*DRB_configList));
|
|
||||||
|
|
||||||
DRB_configList2 = ue_context_pP->ue_context.DRB_configList2[Transaction_id];
|
|
||||||
if (DRB_configList2) {
|
|
||||||
free(DRB_configList2);
|
|
||||||
}
|
|
||||||
DRB_configList2 = CALLOC(1, sizeof(*DRB_configList2));
|
|
||||||
memset(DRB_configList2, 0, sizeof(*DRB_configList2));
|
|
||||||
|
|
||||||
DRB_config = CALLOC(1, sizeof(*DRB_config));
|
|
||||||
DRB_config->drb_Identity = 1;
|
|
||||||
DRB_config->cnAssociation = CALLOC(1, sizeof(*DRB_config->cnAssociation));
|
|
||||||
DRB_config->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config;
|
|
||||||
// TODO sdap_Config
|
|
||||||
sdap_config = CALLOC(1, sizeof(NR_SDAP_Config_t));
|
|
||||||
memset(sdap_config, 0, sizeof(NR_SDAP_Config_t));
|
|
||||||
DRB_config->cnAssociation->choice.sdap_Config = sdap_config;
|
|
||||||
// TODO pdcp_Config
|
|
||||||
DRB_config->reestablishPDCP = NULL;
|
|
||||||
DRB_config->recoverPDCP = NULL;
|
|
||||||
DRB_config->pdcp_Config = calloc(1, sizeof(*DRB_config->pdcp_Config));
|
|
||||||
DRB_config->pdcp_Config->drb = calloc(1,sizeof(*DRB_config->pdcp_Config->drb));
|
|
||||||
DRB_config->pdcp_Config->drb->discardTimer = calloc(1, sizeof(*DRB_config->pdcp_Config->drb->discardTimer));
|
|
||||||
*DRB_config->pdcp_Config->drb->discardTimer = NR_PDCP_Config__drb__discardTimer_ms30;
|
|
||||||
DRB_config->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1, sizeof(*DRB_config->pdcp_Config->drb->pdcp_SN_SizeUL));
|
|
||||||
*DRB_config->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
|
|
||||||
DRB_config->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1, sizeof(*DRB_config->pdcp_Config->drb->pdcp_SN_SizeDL));
|
|
||||||
*DRB_config->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
|
|
||||||
DRB_config->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
|
|
||||||
DRB_config->pdcp_Config->drb->headerCompression.choice.notUsed = 0;
|
|
||||||
|
|
||||||
DRB_config->pdcp_Config->drb->integrityProtection = NULL;
|
|
||||||
DRB_config->pdcp_Config->drb->statusReportRequired = NULL;
|
|
||||||
DRB_config->pdcp_Config->drb->outOfOrderDelivery = NULL;
|
|
||||||
DRB_config->pdcp_Config->moreThanOneRLC = NULL;
|
|
||||||
|
|
||||||
DRB_config->pdcp_Config->t_Reordering = calloc(1, sizeof(*DRB_config->pdcp_Config->t_Reordering));
|
|
||||||
*DRB_config->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms0;
|
|
||||||
DRB_config->pdcp_Config->ext1 = NULL;
|
|
||||||
|
|
||||||
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
|
|
||||||
ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config);
|
|
||||||
|
|
||||||
/* Configure Security */
|
/* Configure Security */
|
||||||
// security_config = CALLOC(1, sizeof(NR_SecurityConfig_t));
|
// security_config = CALLOC(1, sizeof(NR_SecurityConfig_t));
|
||||||
// security_config->securityAlgorithmConfig = CALLOC(1, sizeof(*ie->radioBearerConfig->securityConfig->securityAlgorithmConfig));
|
// security_config->securityAlgorithmConfig = CALLOC(1, sizeof(*ie->radioBearerConfig->securityConfig->securityAlgorithmConfig));
|
||||||
@@ -1066,7 +999,7 @@ uint16_t do_RRCReconfiguration(
|
|||||||
ie->radioBearerConfig->drb_ToAddModList = DRB_configList;
|
ie->radioBearerConfig->drb_ToAddModList = DRB_configList;
|
||||||
ie->radioBearerConfig->securityConfig = security_config;
|
ie->radioBearerConfig->securityConfig = security_config;
|
||||||
ie->radioBearerConfig->srb3_ToRelease = NULL;
|
ie->radioBearerConfig->srb3_ToRelease = NULL;
|
||||||
ie->radioBearerConfig->drb_ToReleaseList = NULL;
|
ie->radioBearerConfig->drb_ToReleaseList = DRB_releaseList;
|
||||||
|
|
||||||
/******************** Secondary Cell Group ********************/
|
/******************** Secondary Cell Group ********************/
|
||||||
// rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
|
// rrc_gNB_carrier_data_t *carrier = &(gnb_rrc_inst->carrier);
|
||||||
@@ -1079,16 +1012,12 @@ uint16_t do_RRCReconfiguration(
|
|||||||
|
|
||||||
/******************** Meas Config ********************/
|
/******************** Meas Config ********************/
|
||||||
// measConfig
|
// measConfig
|
||||||
ie->measConfig = NULL;
|
ie->measConfig = meas_config;
|
||||||
// lateNonCriticalExtension
|
// lateNonCriticalExtension
|
||||||
ie->lateNonCriticalExtension = NULL;
|
ie->lateNonCriticalExtension = NULL;
|
||||||
// nonCriticalExtension
|
// nonCriticalExtension
|
||||||
ie->nonCriticalExtension = calloc(1, sizeof(NR_RRCReconfiguration_v1530_IEs_t));
|
ie->nonCriticalExtension = calloc(1, sizeof(NR_RRCReconfiguration_v1530_IEs_t));
|
||||||
dedicatedNAS_Message = calloc(1, sizeof(NR_DedicatedNAS_Message_t));
|
ie->nonCriticalExtension->dedicatedNAS_MessageList = dedicatedNAS_MessageList;
|
||||||
dedicatedNAS_Message->buf = ue_context_pP->ue_context.nas_pdu.buffer;
|
|
||||||
dedicatedNAS_Message->size = ue_context_pP->ue_context.nas_pdu.length;
|
|
||||||
ie->nonCriticalExtension->dedicatedNAS_MessageList = calloc(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList));
|
|
||||||
ASN_SEQUENCE_ADD(&ie->nonCriticalExtension->dedicatedNAS_MessageList->list, dedicatedNAS_Message);
|
|
||||||
|
|
||||||
dl_dcch_msg.message.choice.c1->choice.rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration = ie;
|
dl_dcch_msg.message.choice.c1->choice.rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration = ie;
|
||||||
|
|
||||||
@@ -1329,3 +1258,202 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8
|
|||||||
|
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer, uint16_t c_rnti) {
|
||||||
|
asn_enc_rval_t enc_rval;
|
||||||
|
NR_UL_CCCH_Message_t ul_ccch_msg;
|
||||||
|
NR_RRCReestablishmentRequest_t *rrcReestablishmentRequest;
|
||||||
|
uint8_t buf[2];
|
||||||
|
|
||||||
|
memset((void *)&ul_ccch_msg,0,sizeof(NR_UL_CCCH_Message_t));
|
||||||
|
ul_ccch_msg.message.present = NR_UL_CCCH_MessageType_PR_c1;
|
||||||
|
ul_ccch_msg.message.choice.c1 = CALLOC(1, sizeof(struct NR_UL_CCCH_MessageType__c1));
|
||||||
|
ul_ccch_msg.message.choice.c1->present = NR_UL_CCCH_MessageType__c1_PR_rrcReestablishmentRequest;
|
||||||
|
ul_ccch_msg.message.choice.c1->choice.rrcReestablishmentRequest = CALLOC(1, sizeof(NR_RRCReestablishmentRequest_t));
|
||||||
|
|
||||||
|
rrcReestablishmentRequest = ul_ccch_msg.message.choice.c1->choice.rrcReestablishmentRequest;
|
||||||
|
// test
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.reestablishmentCause = NR_ReestablishmentCause_reconfigurationFailure;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.c_RNTI = c_rnti;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.physCellId = 0;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf = buf;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[0] = 0x08;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[1] = 0x32;
|
||||||
|
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.size = 2;
|
||||||
|
|
||||||
|
|
||||||
|
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||||
|
xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_ccch_msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_CCCH_Message,
|
||||||
|
NULL,
|
||||||
|
(void *)&ul_ccch_msg,
|
||||||
|
buffer,
|
||||||
|
100);
|
||||||
|
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
|
||||||
|
LOG_D(NR_RRC,"[UE] RRCReestablishmentRequest Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||||
|
return((enc_rval.encoded+7)/8);
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
uint8_t
|
||||||
|
do_RRCReestablishment(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
int CC_id,
|
||||||
|
uint8_t *const buffer,
|
||||||
|
//const uint8_t transmission_mode,
|
||||||
|
const uint8_t Transaction_id,
|
||||||
|
NR_SRB_ToAddModList_t **SRB_configList
|
||||||
|
) {
|
||||||
|
asn_enc_rval_t enc_rval;
|
||||||
|
//long *logicalchannelgroup = NULL;
|
||||||
|
struct NR_SRB_ToAddMod *SRB1_config = NULL;
|
||||||
|
struct NR_SRB_ToAddMod *SRB2_config = NULL;
|
||||||
|
//gNB_RRC_INST *nrrrc = RC.nrrrc[ctxt_pP->module_id];
|
||||||
|
NR_DL_DCCH_Message_t dl_dcch_msg;
|
||||||
|
NR_RRCReestablishment_t *rrcReestablishment = NULL;
|
||||||
|
int i = 0;
|
||||||
|
ue_context_pP->ue_context.reestablishment_xid = Transaction_id;
|
||||||
|
NR_SRB_ToAddModList_t **SRB_configList2 = NULL;
|
||||||
|
SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[Transaction_id];
|
||||||
|
|
||||||
|
if (*SRB_configList2) {
|
||||||
|
free(*SRB_configList2);
|
||||||
|
}
|
||||||
|
|
||||||
|
*SRB_configList2 = CALLOC(1, sizeof(NR_SRB_ToAddModList_t));
|
||||||
|
memset((void *)&dl_dcch_msg, 0, sizeof(NR_DL_DCCH_Message_t));
|
||||||
|
dl_dcch_msg.message.present = NR_DL_DCCH_MessageType_PR_c1;
|
||||||
|
dl_dcch_msg.message.choice.c1 = calloc(1,sizeof(struct NR_DL_DCCH_MessageType__c1));
|
||||||
|
dl_dcch_msg.message.choice.c1->present = NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment;
|
||||||
|
dl_dcch_msg.message.choice.c1->choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_t));
|
||||||
|
rrcReestablishment = dl_dcch_msg.message.choice.c1->choice.rrcReestablishment;
|
||||||
|
|
||||||
|
// get old configuration of SRB2
|
||||||
|
if (*SRB_configList != NULL) {
|
||||||
|
for (i = 0; (i < (*SRB_configList)->list.count) && (i < 3); i++) {
|
||||||
|
LOG_D(NR_RRC, "(*SRB_configList)->list.array[%d]->srb_Identity=%ld\n",
|
||||||
|
i, (*SRB_configList)->list.array[i]->srb_Identity);
|
||||||
|
|
||||||
|
if ((*SRB_configList)->list.array[i]->srb_Identity == 2 ) {
|
||||||
|
SRB2_config = (*SRB_configList)->list.array[i];
|
||||||
|
} else if ((*SRB_configList)->list.array[i]->srb_Identity == 1 ) {
|
||||||
|
SRB1_config = (*SRB_configList)->list.array[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SRB1_config == NULL) {
|
||||||
|
// default SRB1 configuration
|
||||||
|
LOG_W(NR_RRC,"SRB1 configuration does not exist in SRB configuration list, use default\n");
|
||||||
|
/// SRB1
|
||||||
|
SRB1_config = CALLOC(1, sizeof(*SRB1_config));
|
||||||
|
SRB1_config->srb_Identity = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SRB2_config == NULL) {
|
||||||
|
LOG_W(NR_RRC,"SRB2 configuration does not exist in SRB configuration list\n");
|
||||||
|
} else {
|
||||||
|
ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*SRB_configList) {
|
||||||
|
free(*SRB_configList);
|
||||||
|
}
|
||||||
|
|
||||||
|
*SRB_configList = CALLOC(1, sizeof(LTE_SRB_ToAddModList_t));
|
||||||
|
ASN_SEQUENCE_ADD(&(*SRB_configList)->list,SRB1_config);
|
||||||
|
|
||||||
|
rrcReestablishment->rrc_TransactionIdentifier = Transaction_id;
|
||||||
|
rrcReestablishment->criticalExtensions.present = NR_RRCReestablishment__criticalExtensions_PR_rrcReestablishment;
|
||||||
|
rrcReestablishment->criticalExtensions.choice.rrcReestablishment = CALLOC(1,sizeof(NR_RRCReestablishment_IEs_t));
|
||||||
|
|
||||||
|
uint8_t KgNB_star[32] = { 0 };
|
||||||
|
/** TODO
|
||||||
|
uint16_t pci = nrrrc->carrier[CC_id].physCellId;
|
||||||
|
uint32_t earfcn_dl = (uint32_t)freq_to_arfcn10(RC.mac[ctxt_pP->module_id]->common_channels[CC_id].eutra_band,
|
||||||
|
nrrrc->carrier[CC_id].dl_CarrierFreq);
|
||||||
|
bool is_rel8_only = true;
|
||||||
|
|
||||||
|
if (earfcn_dl > 65535) {
|
||||||
|
is_rel8_only = false;
|
||||||
|
}
|
||||||
|
LOG_D(NR_RRC, "pci=%d, eutra_band=%d, downlink_frequency=%d, earfcn_dl=%u, is_rel8_only=%s\n",
|
||||||
|
pci,
|
||||||
|
RC.mac[ctxt_pP->module_id]->common_channels[CC_id].eutra_band,
|
||||||
|
nrrrc->carrier[CC_id].dl_CarrierFreq,
|
||||||
|
earfcn_dl,
|
||||||
|
is_rel8_only == true ? "true": "false");
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (ue_context_pP->ue_context.nh_ncc >= 0) {
|
||||||
|
//TODO derive_keNB_star(ue_context_pP->ue_context.nh, pci, earfcn_dl, is_rel8_only, KgNB_star);
|
||||||
|
rrcReestablishment->criticalExtensions.choice.rrcReestablishment->nextHopChainingCount = ue_context_pP->ue_context.nh_ncc;
|
||||||
|
} else { // first HO
|
||||||
|
//TODO derive_keNB_star (ue_context_pP->ue_context.kgnb, pci, earfcn_dl, is_rel8_only, KgNB_star);
|
||||||
|
// LG: really 1
|
||||||
|
rrcReestablishment->criticalExtensions.choice.rrcReestablishment->nextHopChainingCount = 0;
|
||||||
|
}
|
||||||
|
// copy KgNB_star to ue_context_pP->ue_context.kgnb
|
||||||
|
memcpy (ue_context_pP->ue_context.kgnb, KgNB_star, 32);
|
||||||
|
ue_context_pP->ue_context.kgnb_ncc = 0;
|
||||||
|
rrcReestablishment->criticalExtensions.choice.rrcReestablishment->lateNonCriticalExtension = NULL;
|
||||||
|
rrcReestablishment->criticalExtensions.choice.rrcReestablishment->nonCriticalExtension = NULL;
|
||||||
|
|
||||||
|
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||||
|
xer_fprint(stdout, &asn_DEF_NR_DL_DCCH_Message, (void *)&dl_dcch_msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_DL_DCCH_Message,
|
||||||
|
NULL,
|
||||||
|
(void *)&dl_dcch_msg,
|
||||||
|
buffer,
|
||||||
|
100);
|
||||||
|
|
||||||
|
if(enc_rval.encoded == -1) {
|
||||||
|
LOG_E(NR_RRC, "[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
|
||||||
|
enc_rval.failed_type->name, enc_rval.encoded);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_D(NR_RRC,"RRCReestablishment Encoded %u bits (%u bytes)\n",
|
||||||
|
(uint32_t)enc_rval.encoded, (uint32_t)(enc_rval.encoded+7)/8);
|
||||||
|
return((enc_rval.encoded+7)/8);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t
|
||||||
|
do_RRCReestablishmentComplete(uint8_t *buffer, int64_t rrc_TransactionIdentifier) {
|
||||||
|
asn_enc_rval_t enc_rval;
|
||||||
|
NR_UL_DCCH_Message_t ul_dcch_msg;
|
||||||
|
NR_RRCReestablishmentComplete_t *rrcReestablishmentComplete;
|
||||||
|
|
||||||
|
memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t));
|
||||||
|
ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1;
|
||||||
|
ul_dcch_msg.message.choice.c1 = CALLOC(1, sizeof(struct NR_UL_DCCH_MessageType__c1));
|
||||||
|
ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete;
|
||||||
|
ul_dcch_msg.message.choice.c1->choice.rrcReestablishmentComplete = CALLOC(1, sizeof(NR_RRCReestablishmentComplete_t));
|
||||||
|
|
||||||
|
rrcReestablishmentComplete = ul_dcch_msg.message.choice.c1->choice.rrcReestablishmentComplete;
|
||||||
|
rrcReestablishmentComplete->rrc_TransactionIdentifier = rrc_TransactionIdentifier;
|
||||||
|
rrcReestablishmentComplete->criticalExtensions.present = NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete;
|
||||||
|
rrcReestablishmentComplete->criticalExtensions.choice.rrcReestablishmentComplete = CALLOC(1, sizeof(NR_RRCReestablishmentComplete_IEs_t));
|
||||||
|
rrcReestablishmentComplete->criticalExtensions.choice.rrcReestablishmentComplete->lateNonCriticalExtension = NULL;
|
||||||
|
rrcReestablishmentComplete->criticalExtensions.choice.rrcReestablishmentComplete->nonCriticalExtension = NULL;
|
||||||
|
|
||||||
|
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||||
|
xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_dcch_msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_DCCH_Message,
|
||||||
|
NULL,
|
||||||
|
(void *)&ul_dcch_msg,
|
||||||
|
buffer,
|
||||||
|
100);
|
||||||
|
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n", enc_rval.failed_type->name, enc_rval.encoded);
|
||||||
|
LOG_D(NR_RRC,"[UE] RRCReestablishmentComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
|
||||||
|
return((enc_rval.encoded+7)/8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
|
|||||||
int CC_id,
|
int CC_id,
|
||||||
uint8_t *const buffer,
|
uint8_t *const buffer,
|
||||||
const uint8_t transaction_id,
|
const uint8_t transaction_id,
|
||||||
NR_SRB_ToAddModList_t *SRB_configList);
|
NR_SRB_ToAddModList_t **SRB_configList);
|
||||||
uint8_t do_NR_SecurityModeCommand(
|
uint8_t do_NR_SecurityModeCommand(
|
||||||
const protocol_ctxt_t *const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
uint8_t *const buffer,
|
uint8_t *const buffer,
|
||||||
@@ -106,11 +106,18 @@ uint8_t do_NR_SA_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
|
|||||||
uint8_t do_NR_RRCRelease(uint8_t *buffer,
|
uint8_t do_NR_RRCRelease(uint8_t *buffer,
|
||||||
uint8_t Transaction_id);
|
uint8_t Transaction_id);
|
||||||
uint16_t do_RRCReconfiguration(
|
uint16_t do_RRCReconfiguration(
|
||||||
const protocol_ctxt_t *const ctxt_pP,
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
uint8_t *buffer,
|
||||||
uint8_t *buffer,
|
uint8_t Transaction_id,
|
||||||
uint8_t Transaction_id,
|
NR_SRB_ToAddModList_t *SRB_configList,
|
||||||
gNB_RRC_INST *gnb_rrc_inst);
|
NR_DRB_ToAddModList_t *DRB_configList,
|
||||||
|
NR_DRB_ToReleaseList_t *DRB_releaseList,
|
||||||
|
NR_SecurityConfig_t *security_config,
|
||||||
|
NR_SDAP_Config_t *sdap_config,
|
||||||
|
NR_MeasConfig_t *meas_config,
|
||||||
|
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList
|
||||||
|
*dedicatedNAS_MessageList,
|
||||||
|
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig);
|
||||||
|
|
||||||
uint8_t do_RRCSetupComplete(uint8_t Mod_id,
|
uint8_t do_RRCSetupComplete(uint8_t Mod_id,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
@@ -138,4 +145,23 @@ do_NR_DLInformationTransfer(
|
|||||||
|
|
||||||
uint8_t do_NR_ULInformationTransfer(uint8_t **buffer,
|
uint8_t do_NR_ULInformationTransfer(uint8_t **buffer,
|
||||||
uint32_t pdu_length,
|
uint32_t pdu_length,
|
||||||
uint8_t *pdu_buffer);
|
uint8_t *pdu_buffer);
|
||||||
|
|
||||||
|
uint8_t do_RRCReestablishmentRequest(uint8_t Mod_id, uint8_t *buffer, uint16_t c_rnti);
|
||||||
|
|
||||||
|
uint8_t
|
||||||
|
do_RRCReestablishment(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
int CC_id,
|
||||||
|
uint8_t *const buffer,
|
||||||
|
//const uint8_t transmission_mode,
|
||||||
|
const uint8_t Transaction_id,
|
||||||
|
NR_SRB_ToAddModList_t **SRB_configList
|
||||||
|
);
|
||||||
|
|
||||||
|
uint8_t
|
||||||
|
do_RRCReestablishmentComplete(
|
||||||
|
uint8_t *buffer,
|
||||||
|
int64_t rrc_TransactionIdentifier);
|
||||||
|
|
||||||
|
|||||||
@@ -261,7 +261,10 @@ typedef enum pdu_session_satus_e {
|
|||||||
PDU_SESSION_STATUS_NEW,
|
PDU_SESSION_STATUS_NEW,
|
||||||
PDU_SESSION_STATUS_DONE,
|
PDU_SESSION_STATUS_DONE,
|
||||||
PDU_SESSION_STATUS_ESTABLISHED,
|
PDU_SESSION_STATUS_ESTABLISHED,
|
||||||
|
PDU_SESSION_STATUS_REESTABLISHED, // after HO
|
||||||
|
PDU_SESSION_STATUS_TOMODIFY, // ENDC NSA
|
||||||
PDU_SESSION_STATUS_FAILED,
|
PDU_SESSION_STATUS_FAILED,
|
||||||
|
PDU_SESSION_STATUS_TORELEASE // to release DRB between eNB and UE
|
||||||
} pdu_session_status_t;
|
} pdu_session_status_t;
|
||||||
|
|
||||||
typedef struct pdu_session_param_s {
|
typedef struct pdu_session_param_s {
|
||||||
@@ -323,7 +326,7 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
NR_EstablishmentCause_t establishment_cause;
|
NR_EstablishmentCause_t establishment_cause;
|
||||||
|
|
||||||
/* Information from UE RRC ConnectionReestablishmentRequest */
|
/* Information from UE RRC ConnectionReestablishmentRequest */
|
||||||
NR_ReestablishmentCause_t reestablishment_cause;
|
NR_ReestablishmentCause_t reestablishment_cause;
|
||||||
|
|
||||||
/* UE id for initial connection to S1AP */
|
/* UE id for initial connection to S1AP */
|
||||||
uint16_t ue_initial_id;
|
uint16_t ue_initial_id;
|
||||||
@@ -342,6 +345,8 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
uint8_t nb_of_e_rabs;
|
uint8_t nb_of_e_rabs;
|
||||||
/* Total number of pdu session already setup in the list */
|
/* Total number of pdu session already setup in the list */
|
||||||
uint8_t setup_pdu_sessions;
|
uint8_t setup_pdu_sessions;
|
||||||
|
/* Number of e_rab to be setup in the list */
|
||||||
|
uint8_t nb_of_e_rabs;
|
||||||
/* Number of pdu session to be setup in the list */
|
/* Number of pdu session to be setup in the list */
|
||||||
uint8_t nb_of_pdusessions;
|
uint8_t nb_of_pdusessions;
|
||||||
/* Number of e_rab to be modified in the list */
|
/* Number of e_rab to be modified in the list */
|
||||||
@@ -349,10 +354,14 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
uint8_t nb_of_failed_e_rabs;
|
uint8_t nb_of_failed_e_rabs;
|
||||||
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||||
/* list of e_rab to be setup by RRC layers */
|
/* list of e_rab to be setup by RRC layers */
|
||||||
|
/* list of pdu session to be setup by RRC layers */
|
||||||
|
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||||
pdu_session_param_t pdusession[NR_NB_RB_MAX];//[NGAP_MAX_PDU_SESSION];
|
pdu_session_param_t pdusession[NR_NB_RB_MAX];//[NGAP_MAX_PDU_SESSION];
|
||||||
//release e_rabs
|
//release e_rabs
|
||||||
uint8_t nb_release_of_e_rabs;
|
uint8_t nb_release_of_e_rabs;
|
||||||
e_rab_failed_t e_rabs_release_failed[S1AP_MAX_E_RAB];
|
e_rab_failed_t e_rabs_release_failed[S1AP_MAX_E_RAB];
|
||||||
|
uint8_t nb_release_of_pdusessions;
|
||||||
|
pdusession_failed_t pdusessions_release_failed[NGAP_MAX_PDUSESSION];
|
||||||
// LG: For GTPV1 TUNNELS
|
// LG: For GTPV1 TUNNELS
|
||||||
uint32_t gnb_gtp_teid[S1AP_MAX_E_RAB];
|
uint32_t gnb_gtp_teid[S1AP_MAX_E_RAB];
|
||||||
transport_layer_addr_t gnb_gtp_addrs[S1AP_MAX_E_RAB];
|
transport_layer_addr_t gnb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||||
@@ -371,6 +380,9 @@ typedef struct gNB_RRC_UE_s {
|
|||||||
uint32_t ue_reestablishment_timer;
|
uint32_t ue_reestablishment_timer;
|
||||||
uint32_t ue_reestablishment_timer_thres;
|
uint32_t ue_reestablishment_timer_thres;
|
||||||
uint8_t e_rab_release_command_flag;
|
uint8_t e_rab_release_command_flag;
|
||||||
|
uint8_t pdu_session_release_command_flag;
|
||||||
|
uint32_t ue_rrc_inactivity_timer;
|
||||||
|
int8_t reestablishment_xid;
|
||||||
//------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------//
|
||||||
NR_CellGroupId_t cellGroupId;
|
NR_CellGroupId_t cellGroupId;
|
||||||
struct NR_SpCellConfig *spCellConfig;
|
struct NR_SpCellConfig *spCellConfig;
|
||||||
@@ -429,6 +441,8 @@ typedef struct {
|
|||||||
NR_SRB_INFO SI;
|
NR_SRB_INFO SI;
|
||||||
NR_SRB_INFO Srb0;
|
NR_SRB_INFO Srb0;
|
||||||
int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS];
|
int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS];
|
||||||
|
int physCellId;
|
||||||
|
int p_gNB;
|
||||||
|
|
||||||
} rrc_gNB_carrier_data_t;
|
} rrc_gNB_carrier_data_t;
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
|
|||||||
@@ -145,3 +145,11 @@ nr_rrc_data_req(
|
|||||||
int
|
int
|
||||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||||
rnti_t rntiP);
|
rnti_t rntiP);
|
||||||
|
|
||||||
|
void
|
||||||
|
rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
uint8_t xid,
|
||||||
|
uint32_t nas_length,
|
||||||
|
uint8_t *nas_buffer);
|
||||||
|
|||||||
+962
-52
File diff suppressed because it is too large
Load Diff
@@ -1230,3 +1230,165 @@ rrc_gNB_send_NGAP_UE_CAPABILITIES_IND(
|
|||||||
LOG_I(NR_RRC,"Send message to ngap: NGAP_UE_CAPABILITIES_IND\n");
|
LOG_I(NR_RRC,"Send message to ngap: NGAP_UE_CAPABILITIES_IND\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
uint8_t xid
|
||||||
|
)
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
int pdu_sessions_released = 0;
|
||||||
|
MessageDef *msg_p;
|
||||||
|
msg_p = itti_alloc_new_message (TASK_RRC_GNB, NGAP_PDUSESSION_RELEASE_RESPONSE);
|
||||||
|
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
|
||||||
|
|
||||||
|
for (int i = 0; i < NB_RB_MAX; i++) {
|
||||||
|
if (xid == ue_context_pP->ue_context.pdusession[i].xid) {
|
||||||
|
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).pdusession_release[pdu_sessions_released].pdusession_id =
|
||||||
|
ue_context_pP->ue_context.pdusession[i].param.pdusession_id;
|
||||||
|
pdu_sessions_released++;
|
||||||
|
//clear
|
||||||
|
memset(&ue_context_pP->ue_context.pdusession[i], 0, sizeof(pdu_session_param_t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).nb_of_pdusessions_released = pdu_sessions_released;
|
||||||
|
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).nb_of_pdusessions_failed = ue_context_pP->ue_context.nb_release_of_pdusessions;
|
||||||
|
memcpy(&(NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).pdusessions_failed[0]), &ue_context_pP->ue_context.pdusessions_release_failed[0],
|
||||||
|
sizeof(pdusession_failed_t)*ue_context_pP->ue_context.nb_release_of_pdusessions);
|
||||||
|
ue_context_pP->ue_context.setup_pdu_sessions -= pdu_sessions_released;
|
||||||
|
LOG_I(NR_RRC,"NGAP PDUSESSION RELEASE RESPONSE: GNB_UE_NGAP_ID %d release_pdu_sessions %d setup_pdu_sessions %d \n",
|
||||||
|
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).gNB_ue_ngap_id,
|
||||||
|
pdu_sessions_released, ue_context_pP->ue_context.setup_pdu_sessions);
|
||||||
|
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
|
||||||
|
|
||||||
|
//clear xid
|
||||||
|
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||||
|
ue_context_pP->ue_context.pdusession[i].xid = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//clear release pdusessions
|
||||||
|
ue_context_pP->ue_context.nb_release_of_pdusessions = 0;
|
||||||
|
memset(&ue_context_pP->ue_context.pdusessions_release_failed[0], 0, sizeof(pdusession_failed_t)*NGAP_MAX_PDUSESSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
int
|
||||||
|
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
|
||||||
|
MessageDef *msg_p,
|
||||||
|
const char *msg_name,
|
||||||
|
instance_t instance
|
||||||
|
)
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
uint32_t gNB_ue_ngap_id;
|
||||||
|
rrc_gNB_ue_context_t *ue_context_p = NULL;
|
||||||
|
protocol_ctxt_t ctxt;
|
||||||
|
pdusession_release_t pdusession_release_params[NGAP_MAX_PDUSESSION];
|
||||||
|
uint8_t nb_pdusessions_torelease;
|
||||||
|
MessageDef *msg_delete_tunnels_p = NULL;
|
||||||
|
uint8_t xid;
|
||||||
|
int i, pdusession;
|
||||||
|
uint8_t b_existed,is_existed;
|
||||||
|
uint8_t pdusession_release_drb = 0;
|
||||||
|
|
||||||
|
memcpy(&pdusession_release_params[0], &(NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).pdusession_release_params[0]),
|
||||||
|
sizeof(pdusession_release_t)*NGAP_MAX_PDUSESSION);
|
||||||
|
gNB_ue_ngap_id = NGAP_PDUSESSION_RELEASE_COMMAND(msg_p).gNB_ue_ngap_id;
|
||||||
|
nb_pdusessions_torelease = NGAP_PDUSESSION_RELEASE_COMMAND(msg_p).nb_pdusessions_torelease;
|
||||||
|
if (nb_pdusessions_torelease > NGAP_MAX_PDUSESSION) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, UE_INITIAL_ID_INVALID, gNB_ue_ngap_id);
|
||||||
|
LOG_I(NR_RRC, "[gNB %d] Received %s: gNB_ue_ngap_id %d \n", instance, msg_name, gNB_ue_ngap_id);
|
||||||
|
|
||||||
|
if (ue_context_p != NULL) {
|
||||||
|
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||||
|
xid = rrc_gNB_get_next_transaction_identifier(ctxt.module_id);
|
||||||
|
LOG_I(NR_RRC,"PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d release_pdusessions %d \n",
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id&0x000000FFFFFFFFFF, gNB_ue_ngap_id, nb_pdusessions_torelease);
|
||||||
|
|
||||||
|
for (pdusession = 0; pdusession < nb_pdusessions_torelease; pdusession++) {
|
||||||
|
b_existed = 0;
|
||||||
|
is_existed = 0;
|
||||||
|
|
||||||
|
for (i = pdusession-1; i >= 0; i--) {
|
||||||
|
if (pdusession_release_params[pdusession].pdusession_id == pdusession_release_params[i].pdusession_id) {
|
||||||
|
is_existed = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(is_existed == 1) {
|
||||||
|
// pdusession_id is existed
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < NR_NB_RB_MAX; i++) {
|
||||||
|
if (pdusession_release_params[pdusession].pdusession_id == ue_context_p->ue_context.pdusession[i].param.pdusession_id) {
|
||||||
|
b_existed = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(b_existed == 0) {
|
||||||
|
// no pdusession_id
|
||||||
|
LOG_I(NR_RRC, "no pdusession_id \n");
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].pdusession_id = pdusession_release_params[pdusession].pdusession_id;
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].cause_value = 30;
|
||||||
|
ue_context_p->ue_context.nb_release_of_pdusessions++;
|
||||||
|
} else {
|
||||||
|
if(ue_context_p->ue_context.pdusession[i].status == PDU_SESSION_STATUS_FAILED) {
|
||||||
|
ue_context_p->ue_context.pdusession[i].xid = xid;
|
||||||
|
continue;
|
||||||
|
} else if(ue_context_p->ue_context.pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED) {
|
||||||
|
LOG_I(NR_RRC, "RELEASE pdusession %d \n", ue_context_p->ue_context.pdusession[i].param.pdusession_id);
|
||||||
|
ue_context_p->ue_context.pdusession[i].status = PDU_SESSION_STATUS_TORELEASE;
|
||||||
|
ue_context_p->ue_context.pdusession[i].xid = xid;
|
||||||
|
pdusession_release_drb++;
|
||||||
|
} else {
|
||||||
|
// pdusession_id status NG
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].pdusession_id = pdusession_release_params[pdusession].pdusession_id;
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].cause = NGAP_CAUSE_RADIO_NETWORK;
|
||||||
|
ue_context_p->ue_context.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].cause_value = 0;
|
||||||
|
ue_context_p->ue_context.nb_release_of_pdusessions++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pdusession_release_drb > 0) {
|
||||||
|
//TODO RRCReconfiguration To UE
|
||||||
|
LOG_I(NR_RRC, "Send RRCReconfiguration To UE \n");
|
||||||
|
rrc_gNB_generate_dedicatedRRCReconfiguration_release(&ctxt, ue_context_p, xid, NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).nas_pdu.length, NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).nas_pdu.buffer);
|
||||||
|
} else {
|
||||||
|
//gtp tunnel delete
|
||||||
|
LOG_I(NR_RRC, "gtp tunnel delete \n");
|
||||||
|
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, GTPV1U_GNB_DELETE_TUNNEL_REQ);
|
||||||
|
memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||||
|
|
||||||
|
for(i = 0; i < NB_RB_MAX; i++) {
|
||||||
|
if(xid == ue_context_p->ue_context.pdusession[i].xid) {
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i];
|
||||||
|
ue_context_p->ue_context.gnb_gtp_teid[i] = 0;
|
||||||
|
memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i]));
|
||||||
|
ue_context_p->ue_context.gnb_gtp_psi[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p);
|
||||||
|
//NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||||
|
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(&ctxt, ue_context_p, xid);
|
||||||
|
LOG_I(NR_RRC, "Send PDU Session Release Response \n");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOG_E(NR_RRC, "PDU Session Release Command: AMF_UE_NGAP_ID %lu GNB_UE_NGAP_ID %d Error ue_context_p NULL \n",
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND (msg_p).amf_ue_ngap_id&0x000000FFFFFFFFFF, NGAP_PDUSESSION_RELEASE_COMMAND(msg_p).gNB_ue_ngap_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -142,4 +142,25 @@ rrc_gNB_send_NGAP_UE_CAPABILITIES_IND(
|
|||||||
NR_UL_DCCH_Message_t *const ul_dcch_msg
|
NR_UL_DCCH_Message_t *const ul_dcch_msg
|
||||||
);
|
);
|
||||||
|
|
||||||
|
int
|
||||||
|
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
|
||||||
|
MessageDef *msg_p,
|
||||||
|
const char *msg_name,
|
||||||
|
instance_t instance
|
||||||
|
);
|
||||||
|
|
||||||
|
void
|
||||||
|
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
uint8_t xid
|
||||||
|
);
|
||||||
|
|
||||||
|
void
|
||||||
|
nr_rrc_pdcp_config_security(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||||
|
const uint8_t send_security_mode_command
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ rrc_gNB_allocate_new_UE_context(
|
|||||||
new_p->local_uid = nr_uid_linear_allocator_new(rrc_instance_pP);
|
new_p->local_uid = nr_uid_linear_allocator_new(rrc_instance_pP);
|
||||||
|
|
||||||
for(int i = 0; i < NB_RB_MAX; i++) {
|
for(int i = 0; i < NB_RB_MAX; i++) {
|
||||||
|
new_p->ue_context.e_rab[i].xid = -1;
|
||||||
new_p->ue_context.pdusession[i].xid = -1;
|
new_p->ue_context.pdusession[i].xid = -1;
|
||||||
new_p->ue_context.modify_e_rab[i].xid = -1;
|
new_p->ue_context.modify_e_rab[i].xid = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,15 +183,15 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
|||||||
|
|
||||||
if (m->nb_e_rabs_tobeadded>0) {
|
if (m->nb_e_rabs_tobeadded>0) {
|
||||||
for (int i=0; i<m->nb_e_rabs_tobeadded; i++) {
|
for (int i=0; i<m->nb_e_rabs_tobeadded; i++) {
|
||||||
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
// Add the new E-RABs at the corresponding rrc ue context of the gNB
|
||||||
ue_context_p->ue_context.pdusession[i].param.pdusession_id = m->e_rabs_tobeadded[i].e_rab_id;
|
ue_context_p->ue_context.e_rab[i].param.e_rab_id = m->e_rabs_tobeadded[i].e_rab_id;
|
||||||
ue_context_p->ue_context.pdusession[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
ue_context_p->ue_context.e_rab[i].param.gtp_teid = m->e_rabs_tobeadded[i].gtp_teid;
|
||||||
memcpy(&ue_context_p->ue_context.pdusession[i].param.upf_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
memcpy(&ue_context_p->ue_context.e_rab[i].param.sgw_addr, &m->e_rabs_tobeadded[i].sgw_addr, sizeof(transport_layer_addr_t));
|
||||||
ue_context_p->ue_context.nb_of_pdusessions++;
|
ue_context_p->ue_context.nb_of_e_rabs++;
|
||||||
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
//Fill the required E-RAB specific information for the creation of the S1-U tunnel between the gNB and the SGW
|
||||||
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.pdusession[i].param.pdusession_id;
|
create_tunnel_req.eps_bearer_id[i] = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||||
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.pdusession[i].param.gtp_teid;
|
create_tunnel_req.sgw_S1u_teid[i] = ue_context_p->ue_context.e_rab[i].param.gtp_teid;
|
||||||
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.pdusession[i].param.upf_addr, sizeof(transport_layer_addr_t));
|
memcpy(&create_tunnel_req.sgw_addr[i], &ue_context_p->ue_context.e_rab[i].param.sgw_addr, sizeof(transport_layer_addr_t));
|
||||||
inde_list[i] = i;
|
inde_list[i] = i;
|
||||||
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
LOG_I(RRC,"S1-U tunnel: index %d target sgw ip %d.%d.%d.%d length %d gtp teid %u\n",
|
||||||
i,
|
i,
|
||||||
@@ -218,8 +218,8 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
|||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).nb_e_rabs_admitted_tobeadded = m->nb_e_rabs_tobeadded;
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).target_assoc_id = m->target_assoc_id;
|
||||||
|
|
||||||
for(int i=0; i<ue_context_p->ue_context.nb_of_pdusessions; i++) {
|
for(int i=0; i<ue_context_p->ue_context.nb_of_e_rabs; i++) {
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.pdusession[i].param.pdusession_id;
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].e_rab_id = ue_context_p->ue_context.e_rab[i].param.e_rab_id;
|
||||||
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gtp_teid = create_tunnel_resp.enb_S1u_teid[i];
|
||||||
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
memcpy(&X2AP_ENDC_SGNB_ADDITION_REQ_ACK(msg).e_rabs_admitted_tobeadded[i].gnb_addr, &create_tunnel_resp.enb_addr, sizeof(transport_layer_addr_t));
|
||||||
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
//The length field in the X2AP targetting structure is expected in bits but the create_tunnel_resp returns the address length in bytes
|
||||||
|
|||||||
+184
-101
@@ -117,7 +117,17 @@ uint8_t do_NR_RRCReconfigurationComplete(
|
|||||||
const uint8_t Transaction_id
|
const uint8_t Transaction_id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index );
|
||||||
|
|
||||||
|
void
|
||||||
|
nr_rrc_ue_generate_rrcReestablishmentComplete(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
NR_RRCReestablishment_t *rrcReestablishment,
|
||||||
|
uint8_t gNB_index
|
||||||
|
);
|
||||||
|
|
||||||
mui_t nr_rrc_mui=0;
|
mui_t nr_rrc_mui=0;
|
||||||
|
uint8_t first_rrcreconfigurationcomplete = 0;
|
||||||
|
|
||||||
static Rrc_State_NR_t nr_rrc_get_state (module_id_t ue_mod_idP) {
|
static Rrc_State_NR_t nr_rrc_get_state (module_id_t ue_mod_idP) {
|
||||||
return NR_UE_rrc_inst[ue_mod_idP].nrRrcState;
|
return NR_UE_rrc_inst[ue_mod_idP].nrRrcState;
|
||||||
@@ -1394,81 +1404,83 @@ static void rrc_ue_generate_RRCSetupComplete(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB_INFO *const Srb_info, const uint8_t gNB_index ){
|
int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB_INFO *const Srb_info, const uint8_t gNB_index ){
|
||||||
NR_DL_CCCH_Message_t *dl_ccch_msg=NULL;
|
NR_DL_CCCH_Message_t *dl_ccch_msg=NULL;
|
||||||
asn_dec_rval_t dec_rval;
|
asn_dec_rval_t dec_rval;
|
||||||
int rval=0;
|
int rval=0;
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH, VCD_FUNCTION_IN);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH, VCD_FUNCTION_IN);
|
||||||
// LOG_D(RRC,"[UE %d] Decoding DL-CCCH message (%d bytes), State %d\n",ue_mod_idP,Srb_info->Rx_buffer.payload_size,
|
// LOG_D(RRC,"[UE %d] Decoding DL-CCCH message (%d bytes), State %d\n",ue_mod_idP,Srb_info->Rx_buffer.payload_size,
|
||||||
// NR_UE_rrc_inst[ue_mod_idP].Info[gNB_index].State);
|
// NR_UE_rrc_inst[ue_mod_idP].Info[gNB_index].State);
|
||||||
dec_rval = uper_decode(NULL,
|
dec_rval = uper_decode(NULL,
|
||||||
&asn_DEF_NR_DL_CCCH_Message,
|
&asn_DEF_NR_DL_CCCH_Message,
|
||||||
(void **)&dl_ccch_msg,
|
(void **)&dl_ccch_msg,
|
||||||
(uint8_t *)Srb_info->Rx_buffer.Payload,
|
(uint8_t *)Srb_info->Rx_buffer.Payload,
|
||||||
100,0,0);
|
100,0,0);
|
||||||
|
|
||||||
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
// if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||||
xer_fprint(stdout,&asn_DEF_NR_DL_CCCH_Message,(void *)dl_ccch_msg);
|
xer_fprint(stdout,&asn_DEF_NR_DL_CCCH_Message,(void *)dl_ccch_msg);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
|
if ((dec_rval.code != RC_OK) && (dec_rval.consumed==0)) {
|
||||||
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
|
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode DL-CCCH-Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
|
||||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH, VCD_FUNCTION_OUT);
|
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH, VCD_FUNCTION_OUT);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dl_ccch_msg->message.present == NR_DL_CCCH_MessageType_PR_c1) {
|
if (dl_ccch_msg->message.present == NR_DL_CCCH_MessageType_PR_c1) {
|
||||||
if (NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].State == NR_RRC_SI_RECEIVED) {
|
if (NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].State == NR_RRC_SI_RECEIVED) {
|
||||||
switch (dl_ccch_msg->message.choice.c1->present) {
|
switch (dl_ccch_msg->message.choice.c1->present) {
|
||||||
case NR_DL_CCCH_MessageType__c1_PR_NOTHING:
|
case NR_DL_CCCH_MessageType__c1_PR_NOTHING:
|
||||||
LOG_I(NR_RRC, "[UE%d] Frame %d : Received PR_NOTHING on DL-CCCH-Message\n",
|
LOG_I(NR_RRC, "[UE%d] Frame %d : Received PR_NOTHING on DL-CCCH-Message\n",
|
||||||
ctxt_pP->module_id,
|
ctxt_pP->module_id,
|
||||||
ctxt_pP->frame);
|
ctxt_pP->frame);
|
||||||
rval = 0;
|
rval = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NR_DL_CCCH_MessageType__c1_PR_rrcReject:
|
case NR_DL_CCCH_MessageType__c1_PR_rrcReject:
|
||||||
LOG_I(NR_RRC,
|
LOG_I(NR_RRC,
|
||||||
"[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n",
|
"[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n",
|
||||||
ctxt_pP->module_id,
|
ctxt_pP->module_id,
|
||||||
ctxt_pP->frame);
|
ctxt_pP->frame);
|
||||||
rval = 0;
|
rval = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
|
case NR_DL_CCCH_MessageType__c1_PR_rrcSetup:
|
||||||
LOG_I(NR_RRC,
|
LOG_I(NR_RRC,
|
||||||
"[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup RNTI %x\n",
|
"[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received NR_RRCSetup RNTI %x\n",
|
||||||
ctxt_pP->module_id,
|
ctxt_pP->module_id,
|
||||||
ctxt_pP->frame,
|
ctxt_pP->frame,
|
||||||
ctxt_pP->rnti);
|
ctxt_pP->rnti);
|
||||||
// Get configuration
|
|
||||||
// Release T300 timer
|
// Get configuration
|
||||||
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
|
// Release T300 timer
|
||||||
|
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
|
||||||
nr_rrc_ue_process_masterCellGroup(
|
|
||||||
ctxt_pP,
|
nr_rrc_ue_process_masterCellGroup(
|
||||||
gNB_index,
|
ctxt_pP,
|
||||||
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
|
gNB_index,
|
||||||
nr_sa_rrc_ue_process_radioBearerConfig(
|
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
|
||||||
ctxt_pP,
|
nr_sa_rrc_ue_process_radioBearerConfig(
|
||||||
gNB_index,
|
ctxt_pP,
|
||||||
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
|
gNB_index,
|
||||||
nr_rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
|
&dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
|
||||||
nr_rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
|
nr_rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
|
||||||
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rnti;
|
nr_rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
|
||||||
rrc_ue_generate_RRCSetupComplete(
|
NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rnti;
|
||||||
ctxt_pP,
|
rrc_ue_generate_RRCSetupComplete(
|
||||||
gNB_index,
|
ctxt_pP,
|
||||||
dl_ccch_msg->message.choice.c1->choice.rrcSetup->rrc_TransactionIdentifier,
|
gNB_index,
|
||||||
NR_UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
|
dl_ccch_msg->message.choice.c1->choice.rrcSetup->rrc_TransactionIdentifier,
|
||||||
rval = 0;
|
NR_UE_rrc_inst[ctxt_pP->module_id].selected_plmn_identity);
|
||||||
break;
|
rval = 0;
|
||||||
|
break;
|
||||||
default:
|
|
||||||
LOG_E(NR_RRC, "[UE%d] Frame %d : Unknown message\n",
|
default:
|
||||||
ctxt_pP->module_id,
|
LOG_E(NR_RRC, "[UE%d] Frame %d : Unknown message\n",
|
||||||
ctxt_pP->frame);
|
ctxt_pP->module_id,
|
||||||
rval = -1;
|
ctxt_pP->frame);
|
||||||
break;
|
rval = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2252,6 +2264,7 @@ void nr_rrc_ue_generate_RRCReconfigurationComplete( const protocol_ctxt_t *const
|
|||||||
UE_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
|
UE_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
|
||||||
UE_RRC_DCCH_DATA_IND (message_p).size = size;
|
UE_RRC_DCCH_DATA_IND (message_p).size = size;
|
||||||
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
|
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
rrc_data_req_ue (
|
rrc_data_req_ue (
|
||||||
ctxt_pP,
|
ctxt_pP,
|
||||||
@@ -2320,32 +2333,38 @@ nr_rrc_ue_decode_dcch(
|
|||||||
nr_rrc_ue_generate_RRCReconfigurationComplete(ctxt_pP,
|
nr_rrc_ue_generate_RRCReconfigurationComplete(ctxt_pP,
|
||||||
gNB_indexP,
|
gNB_indexP,
|
||||||
dl_dcch_msg->message.choice.c1->choice.rrcReconfiguration->rrc_TransactionIdentifier);
|
dl_dcch_msg->message.choice.c1->choice.rrcReconfiguration->rrc_TransactionIdentifier);
|
||||||
|
|
||||||
|
if (first_rrcreconfigurationcomplete == 0) {
|
||||||
|
first_rrcreconfigurationcomplete = 1;
|
||||||
#ifdef ITTI_SIM
|
#ifdef ITTI_SIM
|
||||||
as_nas_info_t initialNasMsg;
|
if (AMF_MODE_ENABLED) {
|
||||||
memset(&initialNasMsg, 0, sizeof(as_nas_info_t));
|
as_nas_info_t initialNasMsg;
|
||||||
generateRegistrationComplete(&initialNasMsg, NULL);
|
memset(&initialNasMsg, 0, sizeof(as_nas_info_t));
|
||||||
if(initialNasMsg.length > 0){
|
generateRegistrationComplete(&initialNasMsg, NULL);
|
||||||
MessageDef *message_p;
|
if(initialNasMsg.length > 0){
|
||||||
message_p = itti_alloc_new_message(TASK_RRC_NRUE, NAS_UPLINK_DATA_REQ);
|
MessageDef *message_p;
|
||||||
NAS_UPLINK_DATA_REQ(message_p).UEid = ctxt_pP->module_id;
|
message_p = itti_alloc_new_message(TASK_RRC_NRUE, NAS_UPLINK_DATA_REQ);
|
||||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = (uint8_t *)initialNasMsg.data;
|
NAS_UPLINK_DATA_REQ(message_p).UEid = ctxt_pP->module_id;
|
||||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = initialNasMsg.length;
|
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = (uint8_t *)initialNasMsg.data;
|
||||||
itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p);
|
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = initialNasMsg.length;
|
||||||
LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)\n");
|
itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p);
|
||||||
}
|
LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)\n");
|
||||||
as_nas_info_t pduEstablishMsg;
|
}
|
||||||
memset(&pduEstablishMsg, 0, sizeof(as_nas_info_t));
|
as_nas_info_t pduEstablishMsg;
|
||||||
generatePduSessionEstablishRequest(&pduEstablishMsg);
|
memset(&pduEstablishMsg, 0, sizeof(as_nas_info_t));
|
||||||
if(initialNasMsg.length > 0){
|
generatePduSessionEstablishRequest(&pduEstablishMsg);
|
||||||
MessageDef *message_p;
|
if(initialNasMsg.length > 0){
|
||||||
message_p = itti_alloc_new_message(TASK_RRC_NRUE, NAS_UPLINK_DATA_REQ);
|
MessageDef *message_p;
|
||||||
NAS_UPLINK_DATA_REQ(message_p).UEid = ctxt_pP->module_id;
|
message_p = itti_alloc_new_message(TASK_RRC_NRUE, NAS_UPLINK_DATA_REQ);
|
||||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = (uint8_t *)pduEstablishMsg.data;
|
NAS_UPLINK_DATA_REQ(message_p).UEid = ctxt_pP->module_id;
|
||||||
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = pduEstablishMsg.length;
|
NAS_UPLINK_DATA_REQ(message_p).nasMsg.data = (uint8_t *)pduEstablishMsg.data;
|
||||||
itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p);
|
NAS_UPLINK_DATA_REQ(message_p).nasMsg.length = pduEstablishMsg.length;
|
||||||
LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n");
|
itti_send_msg_to_task(TASK_RRC_NRUE, ctxt_pP->instance, message_p);
|
||||||
}
|
LOG_I(NR_RRC, " Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2375,6 +2394,14 @@ nr_rrc_ue_decode_dcch(
|
|||||||
gNB_indexP);
|
gNB_indexP);
|
||||||
break;
|
break;
|
||||||
case NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment:
|
case NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment:
|
||||||
|
LOG_I(NR_RRC,
|
||||||
|
"[UE%d] Frame %d : Logical Channel DL-DCCH (SRB1), Received RRCReestablishment\n",
|
||||||
|
ctxt_pP->module_id,
|
||||||
|
ctxt_pP->frame);
|
||||||
|
nr_rrc_ue_generate_rrcReestablishmentComplete(
|
||||||
|
ctxt_pP,
|
||||||
|
dl_dcch_msg->message.choice.c1->choice.rrcReestablishment,
|
||||||
|
gNB_indexP);
|
||||||
break;
|
break;
|
||||||
case NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
|
case NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
|
||||||
{
|
{
|
||||||
@@ -2515,8 +2542,8 @@ void *rrc_nrue_task( void *args_p ) {
|
|||||||
memcpy (srb_info_p->Rx_buffer.Payload, NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu,
|
memcpy (srb_info_p->Rx_buffer.Payload, NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu,
|
||||||
NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size);
|
NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size);
|
||||||
srb_info_p->Rx_buffer.payload_size = NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size;
|
srb_info_p->Rx_buffer.payload_size = NR_RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size;
|
||||||
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, RRC_MAC_CCCH_DATA_IND (msg_p).rnti, RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0);
|
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0);
|
||||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
|
// PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_RRC_MAC_CCCH_DATA_IND (msg_p).rnti, NR_RRC_MAC_CCCH_DATA_IND (msg_p).frame, 0, NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
|
||||||
nr_rrc_ue_decode_ccch (&ctxt,
|
nr_rrc_ue_decode_ccch (&ctxt,
|
||||||
srb_info_p,
|
srb_info_p,
|
||||||
NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
|
NR_RRC_MAC_CCCH_DATA_IND (msg_p).gnb_index);
|
||||||
@@ -2728,3 +2755,59 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index )
|
||||||
|
{
|
||||||
|
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size =
|
||||||
|
do_RRCReestablishmentRequest(
|
||||||
|
ctxt_pP->module_id,
|
||||||
|
(uint8_t *)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, 1);
|
||||||
|
LOG_I(NR_RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCReestablishmentRequest (bytes %d, gNB %d)\n",
|
||||||
|
ctxt_pP->module_id, ctxt_pP->frame, NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size, gNB_index);
|
||||||
|
|
||||||
|
for (int i=0; i<NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; i++) {
|
||||||
|
LOG_T(NR_RRC,"%x.",NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_T(NR_RRC,"\n");
|
||||||
|
|
||||||
|
#ifdef ITTI_SIM
|
||||||
|
MessageDef *message_p;
|
||||||
|
uint8_t *message_buffer;
|
||||||
|
message_buffer = itti_malloc (TASK_RRC_NRUE,TASK_RRC_GNB_SIM,
|
||||||
|
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size);
|
||||||
|
memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload,
|
||||||
|
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size);
|
||||||
|
message_p = itti_alloc_new_message (TASK_RRC_NRUE, UE_RRC_CCCH_DATA_IND);
|
||||||
|
UE_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer;
|
||||||
|
UE_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size;
|
||||||
|
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nr_rrc_ue_generate_rrcReestablishmentComplete(
|
||||||
|
const protocol_ctxt_t *const ctxt_pP,
|
||||||
|
NR_RRCReestablishment_t *rrcReestablishment,
|
||||||
|
uint8_t gNB_index
|
||||||
|
)
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
uint32_t length;
|
||||||
|
uint8_t buffer[100];
|
||||||
|
length = do_RRCReestablishmentComplete(buffer, rrcReestablishment->rrc_TransactionIdentifier);
|
||||||
|
#ifdef ITTI_SIM
|
||||||
|
MessageDef *message_p;
|
||||||
|
uint8_t *message_buffer;
|
||||||
|
message_buffer = itti_malloc (TASK_RRC_NRUE,TASK_RRC_GNB_SIM,length);
|
||||||
|
memcpy (message_buffer, buffer, length);
|
||||||
|
|
||||||
|
message_p = itti_alloc_new_message (TASK_RRC_NRUE, UE_RRC_DCCH_DATA_IND);
|
||||||
|
UE_RRC_DCCH_DATA_IND (message_p).rbid = DCCH;
|
||||||
|
UE_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
|
||||||
|
UE_RRC_DCCH_DATA_IND (message_p).size = length;
|
||||||
|
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ typedef struct NR_UE_RRC_INST_s {
|
|||||||
|
|
||||||
/* KeNB as computed from parameters within USIM card */
|
/* KeNB as computed from parameters within USIM card */
|
||||||
uint8_t kgnb[32];
|
uint8_t kgnb[32];
|
||||||
|
|
||||||
/* Used integrity/ciphering algorithms */
|
/* Used integrity/ciphering algorithms */
|
||||||
//RRC_LIST_TYPE(NR_SecurityAlgorithmConfig_t, NR_SecurityAlgorithmConfig) SecurityAlgorithmConfig_list;
|
//RRC_LIST_TYPE(NR_SecurityAlgorithmConfig_t, NR_SecurityAlgorithmConfig) SecurityAlgorithmConfig_list;
|
||||||
NR_CipheringAlgorithm_t cipheringAlgorithm;
|
NR_CipheringAlgorithm_t cipheringAlgorithm;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ int config_sync_var=-1;
|
|||||||
|
|
||||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||||
|
|
||||||
volatile int start_gNB = 0;
|
//volatile int start_gNB = 0;
|
||||||
volatile int oai_exit = 0;
|
volatile int oai_exit = 0;
|
||||||
|
|
||||||
//static int wait_for_sync = 0;
|
//static int wait_for_sync = 0;
|
||||||
@@ -543,7 +543,7 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
AMF_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||||
// AMF_MODE_ENABLED = 0;
|
// AMF_MODE_ENABLED = 0;
|
||||||
NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
|
NGAP_CONF_MODE = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
|
||||||
|
|
||||||
#if T_TRACER
|
#if T_TRACER
|
||||||
|
|||||||
@@ -551,6 +551,173 @@ gtpv1u_create_ngu_tunnel(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int gtpv1u_update_ngu_tunnel(
|
||||||
|
const instance_t instanceP,
|
||||||
|
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||||
|
const rnti_t prior_rnti
|
||||||
|
) {
|
||||||
|
/* Local tunnel end-point identifier */
|
||||||
|
teid_t ngu_teid = 0;
|
||||||
|
nr_gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL;
|
||||||
|
nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL;
|
||||||
|
nr_gtpv1u_ue_data_t *gtpv1u_ue_data_new_p = NULL;
|
||||||
|
//MessageDef *message_p = NULL;
|
||||||
|
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
|
||||||
|
int i,j;
|
||||||
|
uint8_t bearers_num = 0,bearers_total = 0;
|
||||||
|
//-----------------------
|
||||||
|
// PDCP->GTPV1U mapping
|
||||||
|
//-----------------------
|
||||||
|
hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti, (void **)>pv1u_ue_data_p);
|
||||||
|
|
||||||
|
if(hash_rc != HASH_TABLE_OK) {
|
||||||
|
LOG_E(GTPU,"Error get ue_mapping(rnti=%x) from GTPV1U hashtable error\n", prior_rnti);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtpv1u_ue_data_new_p = calloc (1, sizeof(nr_gtpv1u_ue_data_t));
|
||||||
|
memcpy(gtpv1u_ue_data_new_p,gtpv1u_ue_data_p,sizeof(nr_gtpv1u_ue_data_t));
|
||||||
|
gtpv1u_ue_data_new_p->ue_id = create_tunnel_req_pP->rnti;
|
||||||
|
hash_rc = hashtable_insert(RC.nr_gtpv1u_data_g->ue_mapping, create_tunnel_req_pP->rnti, gtpv1u_ue_data_new_p);
|
||||||
|
|
||||||
|
//AssertFatal(hash_rc == HASH_TABLE_OK, "Error inserting ue_mapping in GTPV1U hashtable");
|
||||||
|
if ( hash_rc != HASH_TABLE_OK ) {
|
||||||
|
LOG_E(GTPU,"Failed to insert ue_mapping(rnti=%x) in GTPV1U hashtable\n",create_tunnel_req_pP->rnti);
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
LOG_I(GTPU, "inserting ue_mapping(rnti=%x) in GTPV1U hashtable\n",
|
||||||
|
create_tunnel_req_pP->rnti);
|
||||||
|
}
|
||||||
|
|
||||||
|
hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, prior_rnti);
|
||||||
|
LOG_I(GTPU, "hashtable_remove ue_mapping(rnti=%x) in GTPV1U hashtable\n",
|
||||||
|
prior_rnti);
|
||||||
|
//-----------------------
|
||||||
|
// GTPV1U->PDCP mapping
|
||||||
|
//-----------------------
|
||||||
|
bearers_total =gtpv1u_ue_data_new_p->num_bearers;
|
||||||
|
|
||||||
|
for(j = 0; j<GTPV1U_MAX_BEARERS_ID; j++) {
|
||||||
|
if(gtpv1u_ue_data_new_p->bearers[j].state != BEARER_IN_CONFIG)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
bearers_num++;
|
||||||
|
|
||||||
|
for (i = 0; i < create_tunnel_req_pP->num_tunnels; i++) {
|
||||||
|
if(j == (create_tunnel_req_pP->pdusession_id[i]-GTPV1U_BEARER_OFFSET))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(i < create_tunnel_req_pP->num_tunnels) {
|
||||||
|
ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB;
|
||||||
|
hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid, (void **)>pv1u_teid_data_p);
|
||||||
|
|
||||||
|
if (hash_rc == HASH_TABLE_OK) {
|
||||||
|
gtpv1u_teid_data_p->ue_id = create_tunnel_req_pP->rnti;
|
||||||
|
gtpv1u_teid_data_p->pdu_session_id = create_tunnel_req_pP->pdusession_id[i];
|
||||||
|
LOG_I(GTPU, "updata teid_mapping te_id %u (prior_rnti %x rnti %x) in GTPV1U hashtable\n",
|
||||||
|
ngu_teid,prior_rnti,create_tunnel_req_pP->rnti);
|
||||||
|
} else {
|
||||||
|
LOG_W(GTPU, "Error get teid mapping(s1u_teid=%u) from GTPV1U hashtable", ngu_teid);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ngu_teid = gtpv1u_ue_data_new_p->bearers[j].teid_gNB;
|
||||||
|
hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, ngu_teid);
|
||||||
|
|
||||||
|
if (hash_rc != HASH_TABLE_OK) {
|
||||||
|
LOG_D(GTPU, "Removed user rnti %x , enb S1U teid %u not found\n", prior_rnti, ngu_teid);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtpv1u_ue_data_new_p->bearers[j].state = BEARER_DOWN;
|
||||||
|
gtpv1u_ue_data_new_p->num_bearers--;
|
||||||
|
LOG_I(GTPU, "delete teid_mapping te_id %u (rnti%x) bearer_id %d in GTPV1U hashtable\n",
|
||||||
|
ngu_teid,prior_rnti,j+GTPV1U_BEARER_OFFSET);;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bearers_num > bearers_total)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
int gtpv1u_delete_ngu_tunnel(
|
||||||
|
const instance_t instanceP,
|
||||||
|
const gtpv1u_gnb_delete_tunnel_req_t *const req_pP) {
|
||||||
|
NwGtpv1uUlpApiT stack_req;
|
||||||
|
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
|
||||||
|
MessageDef *message_p = NULL;
|
||||||
|
nr_gtpv1u_ue_data_t *gtpv1u_ue_data_p = NULL;
|
||||||
|
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
|
||||||
|
teid_t teid_gNB = 0;
|
||||||
|
int pdusession_index = 0;
|
||||||
|
message_p = itti_alloc_new_message(TASK_GTPV1_U, GTPV1U_GNB_DELETE_TUNNEL_RESP);
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti = req_pP->rnti;
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status = 0;
|
||||||
|
hash_rc = hashtable_get(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti, (void **)>pv1u_ue_data_p);
|
||||||
|
|
||||||
|
if (hash_rc == HASH_TABLE_OK) {
|
||||||
|
for (pdusession_index = 0; pdusession_index < req_pP->num_pdusession; pdusession_index++) {
|
||||||
|
teid_gNB = gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB;
|
||||||
|
LOG_D(GTPU, "Rx GTPV1U_ENB_DELETE_TUNNEL user rnti %x eNB S1U teid %u eps bearer id %u\n",
|
||||||
|
req_pP->rnti, teid_gNB, req_pP->pdusession_id[pdusession_index]);
|
||||||
|
{
|
||||||
|
memset(&stack_req, 0, sizeof(NwGtpv1uUlpApiT));
|
||||||
|
stack_req.apiType = NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT;
|
||||||
|
LOG_D(GTPU, "gtpv1u_delete_ngu_tunnel pdusession %u %u\n",
|
||||||
|
req_pP->pdusession_id[pdusession_index],
|
||||||
|
teid_gNB);
|
||||||
|
stack_req.apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle =
|
||||||
|
gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB_stack_session;
|
||||||
|
rc = nwGtpv1uProcessUlpReq(RC.nr_gtpv1u_data_g->gtpv1u_stack, &stack_req);
|
||||||
|
LOG_D(GTPU, ".\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rc != NW_GTPV1U_OK) {
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status |= 0xFF;
|
||||||
|
LOG_E(GTPU, "NW_GTPV1U_ULP_API_DESTROY_TUNNEL_ENDPOINT failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------
|
||||||
|
// PDCP->GTPV1U mapping
|
||||||
|
//-----------------------
|
||||||
|
gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].state = BEARER_DOWN;
|
||||||
|
gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_gNB = 0;
|
||||||
|
gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].teid_upf = 0;
|
||||||
|
gtpv1u_ue_data_p->bearers[req_pP->pdusession_id[pdusession_index] - GTPV1U_BEARER_OFFSET].upf_ip_addr = 0;
|
||||||
|
gtpv1u_ue_data_p->num_bearers -= 1;
|
||||||
|
|
||||||
|
if (gtpv1u_ue_data_p->num_bearers == 0) {
|
||||||
|
hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->ue_mapping, req_pP->rnti);
|
||||||
|
LOG_D(GTPU, "Removed user rnti %x,no more bearers configured\n", req_pP->rnti);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------
|
||||||
|
// GTPV1U->PDCP mapping
|
||||||
|
//-----------------------
|
||||||
|
hash_rc = hashtable_remove(RC.nr_gtpv1u_data_g->teid_mapping, teid_gNB);
|
||||||
|
|
||||||
|
if (hash_rc != HASH_TABLE_OK) {
|
||||||
|
LOG_D(GTPU, "Removed user rnti %x , gNB NGU teid %u not found\n", req_pP->rnti, teid_gNB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}// else silently do nothing
|
||||||
|
|
||||||
|
LOG_D(GTPU, "Tx GTPV1U_GNB_DELETE_TUNNEL_RESP user rnti %x gNB NGU teid %u status %u\n",
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti,
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).gnb_NGu_teid,
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).status);
|
||||||
|
MSC_LOG_TX_MESSAGE(
|
||||||
|
MSC_GTPU_GNB,
|
||||||
|
MSC_RRC_GNB,
|
||||||
|
NULL,0,
|
||||||
|
"0 GTPV1U_GNB_DELETE_TUNNEL_RESP rnti %x teid %x",
|
||||||
|
GTPV1U_GNB_DELETE_TUNNEL_RESP(message_p).rnti,
|
||||||
|
teid_gNB);
|
||||||
|
return itti_send_msg_to_task(TASK_RRC_GNB, instanceP, message_p);
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) {
|
static int gtpv1u_gNB_send_init_udp(const Gtpv1uNGReq *req) {
|
||||||
// Create and alloc new message
|
// Create and alloc new message
|
||||||
@@ -603,6 +770,10 @@ void *gtpv1u_gNB_process_itti_msg(void *notUsed) {
|
|||||||
gtpv1u_ng_req(instance, &received_message_p->ittiMsg.gtpv1uNGReq);
|
gtpv1u_ng_req(instance, &received_message_p->ittiMsg.gtpv1uNGReq);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GTPV1U_GNB_DELETE_TUNNEL_REQ:
|
||||||
|
gtpv1u_delete_ngu_tunnel(instance, &received_message_p->ittiMsg.NRGtpv1uDeleteTunnelReq);
|
||||||
|
break;
|
||||||
|
|
||||||
case TERMINATE_MESSAGE: {
|
case TERMINATE_MESSAGE: {
|
||||||
if (RC.nr_gtpv1u_data_g->ue_mapping != NULL) {
|
if (RC.nr_gtpv1u_data_g->ue_mapping != NULL) {
|
||||||
hashtable_destroy (&(RC.nr_gtpv1u_data_g->ue_mapping));
|
hashtable_destroy (&(RC.nr_gtpv1u_data_g->ue_mapping));
|
||||||
|
|||||||
@@ -40,5 +40,12 @@ gtpv1u_create_ngu_tunnel(
|
|||||||
const gtpv1u_gnb_create_tunnel_req_t * const create_tunnel_req_pP,
|
const gtpv1u_gnb_create_tunnel_req_t * const create_tunnel_req_pP,
|
||||||
gtpv1u_gnb_create_tunnel_resp_t * const create_tunnel_resp_pP);
|
gtpv1u_gnb_create_tunnel_resp_t * const create_tunnel_resp_pP);
|
||||||
|
|
||||||
|
int
|
||||||
|
gtpv1u_update_ngu_tunnel(
|
||||||
|
const instance_t instanceP,
|
||||||
|
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||||
|
const rnti_t prior_rnti
|
||||||
|
);
|
||||||
|
|
||||||
#endif /* GTPV1U_GNB_TASK_H_ */
|
#endif /* GTPV1U_GNB_TASK_H_ */
|
||||||
|
|
||||||
|
|||||||
@@ -525,6 +525,8 @@ void generateSecurityModeComplete(as_nas_info_t *initialNasMsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void generateRegistrationComplete(as_nas_info_t *initialNasMsg, SORTransparentContainer *sortransparentcontainer) {
|
void generateRegistrationComplete(as_nas_info_t *initialNasMsg, SORTransparentContainer *sortransparentcontainer) {
|
||||||
|
//wait send RRCReconfigurationComplete and InitialContextSetupResponse
|
||||||
|
sleep(1);
|
||||||
int length = 0;
|
int length = 0;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
fgs_nas_message_t nas_msg;
|
fgs_nas_message_t nas_msg;
|
||||||
@@ -603,6 +605,8 @@ void generateRegistrationComplete(as_nas_info_t *initialNasMsg, SORTransparentCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
|
void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
|
||||||
|
//wait send RegistrationComplete
|
||||||
|
usleep(100*150);
|
||||||
int size = 0;
|
int size = 0;
|
||||||
fgs_nas_message_t nas_msg;
|
fgs_nas_message_t nas_msg;
|
||||||
memset(&nas_msg, 0, sizeof(fgs_nas_message_t));
|
memset(&nas_msg, 0, sizeof(fgs_nas_message_t));
|
||||||
|
|||||||
@@ -1754,7 +1754,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// handle e-rab release command and send it to rrc_end
|
// handle pdu session release command and send it to rrc_end
|
||||||
static
|
static
|
||||||
int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
||||||
uint32_t stream,
|
uint32_t stream,
|
||||||
@@ -1772,7 +1772,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
|||||||
container = &pdu->choice.initiatingMessage->value.choice.PDUSessionResourceReleaseCommand;
|
container = &pdu->choice.initiatingMessage->value.choice.PDUSessionResourceReleaseCommand;
|
||||||
|
|
||||||
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
|
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
|
||||||
NGAP_ERROR("[SCTP %d] Received E-RAB release command for non existing AMF context\n", assoc_id);
|
NGAP_ERROR("[SCTP %d] Received pdu session release command for non existing AMF context\n", assoc_id);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1805,11 +1805,11 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initial context request = UE-related procedure -> stream != 0 */
|
/* Initial context request = UE-related procedure -> stream != 0 */
|
||||||
if (stream == 0) {
|
// if (stream == 0) {
|
||||||
NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n",
|
// NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n",
|
||||||
assoc_id, stream);
|
// assoc_id, stream);
|
||||||
return -1;
|
// return -1;
|
||||||
}
|
// }
|
||||||
|
|
||||||
ue_desc_p->rx_stream = stream;
|
ue_desc_p->rx_stream = stream;
|
||||||
|
|
||||||
@@ -1818,7 +1818,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
|||||||
(uint64_t)ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
|
(uint64_t)ue_desc_p->amf_ue_ngap_id, amf_ue_ngap_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
NGAP_DEBUG("[SCTP %d] Received E-RAB release command for gNB_UE_NGAP_ID %lu amf_ue_ngap_id %lu\n",
|
NGAP_DEBUG("[SCTP %d] Received pdu session release command for gNB_UE_NGAP_ID %lu amf_ue_ngap_id %lu\n",
|
||||||
assoc_id, gnb_ue_ngap_id, amf_ue_ngap_id);
|
assoc_id, gnb_ue_ngap_id, amf_ue_ngap_id);
|
||||||
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_RELEASE_COMMAND);
|
message_p = itti_alloc_new_message(TASK_NGAP, NGAP_PDUSESSION_RELEASE_COMMAND);
|
||||||
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).gNB_ue_ngap_id = gnb_ue_ngap_id;
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).gNB_ue_ngap_id = gnb_ue_ngap_id;
|
||||||
@@ -1850,7 +1850,18 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
|
|||||||
item_p = (NGAP_PDUSessionResourceToReleaseItemRelCmd_t *)ie->value.choice.PDUSessionResourceToReleaseListRelCmd.list.array[i];
|
item_p = (NGAP_PDUSessionResourceToReleaseItemRelCmd_t *)ie->value.choice.PDUSessionResourceToReleaseListRelCmd.list.array[i];
|
||||||
|
|
||||||
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].pdusession_id = item_p->pDUSessionID;
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].pdusession_id = item_p->pDUSessionID;
|
||||||
NGAP_DEBUG("[SCTP] Received E-RAB release command for pDUSessionID id %ld\n", item_p->pDUSessionID);
|
if(item_p->pDUSessionResourceReleaseCommandTransfer.size > 0) {
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_length = item_p->pDUSessionResourceReleaseCommandTransfer.size;
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer = malloc(sizeof(uint8_t) * item_p->pDUSessionResourceReleaseCommandTransfer.size);
|
||||||
|
memcpy(NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer,
|
||||||
|
item_p->pDUSessionResourceReleaseCommandTransfer.buf,
|
||||||
|
item_p->pDUSessionResourceReleaseCommandTransfer.size);
|
||||||
|
}else {
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_length = 0;
|
||||||
|
NGAP_PDUSESSION_RELEASE_COMMAND(message_p).pdusession_release_params[i].transfer_buffer = NULL;
|
||||||
|
NGAP_ERROR("[NGAP] Received pdu session release command for pDUSessionResourceReleaseCommandTransfer is NULL!\n");
|
||||||
|
}
|
||||||
|
NGAP_DEBUG("[NGAP] Received pdu session release command for pDUSessionID id %ld\n", item_p->pDUSessionID);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -852,21 +852,22 @@ int ngap_gNB_initial_ctxt_resp(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
MSC_LOG_TX_MESSAGE(
|
MSC_LOG_TX_MESSAGE(
|
||||||
MSC_NGAP_GNB,
|
MSC_NGAP_GNB,
|
||||||
MSC_NGAP_AMF,
|
MSC_NGAP_AMF,
|
||||||
(const char *)buffer,
|
(const char *)buffer,
|
||||||
length,
|
length,
|
||||||
MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
|
MSC_AS_TIME_FMT" InitialContextSetup successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
|
||||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||||
initial_ctxt_resp_p->gNB_ue_ngap_id,
|
initial_ctxt_resp_p->gNB_ue_ngap_id,
|
||||||
ue_context_p->amf_ue_ngap_id);
|
ue_context_p->amf_ue_ngap_id);
|
||||||
/* UE associated signalling -> use the allocated stream */
|
/* UE associated signalling -> use the allocated stream */
|
||||||
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
|
LOG_I(NR_RRC,"Send message to sctp: NGAP_InitialContextSetupResponse\n");
|
||||||
ue_context_p->amf_ref->assoc_id, buffer,
|
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
|
||||||
length, ue_context_p->tx_stream);
|
ue_context_p->amf_ref->assoc_id, buffer,
|
||||||
|
length, ue_context_p->tx_stream);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -1421,7 +1422,52 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
|
|||||||
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
|
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
|
||||||
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceReleasedListRelRes;
|
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceReleasedListRelRes;
|
||||||
ie->criticality = NGAP_Criticality_ignore;
|
ie->criticality = NGAP_Criticality_ignore;
|
||||||
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_PDUSessionResourceReleasedListRelRes;
|
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_AMF_UE_NGAP_ID;
|
||||||
|
asn_uint642INTEGER(&ie->value.choice.AMF_UE_NGAP_ID, ue_context_p->amf_ue_ngap_id);
|
||||||
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
/* mandatory */
|
||||||
|
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
|
||||||
|
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
|
||||||
|
ie->criticality = NGAP_Criticality_ignore;
|
||||||
|
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_RAN_UE_NGAP_ID;
|
||||||
|
ie->value.choice.RAN_UE_NGAP_ID = pdusession_release_resp_p->gNB_ue_ngap_id;
|
||||||
|
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||||
|
|
||||||
|
/* optional */
|
||||||
|
if (pdusession_release_resp_p->nb_of_pdusessions_released > 0) {
|
||||||
|
ie = (NGAP_PDUSessionResourceReleaseResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleaseResponseIEs_t));
|
||||||
|
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceReleasedListRelRes;
|
||||||
|
ie->criticality = NGAP_Criticality_ignore;
|
||||||
|
ie->value.present = NGAP_PDUSessionResourceReleaseResponseIEs__value_PR_PDUSessionResourceReleasedListRelRes;
|
||||||
|
|
||||||
|
for (i = 0; i < pdusession_release_resp_p->nb_of_pdusessions_released; i++) {
|
||||||
|
NGAP_PDUSessionResourceReleasedItemRelRes_t *item;
|
||||||
|
item = (NGAP_PDUSessionResourceReleasedItemRelRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceReleasedItemRelRes_t));
|
||||||
|
|
||||||
|
item->pDUSessionID = pdusession_release_resp_p->pdusession_release[i].pdusession_id;
|
||||||
|
if(pdusession_release_resp_p->pdusession_release[i].transfer_length > 0){
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.size = pdusession_release_resp_p->pdusession_release[i].transfer_length;
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.buf = malloc(sizeof(uint8_t) * pdusession_release_resp_p->pdusession_release[i].transfer_length);
|
||||||
|
memcpy(item->pDUSessionResourceReleaseResponseTransfer.buf,
|
||||||
|
pdusession_release_resp_p->pdusession_release[i].transfer_buffer,
|
||||||
|
pdusession_release_resp_p->pdusession_release[i].transfer_length);
|
||||||
|
}else {
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.size = 0;
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.buf = NULL;
|
||||||
|
NGAP_DEBUG("pdusession_release_resp: transfer_buffer is NULL!\n");
|
||||||
|
#ifdef ITTI_SIM
|
||||||
|
//For testing only
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.buf = malloc(sizeof(uint8_t) * 1);
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.size = 1;
|
||||||
|
uint8_t temp = 0;
|
||||||
|
memcpy(item->pDUSessionResourceReleaseResponseTransfer.buf,
|
||||||
|
&temp,
|
||||||
|
item->pDUSessionResourceReleaseResponseTransfer.size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
NGAP_DEBUG("pdusession_release_resp: pdusession ID %ld\n", item->pDUSessionID);
|
||||||
|
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceReleasedListRelRes.list, item);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < pdusession_release_resp_p->nb_of_pdusessions_released; i++) {
|
for (i = 0; i < pdusession_release_resp_p->nb_of_pdusessions_released; i++) {
|
||||||
NGAP_PDUSessionResourceReleasedItemRelRes_t *item;
|
NGAP_PDUSessionResourceReleasedItemRelRes_t *item;
|
||||||
|
|||||||
Reference in New Issue
Block a user