forked from acouzens/open5gs
update it
This commit is contained in:
parent
20195b67cf
commit
0f7bdc1ded
|
@ -63,14 +63,16 @@ status_t gtp_xact_init(gtp_xact_ctx_t *context,
|
|||
|
||||
status_t gtp_xact_final(void)
|
||||
{
|
||||
if (gtp_xact_pool_initialized == 1)
|
||||
if (gtp_xact_pool_initialized == 1 &&
|
||||
pool_size(>p_xact_pool) == pool_avail(>p_xact_pool))
|
||||
{
|
||||
d_print("%d not freed in gtp_xact_pool[%d] of S11/S5-SM\n",
|
||||
d_print("%d not freed in gtp_xact_pool[%d] of GTP Transaction\n",
|
||||
pool_size(>p_xact_pool) - pool_avail(>p_xact_pool),
|
||||
pool_size(>p_xact_pool));
|
||||
index_final(>p_xact_pool);
|
||||
|
||||
gtp_xact_pool_initialized = 0;
|
||||
}
|
||||
gtp_xact_pool_initialized = 0;
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
@ -175,6 +177,24 @@ gtp_xact_t *gtp_xact_remote_create(gtp_xact_ctx_t *context,
|
|||
GTP_XACT_REMOTE_DURATION, GTP_XACT_REMOTE_RETRY_COUNT);
|
||||
}
|
||||
|
||||
void gtp_xact_delete_all(gtp_node_t *gnode)
|
||||
{
|
||||
gtp_xact_t *xact = NULL;
|
||||
|
||||
xact = list_first(&gnode->local_list);
|
||||
while(xact)
|
||||
{
|
||||
gtp_xact_delete(xact);
|
||||
xact = list_next(xact);
|
||||
}
|
||||
xact = list_first(&gnode->remote_list);
|
||||
while(xact)
|
||||
{
|
||||
gtp_xact_delete(xact);
|
||||
xact = list_next(xact);
|
||||
}
|
||||
}
|
||||
|
||||
status_t gtp_xact_commit(gtp_xact_t *xact,
|
||||
c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf)
|
||||
{
|
||||
|
|
|
@ -53,10 +53,11 @@ CORE_DECLARE(status_t) gtp_xact_init(gtp_xact_ctx_t *context,
|
|||
tm_service_t *tm_service, c_uintptr_t event);
|
||||
CORE_DECLARE(status_t) gtp_xact_final(void);
|
||||
|
||||
CORE_DECLARE(gtp_xact_t *)gtp_xact_local_create(gtp_xact_ctx_t *context,
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_local_create(gtp_xact_ctx_t *context,
|
||||
net_sock_t *sock, gtp_node_t *gnode);
|
||||
CORE_DECLARE(gtp_xact_t *) gtp_xact_remote_create(gtp_xact_ctx_t *context,
|
||||
net_sock_t *sock, gtp_node_t *gnode, c_uint32_t sqn);
|
||||
CORE_DECLARE(void) gtp_xact_delete_all(gtp_node_t *gnode);
|
||||
|
||||
CORE_DECLARE(status_t) gtp_xact_commit(
|
||||
gtp_xact_t *xact, c_uint8_t type, c_uint32_t teid, pkbuf_t *pkbuf);
|
||||
|
|
|
@ -133,6 +133,8 @@ status_t mme_sgw_remove(mme_sgw_t *sgw)
|
|||
{
|
||||
d_assert(sgw, return CORE_ERROR, "Null param");
|
||||
|
||||
gtp_xact_delete_all(&sgw->gnode);
|
||||
|
||||
list_remove(&self.sgw_list, sgw);
|
||||
pool_free_node(&mme_sgw_pool, sgw);
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ void mme_terminate(void)
|
|||
mme_s6a_final();
|
||||
|
||||
mme_context_final();
|
||||
|
||||
gtp_xact_final();
|
||||
}
|
||||
|
||||
void *THREAD_FUNC mme_sm_main(thread_id id, void *data)
|
||||
|
@ -86,7 +88,6 @@ void *THREAD_FUNC mme_sm_main(thread_id id, void *data)
|
|||
fsm_final(&mme_sm, 0);
|
||||
fsm_clear(&mme_sm);
|
||||
|
||||
gtp_xact_final();
|
||||
event_delete(mme_self()->queue_id);
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -88,11 +88,12 @@ status_t mme_s11_build_create_session_req(pkbuf_t **pkbuf, mme_esm_t *esm)
|
|||
req->pgw_s5_s8_address_for_control_plane_or_pmip.len = GTP_F_TEID_IPV4_LEN;
|
||||
|
||||
req->access_point_name.presence = 1;
|
||||
req->access_point_name.data = "cellwire.com";
|
||||
req->access_point_name.len = strlen(req->access_point_name.data);
|
||||
req->access_point_name.data = pdn->apn;
|
||||
req->access_point_name.len = strlen(pdn->apn);
|
||||
|
||||
req->selection_mode.presence = 1;
|
||||
req->selection_mode.u8 = GTP_SELECTION_MODE_MS_OR_NETWORK_PROVIDED_APN | 0xfc;
|
||||
req->selection_mode.u8 =
|
||||
GTP_SELECTION_MODE_MS_OR_NETWORK_PROVIDED_APN | 0xfc;
|
||||
|
||||
req->pdn_type.presence = 1;
|
||||
req->pdn_type.u8 = GTP_PDN_TYPE_IPV4;
|
||||
|
|
|
@ -46,6 +46,9 @@ status_t pgw_context_final()
|
|||
d_assert(context_initiaized == 1, return CORE_ERROR,
|
||||
"HyperCell context already has been finalized");
|
||||
|
||||
gtp_xact_delete_all(&self.s5c_node);
|
||||
pgw_sess_remove_all();
|
||||
|
||||
d_print("%d not freed in pgw_sess_pool[%d] in PGW-Context\n",
|
||||
index_size(&pgw_sess_pool) - pool_avail(&pgw_sess_pool),
|
||||
index_size(&pgw_sess_pool));
|
||||
|
|
|
@ -27,6 +27,8 @@ void pgw_terminate(void)
|
|||
thread_delete(pgw_sm_thread);
|
||||
|
||||
pgw_context_final();
|
||||
|
||||
gtp_xact_final();
|
||||
}
|
||||
|
||||
void *THREAD_FUNC pgw_sm_main(thread_id id, void *data)
|
||||
|
@ -79,7 +81,6 @@ void *THREAD_FUNC pgw_sm_main(thread_id id, void *data)
|
|||
fsm_final(&pgw_sm, 0);
|
||||
fsm_clear(&pgw_sm);
|
||||
|
||||
gtp_xact_final();
|
||||
event_delete(pgw_self()->queue_id);
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -54,6 +54,11 @@ status_t sgw_context_final()
|
|||
d_assert(context_initialized == 1, return CORE_ERROR,
|
||||
"HyperCell context already has been finalized");
|
||||
|
||||
gtp_xact_delete_all(&self.s11_node);
|
||||
gtp_xact_delete_all(&self.s5c_node);
|
||||
|
||||
sgw_sess_remove_all();
|
||||
|
||||
d_print("%d not freed in sgw_sess_pool[%d] in SGW-Context\n",
|
||||
index_size(&sgw_sess_pool) - pool_avail(&sgw_sess_pool),
|
||||
index_size(&sgw_sess_pool));
|
||||
|
|
|
@ -27,6 +27,8 @@ void sgw_terminate(void)
|
|||
thread_delete(sgw_sm_thread);
|
||||
|
||||
sgw_context_final();
|
||||
|
||||
gtp_xact_final();
|
||||
}
|
||||
|
||||
void *THREAD_FUNC sgw_sm_main(thread_id id, void *data)
|
||||
|
@ -79,7 +81,6 @@ void *THREAD_FUNC sgw_sm_main(thread_id id, void *data)
|
|||
fsm_final(&sgw_sm, 0);
|
||||
fsm_clear(&sgw_sm);
|
||||
|
||||
gtp_xact_final();
|
||||
event_delete(sgw_self()->queue_id);
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue