aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/gsm_data.h')
-rw-r--r--openbsc/include/openbsc/gsm_data.h101
1 files changed, 78 insertions, 23 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 52b82c062..b58265fbf 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -85,31 +85,13 @@ typedef int gsm_cbfn(unsigned int hooknum,
struct msgb *msg,
void *data, void *param);
-/*
- * Use the channel. As side effect the lchannel recycle timer
- * will be started.
- */
-#define LCHAN_RELEASE_TIMEOUT 20, 0
-#define use_subscr_con(con) \
- do { (con)->use_count++; \
- DEBUGP(DREF, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) increases usage to: %d\n", \
- (con)->lchan->ts->trx->bts->nr, (con)->lchan->ts->trx->nr, (con)->lchan->ts->nr, \
- (con)->lchan->nr, (con)->use_count); \
- bsc_schedule_timer(&(con)->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0);
-
-#define put_subscr_con(con) \
- do { (con)->use_count--; \
- DEBUGP(DREF, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) decreases usage to: %d\n", \
- (con)->lchan->ts->trx->bts->nr, (con)->lchan->ts->trx->nr, (con)->lchan->ts->nr, \
- (con)->lchan->nr, (con)->use_count); \
- } while(0);
-
-
/* communications link with a BTS */
struct gsm_bts_link {
struct gsm_bts *bts;
};
+struct sccp_connection;
+
/* Real authentication information containing Ki */
enum gsm_auth_algo {
AUTH_ALGO_NONE,
@@ -137,6 +119,43 @@ struct gsm_subscriber;
struct gsm_mncc;
struct rtp_socket;
+/* BSC/MSC data holding them together */
+struct bss_sccp_connection_data {
+ struct gsm_lchan *lchan;
+ struct gsm_lchan *secondary_lchan;
+ struct sccp_connection *sccp;
+ int ciphering_handled : 1;
+
+ /* Timers... */
+
+ /* for assginment command */
+ struct timer_list T10;
+
+ /* for SCCP ... */
+ struct timer_list sccp_it;
+
+ /* audio handling */
+ int rtp_port;
+
+ /* Queue SCCP and GSM0408 messages */
+ int block_gsm;
+ struct llist_head gsm_queue;
+ unsigned int gsm_queue_size;
+
+ struct llist_head sccp_queue;
+ unsigned int sccp_queue_size;
+
+ /* Active connections */
+ struct llist_head active_connections;
+};
+
+#define GSM0808_T10_VALUE 6, 0
+#define sccp_get_lchan(data_ctx) ((struct bss_sccp_connection_data *)data_ctx)->lchan
+#define lchan_get_sccp(lchan) lchan->msc_data->sccp
+struct bss_sccp_connection_data *bss_sccp_create_data();
+void bss_sccp_free_data(struct bss_sccp_connection_data *);
+
+
/* Network Management State */
struct gsm_nm_state {
u_int8_t operational;
@@ -185,6 +204,7 @@ enum gsm_lchan_state {
LCHAN_S_ACT_REQ, /* channel activatin requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
+ LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_INACTIVE, /* channel is set inactive */
};
@@ -193,9 +213,6 @@ struct gsm_subscriber_connection {
/* To whom we are allocated at the moment */
struct gsm_subscriber *subscr;
- /* Timer started to release the channel */
- struct timer_list release_timer;
-
/*
* Operations that have a state and might be pending
*/
@@ -236,6 +253,8 @@ struct gsm_lchan {
} encr;
struct timer_list T3101;
+ struct timer_list T3111;
+ struct timer_list error_timer;
/* AMR bits */
struct gsm48_multi_rate_conf mr_conf;
@@ -243,6 +262,12 @@ struct gsm_lchan {
/* Established data link layer services */
u_int8_t sapis[8];
+ /*
+ * MSC handling...
+ */
+ struct bss_sccp_connection_data *msc_data;
+
+
/* cache of last measurement reports on this lchan */
struct gsm_meas_rep meas_rep[6];
int meas_rep_idx;
@@ -263,6 +288,9 @@ struct gsm_lchan {
} abis_ip;
struct gsm_subscriber_connection conn;
+
+ /* release reason */
+ u_int8_t release_reason;
};
struct gsm_e1_subslot {
@@ -560,6 +588,14 @@ enum gsm_auth_policy {
#define GSM_T3101_DEFAULT 10
#define GSM_T3113_DEFAULT 60
+/*
+ * internal data for audio management
+ */
+struct gsm_audio_support {
+ u_int8_t hr : 1,
+ ver : 7;
+};
+
struct gsm_network {
/* global parameters */
u_int16_t country_code;
@@ -590,6 +626,11 @@ struct gsm_network {
struct gsmnet_stats stats;
+ struct gsm_audio_support **audio_support;
+ int audio_length;
+ int rtp_payload;
+ int rtp_base_port;
+
/* layer 4 */
int (*mncc_recv) (struct gsm_network *net, int msg_type, void *arg);
struct llist_head upqueue;
@@ -615,6 +656,20 @@ struct gsm_network {
struct {
enum rrlp_mode mode;
} rrlp;
+
+ enum gsm_chan_t ctype_by_chreq[16];
+
+ /* Use a TCH for handling requests of type paging any */
+ int pag_any_tch;
+
+ /* a hack for On Waves. It must be signed */
+ int32_t core_country_code;
+ int32_t core_network_code;
+
+ /* a simple token for this network... */
+ char *bsc_token;
+ char *msc_ip;
+ int msc_port;
};
#define SMS_HDR_SIZE 128