Change in osmo-bsc[master]: bsc-filter: Remove unused func barr_adapt and set barr_find static

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
Thu Jun 28 13:43:30 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9761 )

Change subject: bsc-filter: Remove unused func barr_adapt and set barr_find static
......................................................................

bsc-filter: Remove unused func barr_adapt and set barr_find static

bar_find is set as static because it's still being used internally by
other functions.

Change-Id: I2db8f0ba60cf01929ce2c63edd9859612724de48
---
M include/osmocom/bsc/bsc_msg_filter.h
M src/libfilter/bsc_msg_filter.c
2 files changed, 1 insertion(+), 68 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/bsc/bsc_msg_filter.h b/include/osmocom/bsc/bsc_msg_filter.h
index a9dedf4..c9d86f4 100644
--- a/include/osmocom/bsc/bsc_msg_filter.h
+++ b/include/osmocom/bsc/bsc_msg_filter.h
@@ -79,10 +79,6 @@
 	int bsc_nr;
 };
 
-
-int bsc_filter_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *);
-int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu);
-
 /**
  * Content filtering.
  */
diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c
index 852067e..bcabc24 100644
--- a/src/libfilter/bsc_msg_filter.c
+++ b/src/libfilter/bsc_msg_filter.c
@@ -35,7 +35,7 @@
 #include <osmocom/gsm/protocol/gsm_04_11.h>
 #include <osmocom/gsm/gsm48.h>
 
-int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu)
+static int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu)
 {
 	struct bsc_filter_barr_entry *n;
 	n = rb_entry(root->rb_node, struct bsc_filter_barr_entry, node);
@@ -56,69 +56,6 @@
 	return 0;
 }
 
-static int insert_barr_node(struct bsc_filter_barr_entry *entry, struct rb_root *root)
-{
-	struct rb_node **new = &root->rb_node, *parent = NULL;
-
-	while (*new) {
-		int rc;
-		struct bsc_filter_barr_entry *this;
-		this = rb_entry(*new, struct bsc_filter_barr_entry, node);
-		parent = *new;
-
-		rc = strcmp(entry->imsi, this->imsi);
-		if (rc < 0)
-			new = &((*new)->rb_left);
-		else if (rc > 0)
-			new = &((*new)->rb_right);
-		else {
-			LOGP(DFILTER, LOGL_ERROR,
-				"Duplicate entry for IMSI(%s)\n", entry->imsi);
-			talloc_free(entry);
-			return -1;
-		}
-	}
-
-	rb_link_node(&entry->node, parent, new);
-	rb_insert_color(&entry->node, root);
-	return 0;
-}
-
-int bsc_filter_barr_adapt(void *ctx, struct rb_root *root,
-			const struct osmo_config_list *list)
-{
-	struct osmo_config_entry *cfg_entry;
-	int err = 0;
-
-	/* free the old data */
-	while (!RB_EMPTY_ROOT(root)) {
-		struct rb_node *node = rb_first(root);
-		rb_erase(node, root);
-		talloc_free(node);
-	}
-
-	if (!list)
-		return 0;
-
-	/* now adapt the new list */
-	llist_for_each_entry(cfg_entry, &list->entry, list) {
-		struct bsc_filter_barr_entry *entry;
-		entry = talloc_zero(ctx, struct bsc_filter_barr_entry);
-		if (!entry) {
-			LOGP(DFILTER, LOGL_ERROR,
-				"Allocation of the barr entry failed.\n");
-			continue;
-		}
-
-		entry->imsi = talloc_strdup(entry, cfg_entry->mcc);
-		entry->cm_reject_cause = atoi(cfg_entry->mnc);
-		entry->lu_reject_cause = atoi(cfg_entry->option);
-		err |= insert_barr_node(entry, root);
-	}
-
-	return err;
-}
-
 
 static int lst_check_deny(struct bsc_msg_acc_lst *lst, const char *mi_string,
 			int *cm_cause, int *lu_cause)

-- 
To view, visit https://gerrit.osmocom.org/9761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2db8f0ba60cf01929ce2c63edd9859612724de48
Gerrit-Change-Number: 9761
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180628/c43b7ca3/attachment.htm>


More information about the gerrit-log mailing list