summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-10 13:37:59 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-09 18:34:15 +0100
commit446f137c8dca8e26873103f4830cd6b45778a55f (patch)
treec3d1b7d2010f5066919073d8796707552ae44010
parentc5a96ef1f037dec47f3b5e2582144ab7beaa6dfc (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.c22
2 files changed, 20 insertions, 10 deletions
diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h
index c179177..16979e7 100644
--- a/openbsc/include/openbsc/osmo_msc.h
+++ b/openbsc/include/openbsc/osmo_msc.h
@@ -50,9 +50,15 @@ static inline const char *subscr_conn_from_name(enum subscr_conn_from val)
return get_value_string(subscr_conn_from_names, val);
}
+enum msc_compl_l3_rc {
+ MSC_CONN_ACCEPT = 0,
+ MSC_CONN_REJECT = 1,
+};
+
void msc_subscr_conn_init(void);
struct bsc_api *msc_bsc_api();
+
#define subscr_con_get(conn) _subscr_con_get(conn, __BASE_FILE__, __LINE__)
struct gsm_subscriber_connection *
_subscr_con_get(struct gsm_subscriber_connection *conn,
@@ -66,6 +72,8 @@ int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id);
int msc_vlr_alloc(struct gsm_network *net);
int msc_vlr_start(struct gsm_network *net);
+enum msc_compl_l3_rc msc_compl_l3(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, uint16_t chosen_channel);
void msc_close_connection(struct gsm_subscriber_connection *conn);
bool msc_subscr_conn_is_accepted(struct gsm_subscriber_connection *conn);
diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c
index 597577e..61ccbce 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>
@@ -64,9 +65,10 @@ static bool keep_conn(struct gsm_subscriber_connection *conn)
}
}
-/* Receive a COMPLETE LAYER3 INFO from BSC */
-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 */
+enum msc_compl_l3_rc msc_compl_l3(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, uint16_t chosen_channel)
{
gsm0408_new_conn(conn);
gsm0408_dispatch(conn, msg);
@@ -76,13 +78,13 @@ static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg
if (!keep_conn(conn)) {
DEBUGP(DMM, "compl_l3: Discarding conn\n");
- return BSC_API_CONN_POL_REJECT;
+ return MSC_CONN_REJECT;
}
DEBUGP(DMM, "compl_l3: Keeping conn\n");
conn->owned_by_msc = true;
DEBUGP(DMM, "%s owned_by_msc = true\n",
vlr_subscr_name(conn->vsub));
- return BSC_API_CONN_POL_ACCEPT;
+ return MSC_CONN_ACCEPT;
#if 0
/*
@@ -91,14 +93,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;
- if (conn->sec_operation || conn->anch_operation)
- return BSC_API_CONN_POL_ACCEPT;
+ return MSC_CONN_ACCEPT;
+ if (conn->loc_operation || conn->sec_operation || conn->anch_operation)
+ 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;
#endif
}