aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_vty.c
diff options
context:
space:
mode:
authorGus Bourg <gus@bourg.net>2011-12-02 10:18:17 +0100
committerHarald Welte <laforge@gnumonks.org>2011-12-02 10:18:17 +0100
commit1c5dd2c9bbc26902cdad0487e090e97e983b0787 (patch)
tree0d9fec784cb5d1a06c49f18b7561131895fd9c04 /openbsc/src/libbsc/bsc_vty.c
parent6b8a56c365baa65119cc9bc827b971f2362b12a0 (diff)
Add NITZ (timezone) support as part of MM INFO
The UTC offset from the operating system will be used by default to calculate the NITZ in MM INFO. However, a "timezone" vty command is added at the BTS level, allowing BTS-specific overrides, e.g. in case BTSs are distributed accross multiple timezones.
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r--openbsc/src/libbsc/bsc_vty.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 724486ff7..ed74397ec 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -448,6 +448,8 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
VTY_NEWLINE);
vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE);
vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE);
+ if (bts->tz_bts_specific != 0)
+ vty_out(vty, " timezone %d %d%s", bts->tzhr, bts->tzmn, VTY_NEWLINE);
vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE);
vty_out(vty, " cell reselection hysteresis %u%s",
bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE);
@@ -1495,6 +1497,31 @@ DEFUN(cfg_bts_bsic,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_timezone,
+ cfg_bts_timezone_cmd,
+ "timezone <-19-19> (0|15|30|45)",
+ "Set the Timezone Offset of this BTS\n")
+{
+ struct gsm_bts *bts = vty->index;
+ int tzhr = atoi(argv[0]);
+ int tzmn = atoi(argv[1]);
+
+ bts->tzhr = tzhr;
+ bts->tzmn = tzmn;
+ bts->tz_bts_specific=1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_timezone,
+ cfg_bts_no_timezone_cmd,
+ "no timezone",
+ "disable bts specific timezone\n")
+{
+ struct gsm_bts *bts = vty->index;
+ bts->tz_bts_specific=0;
+ return CMD_SUCCESS;
+}
DEFUN(cfg_bts_unit_id,
cfg_bts_unit_id_cmd,
@@ -2691,6 +2718,8 @@ int bsc_vty_init(const struct log_info *cat)
install_element(BTS_NODE, &cfg_bts_tsc_cmd);
install_element(BTS_NODE, &cfg_bts_bsic_cmd);
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
+ install_element(BTS_NODE, &cfg_bts_timezone_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_timezone_cmd);
install_element(BTS_NODE, &cfg_bts_serno_cmd);
install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd);
install_element(BTS_NODE, &cfg_bts_stream_id_cmd);