aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/bsc_nat.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-05-27 12:38:58 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-06-01 20:40:35 +0200
commitad75eababc153d513e75f7f052818ca02acd9533 (patch)
tree495be345f80cbe4f975ec15367c49433350a6c71 /openbsc/include/openbsc/bsc_nat.h
parent384ef099209f92afb0af0c48756731a105da23f5 (diff)
nat: Allow to have a regexp to match the MSISDN
The idea that MCC and MNC is enough to classify a subscriber turns out to be wrong. Certain operatos license a number range of IMSIs to others. When we see a '^' in the MCC field we treat it as a regexp. The code now turns the MCC/MNC into a regexp for the IMSI. It is not using extended POSIX regexp to match the behavior of the access list.
Diffstat (limited to 'openbsc/include/openbsc/bsc_nat.h')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index c3f32eb35..650d1133c 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -267,7 +267,7 @@ struct bsc_nat {
/* number rewriting */
char *num_rewr_name;
- struct osmo_config_list *num_rewr;
+ struct llist_head num_rewr;
/* USSD messages we want to match */
char *ussd_lst_name;
@@ -394,4 +394,18 @@ void bsc_nat_paging_group_delete(struct bsc_nat_paging_group *);
void bsc_nat_paging_group_add_lac(struct bsc_nat_paging_group *grp, int lac);
void bsc_nat_paging_group_del_lac(struct bsc_nat_paging_group *grp, int lac);
+/**
+ * Number rewriting support below
+ */
+struct bsc_nat_num_rewr_entry {
+ struct llist_head list;
+
+ regex_t msisdn_reg;
+ regex_t num_reg;
+
+ char *replace;
+};
+
+void bsc_nat_num_rewr_entry_adapt(struct bsc_nat *nat, const struct osmo_config_list *);
+
#endif