diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-02-12 11:54:04 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-03 16:19:10 +0100 |
commit | c6794eed1dbe726b23c60e96e214ec1a1fbf6b51 (patch) | |
tree | de72e07b02072e41153982212e2691d85dbb0f45 /openbsc | |
parent | 7a70a4f52a837bde0f7fa5f435e302939a2e3d74 (diff) |
cscn: some file moves/renames
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/libmsc/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/src/libmsc/iu_cs.c (renamed from openbsc/src/osmo-cscn/iu_cs.c) | 0 | ||||
-rw-r--r-- | openbsc/src/libmsc/msc_api.c | 50 | ||||
-rw-r--r-- | openbsc/src/libmsc/msc_api.h | 19 | ||||
-rw-r--r-- | openbsc/src/osmo-cscn/Makefile.am | 5 | ||||
-rw-r--r-- | openbsc/src/osmo-cscn/cscn_main.c | 2 |
6 files changed, 72 insertions, 6 deletions
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index c0a09a356..18314a386 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -21,7 +21,7 @@ libmsc_a_SOURCES = auth.c \ vty_interface_layer3.c \ transaction.c \ osmo_msc.c ctrl_commands.c meas_feed.c \ - msc_api.c + msc_api.c iu_cs.c if BUILD_SMPP noinst_HEADERS += smpp_smsc.h diff --git a/openbsc/src/osmo-cscn/iu_cs.c b/openbsc/src/libmsc/iu_cs.c index e321c15a1..e321c15a1 100644 --- a/openbsc/src/osmo-cscn/iu_cs.c +++ b/openbsc/src/libmsc/iu_cs.c diff --git a/openbsc/src/libmsc/msc_api.c b/openbsc/src/libmsc/msc_api.c new file mode 100644 index 000000000..f50ab3275 --- /dev/null +++ b/openbsc/src/libmsc/msc_api.c @@ -0,0 +1,50 @@ +/* MSC decisions which interface to send messages out on. */ + +/* (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 <osmocom/core/logging.h> + +#include <openbsc/debug.h> +#include <openbsc/gsm_data.h> +#include <openbsc/iu_cs.h> + +#include "msc_api.h" + +int msc_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + switch (conn->via_iface) { + case IFACE_A: + //return gsm0808_submit_dtap(conn, msg, link_id, allow_sacch); + LOGP(DMSC, LOGL_ERROR, + "submit dtap: A-interface not implemented\n"); + return -1; + + case IFACE_IUCS: + return iucs_submit_dtap(conn, msg); + + default: + LOGP(DMSC, LOGL_ERROR, + "submit dtap: conn->via_iface invalid (%d)\n", + conn->via_iface); + return -1; + } +} + + diff --git a/openbsc/src/libmsc/msc_api.h b/openbsc/src/libmsc/msc_api.h index 2da2e9fce..ace6ea11d 100644 --- a/openbsc/src/libmsc/msc_api.h +++ b/openbsc/src/libmsc/msc_api.h @@ -3,6 +3,25 @@ #include <osmocom/core/msgb.h> #include <openbsc/gsm_data.h> +/* This callback structure allows linking specific components without having to + * include entire infrastructures of external libraries. For example, a unit + * test does not need to link against external ASN1 libraries if it is never + * going to encode actual outgoing messages. It is up to each building scope to + * plug meaningful sending/receiving callback functions, or to have mere dummy + * implementations. */ +struct msc_api { + + struct { + /* libmsc calls this to send out messages to an A-interface */ + int (*tx)(struct msgb *msg, uint8_t sapi); + } a; + + struct { + /* libmsc calls this to send out messages to an Iu-interface */ + int (*tx)(struct msgb *msg, uint8_t sapi); + } iu; +}; + /* TODO does this belong to openbsc/gsm_04_08.h ?? */ int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint16_t chosen_channel); diff --git a/openbsc/src/osmo-cscn/Makefile.am b/openbsc/src/osmo-cscn/Makefile.am index 2c4cff7c3..3a1021304 100644 --- a/openbsc/src/osmo-cscn/Makefile.am +++ b/openbsc/src/osmo-cscn/Makefile.am @@ -6,12 +6,9 @@ AM_CFLAGS=-Wall $(COVERAGE_CFLAGS) \ AM_LDFLAGS = $(COVERAGE_LDFLAGS) -noinst_HEADERS = iu_cs.h - bin_PROGRAMS = osmo-cscn -osmo_cscn_SOURCES = cscn_main.c \ - iu_cs.c +osmo_cscn_SOURCES = cscn_main.c osmo_cscn_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ diff --git a/openbsc/src/osmo-cscn/cscn_main.c b/openbsc/src/osmo-cscn/cscn_main.c index 4d9109a59..005c8cf6a 100644 --- a/openbsc/src/osmo-cscn/cscn_main.c +++ b/openbsc/src/osmo-cscn/cscn_main.c @@ -65,7 +65,7 @@ #include "../../bscconfig.h" -#include "iu_cs.h" +#include <openbsc/iu_cs.h> static const char * const osmocscn_copyright = "OsmoCSCN - Osmocom Circuit-Switched Core Network implementation\r\n" |