aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-10 13:37:59 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-01-23 13:48:56 +0100
commit995ba2775c18b296e8a6a8a02594891ac1766a40 (patch)
treebe5072d7d7ba314a3c2929badd1daa3a54966a66
parent95e219d21e3056a0a8f816f52ced0e55d7b1ae41 (diff)
msc_compl_l3(): publish in .h, tweak return value
Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c Change-Id: If24007445899e9c75553a0dbf843ada3566b3380
-rw-r--r--openbsc/include/openbsc/osmo_msc.h8
-rw-r--r--openbsc/src/libmsc/osmo_msc.c15
2 files changed, 17 insertions, 6 deletions
diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h
index beb3f5e4c..8ee22de27 100644
--- a/openbsc/include/openbsc/osmo_msc.h
+++ b/openbsc/include/openbsc/osmo_msc.h
@@ -5,7 +5,15 @@
#include "bsc_api.h"
+enum {
+ MSC_CONN_ACCEPT = 0,
+ MSC_CONN_REJECT = 1,
+};
+
struct bsc_api *msc_bsc_api();
+
+int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
+ uint16_t chosen_channel);
void msc_release_connection(struct gsm_subscriber_connection *conn);
#endif
diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c
index d77ff0f28..dd42e7766 100644
--- a/openbsc/src/libmsc/osmo_msc.c
+++ b/openbsc/src/libmsc/osmo_msc.c
@@ -21,6 +21,7 @@
*
*/
+#include <openbsc/osmo_msc.h>
#include <openbsc/bsc_api.h>
#include <openbsc/debug.h>
#include <openbsc/transaction.h>
@@ -42,8 +43,10 @@ static int msc_clear_request(struct gsm_subscriber_connection *conn, uint32_t ca
return 1;
}
-static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
- uint16_t chosen_channel)
+/* receive a Level 3 Complete message and return MSC_CONN_ACCEPT or
+ * MSC_CONN_REJECT */
+int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg,
+ uint16_t chosen_channel)
{
gsm0408_new_conn(conn);
gsm0408_dispatch(conn, msg);
@@ -54,14 +57,14 @@ static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg
* pending transaction or ongoing operation.
*/
if (conn->silent_call)
- return BSC_API_CONN_POL_ACCEPT;
+ return MSC_CONN_ACCEPT;
if (conn->loc_operation || conn->sec_operation || conn->anch_operation)
- return BSC_API_CONN_POL_ACCEPT;
+ return MSC_CONN_ACCEPT;
if (trans_has_conn(conn))
- return BSC_API_CONN_POL_ACCEPT;
+ return MSC_CONN_ACCEPT;
LOGP(DRR, LOGL_INFO, "MSC Complete L3: Rejecting connection.\n");
- return BSC_API_CONN_POL_REJECT;
+ return MSC_CONN_REJECT;
}
static void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg)