aboutsummaryrefslogtreecommitdiffstats
path: root/src/bsc.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-02-15 20:25:10 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-02-17 19:34:27 +0100
commit2ff47b8606d93a301cf6cecb0d32fa4b77f5c5c9 (patch)
tree8bb6b8fda84e79b62d22479655afd7b04e4a2ee3 /src/bsc.c
parent1927e638e18ff03a77a9e227c12f7050559a93c5 (diff)
bsc: Allocate the bsc with talloc instead
Allocate the bsc with talloc to have a nice root context for everything in the system.
Diffstat (limited to 'src/bsc.c')
-rw-r--r--src/bsc.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/bsc.c b/src/bsc.c
new file mode 100644
index 0000000..c26c6ec
--- /dev/null
+++ b/src/bsc.c
@@ -0,0 +1,54 @@
+/* Everything related to the global BSC */
+/*
+ * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010-2011 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <bsc_data.h>
+#include <cellmgr_debug.h>
+#include <mtp_level3.h>
+
+#include <osmocore/talloc.h>
+
+struct bsc_data *bsc_data_create()
+{
+ struct bsc_data *bsc;
+
+ bsc = talloc_zero(NULL, struct bsc_data);
+ if (!bsc) {
+ LOGP(DINP, LOGL_ERROR, "Failed to create the BSC.\n");
+ return NULL;
+ }
+
+ INIT_LLIST_HEAD(&bsc->links);
+ bsc->dpc = 1;
+ bsc->opc = 0;
+ bsc->sccp_opc = -1;
+ bsc->isup_opc = -1;
+ bsc->udp_port = 3456;
+ bsc->udp_ip = NULL;
+ bsc->udp_nr_links = 1;
+ bsc->src_port = 1313;
+ bsc->ni_ni = MTP_NI_NATION_NET;
+ bsc->ni_spare = 0;
+ bsc->setup = 0;
+ bsc->pcap_fd = -1;
+ bsc->udp_reset_timeout = 180;
+
+ return bsc;
+}