aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r--openbsc/src/osmo-bsc/Makefile.am4
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_api.c2
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_bssap.c2
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_ctrl.c27
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_filter.c15
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_main.c10
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_sccp.c4
7 files changed, 40 insertions, 24 deletions
diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am
index 69b363b45..b17baed6d 100644
--- a/openbsc/src/osmo-bsc/Makefile.am
+++ b/openbsc/src/osmo-bsc/Makefile.am
@@ -12,11 +12,9 @@ osmo_bsc_SOURCES = osmo_bsc_main.c osmo_bsc_vty.c osmo_bsc_api.c \
osmo_bsc_LDADD = \
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libbsc/libbsc.a \
- $(top_builddir)/src/libmsc/libmsc.a \
- $(top_builddir)/src/libbsc/libbsc.a \
+ $(top_builddir)/src/libxsc/libxsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a \
- $(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOSCCP_LIBS) $(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOCTRL_LIBS) \
$(COVERAGE_LDFLAGS) $(LIBOSMOABIS_LIBS)
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c
index d31e6c152..bf5db5a76 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_api.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c
@@ -330,7 +330,7 @@ static int move_to_msc(struct gsm_subscriber_connection *_conn,
_conn->sccp_con = NULL;
if (complete_layer3(_conn, msg, msc) != BSC_API_CONN_POL_ACCEPT) {
gsm0808_clear(_conn);
- subscr_con_free(_conn);
+ bsc_subscr_con_free(_conn);
return 1;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
index a60940d22..f38c97f19 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_bssap.c
@@ -185,7 +185,7 @@ static int bssmap_handle_clear_command(struct osmo_bsc_sccp_con *conn,
if (conn->conn) {
LOGP(DMSC, LOGL_INFO, "Releasing all transactions on %p\n", conn);
gsm0808_clear(conn->conn);
- subscr_con_free(conn->conn);
+ bsc_subscr_con_free(conn->conn);
conn->conn = NULL;
}
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 72f80edb7..4221e5917 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -371,9 +371,10 @@ static int get_bts_timezone(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_ERROR;
}
- if (bts->tz.override)
+ struct gsm_tz *tz = &bts->network->tz;
+ if (tz->override)
cmd->reply = talloc_asprintf(cmd, "%d,%d,%d",
- bts->tz.hr, bts->tz.mn, bts->tz.dst);
+ tz->hr, tz->mn, tz->dst);
else
cmd->reply = talloc_asprintf(cmd, "off");
@@ -385,8 +386,19 @@ static int get_bts_timezone(struct ctrl_cmd *cmd, void *data)
return CTRL_CMD_REPLY;
}
+/* Note: it may appear that set_bts_timezone() is never used, but is in in fact
+ * used by CTRL_CMD_DEFINE(bts_timezone, "timezone"); above. */
static int set_bts_timezone(struct ctrl_cmd *cmd, void *data)
{
+ /* FIXME: in the course of MSCSPLIT, the osmo CN no longer has access
+ * to the BTS structs, and hence the timezone override was moved to the
+ * network level. It does of course still make sense to allow adjusting
+ * the timezone per BTS in osmo-bsc. This function currently modifies
+ * the global timezone data on network level, thus having an effect on
+ * all other BTSs at the same time. I'm doing it this way because I'm
+ * focusing on IuCS and the MSCSPLIT and hope to do this properly
+ * at a later time. Sorry about that... ~Neels */
+
char *saveptr, *hourstr, *minstr, *dststr, *tmp = 0;
int override;
struct gsm_bts *bts = (struct gsm_bts *) cmd->node;
@@ -409,12 +421,13 @@ static int set_bts_timezone(struct ctrl_cmd *cmd, void *data)
if (hourstr != NULL)
override = strcasecmp(hourstr, "off") != 0;
- bts->tz.override = override;
+ struct gsm_tz *tz = &bts->network->tz;
+ tz->override = override;
if (override) {
- bts->tz.hr = hourstr ? atol(hourstr) : 0;
- bts->tz.mn = minstr ? atol(minstr) : 0;
- bts->tz.dst = dststr ? atol(dststr) : 0;
+ tz->hr = hourstr ? atol(hourstr) : 0;
+ tz->mn = minstr ? atol(minstr) : 0;
+ tz->dst = dststr ? atol(dststr) : 0;
}
talloc_free(tmp);
@@ -583,7 +596,7 @@ static int set_net_ussd_notify(struct ctrl_cmd *cmd, void *data)
alert = atoi(alert_str);
net = cmd->node;
- llist_for_each_entry(conn, bsc_api_sub_connections(net), entry) {
+ llist_for_each_entry(conn, &net->subscr_conns, entry) {
if (!conn->sccp_con)
continue;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
index 14e0b7144..9d7a5ca5e 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
@@ -270,23 +270,24 @@ static int bsc_patch_mm_info(struct gsm_subscriber_connection *conn,
return 0;
/* Is TZ patching enabled? */
- if (!bts->tz.override)
+ struct gsm_tz *tz = &bts->network->tz;
+ if (!tz->override)
return 0;
/* Convert tz.hr and tz.mn to units */
- if (bts->tz.hr < 0) {
- tzunits = -bts->tz.hr*4;
+ if (tz->hr < 0) {
+ tzunits = -tz->hr*4;
tzbsd |= 0x08;
} else
- tzunits = bts->tz.hr*4;
+ tzunits = tz->hr*4;
- tzunits = tzunits + (bts->tz.mn/15);
+ tzunits = tzunits + (tz->mn/15);
tzbsd |= (tzunits % 10)*0x10 + (tzunits / 10);
/* Convert DST value */
- if (bts->tz.dst >= 0 && bts->tz.dst <= 2)
- dst = bts->tz.dst;
+ if (tz->dst >= 0 && tz->dst <= 2)
+ dst = tz->dst;
if (TLVP_PRESENT(&tp, GSM48_IE_UTC)) {
LOGP(DMSC, LOGL_DEBUG,
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c
index 3594a5b5a..c23af1436 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_main.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c
@@ -204,7 +204,7 @@ int main(int argc, char **argv)
/* This needs to precede handle_options() */
vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
- bsc_vty_init(&log_info);
+ bsc_vty_init(&log_info, bsc_gsmnet);
bsc_msg_lst_vty_init(tall_bsc_ctx, &access_lists, BSC_NODE);
ctrl_vty_init(tall_bsc_ctx);
@@ -219,8 +219,12 @@ int main(int argc, char **argv)
/* initialize SCCP */
sccp_set_log_area(DSCCP);
-
- rc = bsc_bootstrap_network(NULL, config_file);
+ rc = bsc_network_init(NULL);
+ if (rc) {
+ fprintf(stderr, "Allocation failed. exiting.\n");
+ exit(1);
+ }
+ rc = bsc_network_configure(config_file);
if (rc < 0) {
fprintf(stderr, "Bootstrapping the network failed. exiting.\n");
exit(1);
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 33c737f52..01af3d904 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -84,7 +84,7 @@ static void msc_outgoing_sccp_state(struct sccp_connection *conn, int old_state)
LOGP(DMSC, LOGL_ERROR,
"ERROR: The lchan is still associated.\n");
gsm0808_clear(con_data->conn);
- subscr_con_free(con_data->conn);
+ bsc_subscr_con_free(con_data->conn);
con_data->conn = NULL;
}
@@ -107,7 +107,7 @@ static void bsc_sccp_force_free(struct osmo_bsc_sccp_con *data)
{
if (data->conn) {
gsm0808_clear(data->conn);
- subscr_con_free(data->conn);
+ bsc_subscr_con_free(data->conn);
data->conn = NULL;
}