aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-18 14:54:37 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-24 16:16:39 +0200
commit0d4236be54981cf4c7b39f5c6f6ed80b5f8fefe5 (patch)
treebd12ef8db5259c8a2b0ef4b6410e64f12e3ab50d
parent9057bc3c727e97cd7ff2534bffbd9ba4dcd8d4ea (diff)
gbproxy: Add 'patch-ptmsi' command to enable TLLI/P-TMSI patching
This VTY command add the following commands to the gbproxy node: - patch-ptmsi: Enables P-TMSI/TLLI patching - no patch-ptmsi: Disables P-TMSI/TLLI patching Note that using these commands interactively can load to undefined behavior of existing LLC connections. Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/gb_proxy_vty.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index d1b912fcd..a85f43969 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -104,6 +104,11 @@ static int config_write_gbproxy(struct vty *vty)
else
vty_out(vty, "%s", VTY_NEWLINE);
}
+
+ if (g_cfg->patch_ptmsi > 0)
+ vty_out(vty, " patch-ptmsi%s",
+ VTY_NEWLINE);
+
if (g_cfg->tlli_max_age > 0)
vty_out(vty, " tlli-list max-age %d%s",
g_cfg->tlli_max_age, VTY_NEWLINE);
@@ -268,6 +273,28 @@ DEFUN(cfg_gbproxy_no_core_apn,
return set_core_apn(vty, NULL, NULL);
}
+#define GBPROXY_PATCH_PTMSI_STR "Patch P-TMSI/TLLI\n"
+
+DEFUN(cfg_gbproxy_patch_ptmsi,
+ cfg_gbproxy_patch_ptmsi_cmd,
+ "patch-ptmsi",
+ GBPROXY_PATCH_PTMSI_STR)
+{
+ g_cfg->patch_ptmsi = 1;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_gbproxy_no_patch_ptmsi,
+ cfg_gbproxy_no_patch_ptmsi_cmd,
+ "no patch-ptmsi",
+ NO_STR GBPROXY_PATCH_PTMSI_STR)
+{
+ g_cfg->patch_ptmsi = 0;
+
+ return CMD_SUCCESS;
+}
+
#define GBPROXY_TLLI_LIST_STR "Set TLLI list parameters\n"
#define GBPROXY_MAX_AGE_STR "Limit maximum age\n"
@@ -575,11 +602,13 @@ int gbproxy_vty_init(void)
install_element(GBPROXY_NODE, &cfg_gbproxy_core_mnc_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_core_apn_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_core_apn_match_cmd);
+ install_element(GBPROXY_NODE, &cfg_gbproxy_patch_ptmsi_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_tlli_list_max_age_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_tlli_list_max_len_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_mcc_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_mnc_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_apn_cmd);
+ install_element(GBPROXY_NODE, &cfg_gbproxy_no_patch_ptmsi_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_tlli_list_no_max_age_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_tlli_list_no_max_len_cmd);
install_element(GBPROXY_NODE, &cfg_gbproxy_patch_mode_cmd);