summaryrefslogtreecommitdiffstats
path: root/src/host/layer23
diff options
context:
space:
mode:
authorAndreas.Eversberg2010-07-17 14:43:53 +0200
committerAndreas.Eversberg2010-07-17 14:43:53 +0200
commit0f184d1dfef64ee33a2908c9a3b54aed96ed32ea (patch)
tree9e23f6f00c4c437d1d0e9c07718986ac4fdfac87 /src/host/layer23
parent[layer23] Fixed cell search process of automatic network selection (diff)
downloadosmocom-0f184d1dfef64ee33a2908c9a3b54aed96ed32ea.tar.gz
osmocom-0f184d1dfef64ee33a2908c9a3b54aed96ed32ea.tar.xz
osmocom-0f184d1dfef64ee33a2908c9a3b54aed96ed32ea.zip
[layer23] Option "no location-updating" to disabled location updating
The mobile will not transmit for location updating. All networks will be marked as "roaming not allowed", so search process continues.
Diffstat (limited to 'src/host/layer23')
-rw-r--r--src/host/layer23/include/osmocom/settings.h1
-rw-r--r--src/host/layer23/src/gsm48_mm.c17
-rw-r--r--src/host/layer23/src/vty_interface.c26
3 files changed, 41 insertions, 3 deletions
diff --git a/src/host/layer23/include/osmocom/settings.h b/src/host/layer23/include/osmocom/settings.h
index e44ee3f..be13d20 100644
--- a/src/host/layer23/include/osmocom/settings.h
+++ b/src/host/layer23/include/osmocom/settings.h
@@ -31,6 +31,7 @@ struct gsm_settings {
int8_t alter_delay;
uint8_t stick;
uint16_t stick_arfcn;
+ uint8_t no_lupd;
};
int gsm_settings_init(struct osmocom_ms *ms);
diff --git a/src/host/layer23/src/gsm48_mm.c b/src/host/layer23/src/gsm48_mm.c
index 605fc4f..82d09a7 100644
--- a/src/host/layer23/src/gsm48_mm.c
+++ b/src/host/layer23/src/gsm48_mm.c
@@ -2014,6 +2014,7 @@ static int gsm48_mm_loc_upd(struct osmocom_ms *ms, struct msgb *msg)
struct gsm322_cellsel *cs = &ms->cellsel;
struct gsm48_sysinfo *s = &cs->sel_si;
struct gsm_subscriber *subscr = &ms->subscr;
+ struct gsm_settings *set = &ms->settings;
struct msgb *nmsg;
int msg_type;
@@ -2038,6 +2039,16 @@ static int gsm48_mm_loc_upd(struct osmocom_ms *ms, struct msgb *msg)
return 0;
}
+ /* deny network, if disabled */
+ if (set->no_lupd) {
+ LOGP(DMM, LOGL_INFO, "Loc. upd. disabled, adding "
+ "forbidden PLMN.\n");
+ gsm_subscr_add_forbidden_plmn(subscr, cs->sel_mcc,
+ cs->sel_mnc, GSM48_REJECT_PLMN_NOT_ALLOWED);
+ msg_type = GSM322_EVENT_ROAMING_NA;
+ goto stop;
+ }
+
/* if LAI is forbidden, don't start */
if (gsm_subscr_is_forbidden_plmn(subscr, cs->sel_mcc, cs->sel_mnc)) {
LOGP(DMM, LOGL_INFO, "Loc. upd. not allowed PLMN.\n");
@@ -2632,7 +2643,7 @@ static int gsm48_mm_tx_cm_serv_req(struct osmocom_ms *ms, int rr_prim,
uint8_t cause, uint8_t cm_serv)
{
struct gsm_subscriber *subscr = &ms->subscr;
- struct gsm_settings *settings = &ms->settings;
+ struct gsm_settings *set = &ms->settings;
struct msgb *nmsg;
struct gsm48_hdr *ngh;
struct gsm48_service_request *nsr; /* NOTE: includes MI length */
@@ -2659,9 +2670,9 @@ static int gsm48_mm_tx_cm_serv_req(struct osmocom_ms *ms, int rr_prim,
gsm48_rr_enc_cm2(ms, (struct gsm48_classmark2 *)(cm2lv + 1));
/* MI */
if (!subscr->sim_valid) { /* have no SIM ? */
- if (settings->emergency_imsi[0])
+ if (set->emergency_imsi[0])
gsm48_generate_mid_from_imsi(buf,
- settings->emergency_imsi);
+ set->emergency_imsi);
else
gsm48_encode_mi(buf, NULL, ms, GSM_MI_TYPE_IMEI);
} else if (subscr->tmsi_valid) /* have TMSI ? */
diff --git a/src/host/layer23/src/vty_interface.c b/src/host/layer23/src/vty_interface.c
index 192b864..297d5d1 100644
--- a/src/host/layer23/src/vty_interface.c
+++ b/src/host/layer23/src/vty_interface.c
@@ -607,6 +607,10 @@ static void config_write_ms_single(struct vty *vty, struct osmocom_ms *ms)
VTY_NEWLINE);
else
vty_out(vty, " no stick%s", VTY_NEWLINE);
+ if (set->no_lupd)
+ vty_out(vty, " no location-updating%s", VTY_NEWLINE);
+ else
+ vty_out(vty, " location-updating%s", VTY_NEWLINE);
vty_out(vty, "exit%s", VTY_NEWLINE);
vty_out(vty, "!%s", VTY_NEWLINE);
}
@@ -873,6 +877,26 @@ DEFUN(cfg_ms_no_stick, cfg_ms_no_stick_cmd, "no stick",
return CMD_SUCCESS;
}
+DEFUN(cfg_ms_lupd, cfg_ms_lupd_cmd, "location-updating",
+ "Allow location updating")
+{
+ struct osmocom_ms *ms = vty->index;
+
+ ms->settings.no_lupd = 0;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_ms_no_lupd, cfg_ms_no_lupd_cmd, "no location-updating",
+ NO_STR "Do not allow location updating")
+{
+ struct osmocom_ms *ms = vty->index;
+
+ ms->settings.no_lupd = 1;
+
+ return CMD_SUCCESS;
+}
+
/* per testsim config */
DEFUN(cfg_ms_testsim, cfg_ms_testsim_cmd, "test-sim",
"Configure test SIM emulation")
@@ -1081,6 +1105,8 @@ int ms_vty_init(void)
install_element(MS_NODE, &cfg_ms_no_sim_delay_cmd);
install_element(MS_NODE, &cfg_ms_stick_cmd);
install_element(MS_NODE, &cfg_ms_no_stick_cmd);
+ install_element(MS_NODE, &cfg_ms_lupd_cmd);
+ install_element(MS_NODE, &cfg_ms_no_lupd_cmd);
install_node(&testsim_node, config_write_dummy);
install_default(TESTSIM_NODE);