summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-10-23 12:03:27 +0330
committerVadim Yanitskiy <axilirator@gmail.com>2018-11-21 11:00:55 +0700
commitef83f5cb94b9cbf87becaf9ab8c2adff9d1925dd (patch)
tree3b5f29d85d3a6f88fe4bb4247501e8d352d2d27e
parent1fda9312f4bb0fda2a968ca58196dbca11f8941a (diff)
mobile/vty: add Key Sequence number change command
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 7e59c5c..171a47c 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -486,6 +486,29 @@ DEFUN(clone_imsi, clone_imsi_cmd, "clone imsi MS_NAME [IMSI]",
return CMD_SUCCESS;
}
+DEFUN(clone_kc_num, clone_kc_num_cmd, "clone kc_num MS_NAME NUM",
+ "Spoof mobile identity\n"
+ "Change current Key Sequence number\n"
+ "Name of MS (see \"show ms\")\n"
+ "Key Sequence number")
+{
+ uint8_t kc_num = 0;
+ struct osmocom_ms *ms;
+
+ ms = get_ms(argv[0], vty);
+ if (!ms)
+ return CMD_WARNING;
+
+ if (argc >= 2)
+ kc_num = strtoul(argv[1], NULL, 10);
+
+ ms->subscr.key_seq = kc_num;
+ vty_out(vty, "Forced to use the following "
+ "Key Sequence number: %u%s", kc_num, VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(monitor_network, monitor_network_cmd, "monitor network MS_NAME",
"Monitor...\nMonitor network information\nName of MS (see \"show ms\")")
{
@@ -2919,6 +2942,7 @@ int ms_vty_init(void)
install_element(ENABLE_NODE, &delete_forbidden_plmn_cmd);
install_element(ENABLE_NODE, &clone_tsmi_cmd);
install_element(ENABLE_NODE, &clone_imsi_cmd);
+ install_element(ENABLE_NODE, &clone_kc_num_cmd);
#ifdef _HAVE_GPSD
install_element(CONFIG_NODE, &cfg_gps_host_cmd);