Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
42719e6
agw(fix): coverted C structure of ue context, ue_description_t to pro…
rsarwad Jul 25, 2022
a3b791b
Defined S1ap UE state in proto file and removed the enum definition
rsarwad Aug 2, 2022
fafd30f
Resolved merge conflicts
rsarwad Aug 4, 2022
ecea04c
Resolved merge conflicts
rsarwad Aug 22, 2022
bf7e827
Updating s1ap_state.pb.go file
rsarwad Aug 22, 2022
4f960ca
Addressed self review comments
rsarwad Aug 30, 2022
b5e9802
chore(agw): Clean up unnecessary Make commands (#13782)
LKreutzer Sep 2, 2022
ccc7293
Addressed review comments
rsarwad Sep 2, 2022
b9bf710
fix(agw): Migrate hash list of state_ue to protobuf_map (#13508)
rsarwad Sep 2, 2022
e2e032c
fix(agw): Fix spyne version in pydep lockfile (#13809)
sebathomas Sep 2, 2022
2ed0912
Resolved merge conflicts
rsarwad Sep 2, 2022
9c6abcf
Addressed self comments
rsarwad Sep 2, 2022
d7e2482
fix(ci): Set up the scripts needed in the bazel LTE integ test workfl…
LKreutzer Sep 2, 2022
4134ee9
fix(ci): Fix feg integ tests. Feg integ tests need both docker magmad…
Sep 2, 2022
cf0da32
Merge remote-tracking branch 'upstream/master' into 11191_move_ue_con…
rsarwad Sep 2, 2022
13f8b02
fix(ci): Trigger all bazel workflow jobs by pushing to master (#13825)
LKreutzer Sep 2, 2022
85e81ed
fix(ci): fix ipv6 uplink test (#13669)
Sep 2, 2022
4ae86aa
fix(agw): Modified code to fix compilation error on inclusion of prot…
rsarwad Sep 5, 2022
e5141ba
fix(feg): fix snowflake issue in feg integ test (#13600)
wolfseb Sep 5, 2022
c361224
chore(agw): Increase disksize for agw container to accomodate the con…
Sep 5, 2022
2541951
refactor(nms): Migrate Alerts rules detail to new style (#13792)
HannaFar Sep 5, 2022
603949f
chore(agw): Clean up dead code in gxgy_tests/local integ tests (#13783)
LKreutzer Sep 5, 2022
7fba511
fix(agw): Reload magma_deb when provisioning (#13823)
voisey Sep 5, 2022
dbbf0e2
fix(ci): refine backport title (#13637)
Neudrino Sep 5, 2022
2880fed
docs: Document magma_deb VM (#13840)
voisey Sep 5, 2022
6c9a96b
fix: ryu patching is cleaned up (#13705)
nstng Sep 6, 2022
d1281e3
refactor(ci): never used successfully within its whole lifetime (#13846)
Neudrino Sep 6, 2022
f0c3169
fix(feg): Added vagrant-reload to workflows (#13849)
MoritzThomasHuebner Sep 6, 2022
49d9791
chore(dp): Remove unused CPI related fields (#13858)
jkmar Sep 7, 2022
9d60f69
fix(cwg): Install necesssary vagrant plugin for test flow (#13860)
sebathomas Sep 7, 2022
0c49239
feat(dp): Add support for json columns in db framework (#13863)
jkmar Sep 7, 2022
15c16eb
refactor(nms): replace moment.js with date-fns (#13804)
Neudrino Sep 7, 2022
9b338d4
Addressed review comments
rsarwad Sep 7, 2022
74db2ab
chore(ci): codecov should not fail the build pipeline (#13866)
Neudrino Sep 7, 2022
c40bfe4
feat(dp): Add interface for radio controller replacement (#13864)
jkmar Sep 7, 2022
66f3799
feat(agw): Write per subscriber APN specific data into subscriberDB s…
vroon2703 Sep 7, 2022
ea38c5c
chore: delete stale example dir (#13829)
lucasgonze Sep 8, 2022
ffe5bb1
fix(ci): Join the qfi test to resolve test interdependency issue (#13…
Sep 8, 2022
3082cfc
chore(orc8r): Rework domain-proxy configuration file (#13875)
jkmar Sep 8, 2022
c31168d
fix(dp): add 103 grantId handling (#13876)
Sep 8, 2022
5959b34
chore(dp): remove channels DB table (#13871)
Sep 8, 2022
d6cea33
chore(nms): Upgrade chart-js-2 and react-chart-js (#13590)
thmsschmitt Sep 9, 2022
6827767
fix(orc8r): Updated helm chart version for 1.8.0 release (#13731)
ShubhamTatvamasi Sep 9, 2022
0fe1ed0
chore(dp): Move AMC to dp orc8r service (#13886)
jkmar Sep 9, 2022
bb73325
fix(mobilityd): Set daemon flag for mobilityd timers (#13879)
sebathomas Sep 12, 2022
3c5edbf
fix(nms): Show an error message if the user login fails (#13888)
sebathomas Sep 12, 2022
7673213
fix: bazel base uses same folly version as magma vm (#13867)
nstng Sep 12, 2022
0a6dbec
fix(dp): Adjust dp config to deployment names (#13893)
jkmar Sep 12, 2022
c4de1e5
fix(ci): Add repository with grpc-dev version 1.43 (#13896)
LKreutzer Sep 12, 2022
3abc95e
chore: bump postcss (#13675)
lucasgonze Sep 12, 2022
1f355f9
fix(nms): bump network timeout to avoid preventable build failures (#…
lucasgonze Sep 12, 2022
ff523a8
Addressed review comments
rsarwad Sep 7, 2022
baf982e
Merge branch '11191_move_ue_context' of https://github.com/rsarwad/ma…
rsarwad Sep 13, 2022
a7a1a9d
Merge remote-tracking branch 'upstream/master' into 11191_move_ue_con…
rsarwad Sep 13, 2022
43f3d01
feat(ci): Add federated integ test for HSS (#13805)
orion-belt Sep 13, 2022
e8b2d80
chore(agw): Tidy up fabfile (#13872)
voisey Sep 13, 2022
b9747f5
fix(ci): activate carryforward + apply best practise for flag managem…
Neudrino Sep 13, 2022
e2cd8f3
chore(agw): Create convenient aliases in magma-dev VM for service com…
LKreutzer Sep 13, 2022
9d4a75d
chore(ci): Parallelize the LTE integ tests and the sudo python tests …
LKreutzer Sep 13, 2022
88b6e7f
fix: ansible is pinned because of ansible-core 2.13.4 breaking change…
nstng Sep 13, 2022
0f9a6d3
fix(amf): Adding Reject if Static ip configured is in subset of ip_po…
Sathyaj27 Sep 14, 2022
94547e4
chore(dp): New AmcManager CreateRequest func (#13908)
Sep 14, 2022
1a22cca
chore(dp): Implement AmcManager DeleteCbsd func (#13921)
Sep 14, 2022
5444521
fix: golangci is upgraded to 1.47.3 in order to support generics (#13…
nstng Sep 14, 2022
0589db4
fix(dp): make 37 default value for max_eirp (#13922)
WojSad Sep 14, 2022
da0d251
chore(dp): Implement AmcManager UpdateCbsd func (#13927)
Sep 14, 2022
935783d
chore: magma deb build is bazelified (#13749)
nstng Sep 14, 2022
5287b74
fix(agw): Fix wildcard expansion error in magma aliases (#13929)
LKreutzer Sep 15, 2022
a61dd26
feat(agw): dockerize the agw envoy controller (#13852)
wolfseb Sep 15, 2022
886ce0e
feat(agw): LTE integration tests run on a containerized AGW (#13853)
mpfirrmann Sep 15, 2022
1212843
chore(dp): WithinTx should not suppress panic (#13933)
Sep 15, 2022
11896c1
chore(dp): Get rid of legacy active-mode controller (#13906)
sklgromek Sep 15, 2022
cadd2b8
feat(dp): Implement GetState in DP orc8r service (#13914)
WojSad Sep 15, 2022
f042921
docs(agw): Mark the AGWC Helm chart as experimental (#13920)
jheidbrink Sep 15, 2022
3356cb0
chore(dp): Fix domain-proxy build job (#13937)
sklgromek Sep 15, 2022
e718514
feat(dp): Use database directly in AMC (#13930)
jkmar Sep 15, 2022
0118afd
chore(orc8r): Add missing dp enabled parameter to terraform input tem…
sklgromek Sep 15, 2022
9755fdf
fix(agw): perform install of magma runtime dependencies (#13924)
berezovskyi-oleksandr Sep 15, 2022
0e293ef
chore(dp): Preallocate memory when collecting column pointers (#13890)
jkmar Sep 16, 2022
b8ad056
chore(dp): supressed radio controller operation (#13925)
WojSad Sep 16, 2022
8dc6dea
test(cwg): Stabilizing `TestGyCreditExhaustionRedirect` (#13870)
MoritzThomasHuebner Sep 18, 2022
4299e29
chore(agw): cleanup apt installs in agw Dockerfiles (#13932)
wolfseb Sep 19, 2022
1d34f11
fix(agw): Downgrade grpcio to fix pylint (#13946)
sebathomas Sep 19, 2022
f6f1d00
fix(ci): Add missing paths to path filter (#13959)
jheidbrink Sep 19, 2022
f9decaf
chore(ci): run integ tests again deb installation in ci (#13842)
Sep 19, 2022
366f6be
fix(nms): Improve sync of NMS organizations and orc8r tenants (#13917)
sebathomas Sep 19, 2022
e111d5a
fix(agw): the envoy controller is in the feg image (#13947)
Neudrino Sep 19, 2022
5a26549
chore: #11633 is reverted manually (#13868)
nstng Sep 19, 2022
c89642a
fix: py cryptography is pinned to a version that works with magma (#1…
nstng Sep 19, 2022
dc69a34
feat(agw): all AGW containeres have health checks (#13918)
mpfirrmann Sep 19, 2022
3ab0f9d
fix(agw): Modified code to remove unused files, pgw_pcef_emulation.cp…
rsarwad Sep 20, 2022
dc23b8c
feat(amf): Support for Protocol Configuration Options IE (#13768)
sreedharkumartn Sep 20, 2022
a9c2f01
fix(agw): Pin version of grpcio_tool in python_dev ansible role (#13957)
mpfirrmann Sep 20, 2022
8f7d260
Merge remote-tracking branch 'upstream/master' into 11191_move_ue_con…
rsarwad Sep 20, 2022
59c836c
Addressed review comments
rsarwad Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lte/gateway/c/core/oai/common/itti_free_defined_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ void itti_free_msg_content(MessageDef* const message_p) {
bdestroy_wrapper(
&message_p->ittiMsg.s1ap_handover_request_ack.tgt_src_container);
break;
case S1AP_HANDOVER_NOTIFY: {
e_rab_admitted_list_t e_rab_admitted_list = {0};
e_rab_admitted_list =
message_p->ittiMsg.s1ap_handover_notify.e_rab_admitted_list;
for (int idx = 0; idx < e_rab_admitted_list.no_of_items; idx++) {
bdestroy_wrapper(
&e_rab_admitted_list.item[idx].transport_layer_address);
}
} break;
case S6A_UPDATE_LOCATION_REQ:
case S6A_UPDATE_LOCATION_ANS:
case S6A_AUTH_INFO_REQ:
Expand Down
33 changes: 17 additions & 16 deletions lte/gateway/c/core/oai/include/s1ap_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@ int s1ap_state_init(uint32_t max_ues, uint32_t max_enbs, bool use_stateless);

void s1ap_state_exit(void);

#ifdef __cplusplus
}
#endif
s1ap_state_t* get_s1ap_state(bool read_from_db);

void put_s1ap_state(void);

enb_description_t* s1ap_state_get_enb(s1ap_state_t* state,
sctp_assoc_id_t assoc_id);

ue_description_t* s1ap_state_get_ue_enbid(sctp_assoc_id_t sctp_assoc_id,
enb_ue_s1ap_id_t enb_ue_s1ap_id);
magma::lte::oai::UeDescription* s1ap_state_get_ue_enbid(
sctp_assoc_id_t sctp_assoc_id, enb_ue_s1ap_id_t enb_ue_s1ap_id);

ue_description_t* s1ap_state_get_ue_mmeid(mme_ue_s1ap_id_t mme_ue_s1ap_id);
magma::lte::oai::UeDescription* s1ap_state_get_ue_mmeid(
mme_ue_s1ap_id_t mme_ue_s1ap_id);

ue_description_t* s1ap_state_get_ue_imsi(imsi64_t imsi64);
magma::lte::oai::UeDescription* s1ap_state_get_ue_imsi(imsi64_t imsi64);

/**
* Return unique composite id for S1AP UE context
Expand All @@ -65,22 +69,19 @@ map_uint64_ue_description_t* get_s1ap_ue_state(void);

int read_s1ap_ue_state_db(void);

void remove_ues_without_imsi_from_ue_id_coll(void);

void clean_stale_enb_state(s1ap_state_t* state,
enb_description_t* new_enb_association);

void put_s1ap_ue_state(imsi64_t imsi64);

void delete_s1ap_ue_state(imsi64_t imsi64);

bool s1ap_ue_compare_by_mme_ue_id_cb(__attribute__((unused)) uint64_t keyP,
struct ue_description_s* elementP, void* parameterP,
void** resultP);
magma::lte::oai::UeDescription* elementP,
void* parameterP, void** resultP);

bool s1ap_ue_compare_by_imsi(__attribute__((unused)) uint64_t keyP,
struct ue_description_s* elementP, void* parameterP, void** resultP);

void remove_ues_without_imsi_from_ue_id_coll(void);

void clean_stale_enb_state(s1ap_state_t* state,
enb_description_t* new_enb_association);

#ifdef __cplusplus
}
#endif
magma::lte::oai::UeDescription* elementP,
void* parameterP, void** resultP);
72 changes: 3 additions & 69 deletions lte/gateway/c/core/oai/include/s1ap_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern "C" {
#ifdef __cplusplus
}
#endif
#include "lte/protos/oai/s1ap_state.pb.h"

// Forward declarations
struct enb_description_s;
Expand All @@ -53,18 +54,6 @@ typedef struct s1ap_imsi_map_s {
magma::proto_map_uint32_uint64_t mme_ueid2imsi_map;
} s1ap_imsi_map_t;

enum s1_timer_class_s {
S1AP_INVALID_TIMER_CLASS,
S1AP_ENB_TIMER,
S1AP_UE_TIMER
};

/* Timer structure */
struct s1ap_timer_t {
long id; /* The timer identifier */
long msec; /* The timer interval value in seconds */
};

// The current s1 state of the MME relating to the specific eNB.
enum mme_s1_enb_state_s {
S1AP_INIT, /// The sctp association has been established but s1 hasn't been
Expand All @@ -75,63 +64,8 @@ enum mme_s1_enb_state_s {
S1AP_SHUTDOWN /// The S1 state is being torn down due to sctp shutdown.
};

enum s1_ue_state_s {
S1AP_UE_INVALID_STATE,
S1AP_UE_WAITING_CSR, ///< Waiting for Initial Context Setup Response
S1AP_UE_HANDOVER, ///< Handover procedure triggered
S1AP_UE_CONNECTED, ///< UE context ready
S1AP_UE_WAITING_CRR, /// UE Context release Procedure initiated , waiting for
/// UE context Release Complete
};

typedef struct s1ap_handover_state_s {
mme_ue_s1ap_id_t mme_ue_s1ap_id;
uint32_t source_enb_id;
uint32_t target_enb_id;
enb_ue_s1ap_id_t source_enb_ue_s1ap_id : 24;
enb_ue_s1ap_id_t target_enb_ue_s1ap_id : 24;
sctp_stream_id_t source_sctp_stream_recv; ///< source eNB -> MME stream
sctp_stream_id_t target_sctp_stream_recv; ///< target eNB -> MME stream
sctp_stream_id_t source_sctp_stream_send; ///< MME -> source eNB stream
sctp_stream_id_t target_sctp_stream_send; ///< MME -> target eNB stream
e_rab_admitted_list_t e_rab_admitted_list;
} s1ap_handover_state_t;

/** Main structure representing UE association over s1ap
* Generated every time a new InitialUEMessage is received
**/
typedef struct ue_description_s {
enum s1_ue_state_s s1_ue_state; ///< S1AP UE state

enb_ue_s1ap_id_t
enb_ue_s1ap_id : 24; ///< Unique UE id over eNB (24 bits wide)
mme_ue_s1ap_id_t mme_ue_s1ap_id; ///< Unique UE id over MME (32 bits wide)
sctp_assoc_id_t sctp_assoc_id; ///< Assoc id of eNB which this UE is attached
uint64_t comp_s1ap_id; ///< Unique composite UE id (sctp_assoc_id &
///< enb_ue_s1ap_id)

/** SCTP stream on which S1 message will be sent/received.
* During an UE S1 connection, a pair of streams is
* allocated and is used during all the connection.
* Stream 0 is reserved for non UE signalling.
* @name sctp stream identifier
**/
/*@{*/
sctp_stream_id_t sctp_stream_recv; ///< eNB -> MME stream
sctp_stream_id_t sctp_stream_send; ///< MME -> eNB stream
/*@}*/

// UE Context Release procedure guard timer
struct s1ap_timer_t s1ap_ue_context_rel_timer;

// Handover status. We intentionally do not persist all of this state since
// it's time sensitive; if the MME restarts during a HO procedure the RAN
// will abort the procedure due to timeouts, rendering this state useless.
s1ap_handover_state_t s1ap_handover_state;
} ue_description_t;

// Map- Key:uint64_t, Data:ue_description_s*
typedef magma::proto_map_s<uint64_t, struct ue_description_s*>
// Map- Key:uint64_t, Data: pointer to protobuf object, UeDescription
typedef magma::proto_map_s<uint64_t, magma::lte::oai::UeDescription*>
map_uint64_ue_description_t;

/* Maximum no. of Broadcast PLMNs. Value is 6
Expand Down
23 changes: 12 additions & 11 deletions lte/gateway/c/core/oai/include/state_converter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,26 @@ class StateConverter {

template <typename state_map_t, typename proto_map_t>
static void copy_int_protomap_to_proto(state_map_t state_map,
proto_map_t* proto_map) {
for (auto elm = state_map.map->begin(); elm != state_map.map->end(); ++elm) {
proto_map_t* proto_map) {
for (auto elm = state_map.map->begin(); elm != state_map.map->end();
++elm) {
(*proto_map)[elm->first] = elm->second;
}
}

template <typename proto_map_t, typename state_map_t>
static void copy_int_protomap_to_state(const proto_map_t &proto_map, state_map_t state_map){
for (auto const& kv : proto_map) {
proto_map_rc_t rc =
state_map.insert(kv.first, kv.second);
if (rc != PROTO_MAP_OK) {
OAILOG_ERROR(LOG_UTIL,
"Failed to insert value %lu in table %s: error: %s\n", kv.second,
state_map.get_name(),magma::map_rc_code2string(rc));
static void copy_int_protomap_to_state(const proto_map_t& proto_map,
state_map_t state_map) {
for (auto const& kv : proto_map) {
proto_map_rc_t rc = state_map.insert(kv.first, kv.second);
if (rc != PROTO_MAP_OK) {
OAILOG_ERROR(
LOG_UTIL, "Failed to insert value %lu in table %s: error: %s\n",
kv.second, state_map.get_name(), magma::map_rc_code2string(rc));
}
}
}

}
private:
static void plmn_to_chars(const plmn_t& state_plmn, char* plmn_array);
static void chars_to_plmn(const char* plmn_array, plmn_t* state_plmn);
Expand Down
4 changes: 2 additions & 2 deletions lte/gateway/c/core/oai/tasks/grpc_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ generate_grpc_protos("${SMOSRV_LTE_GRPC_PROTOS}" "${PROTO_SRCS}"
"${PROTO_HDRS}" ${LTE_PROTO_DIR} ${LTE_OUT_DIR})

# S1ap Service
set(S1APSRV_LTE_CPP_PROTOS s1ap_service)
set(S1APSRV_LTE_GRPC_PROTOS s1ap_service)
set(S1APSRV_LTE_CPP_PROTOS s1ap_service oai/s1ap_state)
set(S1APSRV_LTE_GRPC_PROTOS s1ap_service oai/s1ap_state)
generate_cpp_protos("${S1APSRV_LTE_CPP_PROTOS}" "${PROTO_SRCS}"
"${PROTO_HDRS}" ${LTE_PROTO_DIR} ${LTE_OUT_DIR})
generate_grpc_protos("${S1APSRV_LTE_GRPC_PROTOS}" "${PROTO_SRCS}"
Expand Down
2 changes: 0 additions & 2 deletions lte/gateway/c/core/oai/tasks/mme_app/mme_app_bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3703,10 +3703,8 @@ void mme_app_handle_handover_notify(
"Id: " MME_UE_S1AP_ID_FMT " (4 or 16 bytes was expected)\n",
blength(e_rab_admitted_list.item[i].transport_layer_address),
handover_notify_p->mme_ue_s1ap_id);
bdestroy_wrapper(&e_rab_admitted_list.item[i].transport_layer_address);
OAILOG_FUNC_OUT(LOG_MME_APP);
}
bdestroy_wrapper(&e_rab_admitted_list.item[i].transport_layer_address);
s11_modify_bearer_request->bearer_contexts_to_be_modified
.num_bearer_context++;

Expand Down
45 changes: 24 additions & 21 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ bool s1ap_congestion_control_enabled = true;
long s1ap_last_msg_latency = 0;
long s1ap_zmq_th = LONG_MAX;

using magma::lte::oai::UeDescription;
//------------------------------------------------------------------------------
static int s1ap_send_init_sctp(void) {
// Create and alloc new message
Expand Down Expand Up @@ -395,32 +396,33 @@ enb_description_t* s1ap_new_enb(void) {
}

//------------------------------------------------------------------------------
ue_description_t* s1ap_new_ue(s1ap_state_t* state,
const sctp_assoc_id_t sctp_assoc_id,
enb_ue_s1ap_id_t enb_ue_s1ap_id) {
UeDescription* s1ap_new_ue(s1ap_state_t* state,
const sctp_assoc_id_t sctp_assoc_id,
enb_ue_s1ap_id_t enb_ue_s1ap_id) {
enb_description_t* enb_ref = NULL;
ue_description_t* ue_ref = NULL;
UeDescription* ue_ref = nullptr;

enb_ref = s1ap_state_get_enb(state, sctp_assoc_id);
DevAssert(enb_ref != NULL);
ue_ref = new ue_description_t();
ue_ref = new UeDescription();
/*
* Something bad happened during malloc...
* * * * May be we are running out of memory.
* * * * TODO: Notify eNB with a cause like Hardware Failure.
*/
if (ue_ref == NULL) {
OAILOG_ERROR(LOG_S1AP, "Failed to allocate memory for ue context");
if (ue_ref == nullptr) {
OAILOG_ERROR(LOG_S1AP,
"Failed to allocate memory for protobuf object UeDescription");
return NULL;
}
ue_ref->sctp_assoc_id = sctp_assoc_id;
ue_ref->enb_ue_s1ap_id = enb_ue_s1ap_id;
ue_ref->comp_s1ap_id =
S1AP_GENERATE_COMP_S1AP_ID(sctp_assoc_id, enb_ue_s1ap_id);
ue_ref->set_sctp_assoc_id(sctp_assoc_id);
ue_ref->set_enb_ue_s1ap_id(enb_ue_s1ap_id);
ue_ref->set_comp_s1ap_id(
S1AP_GENERATE_COMP_S1AP_ID(sctp_assoc_id, enb_ue_s1ap_id));

map_uint64_ue_description_t* s1ap_ue_state = get_s1ap_ue_state();
magma::proto_map_rc_t rc =
s1ap_ue_state->insert(ue_ref->comp_s1ap_id, ue_ref);
s1ap_ue_state->insert(ue_ref->comp_s1ap_id(), ue_ref);

if (magma::PROTO_MAP_OK != rc) {
OAILOG_ERROR(LOG_S1AP, "Could not insert UE descr in ue_coll: %s\n",
Expand All @@ -436,31 +438,32 @@ ue_description_t* s1ap_new_ue(s1ap_state_t* state,
}

//------------------------------------------------------------------------------
void s1ap_remove_ue(s1ap_state_t* state, ue_description_t* ue_ref) {
void s1ap_remove_ue(s1ap_state_t* state, UeDescription* ue_ref) {
enb_description_t* enb_ref = NULL;

// NULL reference...
if (ue_ref == NULL) return;

mme_ue_s1ap_id_t mme_ue_s1ap_id = ue_ref->mme_ue_s1ap_id;
enb_ref = s1ap_state_get_enb(state, ue_ref->sctp_assoc_id);
mme_ue_s1ap_id_t mme_ue_s1ap_id = ue_ref->mme_ue_s1ap_id();
enb_ref = s1ap_state_get_enb(state, ue_ref->sctp_assoc_id());
DevAssert(enb_ref->nb_ue_associated > 0);
// Updating number of UE
enb_ref->nb_ue_associated--;

OAILOG_TRACE(LOG_S1AP,
"Removing UE enb_ue_s1ap_id: " ENB_UE_S1AP_ID_FMT
" mme_ue_s1ap_id:" MME_UE_S1AP_ID_FMT " in eNB id : %d\n",
ue_ref->enb_ue_s1ap_id, ue_ref->mme_ue_s1ap_id, enb_ref->enb_id);
ue_ref->enb_ue_s1ap_id(), ue_ref->mme_ue_s1ap_id(),
enb_ref->enb_id);

ue_ref->s1_ue_state = S1AP_UE_INVALID_STATE;
if (ue_ref->s1ap_ue_context_rel_timer.id != S1AP_TIMER_INACTIVE_ID) {
s1ap_stop_timer(ue_ref->s1ap_ue_context_rel_timer.id);
ue_ref->s1ap_ue_context_rel_timer.id = S1AP_TIMER_INACTIVE_ID;
ue_ref->set_s1ap_ue_state(magma::lte::oai::S1AP_UE_INVALID_STATE);
if (ue_ref->s1ap_ue_context_rel_timer().id() != S1AP_TIMER_INACTIVE_ID) {
s1ap_stop_timer(ue_ref->s1ap_ue_context_rel_timer().id());
ue_ref->mutable_s1ap_ue_context_rel_timer()->set_id(S1AP_TIMER_INACTIVE_ID);
}

map_uint64_ue_description_t* s1ap_ue_state = get_s1ap_ue_state();
s1ap_ue_state->remove(ue_ref->comp_s1ap_id);
s1ap_ue_state->remove(ue_ref->comp_s1ap_id());
state->mmeid2associd.remove(mme_ue_s1ap_id);
enb_ref->ue_id_coll.remove(mme_ue_s1ap_id);

Expand Down
18 changes: 11 additions & 7 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#pragma once
#include "lte/gateway/c/core/oai/include/s1ap_state.hpp"
#include "lte/gateway/c/core/oai/include/s1ap_types.hpp"
#include "lte/protos/oai/s1ap_state.pb.h"
#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -37,6 +38,9 @@ extern "C" {
#define S1AP_ZMQ_LATENCY_TH \
s1ap_zmq_th // absolute threshold to be used for initial UE messages

#ifdef __cplusplus
}
#endif
extern bool hss_associated;

/** \brief Allocate and add to the list a new eNB descriptor
Expand All @@ -49,21 +53,21 @@ enb_description_t* s1ap_new_enb(void);
* \param enb_ue_s1ap_id ue ID over S1AP
* @returns Reference to the new UE element in list
**/
ue_description_t* s1ap_new_ue(s1ap_state_t* state,
sctp_assoc_id_t sctp_assoc_id,
enb_ue_s1ap_id_t enb_ue_s1ap_id);
magma::lte::oai::UeDescription* s1ap_new_ue(s1ap_state_t* state,
sctp_assoc_id_t sctp_assoc_id,
enb_ue_s1ap_id_t enb_ue_s1ap_id);

/** \brief Remove target UE from the list
* \param ue_ref UE structure reference to remove
**/
void s1ap_remove_ue(s1ap_state_t* state, ue_description_t* ue_ref);
void s1ap_remove_ue(s1ap_state_t* state,
magma::lte::oai::UeDescription* ue_ref);

/** \brief Remove target eNB from the list and remove any UE associated
* \param enb_ref eNB structure reference to remove
**/
void s1ap_remove_enb(s1ap_state_t* state, enb_description_t* enb_ref);

void free_enb_description(void** ptr);
#ifdef __cplusplus
}
#endif

void free_ue_description(void** ptr);
Loading