Commit f94d2870 authored by francescomani's avatar francescomani

code clenup

parent f8f9f8ac
...@@ -1485,161 +1485,154 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -1485,161 +1485,154 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
} }
//----------------------------------------------------------------------------- void nr_rrc_ue_process_securityModeCommand(const protocol_ctxt_t *const ctxt_pP,
void NR_SecurityModeCommand_t *const securityModeCommand,
nr_rrc_ue_process_securityModeCommand( const uint8_t gNB_index)
const protocol_ctxt_t *const ctxt_pP, {
NR_SecurityModeCommand_t *const securityModeCommand, asn_enc_rval_t enc_rval;
const uint8_t gNB_index NR_UL_DCCH_Message_t ul_dcch_msg;
) uint8_t buffer[200];
//----------------------------------------------------------------------------- int i, securityMode;
{ LOG_I(NR_RRC,"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), Processing securityModeCommand (eNB %d)\n",
asn_enc_rval_t enc_rval; ctxt_pP->module_id,ctxt_pP->frame, ctxt_pP->subframe, gNB_index);
NR_UL_DCCH_Message_t ul_dcch_msg;
uint8_t buffer[200]; NR_SecurityConfigSMC_t *securityConfigSMC = &securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC;
int i, securityMode; NR_UE_RRC_INST_t *ue_rrc = &NR_UE_rrc_inst[ctxt_pP->module_id];
LOG_I(NR_RRC,"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), Processing securityModeCommand (eNB %d)\n",
ctxt_pP->module_id,ctxt_pP->frame, ctxt_pP->subframe, gNB_index); switch (securityConfigSMC->securityAlgorithmConfig.cipheringAlgorithm) {
case NR_CipheringAlgorithm_nea0:
switch (securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC.securityAlgorithmConfig.cipheringAlgorithm) { LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea0\n",
case NR_CipheringAlgorithm_nea0: ctxt_pP->module_id);
LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea0\n", securityMode= NR_CipheringAlgorithm_nea0;
ctxt_pP->module_id); break;
securityMode= NR_CipheringAlgorithm_nea0;
break;
case NR_CipheringAlgorithm_nea1: case NR_CipheringAlgorithm_nea1:
LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea1\n",ctxt_pP->module_id); LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea1\n",ctxt_pP->module_id);
securityMode= NR_CipheringAlgorithm_nea1; securityMode= NR_CipheringAlgorithm_nea1;
break; break;
case NR_CipheringAlgorithm_nea2: case NR_CipheringAlgorithm_nea2:
LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea2\n", LOG_I(NR_RRC,"[UE %d] Security algorithm is set to nea2\n",
ctxt_pP->module_id); ctxt_pP->module_id);
securityMode = NR_CipheringAlgorithm_nea2; securityMode = NR_CipheringAlgorithm_nea2;
break; break;
default: default:
LOG_I(NR_RRC,"[UE %d] Security algorithm is set to none\n",ctxt_pP->module_id); LOG_I(NR_RRC,"[UE %d] Security algorithm is set to none\n",ctxt_pP->module_id);
securityMode = NR_CipheringAlgorithm_spare1; securityMode = NR_CipheringAlgorithm_spare1;
break; break;
} }
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm = ue_rrc->cipheringAlgorithm = securityConfigSMC->securityAlgorithmConfig.cipheringAlgorithm;
securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC.securityAlgorithmConfig.cipheringAlgorithm;
if (securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm != NULL)
{
switch (*securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm) {
case NR_IntegrityProtAlgorithm_nia1:
LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to nia1\n",ctxt_pP->module_id);
securityMode |= 1 << 5;
break;
case NR_IntegrityProtAlgorithm_nia2: if (securityConfigSMC->securityAlgorithmConfig.integrityProtAlgorithm != NULL) {
LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to nia2\n",ctxt_pP->module_id); switch (*securityConfigSMC->securityAlgorithmConfig.integrityProtAlgorithm) {
securityMode |= 1 << 6; case NR_IntegrityProtAlgorithm_nia1:
break; LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to nia1\n",ctxt_pP->module_id);
securityMode |= 1 << 5;
break;
default: case NR_IntegrityProtAlgorithm_nia2:
LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to none\n",ctxt_pP->module_id); LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to nia2\n",ctxt_pP->module_id);
securityMode |= 0x70 ; securityMode |= 1 << 6;
break; break;
}
NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm = default:
*securityModeCommand->criticalExtensions.choice.securityModeCommand->securityConfigSMC.securityAlgorithmConfig.integrityProtAlgorithm; LOG_I(NR_RRC,"[UE %d] Integrity protection algorithm is set to none\n",ctxt_pP->module_id);
securityMode |= 0x70 ;
break;
}
} ue_rrc->integrityProtAlgorithm = *securityConfigSMC->securityAlgorithmConfig.integrityProtAlgorithm;
}
LOG_D(NR_RRC,"[UE %d] security mode is %x \n",ctxt_pP->module_id, securityMode); LOG_D(NR_RRC,"[UE %d] security mode is %x \n",ctxt_pP->module_id, securityMode);
memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t));
//memset((void *)&SecurityModeCommand,0,sizeof(SecurityModeCommand_t)); //memset((void *)&SecurityModeCommand,0,sizeof(SecurityModeCommand_t));
ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1;
ul_dcch_msg.message.choice.c1 = calloc(1, sizeof(*ul_dcch_msg.message.choice.c1)); ul_dcch_msg.message.choice.c1 = calloc(1, sizeof(*ul_dcch_msg.message.choice.c1));
if (securityMode >= NO_SECURITY_MODE) {
LOG_I(NR_RRC, "rrc_ue_process_securityModeCommand, security mode complete case \n");
ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeComplete;
} else {
LOG_I(NR_RRC, "rrc_ue_process_securityModeCommand, security mode failure case \n");
ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeFailure;
ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeComplete;
}
uint8_t kRRCenc[16] = {0}; if (securityMode >= NO_SECURITY_MODE) {
uint8_t kUPenc[16] = {0}; LOG_I(NR_RRC, "rrc_ue_process_securityModeCommand, security mode complete case \n");
uint8_t kRRCint[16] = {0}; ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeComplete;
nr_derive_key(UP_ENC_ALG, } else {
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm, LOG_I(NR_RRC, "rrc_ue_process_securityModeCommand, security mode failure case \n");
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeFailure;
kUPenc); ul_dcch_msg.message.choice.c1->present = NR_UL_DCCH_MessageType__c1_PR_securityModeComplete;
nr_derive_key(RRC_ENC_ALG, }
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm,
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, uint8_t kRRCenc[16] = {0};
kRRCenc); uint8_t kUPenc[16] = {0};
nr_derive_key(RRC_INT_ALG, uint8_t kRRCint[16] = {0};
NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm, nr_derive_key(UP_ENC_ALG,
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, ue_rrc->cipheringAlgorithm,
kRRCint); ue_rrc->kgnb,
kUPenc);
LOG_I(NR_RRC, "driving kRRCenc, kRRCint and kUPenc from KgNB=" nr_derive_key(RRC_ENC_ALG,
"%02x%02x%02x%02x" ue_rrc->cipheringAlgorithm,
"%02x%02x%02x%02x" ue_rrc->kgnb,
"%02x%02x%02x%02x" kRRCenc);
"%02x%02x%02x%02x" nr_derive_key(RRC_INT_ALG,
"%02x%02x%02x%02x" ue_rrc->cipheringAlgorithm,
"%02x%02x%02x%02x" ue_rrc->kgnb,
"%02x%02x%02x%02x" kRRCint);
"%02x%02x%02x%02x\n",
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[0], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[1], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[2], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[3], LOG_I(NR_RRC, "driving kRRCenc, kRRCint and kUPenc from KgNB="
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[4], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[5], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[6], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[7], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[8], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[9], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[10], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[11], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[12], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[13], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[14], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[15], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[16], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[17], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[18], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[19], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[20], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[21], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[22], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[23], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[24], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[25], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[26], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[27], "%02x%02x%02x%02x"
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[28], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[29], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[30], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[31]); "%02x%02x%02x%02x"
"%02x%02x%02x%02x\n",
if (securityMode != 0xff) { ue_rrc->kgnb[0], ue_rrc->kgnb[1], ue_rrc->kgnb[2], ue_rrc->kgnb[3],
uint8_t security_mode = ue_rrc->kgnb[4], ue_rrc->kgnb[5], ue_rrc->kgnb[6], ue_rrc->kgnb[7],
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4); ue_rrc->kgnb[8], ue_rrc->kgnb[9], ue_rrc->kgnb[10], ue_rrc->kgnb[11],
nr_pdcp_config_set_security(ctxt_pP->rntiMaybeUEid, DCCH, security_mode, kRRCenc, kRRCint, kUPenc); ue_rrc->kgnb[12], ue_rrc->kgnb[13], ue_rrc->kgnb[14], ue_rrc->kgnb[15],
} else { ue_rrc->kgnb[16], ue_rrc->kgnb[17], ue_rrc->kgnb[18], ue_rrc->kgnb[19],
LOG_I(NR_RRC, "skipped pdcp_config_set_security() as securityMode == 0x%02x", securityMode); ue_rrc->kgnb[20], ue_rrc->kgnb[21], ue_rrc->kgnb[22], ue_rrc->kgnb[23],
} ue_rrc->kgnb[24], ue_rrc->kgnb[25], ue_rrc->kgnb[26], ue_rrc->kgnb[27],
ue_rrc->kgnb[28], ue_rrc->kgnb[29], ue_rrc->kgnb[30], ue_rrc->kgnb[31]);
if (securityMode != 0xff) {
uint8_t security_mode = ue_rrc->cipheringAlgorithm | (ue_rrc->integrityProtAlgorithm << 4);
nr_pdcp_config_set_security(ctxt_pP->rntiMaybeUEid, DCCH, security_mode, kRRCenc, kRRCint, kUPenc);
} else {
LOG_I(NR_RRC, "skipped pdcp_config_set_security() as securityMode == 0x%02x", securityMode);
}
if (securityModeCommand->criticalExtensions.present == NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand) { if (securityModeCommand->criticalExtensions.present == NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand) {
ul_dcch_msg.message.choice.c1->choice.securityModeComplete = CALLOC(1, sizeof(NR_SecurityModeComplete_t)); ul_dcch_msg.message.choice.c1->choice.securityModeComplete = CALLOC(1, sizeof(NR_SecurityModeComplete_t));
ul_dcch_msg.message.choice.c1->choice.securityModeComplete->rrc_TransactionIdentifier = securityModeCommand->rrc_TransactionIdentifier; ul_dcch_msg.message.choice.c1->choice.securityModeComplete->rrc_TransactionIdentifier = securityModeCommand->rrc_TransactionIdentifier;
ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.present = NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete; ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.present = NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete;
ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.choice.securityModeComplete = CALLOC(1, sizeof(NR_SecurityModeComplete_IEs_t)); ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.choice.securityModeComplete = CALLOC(1, sizeof(NR_SecurityModeComplete_IEs_t));
ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.choice.securityModeComplete->nonCriticalExtension =NULL; ul_dcch_msg.message.choice.c1->choice.securityModeComplete->criticalExtensions.choice.securityModeComplete->nonCriticalExtension =NULL;
LOG_I(NR_RRC,"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (gNB %d), rrc_TransactionIdentifier: %ld\n", LOG_I(NR_RRC,"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (gNB %d), rrc_TransactionIdentifier: %ld\n",
ctxt_pP->module_id,ctxt_pP->frame, ctxt_pP->subframe, gNB_index, securityModeCommand->rrc_TransactionIdentifier); ctxt_pP->module_id,ctxt_pP->frame, ctxt_pP->subframe, gNB_index, securityModeCommand->rrc_TransactionIdentifier);
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_DCCH_Message, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UL_DCCH_Message,
NULL, NULL,
(void *)&ul_dcch_msg, (void *)&ul_dcch_msg,
buffer, buffer,
100); 100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n", AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&ul_dcch_msg); xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&ul_dcch_msg);
} }
log_dump(MAC, buffer, 16, LOG_DUMP_CHAR, "securityModeComplete payload: "); log_dump(NR_RRC, buffer, 16, LOG_DUMP_CHAR, "securityModeComplete payload: ");
LOG_D(NR_RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8); LOG_D(NR_RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) { for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
LOG_T(NR_RRC, "%02x.", buffer[i]); LOG_T(NR_RRC, "%02x.", buffer[i]);
} }
LOG_T(NR_RRC, "\n");
LOG_T(NR_RRC, "\n"); nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, (enc_rval.encoded + 7) / 8, buffer, deliver_pdu_srb_rlc, NULL);
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, (enc_rval.encoded + 7) / 8, buffer, deliver_pdu_srb_rlc, NULL); } else
} else LOG_W(NR_RRC,"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand\n",
LOG_W(NR_RRC,"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand\n", securityModeCommand->criticalExtensions.present);
securityModeCommand->criticalExtensions.present); }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index) { void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index) {
...@@ -1698,15 +1691,10 @@ nr_rrc_ue_establish_srb1( ...@@ -1698,15 +1691,10 @@ nr_rrc_ue_establish_srb1(
return(0); return(0);
} }
//----------------------------------------------------------------------------- int32_t nr_rrc_ue_establish_srb2(module_id_t ue_mod_idP,
int32_t frame_t frameP,
nr_rrc_ue_establish_srb2( uint8_t gNB_index,
module_id_t ue_mod_idP, NR_SRB_ToAddMod_t *SRB_config)
frame_t frameP,
uint8_t gNB_index,
NR_SRB_ToAddMod_t *SRB_config
)
//-----------------------------------------------------------------------------
{ {
// add descriptor from RRC PDU // add descriptor from RRC PDU
NR_UE_rrc_inst[ue_mod_idP].Srb2[gNB_index].Active = 1; NR_UE_rrc_inst[ue_mod_idP].Srb2[gNB_index].Active = 1;
...@@ -1715,24 +1703,19 @@ nr_rrc_ue_establish_srb2( ...@@ -1715,24 +1703,19 @@ nr_rrc_ue_establish_srb2(
return(0); return(0);
} }
//----------------------------------------------------------------------------- int32_t nr_rrc_ue_establish_drb(module_id_t ue_mod_idP,
int32_t frame_t frameP,
nr_rrc_ue_establish_drb( uint8_t gNB_index,
module_id_t ue_mod_idP, NR_DRB_ToAddMod_t *DRB_config)
frame_t frameP, {
uint8_t gNB_index, // add descriptor from RRC PDU
NR_DRB_ToAddMod_t *DRB_config int oip_ifup = 0, ip_addr_offset3 = 0, ip_addr_offset4 = 0;
) /* avoid gcc warnings */
//----------------------------------------------------------------------------- (void)oip_ifup;
{ (void)ip_addr_offset3;
// add descriptor from RRC PDU (void)ip_addr_offset4;
int oip_ifup = 0, ip_addr_offset3 = 0, ip_addr_offset4 = 0; LOG_I(NR_RRC,"[UE %d] Frame %d: processing RRCReconfiguration: reconfiguring DRB %ld\n",
/* avoid gcc warnings */ ue_mod_idP, frameP, DRB_config->drb_Identity);
(void)oip_ifup;
(void)ip_addr_offset3;
(void)ip_addr_offset4;
LOG_I(NR_RRC,"[UE %d] Frame %d: processing RRCReconfiguration: reconfiguring DRB %ld\n",
ue_mod_idP, frameP, DRB_config->drb_Identity);
if(!get_softmodem_params()->sa) { if(!get_softmodem_params()->sa) {
ip_addr_offset3 = 0; ip_addr_offset3 = 0;
...@@ -1759,9 +1742,8 @@ nr_rrc_ue_establish_srb2( ...@@ -1759,9 +1742,8 @@ nr_rrc_ue_establish_srb2(
LOG_D(NR_RRC,"[UE %d] State = Attached (gNB %d)\n",ue_mod_idP,gNB_index); LOG_D(NR_RRC,"[UE %d] State = Attached (gNB %d)\n",ue_mod_idP,gNB_index);
} }
} }
return(0);
return(0); }
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
...@@ -2253,11 +2235,9 @@ nr_rrc_ue_establish_srb2( ...@@ -2253,11 +2235,9 @@ nr_rrc_ue_establish_srb2(
case NR_DL_DCCH_MessageType__c1_PR_securityModeCommand: case NR_DL_DCCH_MessageType__c1_PR_securityModeCommand:
LOG_I(NR_RRC, "[UE %d] Received securityModeCommand (gNB %d)\n", LOG_I(NR_RRC, "[UE %d] Received securityModeCommand (gNB %d)\n",
ctxt_pP->module_id, gNB_indexP); ctxt_pP->module_id, gNB_indexP);
nr_rrc_ue_process_securityModeCommand( nr_rrc_ue_process_securityModeCommand(ctxt_pP,
ctxt_pP, dl_dcch_msg->message.choice.c1->choice.securityModeCommand,
dl_dcch_msg->message.choice.c1->choice.securityModeCommand, gNB_indexP);
gNB_indexP);
break; break;
} }
} }
......
...@@ -183,62 +183,61 @@ typedef struct NR_UE_Timers_Constants_s { ...@@ -183,62 +183,61 @@ typedef struct NR_UE_Timers_Constants_s {
} NR_UE_Timers_Constants_t; } NR_UE_Timers_Constants_t;
typedef struct NR_UE_RRC_INST_s { typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config;
NR_MeasConfig_t *meas_config; NR_CellGroupConfig_t *cell_group_config;
NR_CellGroupConfig_t *cell_group_config; NR_ServingCellConfigCommonSIB_t *servingCellConfigCommonSIB;
NR_ServingCellConfigCommonSIB_t *servingCellConfigCommonSIB; NR_CellGroupConfig_t *scell_group_config;
NR_CellGroupConfig_t *scell_group_config; NR_RadioBearerConfig_t *radio_bearer_config;
NR_RadioBearerConfig_t *radio_bearer_config;
NR_MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ];
NR_MeasObjectToAddMod_t *MeasObj[NB_CNX_UE][MAX_MEAS_OBJ]; NR_ReportConfigToAddMod_t *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG];
NR_ReportConfigToAddMod_t *ReportConfig[NB_CNX_UE][MAX_MEAS_CONFIG]; NR_QuantityConfig_t *QuantityConfig[NB_CNX_UE];
NR_QuantityConfig_t *QuantityConfig[NB_CNX_UE]; NR_MeasIdToAddMod_t *MeasId[NB_CNX_UE][MAX_MEAS_ID];
NR_MeasIdToAddMod_t *MeasId[NB_CNX_UE][MAX_MEAS_ID]; NR_MeasGapConfig_t *measGapConfig[NB_CNX_UE];
NR_MeasGapConfig_t *measGapConfig[NB_CNX_UE]; NR_RSRP_Range_t s_measure;
NR_RSRP_Range_t s_measure; NR_SRB_ToAddMod_t *SRB1_config[NB_CNX_UE];
NR_SRB_ToAddMod_t *SRB1_config[NB_CNX_UE]; NR_SRB_ToAddMod_t *SRB2_config[NB_CNX_UE];
NR_SRB_ToAddMod_t *SRB2_config[NB_CNX_UE]; NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8];
NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB
rb_id_t *defaultDRB; // remember the ID of the default DRB
char *uecap_file;
char *uecap_file; rnti_t rnti;
rnti_t rnti;
NR_SRB_INFO Srb0[NB_SIG_CNX_UE];
NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE];
uint8_t MBMS_flag;
uint8_t MBMS_flag; OAI_NR_UECapability_t *UECap;
OAI_NR_UECapability_t *UECap; uint8_t *UECapability;
uint8_t *UECapability; uint16_t UECapability_size;
uint16_t UECapability_size;
NR_UE_Timers_Constants_t timers_and_constants;
NR_UE_Timers_Constants_t timers_and_constants;
RA_trigger_t ra_trigger;
RA_trigger_t ra_trigger;
plmn_t plmnID;
plmn_t plmnID;
BIT_STRING_t requested_SI_List;
BIT_STRING_t requested_SI_List; NR_UE_RRC_SI_INFO SInfo[NB_SIG_CNX_UE];
NR_UE_RRC_SI_INFO SInfo[NB_SIG_CNX_UE];
NR_MIB_t *mib;
NR_MIB_t *mib;
// active BWPs
// active BWPs NR_BWP_DownlinkDedicated_t *bwpd;
NR_BWP_DownlinkDedicated_t *bwpd; NR_BWP_UplinkDedicated_t *ubwpd;
NR_BWP_UplinkDedicated_t *ubwpd;
/* 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; e_NR_IntegrityProtAlgorithm integrityProtAlgorithm;
e_NR_IntegrityProtAlgorithm integrityProtAlgorithm;
long selected_plmn_identity;
long selected_plmn_identity; Rrc_State_NR_t nrRrcState;
Rrc_State_NR_t nrRrcState; Rrc_Sub_State_NR_t nrRrcSubState;
Rrc_Sub_State_NR_t nrRrcSubState; as_nas_info_t initialNasMsg;
as_nas_info_t initialNasMsg;
} NR_UE_RRC_INST_t; } NR_UE_RRC_INST_t;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment