[PATCH] openbsc[master]: log: disable imsi filter

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jan 26 01:18:55 UTC 2017


Review at  https://gerrit.osmocom.org/1685

log: disable imsi filter

gsm_subscriber will soon be split in separate BSC, GPRS and VLR structs, and
making the IMSI filter work with these changes is currently not worth the
effort. The IMSI filter doesn't work well and new libvlr will allow specific
subscribers' FSMs to be put in debug mode. We may want to re-add something
similar later on, but for now just drop it.

Change-Id: Ifecc3c55ae7c050ee53553d6f85d9afbede66ee3
---
M openbsc/include/openbsc/debug.h
M openbsc/src/libcommon/debug.c
M openbsc/src/libmsc/vty_interface_layer3.c
M openbsc/src/osmo-bsc/osmo_bsc_vty.c
4 files changed, 8 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/1685/1

diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h
index ca3d4ad..b46a41f 100644
--- a/openbsc/include/openbsc/debug.h
+++ b/openbsc/include/openbsc/debug.h
@@ -61,7 +61,6 @@
 struct bssgp_bvc_ctx;
 struct gsm_subscriber;
 
-void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr);
 void log_set_nsvc_filter(struct log_target *target,
 			 struct gprs_nsvc *nsvc);
 void log_set_bvc_filter(struct log_target *target,
diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c
index cf5beeb..ff4a1ce 100644
--- a/openbsc/src/libcommon/debug.c
+++ b/openbsc/src/libcommon/debug.c
@@ -187,13 +187,8 @@
 static int filter_fn(const struct log_context *ctx,
 		     struct log_target *tar)
 {
-	struct gsm_subscriber *subscr = ctx->ctx[BSC_CTX_SUBSCR];
 	const struct gprs_nsvc *nsvc = ctx->ctx[GPRS_CTX_NSVC];
 	const struct gprs_nsvc *bvc = ctx->ctx[GPRS_CTX_BVC];
-
-	if ((tar->filter_map & (1 << FLT_IMSI)) != 0
-	    && subscr && subscr == tar->filter_data[FLT_IMSI])
-		return 1;
 
 	/* Filter on the NS Virtual Connection */
 	if ((tar->filter_map & (1 << FLT_NSVC)) != 0
@@ -213,19 +208,3 @@
 	.cat = default_categories,
 	.num_cat = ARRAY_SIZE(default_categories),
 };
-
-void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr)
-{
-	/* free the old data */
-	if (target->filter_data[FLT_IMSI]) {
-		subscr_put(target->filter_data[FLT_IMSI]);
-		target->filter_data[FLT_IMSI] = NULL;
-	}
-
-	if (subscr) {
-		target->filter_map |= (1 << FLT_IMSI);
-		target->filter_data[FLT_IMSI] = subscr_get(subscr);
-	} else {
-		target->filter_map &= ~(1 << FLT_IMSI);
-	}
-}
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index 11d9022..1ae52b9 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -1032,24 +1032,11 @@
       logging_fltr_imsi_cmd,
       "logging filter imsi IMSI",
 	LOGGING_STR FILTER_STR
-      "Filter log messages by IMSI\n" "IMSI to be used as filter\n")
+      "DEPRECATED (Filter log messages by IMSI)\n" "IMSI to be used as filter\n")
 {
-	struct gsm_subscriber *subscr;
-	struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-	struct log_target *tgt = osmo_log_vty2tgt(vty);
-
-	if (!tgt)
-		return CMD_WARNING;
-
-	subscr = subscr_get_by_imsi(gsmnet->subscr_group, argv[0]);
-	if (!subscr) {
-		vty_out(vty, "%%no subscriber with IMSI(%s)%s",
-			argv[0], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	log_set_imsi_filter(tgt, subscr);
-	return CMD_SUCCESS;
+	vty_out(vty, "%% 'logging filter imsi' is no longer supported.%s",
+		VTY_NEWLINE);
+	return CMD_WARNING;
 }
 
 static struct cmd_node nitb_node = {
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
index 86ccec4..8f0d883 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
@@ -859,23 +859,11 @@
       logging_fltr_imsi_cmd,
       "logging filter imsi IMSI",
 	LOGGING_STR FILTER_STR
-      "Filter log messages by IMSI\n" "IMSI to be used as filter\n")
+      "DEPRECATED (Filter log messages by IMSI)\n" "IMSI to be used as filter\n")
 {
-	struct gsm_subscriber *subscr;
-	struct log_target *tgt = osmo_log_vty2tgt(vty);
-
-	if (!tgt)
-		return CMD_WARNING;
-
-	subscr = subscr_get_or_create(bsc_gsmnet->subscr_group, argv[0]);
-	if (!subscr) {
-		vty_out(vty, "%%no subscriber with IMSI(%s)%s",
-			argv[0], VTY_NEWLINE);
-		return CMD_WARNING;
-	}
-
-	log_set_imsi_filter(tgt, subscr);
-	return CMD_SUCCESS;
+	vty_out(vty, "%% 'logging filter imsi' is no longer supported.%s",
+		VTY_NEWLINE);
+	return CMD_WARNING;
 }
 
 int bsc_vty_init_extra(void)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifecc3c55ae7c050ee53553d6f85d9afbede66ee3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list