From 76424392e08fcea56e665295830a9fdcc6dba5b5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 21 Oct 2010 10:59:54 +0200 Subject: nat: Add vty option for number rewriting Parse a msg file in case we do have a list. --- openbsc/include/openbsc/bsc_nat.h | 5 +++++ 1 file changed, 5 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 acecba7de..083746f68 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -237,6 +238,10 @@ struct bsc_nat { /* filter */ char *acc_lst_name; + /* number rewriting */ + char *num_rewr_name; + struct msg_entries *num_rewr; + /* USSD messages we want to match */ char *ussd_lst_name; char *ussd_query; -- cgit v1.2.3 From a914daf174e9d1a78bdccb1d5bd8b69ec8ff2280 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 21 Oct 2010 12:12:57 +0200 Subject: nat: Add hook for rewriting a setup message Create a new function, hand the data to this function, take back a possible modified msgb and invalidate parsed at this point. --- openbsc/include/openbsc/bsc_nat.h | 2 ++ 1 file changed, 2 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 083746f68..049421716 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -343,4 +343,6 @@ struct gsm48_hdr *bsc_unpack_dtap(struct bsc_nat_parsed *parsed, struct msgb *ms int bsc_ussd_init(struct bsc_nat *nat); int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed, struct msgb *msg); +struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct bsc_nat_parsed *); + #endif -- cgit v1.2.3 From 73bbf8924588f5dc9088ac34ac3da2747b18f9dc Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 21 Oct 2010 14:46:57 +0200 Subject: nat: Implement rewriting, have a very basic test for that feature --- openbsc/include/openbsc/bsc_nat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 049421716..9f26c87a0 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -343,6 +343,6 @@ struct gsm48_hdr *bsc_unpack_dtap(struct bsc_nat_parsed *parsed, struct msgb *ms int bsc_ussd_init(struct bsc_nat *nat); int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed, struct msgb *msg); -struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct bsc_nat_parsed *); +struct msgb *bsc_nat_rewrite_setup(struct bsc_nat *nat, struct msgb *msg, struct bsc_nat_parsed *, const char *imsi); #endif -- cgit v1.2.3