Commit 85fe26bd authored by zhenghuangkun's avatar zhenghuangkun

Modify NGAP Messages

parent 170a8f17
......@@ -312,6 +312,7 @@ void * rrc_enb_process_msg(void*);
TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200, NULL,NULL)\
TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NGAP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
......
......@@ -402,15 +402,16 @@ int create_gNB_tasks(uint32_t gnb_nb) {
if (EPC_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
if (gnb_nb > 0) {
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
/*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
return -1;
}
if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(S1AP, "Create task for S1AP failed\n");
*/
if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
LOG_E(S1AP, "Create task for NGAP failed\n");
return -1;
}*/
}
if(!emulate_rf){
......
......@@ -31,23 +31,23 @@ MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMMAND_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_command_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMPLETE_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_complete_log)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_ue_context_release_log)
MESSAGE_DEF(NGAP_E_RAB_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_setup_request_log)
MESSAGE_DEF(NGAP_E_RAB_SETUP_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_setup_response_log)
MESSAGE_DEF(NGAP_E_RAB_MODIFY_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_modify_request_log)
MESSAGE_DEF(NGAP_E_RAB_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_modify_response_log)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_setup_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_setup_response_log)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_modify_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_modify_response_log)
MESSAGE_DEF(NGAP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_paging_log)
MESSAGE_DEF(NGAP_E_RAB_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_release_request_log)
MESSAGE_DEF(NGAP_E_RAB_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_e_rab_release_response_log)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_release_request_log)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_pdusession_release_response_log)
MESSAGE_DEF(NGAP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_error_indication_log)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_path_switch_req_log)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_ACK_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , ngap_path_switch_req_ack_log)
/* gNB application layer -> NGAP messages */
MESSAGE_DEF(NGAP_REGISTER_GNB_REQ , MESSAGE_PRIORITY_MED, ngap_register_enb_req_t , ngap_register_enb_req)
MESSAGE_DEF(NGAP_REGISTER_GNB_REQ , MESSAGE_PRIORITY_MED, ngap_register_gnb_req_t , ngap_register_gnb_req)
/* NGAP -> gNB application layer messages */
MESSAGE_DEF(NGAP_REGISTER_GNB_CNF , MESSAGE_PRIORITY_MED, ngap_register_enb_cnf_t , ngap_register_enb_cnf)
MESSAGE_DEF(NGAP_DEREGISTERED_GNB_IND , MESSAGE_PRIORITY_MED, ngap_deregistered_enb_ind_t , ngap_deregistered_enb_ind)
MESSAGE_DEF(NGAP_REGISTER_GNB_CNF , MESSAGE_PRIORITY_MED, ngap_register_gnb_cnf_t , ngap_register_gnb_cnf)
MESSAGE_DEF(NGAP_DEREGISTERED_GNB_IND , MESSAGE_PRIORITY_MED, ngap_deregistered_gnb_ind_t , ngap_deregistered_gnb_ind)
/* RRC -> NGAP messages */
MESSAGE_DEF(NGAP_NAS_FIRST_REQ , MESSAGE_PRIORITY_MED, ngap_nas_first_req_t , ngap_nas_first_req)
......@@ -60,22 +60,22 @@ MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_RESP , MESSAGE_PRIORITY_MED, ngap_ue_relea
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMPLETE, MESSAGE_PRIORITY_MED, ngap_ue_release_complete_t , ngap_ue_release_complete)
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_RESP , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_resp_t , ngap_ue_ctxt_modification_resp)
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_FAIL , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_fail_t , ngap_ue_ctxt_modification_fail)
MESSAGE_DEF(NGAP_E_RAB_SETUP_RESP , MESSAGE_PRIORITY_MED, ngap_e_rab_setup_resp_t , ngap_e_rab_setup_resp)
MESSAGE_DEF(NGAP_E_RAB_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, ngap_e_rab_setup_req_fail_t , ngap_e_rab_setup_request_fail)
MESSAGE_DEF(NGAP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, ngap_e_rab_modify_resp_t , ngap_e_rab_modify_resp)
MESSAGE_DEF(NGAP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, ngap_e_rab_release_resp_t , ngap_e_rab_release_resp)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_RESP , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_resp_t , ngap_pdusession_setup_resp)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_req_fail_t , ngap_pdusession_setup_request_fail)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_RESP , MESSAGE_PRIORITY_MED, ngap_pdusession_modify_resp_t , ngap_pdusession_modify_resp)
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, ngap_pdusession_release_resp_t , ngap_pdusession_release_resp)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, ngap_path_switch_req_t , ngap_path_switch_req)
MESSAGE_DEF(NGAP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, ngap_path_switch_req_ack_t , ngap_path_switch_req_ack)
MESSAGE_DEF(NGAP_E_RAB_MODIFICATION_IND , MESSAGE_PRIORITY_MED, ngap_e_rab_modification_ind_t , ngap_e_rab_modification_ind)
MESSAGE_DEF(NGAP_PDUSESSION_MODIFICATION_IND , MESSAGE_PRIORITY_MED, ngap_pdusession_modification_ind_t , ngap_pdusession_modification_ind)
/* NGAP -> RRC messages */
MESSAGE_DEF(NGAP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, ngap_downlink_nas_t , ngap_downlink_nas )
MESSAGE_DEF(NGAP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, ngap_initial_context_setup_req_t , ngap_initial_context_setup_req )
MESSAGE_DEF(NGAP_UE_CTXT_MODIFICATION_REQ , MESSAGE_PRIORITY_MED, ngap_ue_ctxt_modification_req_t , ngap_ue_ctxt_modification_req)
MESSAGE_DEF(NGAP_PAGING_IND , MESSAGE_PRIORITY_MED, ngap_paging_ind_t , ngap_paging_ind )
MESSAGE_DEF(NGAP_E_RAB_SETUP_REQ , MESSAGE_PRIORITY_MED, ngap_e_rab_setup_req_t , ngap_e_rab_setup_req )
MESSAGE_DEF(NGAP_E_RAB_MODIFY_REQ , MESSAGE_PRIORITY_MED, ngap_e_rab_modify_req_t , ngap_e_rab_modify_req )
MESSAGE_DEF(NGAP_E_RAB_RELEASE_COMMAND , MESSAGE_PRIORITY_MED, ngap_e_rab_release_command_t , ngap_e_rab_release_command)
MESSAGE_DEF(NGAP_PDUSESSION_SETUP_REQ , MESSAGE_PRIORITY_MED, ngap_pdusession_setup_req_t , ngap_pdusession_setup_req )
MESSAGE_DEF(NGAP_PDUSESSION_MODIFY_REQ , MESSAGE_PRIORITY_MED, ngap_pdusession_modify_req_t , ngap_pdusession_modify_req )
MESSAGE_DEF(NGAP_PDUSESSION_RELEASE_COMMAND , MESSAGE_PRIORITY_MED, ngap_pdusession_release_command_t , ngap_pdusession_release_command)
MESSAGE_DEF(NGAP_UE_CONTEXT_RELEASE_COMMAND, MESSAGE_PRIORITY_MED, ngap_ue_release_command_t , ngap_ue_release_command)
/* NGAP <-> RRC messages (can be initiated either by MME or gNB) */
......
This diff is collapsed.
......@@ -75,26 +75,26 @@ static void configure_nr_rrc(uint32_t gnb_id)
static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, const Enb_properties_array_t *enb_properties)
{
uint32_t gnb_id;
//MessageDef *msg_p;
MessageDef *msg_p;
uint32_t register_gnb_pending = 0;
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
{
//s1ap_register_enb_req_t *s1ap_register_gNB; //Type Temporarily reuse
ngap_register_gnb_req_t *ngap_register_gNB; //Type Temporarily reuse
// note: there is an implicit relationship between the data structure and the message name
/*msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse
*msg_p = itti_alloc_new_message (TASK_GNB_APP, NGAP_REGISTER_GNB_REQ); //Message Temporarily reuse
RCconfig_NR_S1(msg_p, gnb_id);*/
RCconfig_NR_NG(msg_p, gnb_id);
if (gnb_id == 0) RCconfig_nr_gtpu();
/*s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse
LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx);*/
ngap_register_gNB = &NGAP_REGISTER_GNB_REQ(msg_p); //Message Temporarily reuse
LOG_I(GNB_APP,"default drx %d\n",ngap_register_gNB->default_drx);*/
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
//itti_send_msg_to_task (TASK_S1AP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
itti_send_msg_to_task (TASK_NGAP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
register_gnb_pending++;
}
......@@ -201,16 +201,16 @@ void *gNB_app_task(void *args_p)
break;
/*
case S1AP_REGISTER_ENB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
case NGAP_REGISTER_GNB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_REGISTER_GNB_CNF(msg_p).nb_amf);
/*
DevAssert(register_gnb_pending > 0);
register_gnb_pending--;
// Check if at least gNB is registered with one MME
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
// Check if at least gNB is registered with one AMF
if (NGAP_REGISTER_GNB_CNF(msg_p).nb_amf > 0) {
registered_gnb++;
}
......@@ -226,7 +226,7 @@ void *gNB_app_task(void *args_p)
} else {
uint32_t not_associated = gnb_nb - registered_gnb;
LOG_W(GNB_APP, " %d gNB %s not associated with a MME, retrying registration in %d seconds ...\n",
LOG_W(GNB_APP, " %d gNB %s not associated with a AMF, retrying registration in %d seconds ...\n",
not_associated, not_associated > 1 ? "are" : "is", GNB_REGISTER_RETRY_DELAY);
// Restart the gNB registration process in GNB_REGISTER_RETRY_DELAY seconds
......@@ -241,12 +241,12 @@ void *gNB_app_task(void *args_p)
}
}
}
break;
*/
case S1AP_DEREGISTERED_ENB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
break;
case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
/* TODO handle recovering of registration */
break;
......
This diff is collapsed.
......@@ -102,7 +102,7 @@ extern void NRRCConfig(void);
//void ru_config_display(void);
void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc);
int RCconfig_NR_S1(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i);
int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
......
......@@ -226,34 +226,34 @@ typedef struct ccparams_nr_x2 {
/* MME configuration parameters section name */
#define GNB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
#define GNB_CONFIG_STRING_AMF_IP_ADDRESS "amf_ip_address"
/* SRB1 configuration parameters names */
#define GNB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4"
#define GNB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6"
#define GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE "active"
#define GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE "preference"
#define GNB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX "broadcast_plmn_index"
#define GNB_CONFIG_STRING_AMF_IPV4_ADDRESS "ipv4"
#define GNB_CONFIG_STRING_AMF_IPV6_ADDRESS "ipv6"
#define GNB_CONFIG_STRING_AMF_IP_ADDRESS_ACTIVE "active"
#define GNB_CONFIG_STRING_AMF_IP_ADDRESS_PREFERENCE "preference"
#define GNB_CONFIG_STRING_AMF_BROADCAST_PLMN_INDEX "broadcast_plmn_index"
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* MME configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBS1PARAMS_DESC { \
{GNB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
#define GNBNGPARAMS_DESC { \
{GNB_CONFIG_STRING_AMF_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_AMF_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_AMF_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_AMF_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
}
#define GNB_MME_IPV4_ADDRESS_IDX 0
#define GNB_MME_IPV6_ADDRESS_IDX 1
#define GNB_MME_IP_ADDRESS_ACTIVE_IDX 2
#define GNB_MME_IP_ADDRESS_PREFERENCE_IDX 3
#define GNB_MME_BROADCAST_PLMN_INDEX 4
#define GNB_AMF_IPV4_ADDRESS_IDX 0
#define GNB_AMF_IPV6_ADDRESS_IDX 1
#define GNB_AMF_IP_ADDRESS_ACTIVE_IDX 2
#define GNB_AMF_IP_ADDRESS_PREFERENCE_IDX 3
#define GNB_AMF_BROADCAST_PLMN_INDEX 4
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* SCTP configuration parameters section name */
......@@ -281,20 +281,20 @@ typedef struct ccparams_nr_x2 {
/* S1 interface configuration parameters section name */
#define GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG "NETWORK_INTERFACES"
#define GNB_INTERFACE_NAME_FOR_S1_MME_IDX 0
#define GNB_IPV4_ADDRESS_FOR_S1_MME_IDX 1
#define GNB_INTERFACE_NAME_FOR_S1U_IDX 2
#define GNB_IPV4_ADDR_FOR_S1U_IDX 3
#define GNB_PORT_FOR_S1U_IDX 4
#define GNB_INTERFACE_NAME_FOR_NG_AMF_IDX 0
#define GNB_IPV4_ADDRESS_FOR_NG_AMF_IDX 1
#define GNB_INTERFACE_NAME_FOR_NGU_IDX 2
#define GNB_IPV4_ADDR_FOR_NGU_IDX 3
#define GNB_PORT_FOR_NGU_IDX 4
#define GNB_IPV4_ADDR_FOR_X2C_IDX 5
#define GNB_PORT_FOR_X2C_IDX 6
/* S1 interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME "GNB_IPV4_ADDRESS_FOR_S1_MME"
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U "GNB_INTERFACE_NAME_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U "GNB_IPV4_ADDRESS_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_S1U "GNB_PORT_FOR_S1U"
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF "GNB_INTERFACE_NAME_FOR_NG_AMF"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF "GNB_IPV4_ADDRESS_FOR_NG_AMF"
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU "GNB_INTERFACE_NAME_FOR_NGU"
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU "GNB_IPV4_ADDRESS_FOR_NGU"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_NGU "GNB_PORT_FOR_NGU"
/* X2 interface configuration parameters names */
#define GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C "GNB_IPV4_ADDRESS_FOR_X2C"
......@@ -305,11 +305,11 @@ typedef struct ccparams_nr_x2 {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBNETPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_NG_AMF, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0} \
}
......@@ -321,9 +321,9 @@ typedef struct ccparams_nr_x2 {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GNBGTPUPARAMS_DESC { \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&gnb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&gnb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, uptr:&gnb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_NGU, NULL, 0, strptr:&gnb_interface_name_for_NGU, defstrval:"lo", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_NGU, NULL, 0, strptr:&gnb_ipv4_address_for_NGU, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, uptr:&gnb_port_for_NGU, defintval:2152, TYPE_UINT, 0} \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
......
......@@ -54,7 +54,7 @@
#include "NGAP_ProtocolExtensionContainer.h"
#include "NGAP_asn_constant.h"
#include "NGAP_SupportedTAs-Item.h"
#include "NGAP_ServedGUMMEIsItem.h"
#include "NGAP_ServedGUAMIsItem.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
......@@ -82,7 +82,7 @@ extern int asn1_xer_print;
# define NGAP_INFO(x, args...) LOG_I(NGAP, x, ##args)
# define NGAP_DEBUG(x, args...) LOG_I(NGAP, x, ##args)
#else
# include "mme_default_values.h"
# include "amf_default_values.h"
# define NGAP_ERROR(x, args...) do { fprintf(stdout, "[NGAP][E]"x, ##args); } while(0)
# define NGAP_WARN(x, args...) do { fprintf(stdout, "[NGAP][W]"x, ##args); } while(0)
# define NGAP_TRAF(x, args...) do { fprintf(stdout, "[NGAP][T]"x, ##args); } while(0)
......
This diff is collapsed.
......@@ -31,13 +31,13 @@
#define NGAP_GNB_H_
typedef struct ngap_gNB_config_s {
// MME related params
unsigned char mme_enabled; ///< MME enabled ?
// AMF related params
unsigned char amf_enabled; ///< AMF enabled ?
} ngap_gNB_config_t;
extern ngap_gNB_config_t ngap_config;
#define EPC_MODE_ENABLED ngap_config.mme_enabled
#define EPC_MODE_ENABLED ngap_config.amf_enabled
void *ngap_gNB_process_itti_msg(void*);
void ngap_gNB_init(void);
......
......@@ -68,8 +68,8 @@ int ngap_ue_context_release_complete(instance_t instance,
DevAssert(ngap_gNB_instance_p != NULL);
/*RB_FOREACH(ue_context_p, ngap_ue_map, &ngap_gNB_instance_p->ngap_ue_head) {
NGAP_WARN("in ngap_ue_map: UE context gNB_ue_ngap_id %u mme_ue_ngap_id %u state %u\n",
ue_context_p->gNB_ue_ngap_id, ue_context_p->mme_ue_ngap_id,
NGAP_WARN("in ngap_ue_map: UE context gNB_ue_ngap_id %u amf_ue_ngap_id %u state %u\n",
ue_context_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,
ue_context_p->ue_state);
}*/
if ((ue_context_p = ngap_gNB_get_ue_context(ngap_gNB_instance_p,
......@@ -90,10 +90,10 @@ int ngap_ue_context_release_complete(instance_t instance,
/* mandatory */
ie = (NGAP_UEContextReleaseComplete_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseComplete_IEs_t));
ie->id = NGAP_ProtocolIE_ID_id_MME_UE_NGAP_ID;
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_ignore;
ie->value.present = NGAP_UEContextReleaseComplete_IEs__value_PR_MME_UE_NGAP_ID;
ie->value.choice.MME_UE_NGAP_ID = ue_context_p->mme_ue_ngap_id;
ie->value.present = NGAP_UEContextReleaseComplete_IEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -113,21 +113,21 @@ int ngap_ue_context_release_complete(instance_t instance,
MSC_LOG_TX_MESSAGE(
MSC_NGAP_GNB,
MSC_NGAP_MME,
MSC_NGAP_AMF,
buffer,
length,
MSC_AS_TIME_FMT" UEContextRelease successfulOutcome gNB_ue_ngap_id %u mme_ue_ngap_id %u",
MSC_AS_TIME_FMT" UEContextRelease successfulOutcome gNB_ue_ngap_id %u amf_ue_ngap_id %u",
0,0, //MSC_AS_TIME_ARGS(ctxt_pP),
ue_release_complete_p->gNB_ue_ngap_id,
ue_context_p->mme_ue_ngap_id);
ue_context_p->amf_ue_ngap_id);
/* UE associated signalling -> use the allocated stream */
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->mme_ref->assoc_id, buffer,
ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream);
//LG ngap_gNB_itti_send_sctp_close_association(ngap_gNB_instance_p->instance,
// ue_context_p->mme_ref->assoc_id);
// ue_context_p->amf_ref->assoc_id);
// release UE context
struct ngap_gNB_ue_context_s *ue_context2_p = NULL;
......@@ -141,8 +141,8 @@ int ngap_ue_context_release_complete(instance_t instance,
ue_context_p->gNB_ue_ngap_id);
}
/*RB_FOREACH(ue_context_p, ngap_ue_map, &ngap_gNB_instance_p->ngap_ue_head) {
NGAP_WARN("in ngap_ue_map: UE context gNB_ue_ngap_id %u mme_ue_ngap_id %u state %u\n",
ue_context_p->gNB_ue_ngap_id, ue_context_p->mme_ue_ngap_id,
NGAP_WARN("in ngap_ue_map: UE context gNB_ue_ngap_id %u amf_ue_ngap_id %u state %u\n",
ue_context_p->gNB_ue_ngap_id, ue_context_p->amf_ue_ngap_id,
ue_context_p->ue_state);
}*/
......@@ -184,10 +184,10 @@ int ngap_ue_context_release_req(instance_t instance,
/* mandatory */
ie = (NGAP_UEContextReleaseRequest_IEs_t *)calloc(1, sizeof(NGAP_UEContextReleaseRequest_IEs_t));
ie->id = NGAP_ProtocolIE_ID_id_MME_UE_NGAP_ID;
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
ie->criticality = NGAP_Criticality_reject;
ie->value.present = NGAP_UEContextReleaseRequest_IEs__value_PR_MME_UE_NGAP_ID;
ie->value.choice.MME_UE_NGAP_ID = ue_context_p->mme_ue_ngap_id;
ie->value.present = NGAP_UEContextReleaseRequest_IEs__value_PR_AMF_UE_NGAP_ID;
ie->value.choice.AMF_UE_NGAP_ID = ue_context_p->amf_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
......@@ -248,17 +248,17 @@ int ngap_ue_context_release_req(instance_t instance,
MSC_LOG_TX_MESSAGE(
MSC_NGAP_GNB,
MSC_NGAP_MME,
MSC_NGAP_AMF,
buffer,
length,
MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage gNB_ue_ngap_id %u mme_ue_ngap_id %u",
MSC_AS_TIME_FMT" UEContextReleaseRequest initiatingMessage gNB_ue_ngap_id %u amf_ue_ngap_id %u",
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
ue_release_req_p->gNB_ue_ngap_id,
ue_context_p->mme_ue_ngap_id);
ue_context_p->amf_ue_ngap_id);
/* UE associated signalling -> use the allocated stream */
ngap_gNB_itti_send_sctp_data_req(ngap_gNB_instance_p->instance,
ue_context_p->mme_ref->assoc_id, buffer,
ue_context_p->amf_ref->assoc_id, buffer,
length, ue_context_p->tx_stream);
return 0;
......
......@@ -62,22 +62,22 @@ static int ngap_gNB_decode_initiating_message(NGAP_NGAP_PDU_t *pdu) {
free(res.buffer);
break;
case NGAP_ProcedureCode_id_E_RABSetup:
case NGAP_ProcedureCode_id_PDUSESSIONSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("E_RABSetup initiating message\n");
NGAP_INFO("PDUSESSIONSetup initiating message\n");
break;
case NGAP_ProcedureCode_id_E_RABModify:
case NGAP_ProcedureCode_id_PDUSESSIONModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("E_RABModify initiating message\n");
NGAP_INFO("PDUSESSIONModify initiating message\n");
break;
case NGAP_ProcedureCode_id_E_RABRelease:
case NGAP_ProcedureCode_id_PDUSESSIONRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("TODO E_RABRelease initiating message\n");
NGAP_INFO("TODO PDUSESSIONRelease initiating message\n");
break;
case NGAP_ProcedureCode_id_ErrorIndication:
......@@ -112,7 +112,7 @@ static int ngap_gNB_decode_successful_outcome(NGAP_NGAP_PDU_t *pdu) {
free(res.buffer);
break;
case NGAP_ProcedureCode_id_E_RABModificationIndication:
case NGAP_ProcedureCode_id_PDUSESSIONModificationIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
break;
......
......@@ -34,13 +34,13 @@
typedef enum {
/* Disconnected state: initial state for any association. */
NGAP_GNB_STATE_DISCONNECTED = 0x0,
/* State waiting for S1 Setup response message if gNB is MME accepted or
* S1 Setup failure if MME rejects the gNB.
/* State waiting for S1 Setup response message if gNB is AMF accepted or
* S1 Setup failure if AMF rejects the gNB.
*/
NGAP_GNB_STATE_WAITING = 0x1,
/* The gNB is successfully connected to MME, UE contexts can be created. */
/* The gNB is successfully connected to AMF, UE contexts can be created. */
NGAP_GNB_STATE_CONNECTED = 0x2,
/* The MME has sent an overload start message. Once the MME disables the
/* The AMF has sent an overload start message. Once the AMF disables the
* OVERLOAD marker, the state of the association will be
* NGAP_GNB_STATE_CONNECTED.
*/
......@@ -51,18 +51,17 @@ typedef enum {
/* If the Overload Action IE in the OVERLOAD START message is set to
* - “reject all RRC connection establishments for non-emergency mobile
* originated data transfer “ (i.e. reject traffic corresponding to RRC cause
* “mo-data “ (TS 36.331 [16])), or
* - “reject all RRC connection establishments for signalling “ (i.e. reject
* traffic corresponding to RRC cause “modata” and “mo-signalling”
* (TS 36.331 [16])),or
* originated data transfer  E(i.e. reject traffic corresponding to RRC cause
* “mo-data  E(TS 36.331 [16])), or
* - “reject all RRC connection establishments for signalling  E(i.e. reject
* traffic corresponding to RRC cause “modata Eand “mo-signalling E * (TS 36.331 [16])),or
* - “only permit RRC connection establishments for emergency sessions and
* mobile terminated services(i.e. only permit traffic corresponding to RRC
* cause “emergency” and “mt-Access” (TS 36.331 [16])).
* mobile terminated services E(i.e. only permit traffic corresponding to RRC
* cause “emergency Eand “mt-Access E(TS 36.331 [16])).
*
* NOTE: When the Overload Action IE is set to “only permit RRC connection
* establishments for emergency sessions and mobile terminated services”,
* emergency calls with RRC cause “highPriorityAcessfrom high priority users
* establishments for emergency sessions and mobile terminated services E
* emergency calls with RRC cause “highPriorityAcess Efrom high priority users
* are rejected (TS 24.301 [24]).
*/
typedef enum {
......@@ -81,67 +80,106 @@ struct plmn_identity_s {
STAILQ_ENTRY(plmn_identity_s) next;
};
/* Served group id element */
struct served_group_id_s {
uint16_t mme_group_id;
STAILQ_ENTRY(served_group_id_s) next;
/* Served amf region id for a particular AMF */
struct served_region_id_s {
uint8_t amf_region_id;
STAILQ_ENTRY(served_region_id_s) next;
};
/* Served mme code for a particular MME */
struct mme_code_s {
uint8_t mme_code;
STAILQ_ENTRY(mme_code_s) next;
/* Served amf set id for a particular AMF */
struct amf_set_id_s {
uint16_t amf_set_id;
STAILQ_ENTRY(amf_set_id_s) next;
};
/* Served gummei element */
struct served_gummei_s {
/* Number of MME served PLMNs */
/* Served amf pointer for a particular AMF */
struct amf_pointer_s {
uint8_t amf_pointer;
STAILQ_ENTRY(amf_pointer_s) next;
};
/* Served guami element */
struct served_guami_s {
/* Number of AMF served PLMNs */
uint8_t nb_served_plmns;
/* List of served PLMNs by MME */
/* List of served PLMNs by AMF */
STAILQ_HEAD(served_plmns_s, plmn_identity_s) served_plmns;
/* Number of group id in list */
uint8_t nb_group_id;
/* Number of region id in list */
uint8_t nb_region_id;
/* Served group id list */
STAILQ_HEAD(served_group_ids_s, served_group_id_s) served_group_ids;
STAILQ_HEAD(served_region_ids_s, served_region_id_s) served_region_ids;
/* Number of AMF set id */
uint8_t nb_amf_set_id;
/* AMF Set id to uniquely identify an AMF within an AMF pool area */
STAILQ_HEAD(amf_set_ids_s, amf_set_id_s) amf_set_ids;
/* Number of AMF pointer */
uint8_t nb_amf_pointer;
/* AMF pointer to uniquely identify an AMF within an AMF pool area */
STAILQ_HEAD(amf_pointers_s, amf_pointer_s) amf_pointers;
/* Next GUAMI element */
STAILQ_ENTRY(served_guami_s) next;
};
/* slice support element */
struct slice_support_s {
uint8_t sST;
uint8_t sD_flag;
uint8_t sD[3];
};
/* Number of MME code */
uint8_t nb_mme_code;
/* MME Code to uniquely identify an MME within an MME pool area */
STAILQ_HEAD(mme_codes_s, mme_code_s) mme_codes;
/* plmn support element */
struct plmn_support_s {
plmn_identity_s plmn_identity;
/* Next GUMMEI element */
STAILQ_ENTRY(served_gummei_s) next;
/* Number of slice support in list */
uint8_t nb_slice_s;
/* Served group id list */
STAILQ_HEAD(slice_supports_s, slice_support_s) slice_supports;
/* Next plmn support element */
STAILQ_ENTRY(plmn_support_s) next;
};
struct ngap_gNB_instance_s;
/* This structure describes association of a gNB to a MME */
typedef struct ngap_gNB_mme_data_s {
/* MME descriptors tree, ordered by sctp assoc id */
RB_ENTRY(ngap_gNB_mme_data_s) entry;
/* This structure describes association of a gNB to a AMF */
typedef struct ngap_gNB_amf_data_s {
/* AMF descriptors tree, ordered by sctp assoc id */
RB_ENTRY(ngap_gNB_amf_data_s) entry;
/* This is the optional name provided by the MME */
char *mme_name;
/* This is the optional name provided by the AMF */
char *amf_name;
/* MME NGAP IP address */
net_ip_address_t mme_s1_ip;
/* AMF NGAP IP address */
net_ip_address_t amf_s1_ip;
/* List of served GUMMEI per MME. There is one GUMMEI per RAT with a max
/* List of served GUAMI per AMF. There is one GUAMI per RAT with a max
* number of 8 RATs but in our case only one is used. The LTE related pool
* configuration is included on the first place in the list.
*/
STAILQ_HEAD(served_gummeis_s, served_gummei_s) served_gummei;
STAILQ_HEAD(served_guamis_s, served_guami_s) served_guami;
/* Relative processing capacity of an MME with respect to the other MMEs
* in the pool in order to load-balance MMEs within a pool as defined
/* Relative processing capacity of an AMF with respect to the other AMFs
* in the pool in order to load-balance AMFs within a pool as defined
* in TS 23.401.
*/
uint8_t relative_mme_capacity;
uint8_t relative_amf_capacity;
/* Current MME overload information (if any). */
/*
* List of PLMN Support per AMF.
*
*/
STAILQ_HEAD(plmn_supports_s, plmn_support_s) plmn_supports;
/* Current AMF overload information (if any). */
ngap_overload_state_t overload_state;
/* Current gNB->MME NGAP association state */
/* Current gNB->AMF NGAP association state */
ngap_gNB_state_t state;
/* Next usable stream for UE signalling */
......@@ -157,14 +195,21 @@ typedef struct ngap_gNB_mme_data_s {
/* SCTP association id */
int32_t assoc_id;
/* This is served PLMN IDs communicated to the MME via an index over the
/* This is served PLMN IDs communicated to the AMF via an index over the
* MCC/MNC array in ngap_gNB_instance */
uint8_t broadcast_plmn_num;
uint8_t broadcast_plmn_index[PLMN_LIST_MAX_SIZE];
/* Only meaningfull in virtual mode */
struct ngap_gNB_instance_s *ngap_gNB_instance;
} ngap_gNB_mme_data_t;
} ngap_gNB_amf_data_t;
typedef struct ngap_gNB_NSSAI_s{
uint8_t sST;
uint8_t sD_flag;
uint8_t sD[3];
}ngap_gNB_NSSAI_t;
typedef struct ngap_gNB_instance_s {
/* Next ngap gNB association.
......@@ -172,16 +217,16 @@ typedef struct ngap_gNB_instance_s {
*/
STAILQ_ENTRY(ngap_gNB_instance_s) ngap_gNB_entries;
/* Number of MME requested by gNB (tree size) */
uint32_t ngap_mme_nb;
/* Number of MME for which association is pending */
uint32_t ngap_mme_pending_nb;
/* Number of MME successfully associated to gNB */
uint32_t ngap_mme_associated_nb;
/* Tree of NGAP MME associations ordered by association ID */
RB_HEAD(ngap_mme_map, ngap_gNB_mme_data_s) ngap_mme_head;
/* Number of AMF requested by gNB (tree size) */
uint32_t ngap_amf_nb;
/* Number of AMF for which association is pending */
uint32_t ngap_amf_pending_nb;
/* Number of AMF successfully associated to gNB */
uint32_t ngap_amf_associated_nb;
/* Tree of NGAP AMF associations ordered by association ID */
RB_HEAD(ngap_amf_map, ngap_gNB_amf_data_s) ngap_amf_head;
/* TODO: add a map ordered by relative MME capacity */
/* TODO: add a map ordered by relative AMF capacity */
/* Tree of UE ordered by gNB_ue_ngap_id's */
RB_HEAD(ngap_ue_map, ngap_gNB_ue_context_s) ngap_ue_head;
......@@ -214,6 +259,9 @@ typedef struct ngap_gNB_instance_s {
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
uint8_t num_plmn;
uint16_t num_nssai[PLMN_LIST_MAX_SIZE];
ngap_gNB_NSSAI_t s_nssai[PLMN_LIST_MAX_SIZE][1024];
/* Default Paging DRX of the gNB as defined in TS 36.304 */
paging_drx_t default_drx;
} ngap_gNB_instance_t;
......@@ -231,10 +279,10 @@ typedef struct {
} ngap_gNB_internal_data_t;
int ngap_gNB_compare_assoc_id(
struct ngap_gNB_mme_data_s *p1, struct ngap_gNB_mme_data_s *p2);
struct ngap_gNB_amf_data_s *p1, struct ngap_gNB_amf_data_s *p2);
/* Generate the tree management functions */
RB_PROTOTYPE(ngap_mme_map, ngap_gNB_mme_data_s, entry,
RB_PROTOTYPE(ngap_amf_map, ngap_gNB_amf_data_s, entry,
ngap_gNB_compare_assoc_id);
#endif /* NGAP_GNB_DEFS_H_ */
......@@ -118,7 +118,7 @@ int ngap_gNB_encode_initiating(NGAP_NGAP_PDU_t *pdu,
free(res.buffer);
break;
case NGAP_ProcedureCode_id_E_RABModificationIndication:
case NGAP_ProcedureCode_id_PDUSESSIONModificationIndication:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
break;
......@@ -157,22 +157,22 @@ int ngap_gNB_encode_successfull_outcome(NGAP_NGAP_PDU_t *pdu,
free(res.buffer);
break;
case NGAP_ProcedureCode_id_E_RABSetup:
case NGAP_ProcedureCode_id_PDUSESSIONSetup:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("E_RABSetup successful message\n");
NGAP_INFO("PDUSESSIONSetup successful message\n");
break;
case NGAP_ProcedureCode_id_E_RABModify:
case NGAP_ProcedureCode_id_PDUSESSIONModify:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("E_RABModify successful message\n");
NGAP_INFO("PDUSESSIONModify successful message\n");
break;
case NGAP_ProcedureCode_id_E_RABRelease:
case NGAP_ProcedureCode_id_PDUSESSIONRelease:
res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_NGAP_NGAP_PDU, pdu);
free(res.buffer);
NGAP_INFO("E_RAB Release successful message\n");
NGAP_INFO("PDUSESSION Release successful message\n");
break;
default:
......
This diff is collapsed.
......@@ -22,7 +22,7 @@
#ifndef NGAP_GNB_HANDLERS_H_
#define NGAP_GNB_HANDLERS_H_
void ngap_handle_s1_setup_message(ngap_gNB_mme_data_t *mme_desc_p, int sctp_shutdown);
void ngap_handle_ng_setup_message(ngap_gNB_amf_data_t *amf_desc_p, int sctp_shutdown);
int ngap_gNB_handle_message(uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length);
......
......@@ -43,10 +43,10 @@
ngap_gNB_internal_data_t ngap_gNB_internal_data;
RB_GENERATE(ngap_mme_map, ngap_gNB_mme_data_s, entry, ngap_gNB_compare_assoc_id);
RB_GENERATE(ngap_amf_map, ngap_gNB_amf_data_s, entry, ngap_gNB_compare_assoc_id);
int ngap_gNB_compare_assoc_id(
struct ngap_gNB_mme_data_s *p1, struct ngap_gNB_mme_data_s *p2)
struct ngap_gNB_amf_data_s *p1, struct ngap_gNB_amf_data_s *p2)
{
if (p1->assoc_id == -1) {
if (p1->cnx_id < p2->cnx_id) {
......@@ -89,14 +89,14 @@ void ngap_gNB_insert_new_instance(ngap_gNB_instance_t *new_instance_p)
new_instance_p, ngap_gNB_entries);
}
struct ngap_gNB_mme_data_s *ngap_gNB_get_MME(
struct ngap_gNB_amf_data_s *ngap_gNB_get_AMF(
ngap_gNB_instance_t *instance_p,
int32_t assoc_id, uint16_t cnx_id)
{
struct ngap_gNB_mme_data_s temp;
struct ngap_gNB_mme_data_s *found;
struct ngap_gNB_amf_data_s temp;
struct ngap_gNB_amf_data_s *found;
memset(&temp, 0, sizeof(struct ngap_gNB_mme_data_s));
memset(&temp, 0, sizeof(struct ngap_gNB_amf_data_s));
temp.assoc_id = assoc_id;
temp.cnx_id = cnx_id;
......@@ -104,30 +104,30 @@ struct ngap_gNB_mme_data_s *ngap_gNB_get_MME(
if (instance_p == NULL) {
STAILQ_FOREACH(instance_p, &ngap_gNB_internal_data.ngap_gNB_instances_head,
ngap_gNB_entries) {
found = RB_FIND(ngap_mme_map, &instance_p->ngap_mme_head, &temp);
found = RB_FIND(ngap_amf_map, &instance_p->ngap_amf_head, &temp);
if (found != NULL) {
return found;
}
}
} else {
return RB_FIND(ngap_mme_map, &instance_p->ngap_mme_head, &temp);
return RB_FIND(ngap_amf_map, &instance_p->ngap_amf_head, &temp);
}
return NULL;
}
struct ngap_gNB_mme_data_s *ngap_gNB_get_MME_from_instance(
struct ngap_gNB_amf_data_s *ngap_gNB_get_AMF_from_instance(
ngap_gNB_instance_t *instance_p)
{
struct ngap_gNB_mme_data_s *mme = NULL;
struct ngap_gNB_mme_data_s *mme_next = NULL;
struct ngap_gNB_amf_data_s *amf = NULL;
struct ngap_gNB_amf_data_s *amf_next = NULL;
for (mme = RB_MIN(ngap_mme_map, &instance_p->ngap_mme_head); mme!=NULL ; mme = mme_next) {
mme_next = RB_NEXT(ngap_mme_map, &instance_p->ngap_mme_head, mme);
if (mme->ngap_gNB_instance == instance_p) {
return mme;
for (amf = RB_MIN(ngap_amf_map, &instance_p->ngap_amf_head); amf!=NULL ; amf = amf_next) {
amf_next = RB_NEXT(ngap_amf_map, &instance_p->ngap_amf_head, amf);
if (amf->ngap_gNB_instance == instance_p) {
return amf;
}
}
......@@ -149,40 +149,40 @@ ngap_gNB_instance_t *ngap_gNB_get_instance(instance_t instance)
return NULL;
}
void ngap_gNB_remove_mme_desc(ngap_gNB_instance_t * instance)
void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance)
{
struct ngap_gNB_mme_data_s *mme = NULL;
struct ngap_gNB_mme_data_s *mmeNext = NULL;
struct ngap_gNB_amf_data_s *amf = NULL;
struct ngap_gNB_amf_data_s *amfNext = NULL;
struct plmn_identity_s* plmnInfo;
struct served_group_id_s* groupInfo;
struct served_gummei_s* gummeiInfo;
struct mme_code_s* mmeCode;
for (mme = RB_MIN(ngap_mme_map, &instance->ngap_mme_head); mme; mme = mmeNext) {
mmeNext = RB_NEXT(ngap_mme_map, &instance->ngap_mme_head, mme);
RB_REMOVE(ngap_mme_map, &instance->ngap_mme_head, mme);
while (!STAILQ_EMPTY(&mme->served_gummei)) {
gummeiInfo = STAILQ_FIRST(&mme->served_gummei);
STAILQ_REMOVE_HEAD(&mme->served_gummei, next);
while (!STAILQ_EMPTY(&gummeiInfo->served_plmns)) {
plmnInfo = STAILQ_FIRST(&gummeiInfo->served_plmns);
STAILQ_REMOVE_HEAD(&gummeiInfo->served_plmns, next);
struct served_guami_s* guamInfo;
struct amf_code_s* amfCode;
for (amf = RB_MIN(ngap_amf_map, &instance->ngap_amf_head); amf; amf = amfNext) {
amfNext = RB_NEXT(ngap_amf_map, &instance->ngap_amf_head, amf);
RB_REMOVE(ngap_amf_map, &instance->ngap_amf_head, amf);
while (!STAILQ_EMPTY(&amf->served_guami)) {
guamInfo = STAILQ_FIRST(&amf->served_guami);
STAILQ_REMOVE_HEAD(&amf->served_guami, next);
while (!STAILQ_EMPTY(&guamInfo->served_plmns)) {
plmnInfo = STAILQ_FIRST(&guamInfo->served_plmns);
STAILQ_REMOVE_HEAD(&guamInfo->served_plmns, next);
free(plmnInfo);
}
while (!STAILQ_EMPTY(&gummeiInfo->served_group_ids)) {
groupInfo = STAILQ_FIRST(&gummeiInfo->served_group_ids);
STAILQ_REMOVE_HEAD(&gummeiInfo->served_group_ids, next);
while (!STAILQ_EMPTY(&guamInfo->served_group_ids)) {
groupInfo = STAILQ_FIRST(&guamInfo->served_group_ids);
STAILQ_REMOVE_HEAD(&guamInfo->served_group_ids, next);
free(groupInfo);
}
while (!STAILQ_EMPTY(&gummeiInfo->mme_codes)) {
mmeCode = STAILQ_FIRST(&gummeiInfo->mme_codes);
STAILQ_REMOVE_HEAD(&gummeiInfo->mme_codes, next);
free(mmeCode);
while (!STAILQ_EMPTY(&guamInfo->amf_codes)) {
amfCode = STAILQ_FIRST(&guamInfo->amf_codes);
STAILQ_REMOVE_HEAD(&guamInfo->amf_codes, next);
free(amfCode);
}
free(gummeiInfo);
free(guamInfo);
}
free(mme);
free(amf);
}
}
......@@ -22,13 +22,13 @@
#ifndef NGAP_GNB_MANAGEMENT_PROCEDURES_H_
#define NGAP_GNB_MANAGEMENT_PROCEDURES_H_
struct ngap_gNB_mme_data_s *ngap_gNB_get_MME(
struct ngap_gNB_amf_data_s *ngap_gNB_get_AMF(
ngap_gNB_instance_t *instance_p,
int32_t assoc_id, uint16_t cnx_id);
struct ngap_gNB_mme_data_s *ngap_gNB_get_MME_from_instance(ngap_gNB_instance_t *instance_p);
struct ngap_gNB_amf_data_s *ngap_gNB_get_AMF_from_instance(ngap_gNB_instance_t *instance_p);
void ngap_gNB_remove_mme_desc(ngap_gNB_instance_t * instance);
void ngap_gNB_remove_amf_desc(ngap_gNB_instance_t * instance);
void ngap_gNB_insert_new_instance(ngap_gNB_instance_t *new_instance_p);
......
This diff is collapsed.
......@@ -41,19 +41,19 @@ int ngap_gNB_initial_ctxt_resp(
int ngap_gNB_ue_capabilities(instance_t instance,
ngap_ue_cap_info_ind_t *ue_cap_info_ind_p);
int ngap_gNB_e_rab_setup_resp(instance_t instance,
ngap_e_rab_setup_resp_t *e_rab_setup_resp_p);
int ngap_gNB_pdusession_setup_resp(instance_t instance,
ngap_pdusession_setup_resp_t *pdusession_setup_resp_p);
int ngap_gNB_e_rab_modify_resp(instance_t instance,
ngap_e_rab_modify_resp_t *e_rab_modify_resp_p);
int ngap_gNB_pdusession_modify_resp(instance_t instance,
ngap_pdusession_modify_resp_t *pdusession_modify_resp_p);
int ngap_gNB_e_rab_release_resp(instance_t instance,
ngap_e_rab_release_resp_t *e_rab_release_resp_p);
int ngap_gNB_pdusession_release_resp(instance_t instance,
ngap_pdusession_release_resp_t *pdusession_release_resp_p);
int ngap_gNB_path_switch_req(instance_t instance,
ngap_path_switch_req_t *path_switch_req_p);
int ngap_gNB_generate_E_RAB_Modification_Indication(
instance_t instance, ngap_e_rab_modification_ind_t *e_rab_modification_ind);
int ngap_gNB_generate_PDUSESSION_Modification_Indication(
instance_t instance, ngap_pdusession_modification_ind_t *pdusession_modification_ind);
#endif /* NGAP_GNB_NAS_PROCEDURES_H_ */
This diff is collapsed.
......@@ -22,28 +22,28 @@
#ifndef NGAP_GNB_NNSF_H_
#define NGAP_GNB_NNSF_H_
struct ngap_gNB_mme_data_s *
ngap_gNB_nnsf_select_mme(ngap_gNB_instance_t *instance_p,
struct ngap_gNB_amf_data_s *
ngap_gNB_nnsf_select_amf(ngap_gNB_instance_t *instance_p,
rrc_establishment_cause_t cause);
struct ngap_gNB_mme_data_s *
ngap_gNB_nnsf_select_mme_by_plmn_id(ngap_gNB_instance_t *instance_p,
struct ngap_gNB_amf_data_s *
ngap_gNB_nnsf_select_amf_by_plmn_id(ngap_gNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
int selected_plmn_identity);
struct ngap_gNB_mme_data_s*
ngap_gNB_nnsf_select_mme_by_mme_code(ngap_gNB_instance_t *instance_p,
struct ngap_gNB_amf_data_s*
ngap_gNB_nnsf_select_amf_by_amf_code(ngap_gNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
int selected_plmn_identity,
uint8_t mme_code);
uint8_t amf_code);
struct ngap_gNB_mme_data_s*
ngap_gNB_nnsf_select_mme_by_gummei(ngap_gNB_instance_t *instance_p,
struct ngap_gNB_amf_data_s*
ngap_gNB_nnsf_select_amf_by_guami(ngap_gNB_instance_t *instance_p,
rrc_establishment_cause_t cause,
ngap_gummei_t gummei);
ngap_guami_t guami);
struct ngap_gNB_mme_data_s*
ngap_gNB_nnsf_select_mme_by_gummei_no_cause(ngap_gNB_instance_t *instance_p,
ngap_gummei_t gummei);
struct ngap_gNB_amf_data_s*
ngap_gNB_nnsf_select_amf_by_guami_no_cause(ngap_gNB_instance_t *instance_p,
ngap_guami_t guami);
#endif /* NGAP_GNB_NNSF_H_ */
......@@ -47,7 +47,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
uint32_t stream,
NGAP_NGAP_PDU_t *pdu)
{
ngap_gNB_mme_data_t *mme_desc_p;
ngap_gNB_amf_data_t *amf_desc_p;
NGAP_OverloadStart_t *container;
NGAP_OverloadStartIEs_t *ie;
......@@ -65,16 +65,16 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
/* Non UE-associated signalling -> stream 0 */
DevCheck(stream == 0, stream, 0, 0);
if ((mme_desc_p = ngap_gNB_get_MME(NULL, assoc_id, 0)) == NULL) {
/* No MME context associated */
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
/* No AMF context associated */
return -1;
}
/* Mark the MME as overloaded and set the overload state according to
/* Mark the AMF as overloaded and set the overload state according to
* the value received.
*/
mme_desc_p->state = NGAP_GNB_OVERLOAD;
mme_desc_p->overload_state =
amf_desc_p->state = NGAP_GNB_OVERLOAD;
amf_desc_p->overload_state =
ie->value.choice.OverloadResponse.choice.overloadAction;
return 0;
......@@ -84,23 +84,23 @@ int ngap_gNB_handle_overload_stop(uint32_t assoc_id,
uint32_t stream,
NGAP_NGAP_PDU_t *pdu)
{
/* We received Overload stop message, meaning that the MME is no more
/* We received Overload stop message, meaning that the AMF is no more
* overloaded. This is an empty message, with only message header and no
* Information Element.
*/
DevAssert(pdu != NULL);
ngap_gNB_mme_data_t *mme_desc_p;
ngap_gNB_amf_data_t *amf_desc_p;
/* Non UE-associated signalling -> stream 0 */
DevCheck(stream == 0, stream, 0, 0);
if ((mme_desc_p = ngap_gNB_get_MME(NULL, assoc_id, 0)) == NULL) {
/* No MME context associated */
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
/* No AMF context associated */
return -1;
}
mme_desc_p->state = NGAP_GNB_STATE_CONNECTED;
mme_desc_p->overload_state = NGAP_NO_OVERLOAD;
amf_desc_p->state = NGAP_GNB_STATE_CONNECTED;
amf_desc_p->overload_state = NGAP_NO_OVERLOAD;
return 0;
}
......@@ -25,7 +25,7 @@
/**
* \brief Handle an overload start message
**/
// int ngap_gNB_handle_overload_start(gNB_mme_desc_t *gNB_desc_p,
// int ngap_gNB_handle_overload_start(gNB_amf_desc_t *gNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct ngap_message_s *message_p);
int ngap_gNB_handle_overload_start(uint32_t assoc_id,
......@@ -35,7 +35,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
/**
* \brief Handle an overload stop message
**/
// int ngap_gNB_handle_overload_stop(gNB_mme_desc_t *gNB_desc_p,
// int ngap_gNB_handle_overload_stop(gNB_amf_desc_t *gNB_desc_p,
// sctp_queue_item_t *packet_p,
// struct ngap_message_s *message_p);
int ngap_gNB_handle_overload_stop(uint32_t assoc_id,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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