summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-06-07 19:57:02 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-05-02 19:24:29 +0200
commite0a228e135fedd5f61f0f360034b4eb9628388db (patch)
tree8745740b125bcbd6ac77e259ccab15c600207192
parentedc63caa074ee07cc0bb15b2aa822ad73c8bbbf7 (diff)
bsc: Move the finding of a MSC into the filter code
For responding to paging on the right link we will need to figure out if the msg is a paging response.
-rw-r--r--openbsc/include/openbsc/osmo_bsc.h1
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_api.c21
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_filter.c19
3 files changed, 21 insertions, 20 deletions
diff --git a/openbsc/include/openbsc/osmo_bsc.h b/openbsc/include/openbsc/osmo_bsc.h
index 0e904c987..bf582b20a 100644
--- a/openbsc/include/openbsc/osmo_bsc.h
+++ b/openbsc/include/openbsc/osmo_bsc.h
@@ -36,6 +36,7 @@ int bsc_create_new_connection(struct gsm_subscriber_connection *conn,
struct osmo_msc_data *msc);
int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp);
+struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *);
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c
index 2d2b804f4..067ebabf5 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_api.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c
@@ -81,25 +81,6 @@ static void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn,
queue_msg_or_return(resp);
}
-static struct osmo_msc_data *find_msc(struct gsm_subscriber_connection *conn,
- struct msgb *msg)
-{
- struct osmo_bsc_data *bsc;
- struct osmo_msc_data *msc;
-
- bsc = conn->bts->network->bsc_data;
- llist_for_each_entry(msc, &bsc->mscs, entry) {
- if (!msc->msc_con->is_authenticated)
- continue;
-
- /* force round robin by moving it to the end */
- llist_move_tail(&msc->entry, &bsc->mscs);
- return msc;
- }
-
- return NULL;
-}
-
/*
* Instruct to reserve data for a new connectiom, create the complete
* layer three message, send it to open the connection.
@@ -115,7 +96,7 @@ static int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg
LOGP(DMSC, LOGL_INFO, "Tx MSC COMPL L3\n");
/* find the MSC link we want to use */
- msc = find_msc(conn, msg);
+ msc = bsc_find_msc(conn, msg);
if (!msc) {
LOGP(DMSC, LOGL_ERROR, "Failed to find a MSC for a connection.\n");
return -1;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
index 9d6909caa..7271fc8c3 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c
@@ -97,6 +97,25 @@ static int handle_page_resp(struct gsm_subscriber_connection *conn, struct msgb
subscr_put(subscr);
return 0;
}
+struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn,
+ struct msgb *msg)
+{
+ struct osmo_bsc_data *bsc;
+ struct osmo_msc_data *msc;
+
+ bsc = conn->bts->network->bsc_data;
+ llist_for_each_entry(msc, &bsc->mscs, entry) {
+ if (!msc->msc_con->is_authenticated)
+ continue;
+
+ /* force round robin by moving it to the end */
+ llist_move_tail(&msc->entry, &bsc->mscs);
+ return msc;
+ }
+
+ return NULL;
+}
+
/**
* This is used to scan a message for extra functionality of the BSC. This