aboutsummaryrefslogtreecommitdiffstats
path: root/src/bsc_sccp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-30 17:30:50 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-30 17:30:50 +0800
commit35948551fd07441af1fa3a9d4985b08fdbdc7a33 (patch)
treec0b9b8e6fcd14762c606ea98a7ba28bc896ec509 /src/bsc_sccp.c
parent1cb634a1e22987559f3d347c9e404b5eeb21cd73 (diff)
bsc: Move more sccp code into the bsc_sccp.c
Diffstat (limited to 'src/bsc_sccp.c')
-rw-r--r--src/bsc_sccp.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bsc_sccp.c b/src/bsc_sccp.c
index a10a4b6..c588029 100644
--- a/src/bsc_sccp.c
+++ b/src/bsc_sccp.c
@@ -23,10 +23,33 @@
#include "bsc_sccp.h"
#include "bsc_data.h"
+#include <cellmgr_debug.h>
+
+#include <osmocore/talloc.h>
+
#include <string.h>
extern struct bsc_data bsc;
+struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref)
+{
+ struct active_sccp_con *con;
+
+ if (!ref) {
+ LOGP(DINP, LOGL_ERROR, "Dest Reference is NULL. No connection found.\n");
+ return NULL;
+ }
+
+ llist_for_each_entry(con, &bsc.sccp_connections, entry) {
+ if (memcmp(&con->dst_ref, ref, sizeof(*ref)) == 0)
+ return con;
+ }
+
+ LOGP(DINP, LOGL_ERROR, "No connection fond with: 0x%x as dest\n", sccp_src_ref_to_int(ref));
+ return NULL;
+}
+
+
struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_ref)
{
struct active_sccp_con *con;
@@ -68,3 +91,13 @@ unsigned int sls_for_src_ref(struct sccp_source_reference *ref)
return con->sls;
}
+/*
+ * remove data
+ */
+void free_con(struct active_sccp_con *con)
+{
+ llist_del(&con->entry);
+ bsc_del_timer(&con->rlc_timeout);
+ talloc_free(con);
+}
+