aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsup_router.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-04-04 12:00:24 +0200
committerOliver Smith <osmith@sysmocom.de>2019-04-09 13:42:26 +0200
commit95abc2be17f06b28225e19c198340d14d7848c47 (patch)
tree806d821bd90dea8bcf1fd3e7610687bd8e964e97 /src/gsup_router.c
parentf1fe94c8cae5591dff4dd77e74c4c2f09638d6a1 (diff)
USSD: save MO USSD's originating MSC's vlr_number
Save the source IPA name in ss_session, so we can send "invalid IMSI" messages to the originating MSC. Remove the fixed size from ss->vlr_number (we don't know the size of the IPA name when it does not come from the database). Add ss->vlr_number_len to give osmo_gsup_addr_send() the format it expects, and to have one less place in the code where the IPA names are not stored as blob. Looking up the IPA name from struct osmo_gsup_conn could either be done like in osmo_gsup_server_ccm_cb() by reading the IPA IEs (which has a FIXME comment), or by finding the route associated with conn. I went with the latter approach, because it seems cleaner to me. Related: OS#3710 Change-Id: If5a65f471672949192061c5fe396603611123bc1
Diffstat (limited to 'src/gsup_router.c')
-rw-r--r--src/gsup_router.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/gsup_router.c b/src/gsup_router.c
index 4fedd38..df978ba 100644
--- a/src/gsup_router.c
+++ b/src/gsup_router.c
@@ -25,13 +25,7 @@
#include "logging.h"
#include "gsup_server.h"
-
-struct gsup_route {
- struct llist_head list;
-
- uint8_t *addr;
- struct osmo_gsup_conn *conn;
-};
+#include "gsup_router.h"
/*! Find a route for the given address.
* \param[in] gs gsup server
@@ -53,6 +47,22 @@ struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs,
return NULL;
}
+/*! Find a GSUP connection's route (to read the IPA address from the route).
+ * \param[in] conn GSUP connection
+ * \return GSUP route
+ */
+struct gsup_route *gsup_route_find_by_conn(const struct osmo_gsup_conn *conn)
+{
+ struct gsup_route *gr;
+
+ llist_for_each_entry(gr, &conn->server->routes, list) {
+ if (gr->conn == conn)
+ return gr;
+ }
+
+ return NULL;
+}
+
/* add a new route for the given address to the given conn */
int gsup_route_add(struct osmo_gsup_conn *conn, const uint8_t *addr, size_t addrlen)
{