@@ -105,10 +105,9 @@ static int s1ap_send_init_sctp(void) {
105105}
106106
107107static int handle_message (zloop_t * loop, zsock_t * reader, void * arg) {
108- s1ap_state_t * state;
109108 MessageDef* received_message_p = receive_msg (reader);
110109 imsi64_t imsi64 = itti_get_associated_imsi (received_message_p);
111- state = get_s1ap_state (false );
110+ S1apState* state = get_s1ap_state (false );
112111 AssertFatal (state != NULL , " failed to retrieve s1ap state (was null)" );
113112
114113 bool is_task_state_same = false ;
@@ -400,7 +399,7 @@ oai::EnbDescription* s1ap_new_enb(void) {
400399}
401400
402401// ------------------------------------------------------------------------------
403- oai::UeDescription* s1ap_new_ue (s1ap_state_t * state,
402+ oai::UeDescription* s1ap_new_ue (S1apState * state,
404403 const sctp_assoc_id_t sctp_assoc_id,
405404 enb_ue_s1ap_id_t enb_ue_s1ap_id) {
406405 oai::EnbDescription* enb_ref = NULL ;
@@ -446,7 +445,7 @@ oai::UeDescription* s1ap_new_ue(s1ap_state_t* state,
446445}
447446
448447// ------------------------------------------------------------------------------
449- void s1ap_remove_ue (s1ap_state_t * state, oai::UeDescription* ue_ref) {
448+ void s1ap_remove_ue (S1apState * state, oai::UeDescription* ue_ref) {
450449 oai::EnbDescription* enb_ref = NULL ;
451450
452451 // NULL reference...
@@ -476,7 +475,10 @@ void s1ap_remove_ue(s1ap_state_t* state, oai::UeDescription* ue_ref) {
476475 return ;
477476 }
478477 s1ap_ue_state->remove (ue_ref->comp_s1ap_id ());
479- state->mmeid2associd .remove (mme_ue_s1ap_id);
478+ proto_map_uint32_uint32_t mmeid2associd_map.map =
479+ state->mutable_mmeid2associd ();
480+ mmeid2associd_map.remove (mme_ue_s1ap_id);
481+
480482 magma::proto_map_uint32_uint64_t ue_id_coll;
481483 ue_id_coll.map = enb_ref->mutable_ue_id_map ();
482484 ue_id_coll.remove (mme_ue_s1ap_id);
@@ -494,7 +496,7 @@ void s1ap_remove_ue(s1ap_state_t* state, oai::UeDescription* ue_ref) {
494496 OAILOG_INFO (LOG_S1AP, " Moving eNB state to S1AP_INIT \n " );
495497 enb_ref->set_s1_state (magma::lte::oai::S1AP_INIT);
496498 set_gauge (" s1_connection" , 0 , 1 , " enb_name" , enb_ref->enb_name ());
497- state->num_enbs -- ;
499+ state->set_num_enbs (state-> num_enbs () - 1 ) ;
498500 } else if (enb_ref->s1_enb_state () == magma::lte::oai::S1AP_SHUTDOWN) {
499501 OAILOG_INFO (LOG_S1AP, " Deleting eNB \n " );
500502 set_gauge (" s1_connection" , 0 , 1 , " enb_name" , enb_ref->enb_name ());
@@ -504,25 +506,27 @@ void s1ap_remove_ue(s1ap_state_t* state, oai::UeDescription* ue_ref) {
504506}
505507
506508// ------------------------------------------------------------------------------
507- void s1ap_remove_enb (s1ap_state_t * state, oai::EnbDescription* enb_ref) {
509+ void s1ap_remove_enb (S1apState * state, oai::EnbDescription* enb_ref) {
508510 if (enb_ref == NULL ) {
509511 return ;
510512 }
511513 magma::proto_map_uint32_uint64_t ue_id_coll;
514+ map_uint32_enb_description_t enb_map;
512515 enb_ref->set_s1_state (magma::lte::oai::S1AP_INIT);
513516
514517 ue_id_coll.map = enb_ref->mutable_ue_id_map ();
515518 ue_id_coll.clear ();
516519 OAILOG_INFO (LOG_S1AP, " Deleting eNB on assoc_id :%u\n " ,
517520 enb_ref->sctp_assoc_id ());
518- state->enbs .remove (enb_ref->sctp_assoc_id ());
519- state->num_enbs --;
521+ enb_map.map = state->mutable_enbs ();
522+ enb_map.remove (enb_ref->sctp_assoc_id ());
523+ state->set_num_enbs (state->num_enbs () - 1 );
520524}
521525
522526static int handle_stats_timer (zloop_t * loop, int id, void * arg) {
523- s1ap_state_t * s1ap_state_p = get_s1ap_state (false );
527+ S1apState * s1ap_state_p = get_s1ap_state (false );
524528 application_s1ap_stats_msg_t stats_msg;
525- stats_msg.nb_enb_connected = s1ap_state_p->num_enbs ;
529+ stats_msg.nb_enb_connected = s1ap_state_p->num_enbs () ;
526530 stats_msg.nb_s1ap_last_msg_latency = s1ap_last_msg_latency;
527531 return send_s1ap_stats_to_service303 (&s1ap_task_zmq_ctx, TASK_S1AP,
528532 &stats_msg);
0 commit comments