aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-26 09:58:40 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-26 09:58:40 +0100
commita91d15df7e1dd12b08e85910a51582ac257ce3e7 (patch)
tree908ef085ca8afb0dad42bc3377be4c0afdda0d9f
parent3368e2a3d14e6014cca98c06b26cf7431d48a9b2 (diff)
bsc_msc_ip: Keep track of active connections so we could clear them.
Keep track of SCCP connections so we can clear them when the MSC is going down.
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/src/bsc_msc_ip.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 88f8ab31b..6005dee6a 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -138,6 +138,9 @@ struct bss_sccp_connection_data {
struct llist_head sccp_queue;
unsigned int sccp_queue_size;
+
+ /* Active connections */
+ struct llist_head active_connections;
};
#define GSM0808_T10_VALUE 6, 0
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index e95f0050e..b8f2279a0 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -60,6 +60,7 @@ static const char *config_file = "openbsc.cfg";
static char *msc_address = "127.0.0.1";
static struct write_queue msc_queue;
static struct in_addr local_addr;
+static LLIST_HEAD(active_connections);
extern int ipacc_rtp_direct;
extern int bsc_bootstrap_network(int (*layer4)(struct gsm_network *, int, void *), const char *cfg_file);
@@ -77,6 +78,7 @@ struct bss_sccp_connection_data *bss_sccp_create_data()
INIT_LLIST_HEAD(&data->sccp_queue);
INIT_LLIST_HEAD(&data->gsm_queue);
+ llist_add_tail(&data->active_connections, &active_connections);
return data;
}
@@ -86,6 +88,7 @@ void bss_sccp_free_data(struct bss_sccp_connection_data *data)
bsc_del_timer(&data->sccp_it);
bsc_free_queued(data->sccp);
bts_free_queued(data);
+ llist_del(&data->active_connections);
talloc_free(data);
}