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 + * (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 +#include + + +int bsc_check_ussd(struct sccp_connections *con, struct bsc_nat_parsed *parsed, + struct msgb *msg) +{ + return 0; +}