From 1c1ffd1af2d9dc7c078f45d995aad3c5bb6e6f8e Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 23 Oct 2017 15:07:48 +0330 Subject: mobile/vty: add a command to trigger LUR Change-Id: I98ff3fb2611785a897723ea1edca8d8b4b3b5ec2 --- src/host/layer23/src/mobile/gsm48_mm.c | 4 ++-- src/host/layer23/src/mobile/vty_interface.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'src/host/layer23/src/mobile') diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index 49cc2bc6..adea05db 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); @@ -4295,7 +4295,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 52f914b0..05472314 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1081,6 +1081,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" @@ -2986,6 +3008,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); -- cgit v1.2.3