aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libxsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-14 03:24:41 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-11-12 15:50:36 +0100
commit00774fe702ce437e578021f3edf49cec305f7aa4 (patch)
tree84fe418a67b40fe9abc73c00de45e06d98e8aa6d /openbsc/src/libxsc
parentc9fd1d8ba19aa39cfeffc73eeb8ca19c28c2095f (diff)
move to libxsc: net timezone VTY config
Leave the timezone VTY output in libbsc's config_write_net(), until the BSC/MSC separation of struct gsm_network is completed. Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20
Diffstat (limited to 'openbsc/src/libxsc')
-rw-r--r--openbsc/src/libxsc/xsc_vty.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/openbsc/src/libxsc/xsc_vty.c b/openbsc/src/libxsc/xsc_vty.c
index 1564b360a..0b22f0967 100644
--- a/openbsc/src/libxsc/xsc_vty.c
+++ b/openbsc/src/libxsc/xsc_vty.c
@@ -208,6 +208,67 @@ DEFUN(cfg_net_subscr_keep,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_timezone,
+ cfg_net_timezone_cmd,
+ "timezone <-19-19> (0|15|30|45)",
+ "Set the Timezone Offset of the network\n"
+ "Timezone offset (hours)\n"
+ "Timezone offset (00 minutes)\n"
+ "Timezone offset (15 minutes)\n"
+ "Timezone offset (30 minutes)\n"
+ "Timezone offset (45 minutes)\n"
+ )
+{
+ struct gsm_network *net = vty->index;
+ int tzhr = atoi(argv[0]);
+ int tzmn = atoi(argv[1]);
+
+ net->tz.hr = tzhr;
+ net->tz.mn = tzmn;
+ net->tz.dst = 0;
+ net->tz.override = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_timezone_dst,
+ cfg_net_timezone_dst_cmd,
+ "timezone <-19-19> (0|15|30|45) <0-2>",
+ "Set the Timezone Offset of the network\n"
+ "Timezone offset (hours)\n"
+ "Timezone offset (00 minutes)\n"
+ "Timezone offset (15 minutes)\n"
+ "Timezone offset (30 minutes)\n"
+ "Timezone offset (45 minutes)\n"
+ "DST offset (hours)\n"
+ )
+{
+ struct gsm_network *net = vty->index;
+ int tzhr = atoi(argv[0]);
+ int tzmn = atoi(argv[1]);
+ int tzdst = atoi(argv[2]);
+
+ net->tz.hr = tzhr;
+ net->tz.mn = tzmn;
+ net->tz.dst = tzdst;
+ net->tz.override = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_no_timezone,
+ cfg_net_no_timezone_cmd,
+ "no timezone",
+ NO_STR
+ "Disable network timezone override, use system tz\n")
+{
+ struct gsm_network *net = vty->index;
+
+ net->tz.override = 0;
+
+ return CMD_SUCCESS;
+}
+
static struct gsm_network *vty_global_gsm_network = NULL;
/* initialize VTY elements used in both BSC and MSC */
@@ -231,6 +292,9 @@ int xsc_vty_init(struct gsm_network *network,
install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
install_element(GSMNET_NODE, &cfg_net_mm_info_cmd);
install_element(GSMNET_NODE, &cfg_net_subscr_keep_cmd);
+ install_element(GSMNET_NODE, &cfg_net_timezone_cmd);
+ install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd);
+ install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd);
return CMD_SUCCESS;
}