@@ -105,10 +105,9 @@ static int s1ap_send_init_sctp(void) {
105
105
}
106
106
107
107
static int handle_message (zloop_t * loop, zsock_t * reader, void * arg) {
108
- s1ap_state_t * state;
109
108
MessageDef* received_message_p = receive_msg (reader);
110
109
imsi64_t imsi64 = itti_get_associated_imsi (received_message_p);
111
- state = get_s1ap_state (false );
110
+ S1apState* state = get_s1ap_state (false );
112
111
AssertFatal (state != NULL , " failed to retrieve s1ap state (was null)" );
113
112
114
113
bool is_task_state_same = false ;
@@ -400,7 +399,7 @@ oai::EnbDescription* s1ap_new_enb(void) {
400
399
}
401
400
402
401
// ------------------------------------------------------------------------------
403
- oai::UeDescription* s1ap_new_ue (s1ap_state_t * state,
402
+ oai::UeDescription* s1ap_new_ue (S1apState * state,
404
403
const sctp_assoc_id_t sctp_assoc_id,
405
404
enb_ue_s1ap_id_t enb_ue_s1ap_id) {
406
405
oai::EnbDescription* enb_ref = NULL ;
@@ -446,7 +445,7 @@ oai::UeDescription* s1ap_new_ue(s1ap_state_t* state,
446
445
}
447
446
448
447
// ------------------------------------------------------------------------------
449
- void s1ap_remove_ue (s1ap_state_t * state, oai::UeDescription* ue_ref) {
448
+ void s1ap_remove_ue (S1apState * state, oai::UeDescription* ue_ref) {
450
449
oai::EnbDescription* enb_ref = NULL ;
451
450
452
451
// NULL reference...
@@ -476,7 +475,10 @@ void s1ap_remove_ue(s1ap_state_t* state, oai::UeDescription* ue_ref) {
476
475
return ;
477
476
}
478
477
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
+
480
482
magma::proto_map_uint32_uint64_t ue_id_coll;
481
483
ue_id_coll.map = enb_ref->mutable_ue_id_map ();
482
484
ue_id_coll.remove (mme_ue_s1ap_id);
@@ -494,7 +496,7 @@ void s1ap_remove_ue(s1ap_state_t* state, oai::UeDescription* ue_ref) {
494
496
OAILOG_INFO (LOG_S1AP, " Moving eNB state to S1AP_INIT \n " );
495
497
enb_ref->set_s1_state (magma::lte::oai::S1AP_INIT);
496
498
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 ) ;
498
500
} else if (enb_ref->s1_enb_state () == magma::lte::oai::S1AP_SHUTDOWN) {
499
501
OAILOG_INFO (LOG_S1AP, " Deleting eNB \n " );
500
502
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) {
504
506
}
505
507
506
508
// ------------------------------------------------------------------------------
507
- void s1ap_remove_enb (s1ap_state_t * state, oai::EnbDescription* enb_ref) {
509
+ void s1ap_remove_enb (S1apState * state, oai::EnbDescription* enb_ref) {
508
510
if (enb_ref == NULL ) {
509
511
return ;
510
512
}
511
513
magma::proto_map_uint32_uint64_t ue_id_coll;
514
+ map_uint32_enb_description_t enb_map;
512
515
enb_ref->set_s1_state (magma::lte::oai::S1AP_INIT);
513
516
514
517
ue_id_coll.map = enb_ref->mutable_ue_id_map ();
515
518
ue_id_coll.clear ();
516
519
OAILOG_INFO (LOG_S1AP, " Deleting eNB on assoc_id :%u\n " ,
517
520
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 );
520
524
}
521
525
522
526
static 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 );
524
528
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 () ;
526
530
stats_msg.nb_s1ap_last_msg_latency = s1ap_last_msg_latency;
527
531
return send_s1ap_stats_to_service303 (&s1ap_task_zmq_ctx, TASK_S1AP,
528
532
&stats_msg);
0 commit comments