aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-04 15:29:56 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-04 15:34:18 +0100
commite4baf402cb457ad46642cec9271b762a394a59ea (patch)
treee390eab0c4bb81fd6728af306b3432ef08da91a5 /openbsc/src/libbsc
parent53d782fc38c1c609cb5986fc07980651d3ed8916 (diff)
move two gsm0480_send_*() to xsc as gsm0480_gen_*()
Have two separate gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() for each of libbsc and libmsc. Move their core into libxsc as generator functions returning a msgb. Add src/libbsc/gsm_04_80_utils.c (note, not 04_08) to implement the libbsc side of it. The code is identical, but the linked structs and functions differ in each case. There could be a common source file built for both, but I decided against it, for more clarity I hope.
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/Makefile.am1
-rw-r--r--openbsc/src/libbsc/gsm_04_80_utils.c39
2 files changed, 40 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am
index 8fa5c7c1a..488de6d4c 100644
--- a/openbsc/src/libbsc/Makefile.am
+++ b/openbsc/src/libbsc/Makefile.am
@@ -20,6 +20,7 @@ libbsc_a_SOURCES = abis_nm.c abis_nm_vty.c \
e1_config.c \
bsc_api.c bsc_msc.c bsc_vty.c \
gsm_04_08_utils.c \
+ gsm_04_80_utils.c \
bsc_init.c bts_init.c bsc_rf_ctrl.c \
arfcn_range_encode.c bsc_ctrl_commands.c \
bsc_ctrl_lookup.c \
diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/openbsc/src/libbsc/gsm_04_80_utils.c
new file mode 100644
index 000000000..ddd8caf7d
--- /dev/null
+++ b/openbsc/src/libbsc/gsm_04_80_utils.c
@@ -0,0 +1,39 @@
+/* OpenBSC utility functions for 3GPP TS 04.80 */
+
+/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <openbsc/gsm_04_80.h>
+#include <openbsc/bsc_api.h>
+
+int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text)
+{
+ struct msgb *msg = gsm0480_gen_ussdNotify(level, text);
+ if (!msg)
+ return -1;
+ return gsm0808_submit_dtap(conn, msg, 0, 0);
+}
+
+int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
+{
+ struct msgb *msg = gsm0480_gen_releaseComplete();
+ if (!msg)
+ return -1;
+ return gsm0808_submit_dtap(conn, msg, 0, 0);
+}