aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/bsc_nat.h
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-15 20:24:21 +0800
commit8affef5059c3663f581bd3142de606bfc124a7ab (patch)
treea9549b1fcaa23e9c1d4518626c132413b4680552 /openbsc/include/openbsc/bsc_nat.h
parent078321aaae03fbe859f95c05f70bcf578cec539b (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/openbsc/bsc_nat.h')
-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