aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-10-07 09:50:21 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-20 17:35:45 +0100
commit2281d1835f1fc95bb7a235ec04ff28d9b93781b8 (patch)
tree4f52e8713649eb26f28287e3aaf96afc695bfeab /openbsc/include
parentfb4433a129ca7b0757baee834a1e5a6ba4c5bd85 (diff)
[bssap] Start to queue messages to the BTS and to the MSC
For the MSC we need to queue GSM04.08 messages until the SCCP connection is confirmed to be open and then can send the stored messages. The queue is limited to 10 messages at which point new ones will be dropped. Currently the only messages we get are measurement indication messages but it is better to be safe than sorry. The SCCP messages are sent as soon as the connection is considered established and then no queueing happens any more. While replacing sccp_connection_write calls various memory leaks has been fixed. For the MS we might have received a DTAP and need to do an operation that requires a roundtrip and want to send wait until this has happened. The two scenerios are sending a SMS to the phone that requires to do something special for the different SAPI. Currently it is assumed that only one SAPI=0 -> SAPI=3 change happen during the connection. For the first SAPI != 0 we will send the rll_ request and then wait for the timeout or confirmation. In case of timeout a SAPI "n" reject is sent and in case of success the queue is getting emptied.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/bssap.h8
-rw-r--r--openbsc/include/openbsc/gsm_data.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bssap.h b/openbsc/include/openbsc/bssap.h
index 1db026525..d6553409a 100644
--- a/openbsc/include/openbsc/bssap.h
+++ b/openbsc/include/openbsc/bssap.h
@@ -278,4 +278,12 @@ struct msgb *bssmap_create_sapi_reject(u_int8_t link_id);
int dtap_rcvmsg(struct gsm_lchan *lchan, struct msgb *msg, unsigned int length);
struct msgb *dtap_create_msg(struct msgb *msg_l3, u_int8_t link_id);
+void bsc_queue_connection_write(struct sccp_connection *conn, struct msgb *msg);
+void bsc_free_queued(struct sccp_connection *conn);
+void bsc_send_queued(struct sccp_connection *conn);
+
+void bts_queue_send(struct msgb *msg, int link_id);
+void bts_send_queued(struct bss_sccp_connection_data*);
+void bts_free_queued(struct bss_sccp_connection_data*);
+
#endif
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 8a9446a5e..d01973e4b 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -121,6 +121,13 @@ struct bss_sccp_connection_data {
struct gsm_lchan *lchan;
struct sccp_connection *sccp;
int ciphering_handled : 1;
+
+ /* Queue SCCP and GSM0408 messages */
+ struct llist_head gsm_queue;
+ unsigned int gsm_queue_size;
+
+ struct llist_head sccp_queue;
+ unsigned int sccp_queue_size;
};
#define sccp_get_lchan(data_ctx) ((struct bss_sccp_connection_data *)data_ctx)->lchan