Commit c11c1437 authored by Xue Song's avatar Xue Song

add rrc_gNB_modify_dedicatedRRCReconfiguration()

add rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ()
add rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP()
parent c9d00817
......@@ -345,14 +345,18 @@ typedef struct gNB_RRC_UE_s {
uint8_t setup_e_rabs;
/* Number of e_rab to be setup in the list */
uint8_t nb_of_e_rabs;
/* Total number of pdu session already setup in the list */
uint8_t setup_pdu_sessions;
/* Number of pdu session to be setup in the list */
uint8_t nb_of_pdusessions;
/* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_e_rabs;
uint8_t nb_of_failed_e_rabs;
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
/* Total number of pdu session already setup in the list */
uint8_t setup_pdu_sessions;
/* Number of pdu session to be setup in the list */
uint8_t nb_of_pdusessions;
/* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_pdusessions;
uint8_t nb_of_failed_pdusessions;
pdu_session_param_t modify_pdusession[NR_NB_RB_MAX];
/* 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];
......
......@@ -1156,6 +1156,187 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
#endif
}
//-----------------------------------------------------------------------------
int
rrc_gNB_modify_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP)
//-----------------------------------------------------------------------------
{
NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t **DRB_configList = NULL;
NR_DRB_ToAddModList_t *DRB_configList2 = NULL;
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList
*dedicatedNAS_MessageList = NULL;
NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL;
uint8_t buffer[RRC_BUF_SIZE];
uint16_t size;
int qos_flow_index = 0;
NR_QFI_t qfi = 0;
int i, j;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
DRB_configList = &ue_context_pP->ue_context.DRB_configList;
DRB_configList2 = CALLOC(1, sizeof(NR_DRB_ToAddModList_t));
memset(DRB_configList2, 0, sizeof(NR_DRB_ToAddModList_t));
dedicatedNAS_MessageList = CALLOC(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList));
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
// bypass the new and already configured pdu sessions
if (ue_context_pP->ue_context.modify_pdusession[i].status >= PDU_SESSION_STATUS_DONE) {
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
continue;
}
if (ue_context_pP->ue_context.modify_pdusession[i].cause != NGAP_CAUSE_NOTHING) {
// set xid of failure pdu session
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
continue;
}
// search exist DRB_config
for (j = 0; j < (*DRB_configList)->list.count; j++) {
if ((*DRB_configList)->list.array[j]->cnAssociation->choice.sdap_Config->pdu_Session ==
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id) {
DRB_config = (*DRB_configList)->list.array[j];
break;
}
}
if (DRB_config == NULL) {
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unspecified;
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
continue;
}
// Reference TS23501 Table 5.7.4-1: Standardized 5QI to QoS characteristics mapping
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
switch (ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI) {
case 1: //100ms
case 2: //150ms
case 3: //50ms
case 4: //300ms
case 5: //100ms
case 6: //300ms
case 7: //100ms
case 8: //300ms
case 9: //300ms Video (Buffered Streaming)TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc.)
// TODO
break;
default:
LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI);
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_not_supported_5QI_value;
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
continue;
}
LOG_I(NR_RRC, "PDU SESSION ID %ld, DRB ID %ld (index %d), QOS flow %d, 5QI %ld \n",
DRB_config->cnAssociation->choice.sdap_Config->pdu_Session,
DRB_config->drb_Identity, i,
qos_flow_index,
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI
);
}
ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config);
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_DONE;
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t));
memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t));
OCTET_STRING_fromBuf(dedicatedNAS_Message,
(char *)ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message);
LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length,
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
} else {
// TODO
LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
}
}
/* If list is empty free the list and reset the address */
if (dedicatedNAS_MessageList->list.count == 0) {
free(dedicatedNAS_MessageList);
dedicatedNAS_MessageList = NULL;
}
memset(buffer, 0, RRC_BUF_SIZE);
size = do_RRCReconfiguration(ctxt_pP, buffer,
xid,
NULL,
DRB_configList2,
NULL,
NULL,
NULL,
NULL,
dedicatedNAS_MessageList,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
/* Free all NAS PDUs */
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
/* Free the NAS PDU buffer and invalidate it */
free(ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer);
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer = NULL;
}
}
LOG_I(NR_RRC,
"[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCReconfiguration (bytes %d, UE RNTI %x)\n",
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
LOG_D(NR_RRC,
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH);
MSC_LOG_TX_MESSAGE(
MSC_RRC_GNB,
MSC_RRC_UE,
buffer,
size,
MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_context.rnti,
rrc_gNB_mui,
size);
#ifdef ITTI_SIM
MessageDef *message_p;
uint8_t *message_buffer;
message_buffer = itti_malloc (TASK_RRC_GNB_SIM, TASK_RRC_UE_SIM, size);
memcpy (message_buffer, buffer, size);
message_p = itti_alloc_new_message (TASK_RRC_GNB_SIM, 0, GNB_RRC_DCCH_DATA_IND);
GNB_RRC_DCCH_DATA_IND (message_p).rbid = DCCH;
GNB_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
GNB_RRC_DCCH_DATA_IND (message_p).size = size;
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
#else
nr_rrc_data_req(
ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
#endif
}
//-----------------------------------------------------------------------------
void
rrc_gNB_generate_dedicatedRRCReconfiguration_release(
......@@ -2340,6 +2521,17 @@ rrc_gNB_decode_dcch(
ue_context_p,
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
}
} else if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) {
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(ctxt_pP,
ue_context_p,
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
for(int i = 0; i < NR_NB_RB_MAX; i++) {
ue_context_p->ue_context.modify_pdusession[i].xid = -1;
}
}
}
if (first_rrcreconfiguration == 0){
......@@ -3245,6 +3437,10 @@ void *rrc_gnb_task(void *args_p) {
rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(msg_p, msg_name_p, instance);
break;
case NGAP_PDUSESSION_MODIFY_REQ:
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(msg_p, msg_name_p, instance);
break;
case NGAP_PDUSESSION_RELEASE_COMMAND:
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance);
break;
......
......@@ -1118,6 +1118,264 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
}
}
//------------------------------------------------------------------------------
int
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
MessageDef *msg_p,
const char *msg_name,
instance_t instance
)
//------------------------------------------------------------------------------
{
uint16_t ue_initial_id;
uint32_t gNB_ue_ngap_id;
uint8_t nb_pdusessions_tomodify;
rrc_gNB_ue_context_t *ue_context_p = NULL;
uint8_t i;
uint8_t qos_flow_index;
protocol_ctxt_t ctxt;
ue_initial_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).ue_initial_id;
gNB_ue_ngap_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).gNB_ue_ngap_id;
nb_pdusessions_tomodify = NGAP_PDUSESSION_MODIFY_REQ(msg_p).nb_pdusessions_tomodify;
ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id);
if (ue_context_p == NULL) {
LOG_W(NR_RRC, "[gNB %ld] In NGAP_PDUSESSION_MODIFY_REQ: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id);
// TODO
return (-1);
} else {
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
ctxt.eNB_index = 0;
ue_context_p->ue_context.gNB_ue_ngap_id = gNB_ue_ngap_id;
{
int j;
boolean_t is_treated[NGAP_MAX_PDUSESSION] = {FALSE};
uint8_t nb_of_failed_pdusessions = 0;
for (i = 0; i < nb_pdusessions_tomodify; i++) {
if (is_treated[i] == TRUE) {
continue;
}
for (j = i+1; j < nb_pdusessions_tomodify; j++) {
if (is_treated[j] == FALSE &&
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id ==
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
// handle multiple pdu session id
LOG_D(NR_RRC, "handle multiple pdu session id \n");
ue_context_p->ue_context.modify_pdusession[j].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[j].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id;
ue_context_p->ue_context.modify_pdusession[j].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[j].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
nb_of_failed_pdusessions++;
is_treated[i] = TRUE;
is_treated[j] = TRUE;
}
}
if (is_treated[i] == TRUE) {
// handle multiple pdu session id
LOG_D(NR_RRC, "handle multiple pdu session id \n");
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
nb_of_failed_pdusessions++;
continue;
}
for (j = 0; j < NR_NB_RB_MAX -3; j++) {
if (ue_context_p->ue_context.pduSession[j].param.pdusession_id ==
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
if (ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_TORELEASE ||
ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_DONE) {
break;
}
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_NOTHING;
if (NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer != NULL) {
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.buffer =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer;
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.length =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.length;
}
for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; qos_flow_index++) {
ue_context_p->ue_context.modify_pdusession[i].param.qos[qos_flow_index] =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].qos[qos_flow_index];
}
ue_context_p->ue_context.modify_pdusession[i].param.nb_qos =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos;
ue_context_p->ue_context.modify_pdusession[i].param.upf_addr =
ue_context_p->ue_context.pduSession[j].param.upf_addr;
ue_context_p->ue_context.modify_pdusession[i].param.gtp_teid =
ue_context_p->ue_context.pduSession[j].param.gtp_teid;
is_treated[i] = TRUE;
break;
}
}
if (is_treated[i] == FALSE) {
// handle Unknown pdu session ID
LOG_D(NR_RRC, "handle Unknown pdu session ID \n");
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
nb_of_failed_pdusessions++;
is_treated[i] = TRUE;
}
}
ue_context_p->ue_context.nb_of_modify_pdusessions = nb_pdusessions_tomodify;
ue_context_p->ue_context.nb_of_failed_pdusessions = nb_of_failed_pdusessions;
}
if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) {
if (0 == rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p)) {
return (0);
}
}
{ // modify failed
uint8_t nb_of_pdu_sessions_failed = 0;
MessageDef *msg_fail_p = NULL;
msg_fail_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
if (msg_fail_p == NULL) {
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_fail_p is NULL \n");
return (-1);
}
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).gNB_ue_ngap_id = gNB_ue_ngap_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions = 0;
for (nb_of_pdu_sessions_failed = 0; nb_of_pdu_sessions_failed < ue_context_p->ue_context.nb_of_failed_pdusessions; nb_of_pdu_sessions_failed++) {
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].pdusession_id =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause_value =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause_value;
}
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions_failed =
ue_context_p->ue_context.nb_of_failed_pdusessions;
itti_send_msg_to_task(TASK_NGAP, instance, msg_fail_p);
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
return (0);
}
}
}
//------------------------------------------------------------------------------
int
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t xid
)
//------------------------------------------------------------------------------
{
MessageDef *msg_p = NULL;
int i, j;
uint8_t qos_flow_index;
uint8_t pdu_sessions_failed = 0;
uint8_t pdu_sessions_done = 0;
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
if (msg_p == NULL) {
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_p is NULL \n");
return (-1);
}
NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
if (xid == ue_context_pP->ue_context.modify_pdusession[i].xid) {
if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_DONE) {
for (j = 0; j < ue_context_pP->ue_context.setup_pdu_sessions; j++) {
if (ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id ==
ue_context_pP->ue_context.pduSession[i].param.pdusession_id) {
// Update ue_context_pP->ue_context.pduSession
ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_ESTABLISHED;
ue_context_pP->ue_context.pduSession[i].cause = NGAP_CAUSE_NOTHING;
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) {
ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index] =
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index];
}
break;
}
}
if (j < ue_context_pP->ue_context.setup_pdu_sessions) {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
LOG_D(NR_RRC, "gnb_gtp_addr (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ",
pdu_sessions_done, i, ue_context_pP->ue_context.modify_pdusession[i].status, xid,
ue_context_pP->ue_context.nb_of_modify_pdusessions,
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id);
pdu_sessions_done++;
} else {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause = NGAP_CAUSE_RADIO_NETWORK;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
pdu_sessions_failed++;
}
} else if ((ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_NEW) ||
(ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED)) {
LOG_D (NR_RRC, "PDU SESSION is NEW or already ESTABLISHED\n");
} else if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_FAILED) {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause =
ue_context_pP->ue_context.modify_pdusession[i].cause;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value =
ue_context_pP->ue_context.modify_pdusession[i].cause_value;
pdu_sessions_failed++;
}
} else {
LOG_D(NR_RRC,"xid does not corresponds (context pdu session index %d, status %d, xid %d/%d) \n ",
i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.modify_pdusession[i].xid);
}
}
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions = pdu_sessions_done;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions_failed = pdu_sessions_failed;
if (pdu_sessions_done > 0 || pdu_sessions_failed > 0) {
LOG_D(NR_RRC,"NGAP_PDUSESSION_MODIFY_RESP: sending the message: nb_of_pdusessions %d, total pdu session %d, index %d\n",
ue_context_pP->ue_context.nb_of_modify_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, i);
MSC_LOG_TX_MESSAGE(
MSC_RRC_GNB,
MSC_NGAP_GNB,
(const char *)&NGAP_PDUSESSION_MODIFY_RESP(msg_p),
sizeof(ngap_pdusession_modify_resp_t),
MSC_AS_TIME_FMT" PDUSESSION_MODIFY_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_id_rnti,
NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id,
pdu_sessions_done, pdu_sessions_failed);
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
} else {
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
}
return 0;
}
//------------------------------------------------------------------------------
void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
const module_id_t gnb_mod_idP,
......
......@@ -38,6 +38,7 @@
#include "NR_RRCSetupComplete-IEs.h"
#include "NR_RegisteredAMF.h"
#include "NR_UL-DCCH-Message.h"
#include "NGAP_CauseRadioNetwork.h"
typedef struct rrc_ue_ngap_ids_s {
/* Tree related data */
......@@ -107,6 +108,27 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
instance_t instance
);
int
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
MessageDef *msg_p,
const char *msg_name,
instance_t instance
);
int
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t xid
);
int
rrc_gNB_modify_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP
);
void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
const module_id_t gnb_mod_idP,
......
......@@ -2194,7 +2194,7 @@ nr_rrc_ue_establish_srb2(
// nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig);
}
if(ie->nonCriticalExtension->masterCellGroup!=NULL) {
if((ie->nonCriticalExtension) && (ie->nonCriticalExtension->masterCellGroup!=NULL)) {
nr_rrc_ue_process_masterCellGroup(
ctxt_pP,
gNB_index,
......@@ -2207,7 +2207,7 @@ nr_rrc_ue_establish_srb2(
}
/* Check if there is dedicated NAS information to forward to NAS */
if (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL) {
if ((ie->nonCriticalExtension) && (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL)) {
int list_count;
uint32_t pdu_length;
uint8_t *pdu_buffer;
......
......@@ -1631,11 +1631,11 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
}
/* PDUSession Resource modify request = UE-related procedure -> stream != 0 */
if (stream == 0) {
NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n",
assoc_id, stream);
return -1;
}
// if (stream == 0) {
// NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n",
// assoc_id, stream);
// return -1;
// }
ue_desc_p->rx_stream = stream;
......
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