aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bsc_api.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-17 16:41:25 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-17 16:41:25 +0800
commit9764331062643d5b0771d2a93e6e503f0c029a9a (patch)
tree20f0a029c3affa7ce13a19a583e3b0d89b860aa6 /openbsc/src/bsc_api.c
parent86481c29d4cc9bed3010db466be6e0757458b031 (diff)
bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.
The next step in the way to the BSC API. We have a clear a new connection was opened signal now... and the MSC could use it...
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r--openbsc/src/bsc_api.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 28fc324a3..02fc47309 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -27,6 +27,7 @@
#include <openbsc/gsm_data.h>
#include <openbsc/signal.h>
#include <openbsc/abis_rsl.h>
+#include <openbsc/chan_alloc.h>
#include <osmocore/talloc.h>
@@ -84,6 +85,27 @@ int bsc_upqueue(struct gsm_network *net)
return work;
}
+int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
+{
+ int rc;
+ struct gsm_subscriber_connection *conn;
+ struct bsc_api *api = msg->lchan->ts->trx->bts->network->bsc_api;
+
+ conn = &msg->lchan->conn;
+ if (conn->allocated) {
+ api->dtap(conn, msg);
+ } else {
+ /* accept the connection or close the lchan */
+ rc = api->compl_l3(conn, msg, 0);
+ if (rc == BSC_API_CONN_POL_ACCEPT)
+ conn->allocated = 1;
+ else
+ lchan_auto_release(msg->lchan);
+ }
+
+ return 0;
+}
+
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id)
{
struct bsc_api *api;