aboutsummaryrefslogtreecommitdiffstats
path: root/src/hnbgw_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-04-25 15:05:32 +0200
committerHarald Welte <laforge@gnumonks.org>2016-09-27 05:55:55 +0000
commit12181a937ff5658af49e12c57cb08ecba859e1f1 (patch)
tree013780b4daf07e725223c5d27ced524b4099513e /src/hnbgw_vty.c
parentf33e8358cc2350e6fecb8653dc726770afa9fede (diff)
hnbap: accept UE Register Requests with TMSI and pTMSI
Add the option to allow UE Register Requests with a TMSI identity. Add VTY command to enable this option, 'hnbap-allow-tmsi'. Add hnbgw_tx_ue_register_acc_tmsi(). HNBGW so far keeps track of UEs that have registered, with their IMSI. When a UE registers with only a TMSI, we obviously can't store an IMSI. However, since we're so far never *using* the list of UEs in osmo-hnbgw, we might as well just accept the TMSI registration and carry on as usual. All that is needed for proper operation is a valid UE context. This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. So far this caused failures and the need to make the UE clear its TMSI (wait several minutes or attempt to subscribe to a different network), so that UE registration switched back to IMSI. When simply accepting the TMSI in osmo-hngw, no problems are apparent in our current code state. For example, a Samsung Galaxy S4 seems to send a UE_Identity_PR_tMSILAI (CS identity), and a GT-I9100 seems to send a UE_Identity_PR_pTMSIRAI (PS identity) upon first registration to the network. Recording the IMSI in hnbgw: we could use the subscriber list during paging, to page a UE on only its last seen HNB. On the other hand, it doesn't hurt to anyway always page to all HNBs connected to osmo-hnbgw. The paging procedure does include a page-to-all-HNBs in case the first HNB paging fails. But we must be aware that UEs that register by TMSI will simply not have an IMSI recorded in the list of UE contexts, so a lookup based on IMSI may fail. Patch-by: Harald Welte <laforge@gnumonks.org>, me Change-Id: I87bc1aa3e85815ded7ac1dbdca48f1680b468589
Diffstat (limited to 'src/hnbgw_vty.c')
-rw-r--r--src/hnbgw_vty.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 2e3d1e9..d6fad64 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -114,6 +114,16 @@ DEFUN(cfg_hnbgw_iuh_bind, cfg_hnbgw_iuh_bind_cmd, "bind A.B.C.D",
return CMD_SUCCESS;
}
+DEFUN(cfg_hnbgw_iuh_hnbap_allow_tmsi, cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd,
+ "hnbap-allow-tmsi (0|1)",
+ "Allow HNBAP UE Register messages with TMSI or PTMSI identity\n"
+ "Only accept IMSI identity, reject TMSI or PTMSI\n"
+ "Accept IMSI, TMSI or PTMSI as UE identity\n")
+{
+ g_hnb_gw->config.hnbap_allow_tmsi = (*argv[0] == '1');
+ return CMD_SUCCESS;
+}
+
static int config_write_hnbgw(struct vty *vty)
{
vty_out(vty, "hnbgw%s", VTY_NEWLINE);
@@ -130,6 +140,9 @@ static int config_write_hnbgw_iuh(struct vty *vty)
if (addr && (strcmp(addr, HNBGW_IUH_BIND_ADDR_DEFAULT) != 0))
vty_out(vty, " bind %s%s", addr, VTY_NEWLINE);
+ if (g_hnb_gw->config.hnbap_allow_tmsi)
+ vty_out(vty, " hnbap-allow-tmsi 1%s", VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -145,7 +158,9 @@ void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx)
install_element(HNBGW_NODE, &cfg_hnbgw_iuh_cmd);
install_node(&iuh_node, config_write_hnbgw_iuh);
vty_install_default(IUH_NODE);
+
install_element(IUH_NODE, &cfg_hnbgw_iuh_bind_cmd);
+ install_element(IUH_NODE, &cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd);
install_element_ve(&show_hnb_cmd);
install_element_ve(&show_ue_cmd);