lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-iuh/+/38947?usp=email )
Change subject: iu_client: add a new event NEW_LAC_RAC ......................................................................
iu_client: add a new event NEW_LAC_RAC
When the IU client learns a new LAC/RAC or the LAC/RAC has moved from one RNC to another RNC, inform the user via an event.
Allows the SGSN to track RACs which uses Iu.
Change-Id: I8b1b8c58bf72b00e2705ca87a89a91481bac3470 --- M include/osmocom/ranap/iu_client.h M src/iu_client.c 2 files changed, 21 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/47/38947/1
diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h index e2bf8a9..1588b08 100644 --- a/include/osmocom/ranap/iu_client.h +++ b/include/osmocom/ranap/iu_client.h @@ -37,11 +37,17 @@ struct osmo_timer_list release_timeout; };
+struct ranap_iu_event_new_lac_rac { + const struct osmo_rnc_id *rnc_id; + const struct osmo_routing_area_id *rai; +}; + enum ranap_iu_event_type { RANAP_IU_EVENT_RAB_ASSIGN, RANAP_IU_EVENT_SECURITY_MODE_COMPLETE, RANAP_IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ RANAP_IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ + RANAP_IU_EVENT_NEW_LAC_RAC, /* Either a new LAC/RAC has been detected */ };
extern const struct value_string ranap_iu_event_type_names[]; diff --git a/src/iu_client.c b/src/iu_client.c index 75c7640..c30c237 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -112,6 +112,7 @@ OSMO_VALUE_STRING(RANAP_IU_EVENT_SECURITY_MODE_COMPLETE), OSMO_VALUE_STRING(RANAP_IU_EVENT_IU_RELEASE), OSMO_VALUE_STRING(RANAP_IU_EVENT_LINK_INVALIDATED), + OSMO_VALUE_STRING(RANAP_IU_EVENT_NEW_LAC_RAC), { 0, NULL } };
@@ -122,7 +123,7 @@ if (!global_iu_event_cb) return 0;
- if (!ue_ctx->notification) + if (ue_ctx && !ue_ctx->notification) return 0;
LOGPIU(LOGL_DEBUG, "Submit Iu event to upper layer: %s\n", ranap_iu_event_type_str(type)); @@ -130,6 +131,17 @@ return global_iu_event_cb(ue_ctx, type, data); }
+static void global_iu_event_new_rac(const struct osmo_rnc_id *rnc_id, const struct osmo_routing_area_id *rai) +{ + struct ranap_iu_event_new_lac_rac new_lac_rac = (struct ranap_iu_event_new_lac_rac) { + .rnc_id = rnc_id, + .rai = rai, + }; + + global_iu_event(NULL, RANAP_IU_EVENT_NEW_LAC_RAC, &new_lac_rac); +} + + static void ue_conn_ctx_release_timeout_cb(void *ctx_) { struct ranap_ue_conn_ctx *ctx = (struct ranap_ue_conn_ctx *)ctx_; @@ -326,12 +338,14 @@
llist_del(&lre->entry); llist_add(&lre->entry, &rnc->lac_rac_list); + global_iu_event_new_rac(rnc_id, rai); } else if (!old_rnc) { /* LAC, RAC not recorded yet */ LOGPIU(LOGL_NOTICE, "RNC %s: new LAC/RAC %s\n", osmo_rnc_id_name(rnc_id), osmo_rai_name2(rai)); lre = talloc_zero(rnc, struct iu_lac_rac_entry); lre->rai = *rai; llist_add(&lre->entry, &rnc->lac_rac_list); + global_iu_event_new_rac(rnc_id, rai); } /* else, LAC,RAC already recorded with the current RNC. */