Commit c8b67cb1 authored by heshanyun's avatar heshanyun

compile NGAP_GNB lib

parent 46f1dc96
...@@ -473,21 +473,21 @@ add_dependencies(NGAP_LIB rrc_flag ngap_flag) ...@@ -473,21 +473,21 @@ add_dependencies(NGAP_LIB rrc_flag ngap_flag)
include_directories ("${NGAP_C_DIR}") include_directories ("${NGAP_C_DIR}")
include_directories ("${NGAP_DIR}") include_directories ("${NGAP_DIR}")
#add_library(NGAP_GNB add_library(NGAP_GNB
# ${NGAP_DIR}/ngap_gNB.c ${NGAP_DIR}/ngap_gNB.c
# ${NGAP_DIR}/ngap_gNB_context_management_procedures.c ${NGAP_DIR}/ngap_gNB_context_management_procedures.c
# ${NGAP_DIR}/ngap_gNB_decoder.c ${NGAP_DIR}/ngap_gNB_decoder.c
# ${NGAP_DIR}/ngap_gNB_encoder.c ${NGAP_DIR}/ngap_gNB_encoder.c
# ${NGAP_DIR}/ngap_gNB_handlers.c ${NGAP_DIR}/ngap_gNB_handlers.c
# ${NGAP_DIR}/ngap_gNB_itti_messaging.c ${NGAP_DIR}/ngap_gNB_itti_messaging.c
# ${NGAP_DIR}/ngap_gNB_management_procedures.c ${NGAP_DIR}/ngap_gNB_management_procedures.c
# ${NGAP_DIR}/ngap_gNB_nas_procedures.c ${NGAP_DIR}/ngap_gNB_nas_procedures.c
# ${NGAP_DIR}/ngap_gNB_nnsf.c ${NGAP_DIR}/ngap_gNB_nnsf.c
# ${NGAP_DIR}/ngap_gNB_overload.c ${NGAP_DIR}/ngap_gNB_overload.c
# ${NGAP_DIR}/ngap_gNB_trace.c ${NGAP_DIR}/ngap_gNB_trace.c
# ${NGAP_DIR}/ngap_gNB_ue_context.c ${NGAP_DIR}/ngap_gNB_ue_context.c
# ) )
#add_dependencies(NGAP_GNB rrc_flag ngap_flag) add_dependencies(NGAP_GNB rrc_flag ngap_flag)
#M2AP #M2AP
# Same limitation as described in RRC/S1AP: unknown generated file list # Same limitation as described in RRC/S1AP: unknown generated file list
...@@ -2800,7 +2800,7 @@ target_link_libraries (nr-softmodem ...@@ -2800,7 +2800,7 @@ target_link_libraries (nr-softmodem
-Wl,--start-group -Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl) -Wl,--end-group z dl)
......
...@@ -445,6 +445,7 @@ int logInit (void) ...@@ -445,6 +445,7 @@ int logInit (void)
register_log_component("NR_RRC","log",NR_RRC); register_log_component("NR_RRC","log",NR_RRC);
register_log_component("NR_MAC","log",NR_MAC); register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_PHY","log",NR_PHY); register_log_component("NR_PHY","log",NR_PHY);
register_log_component("NGAP","",NGAP);
for (int i=0 ; log_level_names[i].name != NULL ; i++) for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
......
...@@ -384,6 +384,27 @@ ID = LEGACY_S1AP_TRACE ...@@ -384,6 +384,27 @@ ID = LEGACY_S1AP_TRACE
GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_TRACE:LEGACY GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log FORMAT = string,log
ID = LEGACY_NGAP_INFO
DESC = NGAP legacy logs - info level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_ERROR
DESC = NGAP legacy logs - error level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_WARNING
DESC = NGAP legacy logs - warning level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_DEBUG
DESC = NGAP legacy logs - debug level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_NGAP_TRACE
DESC = NGAP legacy logs - trace level
GROUP = ALL:LEGACY_NGAP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_X2AP_INFO ID = LEGACY_X2AP_INFO
DESC = X2AP legacy logs - info level DESC = X2AP legacy logs - info level
GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_INFO:LEGACY GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_INFO:LEGACY
......
...@@ -409,12 +409,11 @@ int create_gNB_tasks(uint32_t gnb_nb) { ...@@ -409,12 +409,11 @@ int create_gNB_tasks(uint32_t gnb_nb) {
return -1; return -1;
} }
*/ */
/*
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) { if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(S1AP, "Create task for NGAP failed\n"); LOG_E(S1AP, "Create task for NGAP failed\n");
return -1; return -1;
} }
*/
if(!emulate_rf){ if(!emulate_rf){
......
...@@ -344,7 +344,7 @@ void RCconfig_nr_flexran() ...@@ -344,7 +344,7 @@ void RCconfig_nr_flexran()
// Calculate a default gNB ID // Calculate a default gNB ID
if (EPC_MODE_ENABLED) if (EPC_MODE_ENABLED)
//gnb_id = i + (ngap_generate_gNB_id () & 0xFFFF8); //gnb_id = i + (ngap_generate_gNB_id () & 0xFFFF8);
gnb_id = i + (s1ap_generate_eNB_id () & 0xFFFF8); gnb_id = i + (ngap_generate_gNB_id () & 0xFFFF8);
else else
gnb_id = i; gnb_id = i;
} else { } else {
...@@ -572,7 +572,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) { ...@@ -572,7 +572,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
uint32_t hash; uint32_t hash;
//hash = ngap_generate_gNB_id (); //hash = ngap_generate_gNB_id ();
hash = s1ap_generate_eNB_id (); hash = ngap_generate_gNB_id ();
gnb_id = i + (hash & 0xFFFF8); gnb_id = i + (hash & 0xFFFF8);
} else { } else {
gnb_id = i; gnb_id = i;
...@@ -790,7 +790,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) { ...@@ -790,7 +790,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
uint32_t hash; uint32_t hash;
//hash = ngap_generate_gNB_id (); //hash = ngap_generate_gNB_id ();
hash = s1ap_generate_eNB_id (); hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFF8); gnb_id = k + (hash & 0xFFFF8);
} else { } else {
gnb_id = k; gnb_id = k;
...@@ -1040,7 +1040,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) { ...@@ -1040,7 +1040,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
if (EPC_MODE_ENABLED) { if (EPC_MODE_ENABLED) {
uint32_t hash; uint32_t hash;
//hash = ngap_generate_gNB_id (); //hash = ngap_generate_gNB_id ();
hash = s1ap_generate_eNB_id (); hash = ngap_generate_gNB_id ();
gnb_id = k + (hash & 0xFFFF8); gnb_id = k + (hash & 0xFFFF8);
} else { } else {
gnb_id = k; gnb_id = k;
......
...@@ -53,8 +53,11 @@ ...@@ -53,8 +53,11 @@
#include "NGAP_ProtocolExtensionField.h" #include "NGAP_ProtocolExtensionField.h"
#include "NGAP_ProtocolExtensionContainer.h" #include "NGAP_ProtocolExtensionContainer.h"
#include "NGAP_asn_constant.h" #include "NGAP_asn_constant.h"
#include "NGAP_SupportedTAs-Item.h" #include "NGAP_SupportedTAItem.h"
#include "NGAP_ServedGUAMIsItem.h" #include "NGAP_ServedGUAMIItem.h"
#include "NGAP_BroadcastPLMNItem.h"
#include "NGAP_SliceSupportItem.h"
#include "NGAP_PLMNSupportItem.h"
/* Checking version of ASN1C compiler */ /* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION) #if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
...@@ -75,7 +78,7 @@ extern int asn1_xer_print; ...@@ -75,7 +78,7 @@ extern int asn1_xer_print;
#if defined(ENB_MODE) #if defined(ENB_MODE)
# include "common/utils/LOG/log.h" # include "common/utils/LOG/log.h"
# include "ngap_eNB_default_values.h" # include "ngap_gNB_default_values.h"
# define NGAP_ERROR(x, args...) LOG_E(NGAP, x, ##args) # define NGAP_ERROR(x, args...) LOG_E(NGAP, x, ##args)
# define NGAP_WARN(x, args...) LOG_W(NGAP, x, ##args) # define NGAP_WARN(x, args...) LOG_W(NGAP, x, ##args)
# define NGAP_TRAF(x, args...) LOG_I(NGAP, x, ##args) # define NGAP_TRAF(x, args...) LOG_I(NGAP, x, ##args)
......
...@@ -502,13 +502,13 @@ static int ngap_gNB_generate_ng_setup_request( ...@@ -502,13 +502,13 @@ static int ngap_gNB_generate_ng_setup_request(
MCC_MNC_TO_TBCD(instance_p->mcc[ngap_amf_data_p->broadcast_plmn_index[i]], MCC_MNC_TO_TBCD(instance_p->mcc[ngap_amf_data_p->broadcast_plmn_index[i]],
instance_p->mnc[ngap_amf_data_p->broadcast_plmn_index[i]], instance_p->mnc[ngap_amf_data_p->broadcast_plmn_index[i]],
instance_p->mnc_digit_length[ngap_amf_data_p->broadcast_plmn_index[i]], instance_p->mnc_digit_length[ngap_amf_data_p->broadcast_plmn_index[i]],
plmn->pLMNIdentity); &plmn->pLMNIdentity);
for(int si = 0; si < instance_p->num_nssai[i]; si++) { for(int si = 0; si < instance_p->num_nssai[i]; si++) {
ssi = (NGAP_SliceSupportItem_t *)calloc(1, sizeof(NGAP_SliceSupportItem_t)); ssi = (NGAP_SliceSupportItem_t *)calloc(1, sizeof(NGAP_SliceSupportItem_t));
INT8_TO_OCTET_STRING(instance_p->s_nssai[i][si].sST, &ssi->s_NSSAI.sST); INT8_TO_OCTET_STRING(instance_p->s_nssai[i][si].sST, &ssi->s_NSSAI.sST);
if(instance_p->s_nssai[i].sD_flag) { if(instance_p->s_nssai[i]->sD_flag) {
ssi->s_NSSAI.sD = calloc(1, sizeof(NGAP_SD_t)); ssi->s_NSSAI.sD = calloc(1, sizeof(NGAP_SD_t));
ssi->s_NSSAI.sD->buf = calloc(3, sizeof(uint8_t)); ssi->s_NSSAI.sD->buf = calloc(3, sizeof(uint8_t));
ssi->s_NSSAI.sD->size = 3; ssi->s_NSSAI.sD->size = 3;
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
int ngap_ue_context_release_complete(instance_t instance, int ngap_ue_context_release_complete(instance_t instance,
ngap_ue_release_complete_t *ue_release_complete_p) ngap_ue_release_complete_t *ue_release_complete_p)
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -145,7 +146,7 @@ int ngap_ue_context_release_complete(instance_t instance, ...@@ -145,7 +146,7 @@ int ngap_ue_context_release_complete(instance_t instance,
ue_context_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id, ue_context_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,
ue_context_p->ue_state); ue_context_p->ue_state);
}*/ }*/
#endif
return 0; return 0;
} }
...@@ -153,6 +154,7 @@ int ngap_ue_context_release_complete(instance_t instance, ...@@ -153,6 +154,7 @@ int ngap_ue_context_release_complete(instance_t instance,
int ngap_ue_context_release_req(instance_t instance, int ngap_ue_context_release_req(instance_t instance,
ngap_ue_release_req_t *ue_release_req_p) ngap_ue_release_req_t *ue_release_req_p)
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -260,7 +262,7 @@ int ngap_ue_context_release_req(instance_t instance, ...@@ -260,7 +262,7 @@ int ngap_ue_context_release_req(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -41,7 +41,7 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) { ...@@ -41,7 +41,7 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) { switch(pdu->choice.initiatingMessage.procedureCode) {
case NGAP_ProcedureCode_id_downlinkNASTransport: case NGAP_ProcedureCode_id_DownlinkNASTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
...@@ -62,19 +62,19 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) { ...@@ -62,19 +62,19 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONSetup: case NGAP_ProcedureCode_id_PDUSessionResourceSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("PDUSESSIONSetup initiating message\n"); NGAP_INFO("PDUSESSIONSetup initiating message\n");
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONModify: case NGAP_ProcedureCode_id_PDUSessionResourceModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("PDUSESSIONModify initiating message\n"); NGAP_INFO("PDUSESSIONModify initiating message\n");
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONRelease: case NGAP_ProcedureCode_id_PDUSessionResourceRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("TODO PDUSESSIONRelease initiating message\n"); NGAP_INFO("TODO PDUSESSIONRelease initiating message\n");
...@@ -102,7 +102,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) { ...@@ -102,7 +102,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) { switch(pdu->choice.successfulOutcome.procedureCode) {
case NGAP_ProcedureCode_id_S1Setup: case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
...@@ -112,7 +112,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) { ...@@ -112,7 +112,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONModificationIndication: case NGAP_ProcedureCode_id_PDUSessionResourceModifyIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
...@@ -132,7 +132,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) { ...@@ -132,7 +132,7 @@ static int ngap_gNB_decode_unsuccessful_outcome(NGAP_NGAP_PDU_t *pdu) {
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) { switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
case NGAP_ProcedureCode_id_S1Setup: case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
......
...@@ -135,7 +135,7 @@ typedef struct ngap_gNB_NSSAI_s{ ...@@ -135,7 +135,7 @@ typedef struct ngap_gNB_NSSAI_s{
/* plmn support element */ /* plmn support element */
struct plmn_support_s { struct plmn_support_s {
plmn_identity_s plmn_identity; struct plmn_identity_s plmn_identity;
/* Number of slice support in list */ /* Number of slice support in list */
uint8_t nb_slice_s; uint8_t nb_slice_s;
......
...@@ -83,22 +83,22 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu, ...@@ -83,22 +83,22 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
DevAssert(pdu != NULL); DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) { switch(pdu->choice.initiatingMessage.procedureCode) {
case NGAP_ProcedureCode_id_S1Setup: case NGAP_ProcedureCode_id_NGSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_uplinkNASTransport: case NGAP_ProcedureCode_id_UplinkNASTransport:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_UECapabilityInfoIndication: case NGAP_ProcedureCode_id_UERadioCapabilityInfoIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_initialUEMessage: case NGAP_ProcedureCode_id_InitialUEMessage:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
...@@ -118,7 +118,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu, ...@@ -118,7 +118,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONModificationIndication: case NGAP_ProcedureCode_id_PDUSessionResourceModifyIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
break; break;
...@@ -157,19 +157,19 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu, ...@@ -157,19 +157,19 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
free(res.buffer); free(res.buffer);
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONSetup: case NGAP_ProcedureCode_id_PDUSessionResourceSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("PDUSESSIONSetup successful message\n"); NGAP_INFO("PDUSESSIONSetup successful message\n");
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONModify: case NGAP_ProcedureCode_id_PDUSessionResourceModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("PDUSESSIONModify successful message\n"); NGAP_INFO("PDUSESSIONModify successful message\n");
break; break;
case NGAP_ProcedureCode_id_PDUSESSIONRelease: case NGAP_ProcedureCode_id_PDUSessionResourceRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu); res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer); free(res.buffer);
NGAP_INFO("PDUSESSION Release successful message\n"); NGAP_INFO("PDUSESSION Release successful message\n");
......
...@@ -110,7 +110,7 @@ int ngap_gNB_handle_ng_ENDC_pdusession_modification_confirm(uint32_t ...@@ -110,7 +110,7 @@ int ngap_gNB_handle_ng_ENDC_pdusession_modification_confirm(uint32_t
NGAP_NGAP_PDU_t *pdu); NGAP_NGAP_PDU_t *pdu);
/* Handlers matrix. Only gNB related procedure present here */ /* Handlers matrix. Only gNB related procedure present here */
ngap_message_decoded_callback messages_callback[][3] = { ngap_message_decoded_callback ngap_messages_callback[][3] = {
{ 0, 0, 0 }, /* AMFConfigurationUpdate */ { 0, 0, 0 }, /* AMFConfigurationUpdate */
{ 0, 0, 0 }, /* AMFStatusIndication */ { 0, 0, 0 }, /* AMFStatusIndication */
{ 0, 0, 0 }, /* CellTrafficTrace */ { 0, 0, 0 }, /* CellTrafficTrace */
...@@ -229,7 +229,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -229,7 +229,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
} }
/* Checking procedure Code and direction of message */ /* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage.procedureCode >= sizeof(messages_callback) / (3 * sizeof( if (pdu.choice.initiatingMessage.procedureCode >= sizeof(ngap_messages_callback) / (3 * sizeof(
ngap_message_decoded_callback)) ngap_message_decoded_callback))
|| (pdu.present > NGAP_NGAP_PDU_PR_unsuccessfulOutcome)) { || (pdu.present > NGAP_NGAP_PDU_PR_unsuccessfulOutcome)) {
NGAP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n", NGAP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
...@@ -241,7 +241,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -241,7 +241,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
/* No handler present. /* No handler present.
* This can mean not implemented or no procedure for gNB (wrong direction). * This can mean not implemented or no procedure for gNB (wrong direction).
*/ */
if (messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1] == NULL) { if (ngap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1] == NULL) {
NGAP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n", NGAP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, pdu.choice.initiatingMessage.procedureCode, assoc_id, pdu.choice.initiatingMessage.procedureCode,
ngap_direction2String(pdu.present - 1)); ngap_direction2String(pdu.present - 1));
...@@ -250,7 +250,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream, ...@@ -250,7 +250,7 @@ int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
} }
/* Calling the right handler */ /* Calling the right handler */
ret = (*messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1]) ret = (*ngap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
(assoc_id, stream, &pdu); (assoc_id, stream, &pdu);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, &pdu);
return ret; return ret;
...@@ -297,6 +297,7 @@ static ...@@ -297,6 +297,7 @@ static
int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id, int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
NGAP_NGSetupResponse_t *container; NGAP_NGSetupResponse_t *container;
NGAP_NGSetupResponseIEs_t *ie; NGAP_NGSetupResponseIEs_t *ie;
ngap_gNB_amf_data_t *amf_desc_p; ngap_gNB_amf_data_t *amf_desc_p;
...@@ -386,10 +387,10 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id, ...@@ -386,10 +387,10 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id,
if (ie) { if (ie) {
amf_desc_p->amf_name = calloc(ie->value.choice.AMFName.size + 1, sizeof(char)); amf_desc_p->amf_name = calloc(ie->value.choice.AMFName.size + 1, sizeof(char));
memcpy(amf_desc_p->amf_name, ie->value.choice.AMFname.buf, memcpy(amf_desc_p->amf_name, ie->value.choice.AMFName.buf,
ie->value.choice.AMFname.size); ie->value.choice.AMFName.size);
/* Convert the amf name to a printable string */ /* Convert the amf name to a printable string */
amf_desc_p->amf_name[ie->value.choice.AMFname.size] = '\0'; amf_desc_p->amf_name[ie->value.choice.AMFName.size] = '\0';
} }
...@@ -446,6 +447,7 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id, ...@@ -446,6 +447,7 @@ int ngap_gNB_handle_ng_setup_response(uint32_t assoc_id,
amf_desc_p->state = NGAP_GNB_STATE_CONNECTED; amf_desc_p->state = NGAP_GNB_STATE_CONNECTED;
amf_desc_p->ngap_gNB_instance->ngap_amf_associated_nb ++; amf_desc_p->ngap_gNB_instance->ngap_amf_associated_nb ++;
ngap_handle_ng_setup_message(amf_desc_p, 0); ngap_handle_ng_setup_message(amf_desc_p, 0);
#endif
return 0; return 0;
} }
...@@ -454,6 +456,7 @@ static ...@@ -454,6 +456,7 @@ static
int ngap_gNB_handle_error_indication(uint32_t assoc_id, int ngap_gNB_handle_error_indication(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
NGAP_ErrorIndication_t *container; NGAP_ErrorIndication_t *container;
NGAP_ErrorIndicationIEs_t *ie; NGAP_ErrorIndicationIEs_t *ie;
ngap_gNB_amf_data_t *amf_desc_p; ngap_gNB_amf_data_t *amf_desc_p;
...@@ -781,6 +784,7 @@ int ngap_gNB_handle_error_indication(uint32_t assoc_id, ...@@ -781,6 +784,7 @@ int ngap_gNB_handle_error_indication(uint32_t assoc_id,
// TODO continue // TODO continue
} }
#endif
// TODO continue // TODO continue
return 0; return 0;
} }
...@@ -790,6 +794,7 @@ static ...@@ -790,6 +794,7 @@ static
int ngap_gNB_handle_initial_context_request(uint32_t assoc_id, int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
int i; int i;
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
...@@ -1070,7 +1075,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id, ...@@ -1070,7 +1075,7 @@ int ngap_gNB_handle_initial_context_request(uint32_t assoc_id,
} else {/* ie != NULL */ } else {/* ie != NULL */
return -1; return -1;
} }
#endif
return 0; return 0;
} }
...@@ -1079,6 +1084,7 @@ static ...@@ -1079,6 +1084,7 @@ static
int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
...@@ -1158,12 +1164,15 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id, ...@@ -1158,12 +1164,15 @@ int ngap_gNB_handle_ue_context_release_command(uint32_t assoc_id,
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_UEContextReleaseCommand_IEs_t, ie, container, NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_UEContextReleaseCommand_IEs_t, ie, container,
NGAP_ProtocolIE_ID_id_Cause, true); NGAP_ProtocolIE_ID_id_Cause, true);
/* TBD */ /* TBD */
#endif
return 0;
} }
static static
int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
int i; int i;
NGAP_AMF_UE_NGAP_ID_t amf_ue_ngap_id; NGAP_AMF_UE_NGAP_ID_t amf_ue_ngap_id;
NGAP_GNB_UE_NGAP_ID_t enb_ue_ngap_id; NGAP_GNB_UE_NGAP_ID_t enb_ue_ngap_id;
...@@ -1278,7 +1287,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id, ...@@ -1278,7 +1287,7 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
} else { } else {
return -1; return -1;
} }
#endif
return 0; return 0;
} }
...@@ -1286,6 +1295,7 @@ static ...@@ -1286,6 +1295,7 @@ static
int ngap_gNB_handle_paging(uint32_t assoc_id, int ngap_gNB_handle_paging(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_instance_t *ngap_gNB_instance = NULL; ngap_gNB_instance_t *ngap_gNB_instance = NULL;
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
...@@ -1449,6 +1459,7 @@ int ngap_gNB_handle_paging(uint32_t assoc_id, ...@@ -1449,6 +1459,7 @@ int ngap_gNB_handle_paging(uint32_t assoc_id,
NGAP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[4], NGAP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[5]); NGAP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[4], NGAP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.buffer[5]);
/* send message to RRC */ /* send message to RRC */
itti_send_msg_to_task(TASK_RRC_GNB, ngap_gNB_instance->instance, message_p); itti_send_msg_to_task(TASK_RRC_GNB, ngap_gNB_instance->instance, message_p);
#endif
return 0; return 0;
} }
...@@ -1456,6 +1467,7 @@ static ...@@ -1456,6 +1467,7 @@ static
int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
int i, nb_of_pdusessions_failed; int i, nb_of_pdusessions_failed;
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
...@@ -1582,7 +1594,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, ...@@ -1582,7 +1594,7 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
} else { /* of if (ie != NULL)*/ } else { /* of if (ie != NULL)*/
return -1; return -1;
} }
#endif
return 0; return 0;
} }
// handle e-rab release command and send it to rrc_end // handle e-rab release command and send it to rrc_end
...@@ -1590,6 +1602,7 @@ static ...@@ -1590,6 +1602,7 @@ static
int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id, int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
int i; int i;
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
...@@ -1687,6 +1700,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id, ...@@ -1687,6 +1700,7 @@ int ngap_gNB_handle_pdusession_release_command(uint32_t assoc_id,
} }
itti_send_msg_to_task(TASK_RRC_GNB, ue_desc_p->gNB_instance->instance, message_p); itti_send_msg_to_task(TASK_RRC_GNB, ue_desc_p->gNB_instance->instance, message_p);
#endif
return 0; return 0;
} }
...@@ -1694,6 +1708,7 @@ static ...@@ -1694,6 +1708,7 @@ static
int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id, int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
MessageDef *message_p = NULL; MessageDef *message_p = NULL;
...@@ -1851,6 +1866,7 @@ int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id, ...@@ -1851,6 +1866,7 @@ int ngap_gNB_handle_ng_path_switch_request_ack(uint32_t assoc_id,
// TODO continue // TODO continue
itti_send_msg_to_task(TASK_RRC_GNB, ue_desc_p->gNB_instance->instance, message_p); itti_send_msg_to_task(TASK_RRC_GNB, ue_desc_p->gNB_instance->instance, message_p);
#endif
return 0; return 0;
} }
...@@ -1858,6 +1874,7 @@ static ...@@ -1858,6 +1874,7 @@ static
int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_id, int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) { NGAP_NGAP_PDU_t *pdu) {
#if 0
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
NGAP_PathSwitchRequestFailure_t *pathSwitchRequestFailure; NGAP_PathSwitchRequestFailure_t *pathSwitchRequestFailure;
NGAP_PathSwitchRequestFailureIEs_t *ie; NGAP_PathSwitchRequestFailureIEs_t *ie;
...@@ -1917,7 +1934,7 @@ int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_ ...@@ -1917,7 +1934,7 @@ int ngap_gNB_handle_ng_path_switch_request_failure(uint32_t assoc_
if(!ie) { if(!ie) {
NGAP_WARN("Critical Diagnostic not supported\n"); NGAP_WARN("Critical Diagnostic not supported\n");
} }
#endif
// TODO continue // TODO continue
return 0; return 0;
} }
......
...@@ -152,6 +152,7 @@ ngap_gNB_instance_t *ngap_gNB_get_instance(instance_t instance) ...@@ -152,6 +152,7 @@ ngap_gNB_instance_t *ngap_gNB_get_instance(instance_t instance)
void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance) void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance)
{ {
#if 0
struct ngap_gNB_amf_data_s *amf = NULL; struct ngap_gNB_amf_data_s *amf = NULL;
struct ngap_gNB_amf_data_s *amfNext = NULL; struct ngap_gNB_amf_data_s *amfNext = NULL;
struct plmn_identity_s* plmnInfo; struct plmn_identity_s* plmnInfo;
...@@ -185,4 +186,5 @@ void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance) ...@@ -185,4 +186,5 @@ void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance)
} }
free(amf); free(amf);
} }
#endif
} }
...@@ -53,6 +53,7 @@ int ngap_gNB_handle_nas_first_req( ...@@ -53,6 +53,7 @@ int ngap_gNB_handle_nas_first_req(
instance_t instance, ngap_nas_first_req_t *ngap_nas_first_req_p) instance_t instance, ngap_nas_first_req_t *ngap_nas_first_req_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *instance_p = NULL; ngap_gNB_instance_t *instance_p = NULL;
struct ngap_gNB_amf_data_s *amf_desc_p = NULL; struct ngap_gNB_amf_data_s *amf_desc_p = NULL;
struct ngap_gNB_ue_context_s *ue_desc_p = NULL; struct ngap_gNB_ue_context_s *ue_desc_p = NULL;
...@@ -314,6 +315,7 @@ int ngap_gNB_handle_nas_first_req( ...@@ -314,6 +315,7 @@ int ngap_gNB_handle_nas_first_req(
/* Send encoded message over sctp */ /* Send encoded message over sctp */
ngap_gNB_itti_send_sctp_data_req(instance_p->instance, amf_desc_p->assoc_id, ngap_gNB_itti_send_sctp_data_req(instance_p->instance, amf_desc_p->assoc_id,
buffer, length, ue_desc_p->tx_stream); buffer, length, ue_desc_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -323,6 +325,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, ...@@ -323,6 +325,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
NGAP_NGAP_PDU_t *pdu) NGAP_NGAP_PDU_t *pdu)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_amf_data_t *amf_desc_p = NULL; ngap_gNB_amf_data_t *amf_desc_p = NULL;
ngap_gNB_ue_context_t *ue_desc_p = NULL; ngap_gNB_ue_context_t *ue_desc_p = NULL;
ngap_gNB_instance_t *ngap_gNB_instance = NULL; ngap_gNB_instance_t *ngap_gNB_instance = NULL;
...@@ -415,6 +418,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, ...@@ -415,6 +418,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
ue_desc_p->gNB_ue_ngap_id, ue_desc_p->gNB_ue_ngap_id,
ie->value.choice.NAS_PDU.buf, ie->value.choice.NAS_PDU.buf,
ie->value.choice.NAS_PDU.size); ie->value.choice.NAS_PDU.size);
#endif
return 0; return 0;
} }
...@@ -422,6 +426,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id, ...@@ -422,6 +426,7 @@ int ngap_gNB_handle_nas_downlink(uint32_t assoc_id,
int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_p) int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
struct ngap_gNB_ue_context_s *ue_context_p; struct ngap_gNB_ue_context_s *ue_context_p;
ngap_gNB_instance_t *ngap_gNB_instance_p; ngap_gNB_instance_t *ngap_gNB_instance_p;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -530,6 +535,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_ ...@@ -530,6 +535,7 @@ int ngap_gNB_nas_uplink(instance_t instance, ngap_uplink_nas_t *ngap_uplink_nas_
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -539,6 +545,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, ...@@ -539,6 +545,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
ngap_nas_non_delivery_ind_t *ngap_nas_non_delivery_ind) ngap_nas_non_delivery_ind_t *ngap_nas_non_delivery_ind)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
struct ngap_gNB_ue_context_s *ue_context_p; struct ngap_gNB_ue_context_s *ue_context_p;
ngap_gNB_instance_t *ngap_gNB_instance_p; ngap_gNB_instance_t *ngap_gNB_instance_p;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -623,6 +630,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance, ...@@ -623,6 +630,7 @@ int ngap_gNB_nas_non_delivery_ind(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -631,6 +639,7 @@ int ngap_gNB_initial_ctxt_resp( ...@@ -631,6 +639,7 @@ int ngap_gNB_initial_ctxt_resp(
instance_t instance, ngap_initial_context_setup_resp_t *initial_ctxt_resp_p) instance_t instance, ngap_initial_context_setup_resp_t *initial_ctxt_resp_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -796,6 +805,7 @@ int ngap_gNB_initial_ctxt_resp( ...@@ -796,6 +805,7 @@ int ngap_gNB_initial_ctxt_resp(
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -804,6 +814,7 @@ int ngap_gNB_ue_capabilities(instance_t instance, ...@@ -804,6 +814,7 @@ int ngap_gNB_ue_capabilities(instance_t instance,
ngap_ue_cap_info_ind_t *ue_cap_info_ind_p) ngap_ue_cap_info_ind_t *ue_cap_info_ind_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p; ngap_gNB_instance_t *ngap_gNB_instance_p;
struct ngap_gNB_ue_context_s *ue_context_p; struct ngap_gNB_ue_context_s *ue_context_p;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -885,6 +896,7 @@ int ngap_gNB_ue_capabilities(instance_t instance, ...@@ -885,6 +896,7 @@ int ngap_gNB_ue_capabilities(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -893,6 +905,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ...@@ -893,6 +905,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
ngap_pdusession_setup_resp_t *pdusession_setup_resp_p) ngap_pdusession_setup_resp_t *pdusession_setup_resp_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -1069,6 +1082,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance, ...@@ -1069,6 +1082,7 @@ int ngap_gNB_pdusession_setup_resp(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
...@@ -1077,6 +1091,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ...@@ -1077,6 +1091,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ngap_pdusession_modify_resp_t *pdusession_modify_resp_p) ngap_pdusession_modify_resp_t *pdusession_modify_resp_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -1232,6 +1247,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ...@@ -1232,6 +1247,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->amf_ref->assoc_id, buffer, ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -1239,6 +1255,7 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, ...@@ -1239,6 +1255,7 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
ngap_pdusession_release_resp_t *pdusession_release_resp_p) ngap_pdusession_release_resp_t *pdusession_release_resp_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
...@@ -1374,6 +1391,7 @@ int ngap_gNB_pdusession_release_resp(instance_t instance, ...@@ -1374,6 +1391,7 @@ int ngap_gNB_pdusession_release_resp(instance_t instance,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
NGAP_INFO("pdusession_release_response sended gNB_UE_NGAP_ID %d amf_ue_ngap_id %d nb_of_pdusessions_released %d nb_of_pdusessions_failed %d\n", NGAP_INFO("pdusession_release_response sended gNB_UE_NGAP_ID %d amf_ue_ngap_id %d nb_of_pdusessions_released %d nb_of_pdusessions_failed %d\n",
pdusession_release_resp_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,pdusession_release_resp_p->nb_of_pdusessions_released,pdusession_release_resp_p->nb_of_pdusessions_failed); pdusession_release_resp_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,pdusession_release_resp_p->nb_of_pdusessions_released,pdusession_release_resp_p->nb_of_pdusessions_failed);
#endif
return 0; return 0;
} }
...@@ -1381,6 +1399,7 @@ int ngap_gNB_path_switch_req(instance_t instance, ...@@ -1381,6 +1399,7 @@ int ngap_gNB_path_switch_req(instance_t instance,
ngap_path_switch_req_t *path_switch_req_p) ngap_path_switch_req_t *path_switch_req_p)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
#if 0
ngap_gNB_instance_t *ngap_gNB_instance_p = NULL; ngap_gNB_instance_t *ngap_gNB_instance_p = NULL;
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
struct ngap_gNB_amf_data_s *amf_desc_p = NULL; struct ngap_gNB_amf_data_s *amf_desc_p = NULL;
...@@ -1610,8 +1629,9 @@ int ngap_gNB_path_switch_req(instance_t instance, ...@@ -1610,8 +1629,9 @@ int ngap_gNB_path_switch_req(instance_t instance,
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
amf_desc_p->assoc_id, buffer, amf_desc_p->assoc_id, buffer,
length, ue_context_p->tx_stream); length, ue_context_p->tx_stream);
#endif
return ret; return 0;
} }
...@@ -1777,6 +1797,7 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication( ...@@ -1777,6 +1797,7 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication(
ngap_pdusession_modification_ind_t *pdusession_modification_ind) ngap_pdusession_modification_ind_t *pdusession_modification_ind)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
#if 0
struct ngap_gNB_ue_context_s *ue_context_p = NULL; struct ngap_gNB_ue_context_s *ue_context_p = NULL;
NGAP_NGAP_PDU_t pdu; NGAP_NGAP_PDU_t pdu;
NGAP_PDUSESSIONModificationIndication_t *out = NULL; NGAP_PDUSESSIONModificationIndication_t *out = NULL;
...@@ -1925,7 +1946,8 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication( ...@@ -1925,7 +1946,8 @@ int ngap_gNB_generate_PDUSESSION_Modification_Indication(
len, ue_context_p->tx_stream); len, ue_context_p->tx_stream);
//ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, len, 0); //ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance, ue_context_p->amf_ref->assoc_id, buffer, len, 0);
return ret; #endif
return 0;
} }
...@@ -339,6 +339,7 @@ ngap_gNB_nnsf_select_amf_by_guami_no_cause(ngap_gNB_instance_t *instance_p ...@@ -339,6 +339,7 @@ ngap_gNB_nnsf_select_amf_by_guami_no_cause(ngap_gNB_instance_t *instance_p
struct ngap_gNB_amf_data_s *amf_highest_capacity_p = NULL; struct ngap_gNB_amf_data_s *amf_highest_capacity_p = NULL;
uint8_t current_capacity = 0; uint8_t current_capacity = 0;
#if 0
RB_FOREACH(amf_data_p, ngap_amf_map, &instance_p->ngap_amf_head) { RB_FOREACH(amf_data_p, ngap_amf_map, &instance_p->ngap_amf_head) {
struct served_guami_s *guami_p = NULL; struct served_guami_s *guami_p = NULL;
...@@ -403,5 +404,6 @@ ngap_gNB_nnsf_select_amf_by_guami_no_cause(ngap_gNB_instance_t *instance_p ...@@ -403,5 +404,6 @@ ngap_gNB_nnsf_select_amf_by_guami_no_cause(ngap_gNB_instance_t *instance_p
* In case the list of known AMF is empty, simply return NULL, that way the RRC * In case the list of known AMF is empty, simply return NULL, that way the RRC
* layer should know about it and reject RRC connectivity. * layer should know about it and reject RRC connectivity.
*/ */
#endif
return amf_highest_capacity_p; return amf_highest_capacity_p;
} }
...@@ -47,6 +47,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id, ...@@ -47,6 +47,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) NGAP_NGAP_PDU_t *pdu)
{ {
#if 0
ngap_gNB_amf_data_t *amf_desc_p; ngap_gNB_amf_data_t *amf_desc_p;
NGAP_OverloadStart_t *container; NGAP_OverloadStart_t *container;
NGAP_OverloadStartIEs_t *ie; NGAP_OverloadStartIEs_t *ie;
...@@ -77,6 +78,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id, ...@@ -77,6 +78,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
amf_desc_p->overload_state = amf_desc_p->overload_state =
ie->value.choice.OverloadResponse.choice.overloadAction; ie->value.choice.OverloadResponse.choice.overloadAction;
#endif
return 0; return 0;
} }
......
...@@ -37,74 +37,12 @@ ...@@ -37,74 +37,12 @@
#include "ngap_gNB_itti_messaging.h" #include "ngap_gNB_itti_messaging.h"
#include "ngap_gNB_management_procedures.h" #include "ngap_gNB_management_procedures.h"
static
void ngap_gNB_generate_trace_failure(struct ngap_gNB_ue_context_s *ue_desc_p,
NGAP_E_UTRAN_Trace_ID_t *trace_id,
NGAP_Cause_t *cause_p)
{
NGAP_NGAP_PDU_t pdu;
NGAP_TraceFailureIndication_t *out;
NGAP_TraceFailureIndicationIEs_t *ie;
uint8_t *buffer = NULL;
uint32_t length;
DevAssert(ue_desc_p != NULL);
DevAssert(trace_id != NULL);
DevAssert(cause_p != NULL);
/* Prepare the NGAP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = NGAP_ProcedureCode_id_TraceFailureIndication;
pdu.choice.initiatingMessage.criticality = NGAP_Criticality_ignore;
pdu.choice.initiatingMessage.value.present = NGAP_InitiatingMessage__value_PR_TraceFailureIndication;
out = &pdu.choice.initiatingMessage.value.choice.TraceFailureIndication;
/* mandatory */
ie = (NGAP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(NGAP_TraceFailureIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_TraceFailureIndicationIEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_desc_p->amf_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(NGAP_TraceFailureIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_TraceFailureIndicationIEs__value_PR_GNB_UE_NGAP_ID;
ie->value.choice.GNB_UE_NGAP_ID = ue_desc_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(NGAP_TraceFailureIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_E_UTRAN_Trace_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_TraceFailureIndicationIEs__value_PR_E_UTRAN_Trace_ID;
memcpy(&ie->value.choice.E_UTRAN_Trace_ID, trace_id, sizeof(NGAP_E_UTRAN_Trace_ID_t));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (NGAP_TraceFailureIndicationIEs_t *)calloc(1, sizeof(NGAP_TraceFailureIndicationIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_Cause;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_TraceFailureIndicationIEs__value_PR_Cause;
memcpy(&ie->value.choice.Cause, cause_p, sizeof(NGAP_Cause_t));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (ngap_gNB_encode_pdu(&pdu, &buffer, &length) < 0) {
return;
}
ngap_gNB_itti_send_sctp_data_req(ue_desc_p->amf_ref->ngap_gNB_instance->instance,
ue_desc_p->amf_ref->assoc_id, buffer,
length, ue_desc_p->tx_stream);
}
int ngap_gNB_handle_trace_start(uint32_t assoc_id, int ngap_gNB_handle_trace_start(uint32_t assoc_id,
uint32_t stream, uint32_t stream,
NGAP_NGAP_PDU_t *pdu) NGAP_NGAP_PDU_t *pdu)
{ {
#if 0
NGAP_TraceStart_t *container; NGAP_TraceStart_t *container;
NGAP_TraceStartIEs_t *ie; NGAP_TraceStartIEs_t *ie;
struct ngap_gNB_ue_context_s *ue_desc_p = NULL; struct ngap_gNB_ue_context_s *ue_desc_p = NULL;
...@@ -135,6 +73,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id, ...@@ -135,6 +73,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id,
ngap_gNB_generate_trace_failure(NULL, &trace_id, &cause); ngap_gNB_generate_trace_failure(NULL, &trace_id, &cause);
} }
#endif
return 0; return 0;
} }
......
...@@ -502,6 +502,18 @@ do { \ ...@@ -502,6 +502,18 @@ do { \
(bITsTRING)->size = 3; \ (bITsTRING)->size = 3; \
(bITsTRING)->bits_unused = 4; \ (bITsTRING)->bits_unused = 4; \
} while(0) } while(0)
#define MACRO_GNB_ID_TO_BIT_STRING(mACRO, bITsTRING) \
do { \
(bITsTRING)->buf = calloc(3, sizeof(uint8_t)); \
(bITsTRING)->buf[0] = ((mACRO) >> 12); \
(bITsTRING)->buf[1] = (mACRO) >> 4; \
(bITsTRING)->buf[2] = ((mACRO) & 0x0f) << 4; \
(bITsTRING)->size = 3; \
(bITsTRING)->bits_unused = 4; \
} while(0)
/* TS 36.413 v10.9.0 section 9.2.1.38: /* TS 36.413 v10.9.0 section 9.2.1.38:
* E-UTRAN CGI/Cell Identity * E-UTRAN CGI/Cell Identity
* The leftmost bits of the Cell * The leftmost bits of the Cell
......
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