fix merge problems in ittisim
This commit is contained in:
@@ -1097,12 +1097,40 @@ rrc_gNB_decode_dcch(
|
||||
|
||||
ue_context_p->ue_context.ue_release_timer = 0;
|
||||
break;
|
||||
case NR_UL_DCCH_MessageType__c1_PR_securityModeComplete:
|
||||
|
||||
case NR_UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
|
||||
LOG_I(NR_RRC,"Recived RRC GNB UL Information Transfer \n");
|
||||
if(!ue_context_p) {
|
||||
LOG_I(NR_RRC, "Processing ulInformationTransfer UE %x, ue_context_p is NULL\n", ctxt_pP->rnti);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_D(NR_RRC,"[MSG] RRC UL Information Transfer \n");
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC UL Information Transfer \n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
|
||||
if (AMF_MODE_ENABLED == 1) {
|
||||
rrc_gNB_send_NGAP_UPLINK_NAS(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg);
|
||||
}
|
||||
break;
|
||||
|
||||
case NR_UL_DCCH_MessageType__c1_PR_securityModeComplete:
|
||||
// to avoid segmentation fault
|
||||
if(!ue_context_p) {
|
||||
LOG_I(NR_RRC, "Processing securityModeComplete UE %x, ue_context_p is NULL\n", ctxt_pP->rnti);
|
||||
break;
|
||||
}
|
||||
if(!ue_context_p) {
|
||||
LOG_I(NR_RRC, "Processing securityModeComplete UE %x, ue_context_p is NULL\n", ctxt_pP->rnti);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" received securityModeComplete on UL-DCCH %d from UE\n",
|
||||
@@ -1122,6 +1150,31 @@ rrc_gNB_decode_dcch(
|
||||
rrc_gNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
|
||||
//rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
break;
|
||||
case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure:
|
||||
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] NR RRC Security Mode Failure\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" securityModeFailure UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_W(NR_RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(securityModeFailure) ---> RRC_gNB\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
DCCH,
|
||||
sdu_sizeP);
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)ul_dcch_msg);
|
||||
}
|
||||
|
||||
rrc_gNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
|
||||
break;
|
||||
|
||||
case NR_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
|
||||
if(!ue_context_p) {
|
||||
@@ -1227,10 +1280,14 @@ rrc_gNB_decode_dcch(
|
||||
|
||||
if(eutra_index == -1)
|
||||
break;
|
||||
}
|
||||
|
||||
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
break;
|
||||
}
|
||||
if (AMF_MODE_ENABLED == 1) {
|
||||
rrc_gNB_send_NGAP_UE_CAPABILITIES_IND(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg);
|
||||
}
|
||||
rrc_gNB_generate_defaultRRCReconfiguration(ctxt_pP, ue_context_p);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
+51
-23
@@ -61,6 +61,9 @@
|
||||
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
#if defined(TEST_S1C_AMF)
|
||||
#include "oaisim_amf_test_s1c.h"
|
||||
#endif
|
||||
|
||||
ngap_gNB_config_t ngap_config;
|
||||
|
||||
@@ -95,6 +98,7 @@ static void ngap_gNB_register_amf(ngap_gNB_instance_t *instance_p,
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
|
||||
ngap_gNB_amf_data_t *ngap_amf_data_p = NULL;
|
||||
struct ngap_gNB_amf_data_s *amf = NULL;
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(amf_ip_address != NULL);
|
||||
message_p = itti_alloc_new_message(TASK_NGAP, SCTP_NEW_ASSOCIATION_REQ);
|
||||
@@ -110,29 +114,50 @@ static void ngap_gNB_register_amf(ngap_gNB_instance_t *instance_p,
|
||||
local_ip_addr,
|
||||
sizeof(*local_ip_addr));
|
||||
NGAP_INFO("[gNB %d] check the amf registration state\n",instance_p->instance);
|
||||
amf = NULL;
|
||||
|
||||
/* Create new AMF descriptor */
|
||||
ngap_amf_data_p = calloc(1, sizeof(*ngap_amf_data_p));
|
||||
DevAssert(ngap_amf_data_p != NULL);
|
||||
ngap_amf_data_p->cnx_id = ngap_gNB_fetch_add_global_cnx_id();
|
||||
sctp_new_association_req_p->ulp_cnx_id = ngap_amf_data_p->cnx_id;
|
||||
ngap_amf_data_p->assoc_id = -1;
|
||||
ngap_amf_data_p->broadcast_plmn_num = broadcast_plmn_num;
|
||||
memcpy(&ngap_amf_data_p->amf_s1_ip,
|
||||
amf_ip_address,
|
||||
sizeof(*amf_ip_address));
|
||||
for (int i = 0; i < broadcast_plmn_num; ++i)
|
||||
ngap_amf_data_p->broadcast_plmn_index[i] = broadcast_plmn_index[i];
|
||||
if ( amf == NULL ) {
|
||||
/* Create new AMF descriptor */
|
||||
ngap_amf_data_p = calloc(1, sizeof(*ngap_amf_data_p));
|
||||
DevAssert(ngap_amf_data_p != NULL);
|
||||
ngap_amf_data_p->cnx_id = ngap_gNB_fetch_add_global_cnx_id();
|
||||
sctp_new_association_req_p->ulp_cnx_id = ngap_amf_data_p->cnx_id;
|
||||
ngap_amf_data_p->assoc_id = -1;
|
||||
ngap_amf_data_p->broadcast_plmn_num = broadcast_plmn_num;
|
||||
memcpy(&ngap_amf_data_p->amf_s1_ip,
|
||||
amf_ip_address,
|
||||
sizeof(*amf_ip_address));
|
||||
for (int i = 0; i < broadcast_plmn_num; ++i)
|
||||
ngap_amf_data_p->broadcast_plmn_index[i] = broadcast_plmn_index[i];
|
||||
|
||||
ngap_amf_data_p->ngap_gNB_instance = instance_p;
|
||||
STAILQ_INIT(&ngap_amf_data_p->served_guami);
|
||||
/* Insert the new descriptor in list of known AMF
|
||||
* but not yet associated.
|
||||
*/
|
||||
RB_INSERT(ngap_amf_map, &instance_p->ngap_amf_head, ngap_amf_data_p);
|
||||
ngap_amf_data_p->state = NGAP_GNB_STATE_WAITING;
|
||||
instance_p->ngap_amf_nb ++;
|
||||
instance_p->ngap_amf_pending_nb ++;
|
||||
ngap_amf_data_p->ngap_gNB_instance = instance_p;
|
||||
STAILQ_INIT(&ngap_amf_data_p->served_guami);
|
||||
/* Insert the new descriptor in list of known AMF
|
||||
* but not yet associated.
|
||||
*/
|
||||
RB_INSERT(ngap_amf_map, &instance_p->ngap_amf_head, ngap_amf_data_p);
|
||||
ngap_amf_data_p->state = NGAP_GNB_STATE_WAITING;
|
||||
instance_p->ngap_amf_nb ++;
|
||||
instance_p->ngap_amf_pending_nb ++;
|
||||
} else if (amf->state == NGAP_GNB_STATE_WAITING) {
|
||||
instance_p->ngap_amf_pending_nb ++;
|
||||
sctp_new_association_req_p->ulp_cnx_id = amf->cnx_id;
|
||||
NGAP_INFO("[gNB %d] AMF already registered, retrive the data (state %d, cnx %d, amf_nb %d, amf_pending_nb %d)\n",
|
||||
instance_p->instance,
|
||||
amf->state, amf->cnx_id,
|
||||
instance_p->ngap_amf_nb, instance_p->ngap_amf_pending_nb);
|
||||
/*ngap_amf_data_p->cnx_id = amf->cnx_id;
|
||||
sctp_new_association_req_p->ulp_cnx_id = amf->cnx_id;
|
||||
|
||||
ngap_amf_data_p->assoc_id = -1;
|
||||
ngap_amf_data_p->ngap_gNB_instance = instance_p;
|
||||
*/
|
||||
} else {
|
||||
NGAP_WARN("[gNB %d] AMF already registered but not in the waiting state, retrive the data (state %d, cnx %d, amf_nb %d, amf_pending_nb %d)\n",
|
||||
instance_p->instance,
|
||||
amf->state, amf->cnx_id,
|
||||
instance_p->ngap_amf_nb, instance_p->ngap_amf_pending_nb);
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
|
||||
}
|
||||
@@ -255,10 +280,13 @@ static
|
||||
void ngap_gNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
|
||||
int result;
|
||||
DevAssert(sctp_data_ind != NULL);
|
||||
|
||||
#if defined(TEST_S1C_AMF)
|
||||
amf_test_s1_notify_sctp_data_ind(sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
|
||||
#else
|
||||
ngap_gNB_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
|
||||
|
||||
#endif
|
||||
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
|
||||
@@ -344,11 +344,11 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
/* UE-related procedure -> stream != 0 */
|
||||
if (stream == 0) {
|
||||
NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream == 0\n",
|
||||
assoc_id);
|
||||
return -1;
|
||||
}
|
||||
// if (stream == 0) {
|
||||
// NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream == 0\n",
|
||||
// assoc_id);
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
|
||||
NGAP_ERROR(
|
||||
@@ -581,6 +581,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
|
||||
/* Prepare the NGAP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = (NGAP_InitiatingMessage_t *)calloc(1,sizeof(NGAP_InitiatingMessage_t));
|
||||
pdu.choice.initiatingMessage->procedureCode = NGAP_ProcedureCode_id_NASNonDeliveryIndication;
|
||||
pdu.choice.initiatingMessage->criticality = NGAP_Criticality_ignore;
|
||||
pdu.choice.initiatingMessage->value.present = NGAP_InitiatingMessage__value_PR_NASNonDeliveryIndication;
|
||||
|
||||
Reference in New Issue
Block a user