summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-10-23 15:07:48 +0330
committerVadim Yanitskiy <axilirator@gmail.com>2018-11-21 11:00:55 +0700
commit8fdf858d82616cc866f53b6cfb821fa5a35b1a12 (patch)
treee7f9eadd50db2e4066fd814c027bfd85cbe400ec
parentef83f5cb94b9cbf87becaf9ab8c2adff9d1925dd (diff)
mobile/vty: add a command to trigger LURfixeria/research
-rw-r--r--src/host/layer23/src/mobile/gsm48_mm.c4
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c23
2 files changed, 25 insertions, 2 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c
index 02d861e8..b0f91030 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -48,7 +48,7 @@ extern void *l23_ctx;
void mm_conn_free(struct gsm48_mm_conn *conn);
static int gsm48_rcv_rr(struct osmocom_ms *ms, struct msgb *msg);
static int gsm48_rcv_mmr(struct osmocom_ms *ms, struct msgb *msg);
-static int gsm48_mm_ev(struct osmocom_ms *ms, int msg_type, struct msgb *msg);
+int gsm48_mm_ev(struct osmocom_ms *ms, int msg_type, struct msgb *msg);
static int gsm48_mm_tx_id_rsp(struct osmocom_ms *ms, uint8_t mi_type);
static int gsm48_mm_tx_loc_upd_req(struct osmocom_ms *ms);
static int gsm48_mm_loc_upd_failed(struct osmocom_ms *ms, struct msgb *msg);
@@ -4300,7 +4300,7 @@ static struct eventstate {
#define EVENTSLLEN \
(sizeof(eventstatelist) / sizeof(struct eventstate))
-static int gsm48_mm_ev(struct osmocom_ms *ms, int msg_type, struct msgb *msg)
+int gsm48_mm_ev(struct osmocom_ms *ms, int msg_type, struct msgb *msg)
{
struct gsm48_mmlayer *mm = &ms->mmlayer;
int i, rc;
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 171a47ce..d5d5295a 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -1079,6 +1079,28 @@ DEFUN(test_reselection, test_reselection_cmd, "test re-selection NAME",
return CMD_SUCCESS;
}
+DEFUN(test_lur, test_lur_cmd, "test location-update NAME",
+ "Manually trigger Location Update procedure\n"
+ "Name of MS (see \"show ms\")")
+{
+ struct osmocom_ms *ms;
+ struct gsm48_mmlayer *mm;
+
+ ms = get_ms(argv[0], vty);
+ if (!ms)
+ return CMD_WARNING;
+
+ /* Reset attempt counter when attempting to update (4.4.4.5) */
+ mm = &ms->mmlayer;
+ if (mm->state == GSM48_MM_ST_MM_IDLE
+ && mm->substate == GSM48_MM_SST_ATTEMPT_UPDATE)
+ mm->lupd_attempt = 0;
+
+ gsm48_mm_ev(ms, GSM48_MM_EVENT_TIMEOUT_T3212, NULL);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(delete_forbidden_plmn, delete_forbidden_plmn_cmd,
"delete forbidden plmn NAME MCC MNC",
"Delete\nForbidden\nplmn\nName of MS (see \"show ms\")\n"
@@ -2939,6 +2961,7 @@ int ms_vty_init(void)
install_element(ENABLE_NODE, &sms_cmd);
install_element(ENABLE_NODE, &service_cmd);
install_element(ENABLE_NODE, &test_reselection_cmd);
+ install_element(ENABLE_NODE, &test_lur_cmd);
install_element(ENABLE_NODE, &delete_forbidden_plmn_cmd);
install_element(ENABLE_NODE, &clone_tsmi_cmd);
install_element(ENABLE_NODE, &clone_imsi_cmd);