[PATCH] osmo-msc[master]: remove unused "authorized-regexp" VTY command

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Feb 13 23:57:03 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6416

to look at the new patch set (#2).

remove unused "authorized-regexp" VTY command

This is another left-over VTY command from the OsmoNITB days.

If such functionality is desired, it must be implemented in OsmoHLR,
but not here.

Related: OS#2528
Change-Id: Icf0897c47388e49ba7886b55acc728a6f7d213fe
---
M include/osmocom/msc/gsm_data.h
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M tests/vty_test_runner.py
4 files changed, 0 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/6416/2

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 0548b80..9701288 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -236,8 +236,6 @@
 	char *name_long;
 	char *name_short;
 	enum gsm_auth_policy auth_policy;
-	regex_t authorized_regexp;
-	char *authorized_reg_str;
 	/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
 	uint8_t a5_encryption_mask;
 	bool authentication_required;
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index cebaf39..a2f5cb3 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -44,14 +44,8 @@
 {
 	struct gsm_network *net;
 
-	const char *default_regexp = ".*";
-
 	net = talloc_zero(ctx, struct gsm_network);
 	if (!net)
-		return NULL;
-
-	if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1,
-			  &default_regexp) != 0)
 		return NULL;
 
 	net->country_code = country_code;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index e5972f1..2fbe09c 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -121,22 +121,6 @@
 	return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd,
-      "authorized-regexp REGEXP",
-      "Set regexp for IMSI which will be used for authorization decision\n"
-      "Regular expression, IMSIs matching it are allowed to use the network\n")
-{
-	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-	if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp,
-			  &gsmnet->authorized_reg_str, argc, argv) != 0) {
-		vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s",
-			argv[0], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
       cfg_net_encryption_cmd,
       "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]",
@@ -307,7 +291,6 @@
 	install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
 	install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
 	install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd);
-	install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd);
 	install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
 	install_element(GSMNET_NODE, &cfg_net_authentication_cmd);
 	install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index 707fc5c..19d2c60 100644
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -156,9 +156,6 @@
         self.vty.command("network")
         self.assertTrue(self.vty.verify("auth policy closed", ['']))
         self.assertTrue(self.vty.verify("auth policy regexp", ['']))
-        self.assertTrue(self.vty.verify("authorized-regexp ^001", ['']))
-        self.assertTrue(self.vty.verify("authorized-regexp 02$", ['']))
-        self.assertTrue(self.vty.verify("authorized-regexp *123.*", ['']))
         self.vty.command("end")
 
     def testSi2Q(self):

-- 
To view, visit https://gerrit.osmocom.org/6416
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icf0897c47388e49ba7886b55acc728a6f7d213fe
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list