aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-29 19:32:55 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-25 21:04:45 +0200
commit17870cf5333736f6829e0add942df5b26382d97e (patch)
tree91973801d4d55b9abe06f27a4c6009c670d640ef
parent74dc3031347fa894bd2490512b8abeb44ecee961 (diff)
nat: Create a USSD module to filter out USSDs...
-rw-r--r--openbsc/include/openbsc/bsc_nat.h3
-rw-r--r--openbsc/src/nat/Makefile.am2
-rw-r--r--openbsc/src/nat/bsc_nat.c7
-rw-r--r--openbsc/src/nat/bsc_ussd.c32
4 files changed, 43 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index a364c17d7..baa950ccb 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -320,4 +320,7 @@ int bsc_conn_type_to_ctr(struct sccp_connections *conn);
struct gsm48_hdr *bsc_unpack_dtap(struct bsc_nat_parsed *parsed, struct msgb *msg, uint32_t *len);
+/** USSD filtering */
+int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed, struct msgb *msg);
+
#endif
diff --git a/openbsc/src/nat/Makefile.am b/openbsc/src/nat/Makefile.am
index 2f37f5cd2..c7c4b0e9f 100644
--- a/openbsc/src/nat/Makefile.am
+++ b/openbsc/src/nat/Makefile.am
@@ -6,7 +6,7 @@ bin_PROGRAMS = bsc_nat
bsc_nat_SOURCES = bsc_filter.c bsc_mgcp_utils.c bsc_nat.c bsc_nat_utils.c \
- bsc_nat_vty.c bsc_sccp.c \
+ bsc_nat_vty.c bsc_sccp.c bsc_ussd.c \
$(top_srcdir)/src/debug.c $(top_srcdir)/src/bsc_msc.c
bsc_nat_LDADD = $(top_builddir)/src/libvty.a \
$(top_builddir)/src/libmgcp.a $(top_builddir)/src/libbsc.a \
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index b82c4ef25..515278cba 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -854,12 +854,19 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
con = NULL;
goto exit2;
}
+
+ /* hand data to a side channel */
+ if (bsc_check_ussd(con, parsed, msg) == 1) {
+ /* we are going to take over the connection */
+ /* TODO: */
+ }
}
con_bsc = con->bsc;
con_msc = con->msc_con;
con_filter = con->con_local;
}
+
break;
case SCCP_MSG_TYPE_RLC:
con = patch_sccp_src_ref_to_msc(msg, parsed, bsc);
diff --git a/openbsc/src/nat/bsc_ussd.c b/openbsc/src/nat/bsc_ussd.c
new file mode 100644
index 000000000..1812cf71d
--- /dev/null
+++ b/openbsc/src/nat/bsc_ussd.c
@@ -0,0 +1,32 @@
+/* USSD Filter Code */
+
+/*
+ * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
+
+
+int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed,
+ struct msgb *msg)
+{
+ return 0;
+}