Commit 75e99957 authored by Laurent THOMAS's avatar Laurent THOMAS

add DLinformationTransfer in nrUE, process SRB!=1 in UE (instead of discard),...

add DLinformationTransfer in nrUE, process SRB!=1 in UE (instead of discard), change struct member pdusession into pduSession to increase code readability (another struct contains also pdusession in lower case)
parent 24a84716
...@@ -356,7 +356,7 @@ typedef struct gNB_RRC_UE_s { ...@@ -356,7 +356,7 @@ typedef struct gNB_RRC_UE_s {
/* 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 */ /* list of pdu session to be setup by RRC layers */
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; 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];
......
...@@ -805,18 +805,18 @@ rrc_gNB_generate_defaultRRCReconfiguration( ...@@ -805,18 +805,18 @@ rrc_gNB_generate_defaultRRCReconfiguration(
/* Add all NAS PDUs to the list */ /* Add all NAS PDUs to the list */
for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) {
if (ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer != NULL) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) {
dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t)); dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t));
memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t)); memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t));
OCTET_STRING_fromBuf(dedicatedNAS_Message, OCTET_STRING_fromBuf(dedicatedNAS_Message,
(char *)ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer, (char *)ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.pdusession[i].param.nas_pdu.length); ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message);
} }
ue_context_pP->ue_context.pdusession[i].status = PDU_SESSION_STATUS_DONE; ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_DONE;
LOG_D(NR_RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n", LOG_D(NR_RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n",
i, ue_context_pP->ue_context.pdusession[i].status, "PDU_SESSION_STATUS_DONE"); i, ue_context_pP->ue_context.pduSession[i].status, "PDU_SESSION_STATUS_DONE");
} }
if (ue_context_pP->ue_context.nas_pdu_flag == 1) { if (ue_context_pP->ue_context.nas_pdu_flag == 1) {
...@@ -853,9 +853,9 @@ rrc_gNB_generate_defaultRRCReconfiguration( ...@@ -853,9 +853,9 @@ rrc_gNB_generate_defaultRRCReconfiguration(
/* Free all NAS PDUs */ /* Free all NAS PDUs */
for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { for (int i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) {
if (ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer != NULL) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) {
free(ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer); free(ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer);
ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer = NULL; ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer = NULL;
} }
} }
...@@ -990,7 +990,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -990,7 +990,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
break; break;
} }
if (ue_context_pP->ue_context.pdusession[i].status >= PDU_SESSION_STATUS_DONE) { if (ue_context_pP->ue_context.pduSession[i].status >= PDU_SESSION_STATUS_DONE) {
continue; continue;
} }
...@@ -1001,15 +1001,15 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1001,15 +1001,15 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
// sdap_Config // sdap_Config
sdap_config = CALLOC(1, sizeof(NR_SDAP_Config_t)); sdap_config = CALLOC(1, sizeof(NR_SDAP_Config_t));
memset(sdap_config, 0, sizeof(NR_SDAP_Config_t)); memset(sdap_config, 0, sizeof(NR_SDAP_Config_t));
sdap_config->pdu_Session = ue_context_pP->ue_context.pdusession[i].param.pdusession_id; sdap_config->pdu_Session = ue_context_pP->ue_context.pduSession[i].param.pdusession_id;
sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent; sdap_config->sdap_HeaderDL = NR_SDAP_Config__sdap_HeaderDL_absent;
sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent; sdap_config->sdap_HeaderUL = NR_SDAP_Config__sdap_HeaderUL_absent;
sdap_config->defaultDRB = TRUE; sdap_config->defaultDRB = TRUE;
sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); sdap_config->mappedQoS_FlowsToAdd = calloc(1, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd));
memset(sdap_config->mappedQoS_FlowsToAdd, 0, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd)); memset(sdap_config->mappedQoS_FlowsToAdd, 0, sizeof(struct NR_SDAP_Config__mappedQoS_FlowsToAdd));
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pdusession[i].param.nb_qos; qos_flow_index++) { for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) {
qfi = ue_context_pP->ue_context.pdusession[i].param.qos[qos_flow_index].qfi; qfi = ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index].qfi;
ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, &qfi); ASN_SEQUENCE_ADD(&sdap_config->mappedQoS_FlowsToAdd->list, &qfi);
} }
sdap_config->mappedQoS_FlowsToRelease = NULL; sdap_config->mappedQoS_FlowsToRelease = NULL;
...@@ -1039,8 +1039,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1039,8 +1039,8 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
DRB_config->pdcp_Config->ext1 = NULL; DRB_config->pdcp_Config->ext1 = NULL;
// Reference TS23501 Table 5.7.4-1: Standardized 5QI to QoS characteristics mapping // 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.pdusession[i].param.nb_qos; qos_flow_index++) { for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[i].param.nb_qos; qos_flow_index++) {
switch (ue_context_pP->ue_context.pdusession[i].param.qos[qos_flow_index].fiveQI) { switch (ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index].fiveQI) {
case 1: //100ms case 1: //100ms
case 2: //150ms case 2: //150ms
case 3: //50ms case 3: //50ms
...@@ -1054,9 +1054,9 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1054,9 +1054,9 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
break; break;
default: default:
LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.pdusession[i].param.qos[qos_flow_index].fiveQI); LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.pduSession[i].param.qos[qos_flow_index].fiveQI);
ue_context_pP->ue_context.pdusession[i].status = PDU_SESSION_STATUS_FAILED; ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_FAILED;
ue_context_pP->ue_context.pdusession[i].xid = xid; ue_context_pP->ue_context.pduSession[i].xid = xid;
pdu_sessions_done++; pdu_sessions_done++;
free(DRB_config); free(DRB_config);
continue; continue;
...@@ -1066,18 +1066,18 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1066,18 +1066,18 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config); ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config); ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
ue_context_pP->ue_context.pdusession[i].status = PDU_SESSION_STATUS_DONE; ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_DONE;
ue_context_pP->ue_context.pdusession[i].xid = xid; ue_context_pP->ue_context.pduSession[i].xid = xid;
if (ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer != NULL) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) {
dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t)); dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t));
memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t)); memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t));
OCTET_STRING_fromBuf(dedicatedNAS_Message, OCTET_STRING_fromBuf(dedicatedNAS_Message,
(char *)ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer, (char *)ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.pdusession[i].param.nas_pdu.length); ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message); 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, i); 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, i);
} else { } else {
// TODO // TODO
LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", i); LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", i);
...@@ -1108,10 +1108,10 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1108,10 +1108,10 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
/* Free all NAS PDUs */ /* Free all NAS PDUs */
for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) {
if (ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer != NULL) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) {
/* Free the NAS PDU buffer and invalidate it */ /* Free the NAS PDU buffer and invalidate it */
free(ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer); free(ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer);
ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer = NULL; ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer = NULL;
} }
} }
...@@ -1180,7 +1180,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( ...@@ -1180,7 +1180,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
*DRB_Release_configList2 = CALLOC(1, sizeof(**DRB_Release_configList2)); *DRB_Release_configList2 = CALLOC(1, sizeof(**DRB_Release_configList2));
for(i = 0; i < NB_RB_MAX; i++) { for(i = 0; i < NB_RB_MAX; i++) {
if((ue_context_pP->ue_context.pdusession[i].status == PDU_SESSION_STATUS_TORELEASE) && ue_context_pP->ue_context.pdusession[i].xid == xid) { if((ue_context_pP->ue_context.pduSession[i].status == PDU_SESSION_STATUS_TORELEASE) && ue_context_pP->ue_context.pduSession[i].xid == xid) {
DRB_release = CALLOC(1, sizeof(NR_DRB_Identity_t)); DRB_release = CALLOC(1, sizeof(NR_DRB_Identity_t));
*DRB_release = i+1; *DRB_release = i+1;
ASN_SEQUENCE_ADD(&(*DRB_Release_configList2)->list, DRB_release); ASN_SEQUENCE_ADD(&(*DRB_Release_configList2)->list, DRB_release);
...@@ -1646,13 +1646,13 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( ...@@ -1646,13 +1646,13 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
memset(&create_tunnel_req, 0, sizeof(create_tunnel_req)); memset(&create_tunnel_req, 0, sizeof(create_tunnel_req));
for ( j = 0, i = 0; i < NB_RB_MAX; i++) { for ( j = 0, i = 0; i < NB_RB_MAX; i++) {
if (ue_context_pP->ue_context.pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED || ue_context_pP->ue_context.pdusession[i].status == PDU_SESSION_STATUS_DONE) { if (ue_context_pP->ue_context.pduSession[i].status == PDU_SESSION_STATUS_ESTABLISHED || ue_context_pP->ue_context.pduSession[i].status == PDU_SESSION_STATUS_DONE) {
create_tunnel_req.pdusession_id[j] = ue_context_pP->ue_context.pdusession[i].param.pdusession_id; create_tunnel_req.pdusession_id[j] = ue_context_pP->ue_context.pduSession[i].param.pdusession_id;
create_tunnel_req.upf_NGu_teid[j] = ue_context_pP->ue_context.pdusession[i].param.gtp_teid; create_tunnel_req.upf_NGu_teid[j] = ue_context_pP->ue_context.pduSession[i].param.gtp_teid;
memcpy(create_tunnel_req.upf_addr[j].buffer, memcpy(create_tunnel_req.upf_addr[j].buffer,
ue_context_pP->ue_context.pdusession[i].param.upf_addr.buffer, ue_context_pP->ue_context.pduSession[i].param.upf_addr.buffer,
sizeof(uint8_t)*20); sizeof(uint8_t)*20);
create_tunnel_req.upf_addr[j].length = ue_context_pP->ue_context.pdusession[i].param.upf_addr.length; create_tunnel_req.upf_addr[j].length = ue_context_pP->ue_context.pduSession[i].param.upf_addr.length;
j++; j++;
} }
} }
...@@ -1712,10 +1712,10 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( ...@@ -1712,10 +1712,10 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
/* TODO parameters yet to process ... */ /* TODO parameters yet to process ... */
/* TODO should test if pdu session are Ok before! */ /* TODO should test if pdu session are Ok before! */
ue_context_pP->ue_context.pdusession[i].status = PDU_SESSION_STATUS_DONE; ue_context_pP->ue_context.pduSession[i].status = PDU_SESSION_STATUS_DONE;
ue_context_pP->ue_context.pdusession[i].xid = xid; ue_context_pP->ue_context.pduSession[i].xid = xid;
LOG_D(NR_RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n", LOG_D(NR_RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n",
i, ue_context_pP->ue_context.pdusession[i].status, "PDU_SESSION_STATUS_DONE"); i, ue_context_pP->ue_context.pduSession[i].status, "PDU_SESSION_STATUS_DONE");
} }
memset(buffer, 0, RRC_BUF_SIZE); memset(buffer, 0, RRC_BUF_SIZE);
...@@ -1736,10 +1736,10 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete( ...@@ -1736,10 +1736,10 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
/* Free all NAS PDUs */ /* Free all NAS PDUs */
for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) { for (i = 0; i < ue_context_pP->ue_context.nb_of_pdusessions; i++) {
if (ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer != NULL) { if (ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer != NULL) {
/* Free the NAS PDU buffer and invalidate it */ /* Free the NAS PDU buffer and invalidate it */
free(ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer); free(ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer);
ue_context_pP->ue_context.pdusession[i].param.nas_pdu.buffer = NULL; ue_context_pP->ue_context.pduSession[i].param.nas_pdu.buffer = NULL;
} }
} }
...@@ -2072,10 +2072,10 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP, ...@@ -2072,10 +2072,10 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
ue_context_p->ue_context.reestablishment_xid); ue_context_p->ue_context.reestablishment_xid);
for (uint8_t pdusessionid = 0; pdusessionid < ue_context_p->ue_context.nb_of_pdusessions; pdusessionid++) { for (uint8_t pdusessionid = 0; pdusessionid < ue_context_p->ue_context.nb_of_pdusessions; pdusessionid++) {
if (ue_context_p->ue_context.pdusession[pdusessionid].status == PDU_SESSION_STATUS_DONE) { if (ue_context_p->ue_context.pduSession[pdusessionid].status == PDU_SESSION_STATUS_DONE) {
ue_context_p->ue_context.pdusession[pdusessionid].status = PDU_SESSION_STATUS_ESTABLISHED; ue_context_p->ue_context.pduSession[pdusessionid].status = PDU_SESSION_STATUS_ESTABLISHED;
} else { } else {
ue_context_p->ue_context.pdusession[pdusessionid].status = PDU_SESSION_STATUS_FAILED; ue_context_p->ue_context.pduSession[pdusessionid].status = PDU_SESSION_STATUS_FAILED;
} }
} }
} }
...@@ -2316,7 +2316,7 @@ rrc_gNB_decode_dcch( ...@@ -2316,7 +2316,7 @@ rrc_gNB_decode_dcch(
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
for(i = 0; i < NB_RB_MAX; i++) { for(i = 0; i < NB_RB_MAX; i++) {
if(xid == ue_context_p->ue_context.pdusession[i].xid) { 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++] = 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_psi[i];
ue_context_p->ue_context.gnb_gtp_teid[i] = 0; ue_context_p->ue_context.gnb_gtp_teid[i] = 0;
......
...@@ -539,20 +539,20 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ( ...@@ -539,20 +539,20 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
if (nb_pdusessions_tosetup != 0) { if (nb_pdusessions_tosetup != 0) {
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t)); memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
for (int i = 0; i < NR_NB_RB_MAX - 3; i++) { for (int i = 0; i < NR_NB_RB_MAX - 3; i++) {
if(ue_context_p->ue_context.pdusession[i].status >= PDU_SESSION_STATUS_DONE) if(ue_context_p->ue_context.pduSession[i].status >= PDU_SESSION_STATUS_DONE)
continue; continue;
ue_context_p->ue_context.pdusession[i].status = PDU_SESSION_STATUS_NEW; ue_context_p->ue_context.pduSession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.pdusession[i].param = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done]; ue_context_p->ue_context.pduSession[i].param = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done];
create_tunnel_req.pdusession_id[pdu_sessions_done] = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].pdusession_id; create_tunnel_req.pdusession_id[pdu_sessions_done] = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].pdusession_id;
create_tunnel_req.upf_NGu_teid[pdu_sessions_done] = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].gtp_teid; create_tunnel_req.upf_NGu_teid[pdu_sessions_done] = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].gtp_teid;
create_tunnel_req.upf_addr[pdu_sessions_done].length = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[i].upf_addr.length; create_tunnel_req.upf_addr[pdu_sessions_done].length = NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].upf_addr.length;
memcpy(create_tunnel_req.upf_addr[pdu_sessions_done].buffer, memcpy(create_tunnel_req.upf_addr[pdu_sessions_done].buffer,
NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[i].upf_addr.buffer, NGAP_INITIAL_CONTEXT_SETUP_REQ (msg_p).pdusession_param[pdu_sessions_done].upf_addr.buffer,
sizeof(uint8_t)*20); sizeof(uint8_t)*20);
LOG_I(NR_RRC, "PDUSESSION SETUP: local index %d teid %u, pdusession id %d \n", LOG_I(NR_RRC, "PDUSESSION SETUP: local index %d teid %u, pdusession id %d \n",
i, i,
create_tunnel_req.upf_NGu_teid[i], create_tunnel_req.upf_NGu_teid[pdu_sessions_done],
create_tunnel_req.pdusession_id[i]); create_tunnel_req.pdusession_id[pdu_sessions_done]);
inde_list[pdu_sessions_done] = i; inde_list[pdu_sessions_done] = i;
pdu_sessions_done++; pdu_sessions_done++;
...@@ -649,24 +649,24 @@ rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP( ...@@ -649,24 +649,24 @@ rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
for (pdusession = 0; pdusession < ue_context_pP->ue_context.nb_of_pdusessions; pdusession++) { for (pdusession = 0; pdusession < ue_context_pP->ue_context.nb_of_pdusessions; pdusession++) {
if (ue_context_pP->ue_context.pdusession[pdusession].status == PDU_SESSION_STATUS_DONE) { if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) {
pdu_sessions_done++; pdu_sessions_done++;
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pdusession[pdusession].param.pdusession_id; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
// TODO add other information from S1-U when it will be integrated // TODO add other information from S1-U when it will be integrated
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession]; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession];
memcpy(NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gNB_addr.buffer , ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, 20); memcpy(NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gNB_addr.buffer , ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, 20);
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gNB_addr.length = 4; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].gNB_addr.length = 4;
ue_context_pP->ue_context.pdusession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED; ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED;
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pdusession[pdusession].param.nb_qos; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos;
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pdusession[pdusession].param.nb_qos; qos_flow_index++) { for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos; qos_flow_index++) {
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi = NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi =
ue_context_pP->ue_context.pdusession[pdusession].param.qos[qos_flow_index].qfi; ue_context_pP->ue_context.pduSession[pdusession].param.qos[qos_flow_index].qfi;
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL;
} }
} else { } else {
pdu_sessions_failed++; pdu_sessions_failed++;
ue_context_pP->ue_context.pdusession[pdusession].status = PDU_SESSION_STATUS_FAILED; ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_FAILED;
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].pdusession_id = ue_context_pP->ue_context.pdusession[pdusession].param.pdusession_id; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
// TODO add cause when it will be integrated // TODO add cause when it will be integrated
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].cause = NGAP_Cause_PR_radioNetwork; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].cause = NGAP_Cause_PR_radioNetwork;
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID; NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).pdusessions_failed[pdusession].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
...@@ -957,10 +957,10 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( ...@@ -957,10 +957,10 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) { for (pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) {
// if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) { // if (xid == ue_context_pP->ue_context.pdusession[pdusession].xid) {
if (ue_context_pP->ue_context.pdusession[pdusession].status == PDU_SESSION_STATUS_DONE) { if (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_DONE) {
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pdusession[pdusession].param.pdusession_id; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
// NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = 1; // NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].pdusession_id = 1;
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pdusession[pdusession].param.nb_qos; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow = ue_context_pP->ue_context.pduSession[pdusession].param.nb_qos;
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession]; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gtp_teid = ue_context_pP->ue_context.gnb_gtp_teid[pdusession];
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.pdu_session_type = PDUSessionType_ipv4; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.pdu_session_type = PDUSessionType_ipv4;
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].gNB_addr.length = ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].length;
...@@ -968,13 +968,13 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( ...@@ -968,13 +968,13 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, sizeof(uint8_t)*20); ue_context_pP->ue_context.gnb_gtp_addrs[pdusession].buffer, sizeof(uint8_t)*20);
for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow; qos_flow_index++) { for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].nb_of_qos_flow; qos_flow_index++) {
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi = NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qfi =
ue_context_pP->ue_context.pdusession[pdusession].param.qos[qos_flow_index].qfi; ue_context_pP->ue_context.pduSession[pdusession].param.qos[qos_flow_index].qfi;
NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL; NGAP_PDUSESSION_SETUP_RESP(msg_p).pdusessions[pdusession].associated_qos_flows[qos_flow_index].qos_flow_mapping_ind = QOSFLOW_MAPPING_INDICATION_DL;
} }
ue_context_pP->ue_context.pdusession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED; ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_ESTABLISHED;
LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u, addr: %d.%d.%d.%d \n ", LOG_I (NR_RRC,"gnb_gtp_addr (msg index %d, pdu_sessions index %d, status %d, xid %d): nb_of_pdusessions %d, pdusession_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
pdu_sessions_done, pdusession, ue_context_pP->ue_context.pdusession[pdusession].status, xid, pdu_sessions_done, pdusession, ue_context_pP->ue_context.pduSession[pdusession].status, xid,
ue_context_pP->ue_context.nb_of_pdusessions, ue_context_pP->ue_context.nb_of_pdusessions,
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].pdusession_id, NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].pdusession_id,
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid, NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gtp_teid,
...@@ -983,12 +983,12 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( ...@@ -983,12 +983,12 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[2], NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[2],
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[3]); NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions[pdu_sessions_done].gNB_addr.buffer[3]);
pdu_sessions_done++; pdu_sessions_done++;
} else if ((ue_context_pP->ue_context.pdusession[pdusession].status == PDU_SESSION_STATUS_NEW) || } else if ((ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_NEW) ||
(ue_context_pP->ue_context.pdusession[pdusession].status == PDU_SESSION_STATUS_ESTABLISHED)) { (ue_context_pP->ue_context.pduSession[pdusession].status == PDU_SESSION_STATUS_ESTABLISHED)) {
LOG_D (NR_RRC,"PDU-SESSION is NEW or already ESTABLISHED\n"); LOG_D (NR_RRC,"PDU-SESSION is NEW or already ESTABLISHED\n");
} else { /* to be improved */ } else { /* to be improved */
ue_context_pP->ue_context.pdusession[pdusession].status = PDU_SESSION_STATUS_FAILED; ue_context_pP->ue_context.pduSession[pdusession].status = PDU_SESSION_STATUS_FAILED;
NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id = ue_context_pP->ue_context.pdusession[pdusession].param.pdusession_id; NGAP_PDUSESSION_SETUP_RESP (msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
pdu_sessions_failed++; pdu_sessions_failed++;
// TODO add cause when it will be integrated // TODO add cause when it will be integrated
} }
...@@ -1017,7 +1017,7 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP( ...@@ -1017,7 +1017,7 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
} }
for(int i = 0; i < NB_RB_MAX; i++) { for(int i = 0; i < NB_RB_MAX; i++) {
ue_context_pP->ue_context.pdusession[i].xid = -1; ue_context_pP->ue_context.pduSession[i].xid = -1;
} }
return; return;
...@@ -1063,20 +1063,20 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( ...@@ -1063,20 +1063,20 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0); PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
for (int i = 0; i < NR_NB_RB_MAX - 3; i++) { for (int i = 0; i < NR_NB_RB_MAX - 3; i++) {
if(ue_context_p->ue_context.pdusession[i].status >= PDU_SESSION_STATUS_DONE) if(ue_context_p->ue_context.pduSession[i].status >= PDU_SESSION_STATUS_DONE)
continue; continue;
ue_context_p->ue_context.pdusession[i].status = PDU_SESSION_STATUS_NEW; ue_context_p->ue_context.pduSession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.pdusession[i].param = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done]; ue_context_p->ue_context.pduSession[i].param = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done];
create_tunnel_req.pdusession_id[pdu_sessions_done] = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].pdusession_id; create_tunnel_req.pdusession_id[pdu_sessions_done] = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].pdusession_id;
create_tunnel_req.upf_NGu_teid[pdu_sessions_done] = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].gtp_teid; create_tunnel_req.upf_NGu_teid[pdu_sessions_done] = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].gtp_teid;
memcpy(create_tunnel_req.upf_addr[pdu_sessions_done].buffer, memcpy(create_tunnel_req.upf_addr[pdu_sessions_done].buffer,
NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[i].upf_addr.buffer, NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].upf_addr.buffer,
sizeof(uint8_t)*20); sizeof(uint8_t)*20);
create_tunnel_req.upf_addr[pdu_sessions_done].length = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[i].upf_addr.length; create_tunnel_req.upf_addr[pdu_sessions_done].length = NGAP_PDUSESSION_SETUP_REQ(msg_p).pdusession_setup_params[pdu_sessions_done].upf_addr.length;
LOG_I(NR_RRC,"NGAP PDUSESSION SETUP REQ: local index %d teid %u, pdusession id %d \n", LOG_I(NR_RRC,"NGAP PDUSESSION SETUP REQ: local index %d teid %u, pdusession id %d \n",
i, i,
create_tunnel_req.upf_NGu_teid[i], create_tunnel_req.upf_NGu_teid[pdu_sessions_done],
create_tunnel_req.pdusession_id[i]); create_tunnel_req.pdusession_id[pdu_sessions_done]);
inde_list[pdu_sessions_done] = i; inde_list[pdu_sessions_done] = i;
pdu_sessions_done++; pdu_sessions_done++;
...@@ -1144,7 +1144,7 @@ rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( ...@@ -1144,7 +1144,7 @@ rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).cause_value = cause_valueP; NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).cause_value = cause_valueP;
NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).nb_of_pdusessions = ue_context_pP->ue_context.setup_pdu_sessions; NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).nb_of_pdusessions = ue_context_pP->ue_context.setup_pdu_sessions;
for (int pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) { for (int pdusession = 0; pdusession < ue_context_pP->ue_context.setup_pdu_sessions; pdusession++) {
NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pdusession[pdusession].param.pdusession_id; NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).pdusessions[pdusession].pdusession_id = ue_context_pP->ue_context.pduSession[pdusession].param.pdusession_id;
} }
itti_send_msg_to_task(TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_mod_idP), msg_context_release_req_p); itti_send_msg_to_task(TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_mod_idP), msg_context_release_req_p);
} }
...@@ -1357,12 +1357,12 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE( ...@@ -1357,12 +1357,12 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id; 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++) { for (int i = 0; i < NB_RB_MAX; i++) {
if (xid == ue_context_pP->ue_context.pdusession[i].xid) { if (xid == ue_context_pP->ue_context.pduSession[i].xid) {
NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).pdusession_release[pdu_sessions_released].pdusession_id = NGAP_PDUSESSION_RELEASE_RESPONSE (msg_p).pdusession_release[pdu_sessions_released].pdusession_id =
ue_context_pP->ue_context.pdusession[i].param.pdusession_id; ue_context_pP->ue_context.pduSession[i].param.pdusession_id;
pdu_sessions_released++; pdu_sessions_released++;
//clear //clear
memset(&ue_context_pP->ue_context.pdusession[i], 0, sizeof(pdu_session_param_t)); memset(&ue_context_pP->ue_context.pduSession[i], 0, sizeof(pdu_session_param_t));
} }
} }
...@@ -1378,7 +1378,7 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE( ...@@ -1378,7 +1378,7 @@ rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(
//clear xid //clear xid
for(int i = 0; i < NB_RB_MAX; i++) { for(int i = 0; i < NB_RB_MAX; i++) {
ue_context_pP->ue_context.pdusession[i].xid = -1; ue_context_pP->ue_context.pduSession[i].xid = -1;
} }
//clear release pdusessions //clear release pdusessions
...@@ -1439,7 +1439,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1439,7 +1439,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
} }
for (i = 0; i < NR_NB_RB_MAX; i++) { 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) { if (pdusession_release_params[pdusession].pdusession_id == ue_context_p->ue_context.pduSession[i].param.pdusession_id) {
b_existed = 1; b_existed = 1;
break; break;
} }
...@@ -1453,13 +1453,13 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1453,13 +1453,13 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
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.pdusessions_release_failed[ue_context_p->ue_context.nb_release_of_pdusessions].cause_value = 30;
ue_context_p->ue_context.nb_release_of_pdusessions++; ue_context_p->ue_context.nb_release_of_pdusessions++;
} else { } else {
if(ue_context_p->ue_context.pdusession[i].status == PDU_SESSION_STATUS_FAILED) { if(ue_context_p->ue_context.pduSession[i].status == PDU_SESSION_STATUS_FAILED) {
ue_context_p->ue_context.pdusession[i].xid = xid; ue_context_p->ue_context.pduSession[i].xid = xid;
continue; continue;
} else if(ue_context_p->ue_context.pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED) { } 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); 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].status = PDU_SESSION_STATUS_TORELEASE;
ue_context_p->ue_context.pdusession[i].xid = xid; ue_context_p->ue_context.pduSession[i].xid = xid;
pdusession_release_drb++; pdusession_release_drb++;
} else { } else {
// pdusession_id status NG // pdusession_id status NG
...@@ -1483,7 +1483,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND( ...@@ -1483,7 +1483,7 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti; GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
for(i = 0; i < NB_RB_MAX; i++) { for(i = 0; i < NB_RB_MAX; i++) {
if(xid == ue_context_p->ue_context.pdusession[i].xid) { 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]; 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; 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])); memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i]));
......
...@@ -135,7 +135,7 @@ rrc_gNB_allocate_new_UE_context( ...@@ -135,7 +135,7 @@ rrc_gNB_allocate_new_UE_context(
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.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;
} }
......
...@@ -2303,7 +2303,6 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB ...@@ -2303,7 +2303,6 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
if (Srb_id != 1) { if (Srb_id != 1) {
LOG_E(NR_RRC,"[UE %d] Frame %d: Received message on DL-DCCH (SRB%ld), should not have ...\n", LOG_E(NR_RRC,"[UE %d] Frame %d: Received message on DL-DCCH (SRB%ld), should not have ...\n",
ctxt_pP->module_id, ctxt_pP->frame, Srb_id); ctxt_pP->module_id, ctxt_pP->frame, Srb_id);
return -1;
} else { } else {
LOG_D(NR_RRC, "Received message on SRB%ld\n", Srb_id); LOG_D(NR_RRC, "Received message on SRB%ld\n", Srb_id);
} }
......
...@@ -612,6 +612,19 @@ void generateRegistrationComplete(as_nas_info_t *initialNasMsg, SORTransparentCo ...@@ -612,6 +612,19 @@ void generateRegistrationComplete(as_nas_info_t *initialNasMsg, SORTransparentCo
} }
} }
void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buffer){
uint8_t msg_type = *(pdu_buffer + 16);
if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){
sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40));
int third_octet = *(pdu_buffer + 41);
int fourth_octet = *(pdu_buffer + 42);
LOG_I(NAS, "Received PDU Session Establishment Accept\n");
nas_config(1,third_octet,fourth_octet,"ue");
} else {
LOG_E(NAS, "Received unexpected message in DLinformationTransfer %d\n", msg_type);
}
}
void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){ void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
//wait send RegistrationComplete //wait send RegistrationComplete
usleep(100*150); usleep(100*150);
...@@ -850,8 +863,7 @@ void *nas_nrue_task(void *args_p) ...@@ -850,8 +863,7 @@ void *nas_nrue_task(void *args_p)
Mod_id, Mod_id,
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length, NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length,
NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data); NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data);
as_nas_info_t initialNasMsg; as_nas_info_t initialNasMsg={0};
memset(&initialNasMsg, 0, sizeof(as_nas_info_t));
pdu_buffer = NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data; pdu_buffer = NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data;
if((pdu_buffer + 1) != NULL){ if((pdu_buffer + 1) != NULL){
...@@ -876,6 +888,10 @@ void *nas_nrue_task(void *args_p) ...@@ -876,6 +888,10 @@ void *nas_nrue_task(void *args_p)
case FGS_SECURITY_MODE_COMMAND: case FGS_SECURITY_MODE_COMMAND:
generateSecurityModeComplete(&initialNasMsg); generateSecurityModeComplete(&initialNasMsg);
break; break;
case FGS_DOWNLINK_NAS_TRANSPORT:
decodeDownlinkNASTransport(&initialNasMsg, pdu_buffer);
break;
default: default:
LOG_W(NR_RRC,"unknow message type %d\n",msg_type); LOG_W(NR_RRC,"unknow message type %d\n",msg_type);
break; break;
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
#define FGS_SECURITY_MODE_COMMAND 0b01011101 /* 93 = 0x5d */ #define FGS_SECURITY_MODE_COMMAND 0b01011101 /* 93 = 0x5d */
#define FGS_SECURITY_MODE_COMPLETE 0b01011110 /* 94 = 0x5e */ #define FGS_SECURITY_MODE_COMPLETE 0b01011110 /* 94 = 0x5e */
#define FGS_UPLINK_NAS_TRANSPORT 0b01100111 /* 103= 0x67 */ #define FGS_UPLINK_NAS_TRANSPORT 0b01100111 /* 103= 0x67 */
#define FGS_DOWNLINK_NAS_TRANSPORT 0b01101000 /* 104= 0x68 */
// message type for 5GS session management // message type for 5GS session management
#define FGS_PDU_SESSION_ESTABLISHMENT_REQ 0b11000001 /* 193= 0xc1 */ #define FGS_PDU_SESSION_ESTABLISHMENT_REQ 0b11000001 /* 193= 0xc1 */
......
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