From 2ff47b8606d93a301cf6cecb0d32fa4b77f5c5c9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 15 Feb 2011 20:25:10 +0100 Subject: bsc: Allocate the bsc with talloc instead Allocate the bsc with talloc to have a nice root context for everything in the system. --- src/bsc.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/bsc.c (limited to 'src/bsc.c') 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 + * (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 . + * + */ + +#include +#include +#include + +#include + +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; +} -- cgit v1.2.3