aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libiu/iu.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libiu/iu.c')
-rw-r--r--openbsc/src/libiu/iu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c
index 20590766a..2a6196193 100644
--- a/openbsc/src/libiu/iu.c
+++ b/openbsc/src/libiu/iu.c
@@ -62,6 +62,21 @@ struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link,
return NULL;
}
+/* Discard/invalidate all ue_conn_ctx entries that reference the
+ * given link, since this link is invalid and about to be deallocated. For
+ * each ue_conn_ctx, invoke the iu_event_cb_t with IU_EVENT_LINK_INVALIDATED.
+ */
+void iu_link_del(struct osmo_sua_link *link)
+{
+ struct ue_conn_ctx *uec, *uec_next;
+ llist_for_each_entry_safe(uec, uec_next, &ue_conn_ctx_list, list) {
+ if (uec->link != link)
+ continue;
+ uec->link = NULL;
+ global_iu_event_cb(uec, IU_EVENT_LINK_INVALIDATED, NULL);
+ }
+}
+
/***********************************************************************
* RANAP handling
***********************************************************************/