aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2018-02-15 10:33:26 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-16 08:09:33 +0000
commit4e825b6a68090b472ffed4c14153e38132e48b6c (patch)
treeca7217d434048fc190435c8fd14dbde127be6d85 /src
parent6fbd3bf732d4676ebb50718b198e20c4ed273f50 (diff)
libmsc: Add a function to return a unique ID of the subscriber conn
The ID will include the type of connection (GERAN_A, UTRAN_IU) followed by the SCCP conn_id. This can be used for the fsm instance ID before we know the IMSI. Change-Id: I4b875772e3994ad3458ee60dbf880604486d9afd
Diffstat (limited to 'src')
-rw-r--r--src/libmsc/subscr_conn.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c
index 124e46bfa..512f5128e 100644
--- a/src/libmsc/subscr_conn.c
+++ b/src/libmsc/subscr_conn.c
@@ -31,6 +31,7 @@
#include <osmocom/msc/transaction.h>
#include <osmocom/msc/signal.h>
#include <osmocom/msc/a_iface.h>
+#include <osmocom/msc/iucs.h>
#define SUBSCR_CONN_TIMEOUT 5 /* seconds */
@@ -303,6 +304,25 @@ static struct osmo_fsm subscr_conn_fsm = {
.timer_cb = subscr_conn_fsm_timeout,
};
+char *msc_subscr_conn_get_conn_id(struct gsm_subscriber_connection *conn)
+{
+ char *id;
+
+ switch (conn->via_ran) {
+ case RAN_GERAN_A:
+ id = talloc_asprintf(conn, "GERAN_A-%08x", conn->a.conn_id);
+ break;
+ case RAN_UTRAN_IU:
+ id = talloc_asprintf(conn, "UTRAN_IU-%08x", iu_get_conn_id(conn->iu.ue_ctx));
+ break;
+ default:
+ LOGP(DMM, LOGL_ERROR, "RAN of conn %p unknown!\n", conn);
+ return NULL;
+ }
+
+ return id;
+}
+
int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id)
{
struct osmo_fsm_inst *fi;