Skip to content

Commit 0cd18bb

Browse files
committed
Resolved merge conflicts
Signed-off-by: Rashmi <[email protected]>
1 parent 4a17193 commit 0cd18bb

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

lte/gateway/c/core/oai/tasks/s1ap/s1ap_state_manager.cpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,18 @@ void S1apStateManager::init(uint32_t max_ues, uint32_t max_enbs,
6363
is_initialized = true;
6464
}
6565

66-
s1ap_state_t* create_s1ap_state(void) {
67-
bstring ht_name;
66+
S1apState* create_s1ap_state(void) {
67+
map_uint32_enb_description_t enb_map;
6868

69-
s1ap_state_t* state_cache_p = new s1ap_state_t();
70-
state_cache_p->enbs.map =
71-
new google::protobuf::Map<unsigned int, oai::EnbDescription*>();
72-
state_cache_p->enbs.set_name(S1AP_ENB_COLL);
73-
state_cache_p->enbs.bind_callback(free_enb_description);
69+
S1apState* state_cache_p = new S1apState();
70+
enb_map.map = state_cache_p->mutable_enbs();
71+
enb_map.set_name(S1AP_ENB_COLL);
72+
enb_map.bind_callback(free_enb_description);
7473

75-
state_cache_p->mmeid2associd.map =
76-
new google::protobuf::Map<uint32_t, uint32_t>();
77-
state_cache_p->mmeid2associd.set_name(S1AP_MME_ID2ASSOC_ID_COLL);
74+
magma::proto_map_uint32_uint32_t mmeid2associd;
75+
mmeid2associd.map = state_cache_p->mutable_mmeid2associd();
76+
mmeid2associd.set_name(S1AP_MME_ID2ASSOC_ID_COLL);
7877

79-
state_cache_p->num_enbs = 0;
8078
return state_cache_p;
8179
}
8280

@@ -98,21 +96,23 @@ void S1apStateManager::create_state() {
9896
create_s1ap_imsi_map();
9997
}
10098

101-
void free_s1ap_state(s1ap_state_t* state_cache_p) {
99+
void free_s1ap_state(S1apState* state_cache_p) {
102100
AssertFatal(state_cache_p,
103-
"s1ap_state_t passed to free_s1ap_state must not be null");
101+
"S1apState passed to free_s1ap_state must not be null");
104102

105103
int i;
106104
hashtable_rc_t ht_rc;
107105
hashtable_key_array_t* keys;
108106
sctp_assoc_id_t assoc_id;
109107
oai::EnbDescription* enb;
108+
map_uint32_enb_description_t enb_map;
109+
enb_map.map = state_cache_p->mutable_enbs();
110110

111-
if (state_cache_p->enbs.isEmpty()) {
111+
if (enb_map.isEmpty()) {
112112
OAILOG_DEBUG(LOG_S1AP, "No keys in the enb hashtable");
113113
} else {
114-
for (auto itr = state_cache_p->enbs.map->begin();
115-
itr != state_cache_p->enbs.map->end(); itr++) {
114+
for (auto itr = enb_map.map->begin(); itr != enb_map.map.map->end();
115+
itr++) {
116116
enb = itr->second;
117117
if (!enb) {
118118
OAILOG_ERROR(LOG_S1AP, "eNB entry not found in eNB S1AP state");
@@ -121,10 +121,13 @@ void free_s1ap_state(s1ap_state_t* state_cache_p) {
121121
}
122122
}
123123
}
124-
if (state_cache_p->enbs.destroy_map() != PROTO_MAP_OK) {
124+
if (enb_map.destroy_map() != PROTO_MAP_OK) {
125125
OAILOG_ERROR(LOG_S1AP, "An error occurred while destroying s1 eNB map");
126126
}
127-
if ((state_cache_p->mmeid2associd.destroy_map()) != magma::PROTO_MAP_OK) {
127+
128+
magma::proto_map_uint32_uint32_t mmeid2associd;
129+
mmeid2associd.map = state_cache_p->mutable_mmeid2associd();
130+
if ((mmeid2associd.destroy_map()) != magma::PROTO_MAP_OK) {
128131
OAILOG_ERROR(LOG_S1AP,
129132
"An error occurred while destroying mmeid2associd map");
130133
}

lte/gateway/c/core/oai/tasks/s1ap/s1ap_state_manager.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ namespace magma {
4242
namespace lte {
4343

4444
/**
45-
* create_s1ap_state allocates a new s1ap_state_t struct and initializes
45+
* create_s1ap_state allocates a new S1apState struct and initializes
4646
* its properties.
4747
*/
48-
s1ap_state_t* create_s1ap_state(void);
48+
S1apState* create_s1ap_state(void);
4949
/**
50-
* free_s1ap_state deallocates a s1ap_state_t struct and its properties.
50+
* free_s1ap_state deallocates a S1apState struct and its properties.
5151
*/
52-
void free_s1ap_state(s1ap_state_t* state_cache_p);
52+
void free_s1ap_state(S1apState* state_cache_p);
5353

5454
/**
5555
* S1apStateManager is a thread safe singleton class that contains functions
5656
* to maintain S1AP task state, allocating and freeing related state structs.
5757
*/
5858
class S1apStateManager
59-
: public StateManager<s1ap_state_t, oai::UeDescription,
59+
: public StateManager<S1apState, oai::UeDescription,
6060
oai::S1apState,
6161
oai::UeDescription, S1apStateConverter> {
6262
public:
@@ -106,7 +106,7 @@ class S1apStateManager
106106
~S1apStateManager() override;
107107

108108
/**
109-
* Allocates new s1ap_state_t struct and its properties
109+
* Allocates new S1apState struct and its properties
110110
*/
111111
void create_state() override;
112112

0 commit comments

Comments
 (0)