summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-05-23 16:56:52 +0000
committerHarald Welte <laforge@gnumonks.org>2009-05-23 16:56:52 +0000
commit78f2f508e6d4560ccf52e2cd0a7d4b779aa34c2a (patch)
tree46655e8f6a58d1e6f8427e0e71477b9c18e25915 /src
parent110c0ab6c5d71375562f78caec2e565c25774b5a (diff)
Add user-configurable BSIC setting
Diffstat (limited to 'src')
-rw-r--r--src/bsc_hack.c4
-rw-r--r--src/gsm_data.c1
-rw-r--r--src/vty_interface.c23
3 files changed, 26 insertions, 2 deletions
diff --git a/src/bsc_hack.c b/src/bsc_hack.c
index 68080ce58..d4a477809 100644
--- a/src/bsc_hack.c
+++ b/src/bsc_hack.c
@@ -880,6 +880,10 @@ static void patch_tables(struct gsm_bts *bts)
/* patch Control Channel Description 10.5.2.11 */
type_3->control_channel_desc = bts->chan_desc;
+
+ /* patch BSIC */
+ msg_2[6] = bts->bsic;
+ nanobts_attr_bts[sizeof(nanobts_attr_bts)-1] = bts->bsic;
}
diff --git a/src/gsm_data.c b/src/gsm_data.c
index 78f976514..a78425f95 100644
--- a/src/gsm_data.c
+++ b/src/gsm_data.c
@@ -109,6 +109,7 @@ struct gsm_network *gsm_network_init(unsigned int num_bts, enum gsm_bts_type bts
bts->nr = i;
bts->type = bts_type;
bts->tsc = HARDCODED_TSC;
+ bts->bsic = HARDCODED_BSIC;
for (j = 0; j < BTS_MAX_TRX; j++) {
struct gsm_bts_trx *trx = &bts->trx[j];
diff --git a/src/vty_interface.c b/src/vty_interface.c
index 6ff3b0cdf..b63c77474 100644
--- a/src/vty_interface.c
+++ b/src/vty_interface.c
@@ -105,9 +105,9 @@ static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l)
static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
{
- vty_out(vty, "BTS %u is of %s type, has LAC %u, TSC %u and %u TRX%s",
+ vty_out(vty, "BTS %u is of %s type, has LAC %u, BSIC %u, TSC %u and %u TRX%s",
bts->nr, btstype2str(bts->type), bts->location_area_code,
- bts->tsc, bts->num_trx, VTY_NEWLINE);
+ bts->bsic, bts->tsc, bts->num_trx, VTY_NEWLINE);
if (is_ipaccess_bts(bts))
vty_out(vty, " Unit ID: %u/%u/0%s",
bts->ip_access.site_id, bts->ip_access.bts_id,
@@ -633,6 +633,25 @@ DEFUN(cfg_bts_tsc,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_bsic,
+ cfg_bts_bsic_cmd,
+ "base_station_id_code <0-63>",
+ "Set the Base Station Identity Code (BSIC) of this BTS\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int bsic = atoi(argv[0]);
+
+ if (bsic < 0 || bsic > 0x3f) {
+ vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s",
+ bsic, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ bts->bsic = bsic;
+
+ return CMD_SUCCESS;
+}
+
+
DEFUN(cfg_bts_unit_id,
cfg_bts_unit_id_cmd,
"unit_id <0-65534> <0-255>",