This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-iuh/+/15473 )
Change subject: iu_client: introduce ranap_iu_tx_release_free()
......................................................................
iu_client: introduce ranap_iu_tx_release_free()
ranap_iu_tx_release_free is a fire and forget function to release
gracefully if possible. It first sends a Iu Release Command. After
a certain timeout the connection will be released.
Change-Id: I349e2c61ba0131e233b7ab927dfced0bd461dd8f
---
M TODO-RELEASE
M include/osmocom/ranap/iu_client.h
M src/iu_client.c
3 files changed, 28 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 41d04bc..bcbf5de 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,4 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libranap iu_client.h struct ranap_ue_conn_ctx: add field notification
+libranap iu_client.h struct ranap_ue_conn_ctx: add field release_timeout
diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h
index b388529..a93fff3 100644
--- a/include/osmocom/ranap/iu_client.h
+++ b/include/osmocom/ranap/iu_client.h
@@ -31,6 +31,8 @@
struct gprs_ra_id ra_id;
enum ranap_nsap_addr_enc rab_assign_addr_enc;
bool notification; /* send notification to the upstream user */
+ /* Will be set when the Iu Release Command has been sent */
+ struct osmo_timer_list release_timeout;
};
enum ranap_iu_event_type {
@@ -71,6 +73,13 @@
int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi);
int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause);
+/* transmit a Iu Release Command and free the ctx afterwards.
+ * If a Release Complete is not received within timeout s,
+ * release the SCCP connection. */
+void ranap_iu_tx_release_free(struct ranap_ue_conn_ctx *ctx,
+ const struct RANAP_Cause *cause,
+ int timeout);
+
/* freeing the UE will release all resources
* This will close the SCCP connection connected to the UE */
void ranap_iu_free_ue(struct ranap_ue_conn_ctx *ue_ctx);
diff --git a/src/iu_client.c b/src/iu_client.c
index 38c8a1d..e4eb83e 100644
--- a/src/iu_client.c
+++ b/src/iu_client.c
@@ -129,6 +129,9 @@
ctx->rnc = rnc;
ctx->conn_id = conn_id;
ctx->notification = true;
+ osmo_timer_setup(&ctx->release_timeout,
+ (void *)(void *) ranap_iu_free_ue,
+ ctx);
llist_add(&ctx->list, &ue_conn_ctx_list);
return ctx;
@@ -150,6 +153,7 @@
if (!ue_ctx)
return;
+ osmo_timer_del(&ue_ctx->release_timeout);
osmo_sccp_tx_disconn(g_scu, ue_ctx->conn_id, NULL, 0);
llist_del(&ue_ctx->list);
talloc_free(ue_ctx);
@@ -491,6 +495,20 @@
return osmo_sccp_user_sap_down(g_scu, &prim->oph);
}
+void ranap_iu_tx_release_free(struct ranap_ue_conn_ctx *ctx,
+ const struct RANAP_Cause *cause,
+ int timeout)
+{
+ ctx->notification = false;
+ int ret = ranap_iu_tx_release(ctx, cause);
+ if (ret) {
+ ranap_iu_free_ue(ctx);
+ return;
+ }
+
+ osmo_timer_schedule(&ctx->release_timeout, timeout, 0);
+}
+
static int ranap_handle_co_iu_rel_req(struct ranap_ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies)
{
LOGPIU(LOGL_INFO, "Received Iu Release Request, Sending Release Command\n");
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/15473
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I349e2c61ba0131e233b7ab927dfced0bd461dd8f
Gerrit-Change-Number: 15473
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190916/d2bc1f7a/attachment.htm>