From 0d4236be54981cf4c7b39f5c6f6ed80b5f8fefe5 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 18 Aug 2014 14:54:37 +0200 Subject: 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 --- openbsc/src/gprs/gb_proxy_vty.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'openbsc/src') 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); -- cgit v1.2.3