aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/bsc_vty.c30
-rw-r--r--src/osmo-bsc/osmo_bsc_main.c4
2 files changed, 34 insertions, 0 deletions
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 27e1bc697..5298644e6 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -2119,6 +2119,30 @@ DEFUN_HIDDEN(cfg_bts_tsc,
return CMD_SUCCESS;
}
+int warn_on_arfcn_bsic_collisions(struct gsm_network *net, struct vty *vty)
+{
+ struct gsm_bts *bts, *bts2;
+ int errors = 0;
+
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ struct neighbor_ident_key *nik = bts_ident_key(bts);
+
+ bts2 = bts_by_neighbor_ident(net, nik);
+ if (bts != bts2) {
+ LOGP(DHO, LOGL_ERROR, "CONFIG ERROR: Multiple BTS match %s: %d and %d\n",
+ neighbor_ident_key_name(nik), bts->nr, bts2->nr);
+ fprintf(stderr, "CONFIG ERROR: Multiple BTS match %s: %d and %d\n",
+ neighbor_ident_key_name(nik), bts->nr, bts2->nr);
+ if (vty)
+ vty_out(vty, "%% CONFIG ERROR: Multiple BTS match %s: %d and %d%s",
+ neighbor_ident_key_name(nik), bts->nr, bts2->nr,
+ VTY_NEWLINE);
+ errors ++;
+ }
+ }
+ return errors;
+}
+
DEFUN(cfg_bts_bsic,
cfg_bts_bsic_cmd,
"base_station_id_code <0-63>",
@@ -2135,6 +2159,9 @@ DEFUN(cfg_bts_bsic,
}
bts->bsic = bsic;
+ if (vty->type != VTY_FILE)
+ warn_on_arfcn_bsic_collisions(bts->network, vty);
+
return CMD_SUCCESS;
}
@@ -3884,6 +3911,9 @@ DEFUN(cfg_trx_arfcn,
/* FIXME: use OML layer to update the ARFCN */
/* FIXME: use RSL layer to update SYSTEM INFORMATION */
+ if (vty->type != VTY_FILE)
+ warn_on_arfcn_bsic_collisions(trx->bts->network, vty);
+
return CMD_SUCCESS;
}
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 69db32e55..c46d2fa9e 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -539,6 +539,8 @@ static int bsc_vty_go_parent(struct vty *vty)
vty->index = bts->network;
vty->index_sub = NULL;
}
+ if (vty->type != VTY_FILE)
+ warn_on_arfcn_bsic_collisions(bsc_gsmnet, vty);
break;
case TRX_NODE:
vty->node = BTS_NODE;
@@ -826,6 +828,8 @@ int main(int argc, char **argv)
fprintf(stderr, "Bootstrapping the network failed. exiting.\n");
exit(1);
}
+ if (warn_on_arfcn_bsic_collisions(bsc_gsmnet, NULL))
+ exit(1);
/* start control interface after reading config for
* ctrl_vty_get_bind_addr() */