From 1f8276e5885f070ec1b0d74c28fc9464bbfe5f8a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 1 Jan 2013 11:25:09 +0100 Subject: nat: Introduce a global IMSI barr list using red-black trees --- openbsc/include/openbsc/bsc_nat.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'openbsc/include/openbsc/bsc_nat.h') diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 71cd121f4..1698fa47f 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -287,6 +287,10 @@ struct bsc_nat { /* filter */ char *acc_lst_name; + /* Barring of subscribers with a rb tree */ + struct rb_root imsi_black_list; + char *imsi_black_list_fn; + /* number rewriting */ char *num_rewr_name; struct llist_head num_rewr; @@ -448,6 +452,17 @@ struct bsc_nat_num_rewr_entry { void bsc_nat_num_rewr_entry_adapt(void *ctx, struct llist_head *head, const struct osmo_config_list *); +struct bsc_nat_barr_entry { + struct rb_node node; + + char *imsi; + int cm_reject_cause; + int lu_reject_cause; +}; + +int bsc_nat_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *); +int bsc_nat_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu); + struct ctrl_handle *bsc_nat_controlif_setup(struct bsc_nat *nat, int port); void bsc_nat_ctrl_del_pending(struct bsc_cmd_list *pending); int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg); -- cgit v1.2.3