aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-msc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/osmo-msc')
-rw-r--r--openbsc/src/osmo-msc/iucs_ranap.c17
-rw-r--r--openbsc/src/osmo-msc/msc_main.c31
2 files changed, 17 insertions, 31 deletions
diff --git a/openbsc/src/osmo-msc/iucs_ranap.c b/openbsc/src/osmo-msc/iucs_ranap.c
index 34f5bfe59..09b81489b 100644
--- a/openbsc/src/osmo-msc/iucs_ranap.c
+++ b/openbsc/src/osmo-msc/iucs_ranap.c
@@ -30,6 +30,7 @@
#include <openbsc/gsm_subscriber.h>
#include <openbsc/iu.h>
#include <openbsc/iucs.h>
+#include <openbsc/vlr.h>
#include "iucs_ranap.h"
@@ -44,9 +45,9 @@ static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn,
rab_id = item->rAB_ID.buf[0];
- LOGP(DIUCS, LOGL_NOTICE, "Received RAB assignment event for %s"
- " rab_id=%hhd\n", subscr_name(conn->subscr), rab_id);
- /* TODO do stuff like in sgsn_ranap_rab_ass_resp() */
+ LOGP(DIUCS, LOGL_NOTICE,
+ "Received RAB assignment event for %s rab_id=%hhd\n",
+ vlr_subscr_name(conn->vsub), rab_id);
return 0;
}
@@ -56,13 +57,13 @@ int iucs_rx_sec_mode_compl(struct gsm_subscriber_connection *conn,
{
gsm_cbfn *cb;
- OSMO_ASSERT(conn->via_iface == IFACE_IU);
+ OSMO_ASSERT(conn->via_ran == RAN_UTRAN_IU);
if (!conn->sec_operation) {
LOGP(DIUCS, LOGL_ERROR,
"Received Security Mode Complete message, but no"
" authentication/cipher operation in progress"
- " for subscr %s\n", subscr_name(conn->subscr));
+ " for subscr %s\n", vlr_subscr_name(conn->vsub));
return -EINVAL;
}
@@ -71,7 +72,7 @@ int iucs_rx_sec_mode_compl(struct gsm_subscriber_connection *conn,
if (conn->iu.integrity_protection)
LOGP(DIUCS, LOGL_NOTICE, "Integrity Protection"
" was already enabled for %s\n",
- subscr_name(conn->subscr));
+ vlr_subscr_name(conn->vsub));
conn->iu.integrity_protection = INTEGRITY_PROTECTION_IK;
@@ -99,13 +100,13 @@ int iucs_rx_ranap_event(struct gsm_network *network,
case IU_EVENT_IU_RELEASE:
case IU_EVENT_LINK_INVALIDATED:
LOGP(DIUCS, LOGL_INFO, "IuCS release for %s\n",
- subscr_name(conn->subscr));
+ vlr_subscr_name(conn->vsub));
gsm0408_clear_request(conn, 0);
return 0;
case IU_EVENT_SECURITY_MODE_COMPLETE:
LOGP(DIUCS, LOGL_INFO, "IuCS security mode complete for %s\n",
- subscr_name(conn->subscr));
+ vlr_subscr_name(conn->vsub));
return iucs_rx_sec_mode_compl(conn,
(RANAP_SecurityModeCompleteIEs_t*)data);
case IU_EVENT_RAB_ASSIGN:
diff --git a/openbsc/src/osmo-msc/msc_main.c b/openbsc/src/osmo-msc/msc_main.c
index 9d3efd702..f4b3b363b 100644
--- a/openbsc/src/osmo-msc/msc_main.c
+++ b/openbsc/src/osmo-msc/msc_main.c
@@ -260,10 +260,6 @@ void msc_network_shutdown(struct gsm_network *net)
static struct gsm_network *msc_network = NULL;
-/* TODO this is here to satisfy linking during intermediate development. Once
- * libbsc is not linked to osmo-msc, this should go away. */
-struct gsm_network *bsc_gsmnet = NULL;
-
extern void *tall_vty_ctx;
static void signal_handler(int signal)
{
@@ -305,12 +301,6 @@ static void db_sync_timer_cb(void *data)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
}
-static void subscr_expire_cb(void *data)
-{
- /* TODO expire vlr_subscrs? */
- osmo_timer_schedule(&bsc_gsmnet->subscr_expire_timer, EXPIRE_INTERVAL);
-}
-
extern int bsc_vty_go_parent(struct vty *vty);
static struct vty_app_info msc_vty_info = {
@@ -370,6 +360,11 @@ int main(int argc, char **argv)
if (!msc_network)
return -ENOMEM;
+ if (msc_vlr_alloc(msc_network)) {
+ fprintf(stderr, "Failed to allocate VLR\n");
+ exit(1);
+ }
+
ctrl_vty_init(tall_msc_ctx);
logging_vty_add_cmds(&log_info);
msc_vty_init(msc_network);
@@ -426,7 +421,7 @@ int main(int argc, char **argv)
* A third-party MSC may well be able to handle a TCH/H TCH/F
* mismatch.
*/
- bsc_gsmnet->dyn_ts_allow_tch_f = false;
+ msc_network->dyn_ts_allow_tch_f = false;
/* start control interface after reading config for
* ctrl_vty_get_bind_addr() */
@@ -448,7 +443,7 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
#endif
#if 0
- if (msc_ctrl_cmds_install(bsc_gsmnet) != 0) {
+ if (msc_ctrl_cmds_install(msc_network) != 0) {
printf("Failed to initialize the MSC control commands.\n");
return -1;
}
@@ -466,19 +461,13 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
}
osmo_fsm_log_addr(true);
- if (msc_vlr_start(bsc_gsmnet)) {
+ if (msc_vlr_start(msc_network)) {
fprintf(stderr, "Failed to start VLR\n");
exit(1);
}
msc_subscr_conn_init();
- if (db_init(database_name)) {
- printf("DB: Failed to init database. Please check the option settings.\n");
- return -1;
- }
- printf("DB: Database initialized.\n");
-
if (db_prepare()) {
printf("DB: Failed to prepare database.\n");
return 5;
@@ -489,10 +478,6 @@ TODO: we probably want some of the _net_ ctrl commands from bsc_base_ctrl_cmds_i
if (msc_cmdline_config.use_db_counter)
osmo_timer_schedule(&db_sync_timer, DB_SYNC_INTERVAL);
- msc_network->subscr_expire_timer.cb = subscr_expire_cb;
- msc_network->subscr_expire_timer.data = NULL;
- osmo_timer_schedule(&msc_network->subscr_expire_timer, EXPIRE_INTERVAL);
-
signal(SIGINT, &signal_handler);
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);