aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-01 01:03:13 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-01 01:03:13 +0800
commitdf342ea82bdca152c7ebfab91857e4a508b37597 (patch)
tree2ca487ea80d4f5ca813c803bf0fcc606593602fd /openbsc/include
parent049eb23b73c0827936888aa555c5eb9866f9ef27 (diff)
[nat] Introduce the concept of access-list
One can set one access-list to one BSC and one access-list to one NAT. The matching of IMSIs remains the same for now, also applying the white/blacklist. Access lists can not be deleted for now and no perf opt is done (e.g. one could cache the result of the last lookup in the bsc struct).
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index f39afafb7..5d28e4c9d 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -165,10 +165,7 @@ struct bsc_config {
char *description;
/* imsi white and blacklist */
- char *imsi_allow;
- regex_t imsi_allow_re;
- char *imsi_deny;
- regex_t imsi_deny_re;
+ char *acc_lst_name;
int forbid_paging;
@@ -207,6 +204,19 @@ struct bsc_nat_statistics {
} msc;
};
+struct bsc_nat_access_list {
+ struct llist_head list;
+
+ /* the name of the list */
+ const char *name;
+
+ /* the filter */
+ char *imsi_allow;
+ regex_t imsi_allow_re;
+ char *imsi_deny;
+ regex_t imsi_deny_re;
+};
+
/**
* the structure of the "nat" network
*/
@@ -217,6 +227,9 @@ struct bsc_nat {
/* active BSC connections that need patching */
struct llist_head bsc_connections;
+ /* access lists */
+ struct llist_head access_lists;
+
/* known BSC's */
struct llist_head bsc_configs;
int num_bsc;
@@ -243,8 +256,7 @@ struct bsc_nat {
struct bsc_endpoint *bsc_endpoints;
/* filter */
- char *imsi_deny;
- regex_t imsi_deny_re;
+ char *acc_lst_name;
/* statistics */
struct bsc_nat_statistics stats;
@@ -310,7 +322,9 @@ int bsc_mgcp_extract_ci(const char *resp);
int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id);
-/* regexp handling */
+/* IMSI allow/deny handling */
void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv);
+struct bsc_nat_access_list *bsc_nat_accs_list_find(struct bsc_nat *nat, const char *name);
+struct bsc_nat_access_list *bsc_nat_accs_list_get(struct bsc_nat *nat, const char *name);
#endif