blob: 833257da360bbe3c15d8cfa0bbcbf209948bee0b [file] [log] [blame]
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +08001/*
2 * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
3 * (C) 2010 by On-Waves
4 * All Rights Reserved
5 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +01006 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +08009 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010014 * GNU Affero General Public License for more details.
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080015 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010016 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080018 *
19 */
20
21#ifndef bsc_sccp_h
22#define bsc_sccp_h
23
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080024#include <inttypes.h>
25
26#include <osmocore/linuxlist.h>
27#include <osmocore/timer.h>
28
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080029#include <osmocore/protocol/gsm_08_08.h>
30
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080031#include <osmocom/sccp/sccp.h>
32
Holger Hans Peter Freythere86c02e2011-02-10 15:32:14 +010033struct bsc_msc_forward;
34
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080035/*
36 * One SCCP connection.
37 * Use for connection tracking and fixups...
38 */
39struct active_sccp_con {
40 struct llist_head entry;
41
42 struct sccp_source_reference src_ref;
43 struct sccp_source_reference dst_ref;
44
45 int has_dst_ref;
46
47 /* fixup stuff */
48
49 /* We get a RLSD from the MSC and need to send a RLC */
50 int released_from_msc;
51
52 /* timeout for waiting for the RLC */
53 struct timer_list rlc_timeout;
54
55 /* how often did we send a RLSD this */
56 unsigned int rls_tries;
57
Holger Hans Peter Freyther5d930f82010-10-08 23:18:15 +080058 /* MTP link this was coming in */
Holger Hans Peter Freyther569f1e12011-01-02 18:47:49 +010059 struct mtp_link_set *link;
Holger Hans Peter Freyther5d930f82010-10-08 23:18:15 +080060
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080061 /* sls id */
62 int sls;
63};
64
Holger Hans Peter Freyther35948552010-09-30 17:30:50 +080065void free_con(struct active_sccp_con *con);
Holger Hans Peter Freythere86c02e2011-02-10 15:32:14 +010066struct active_sccp_con *find_con_by_dest_ref(struct bsc_msc_forward *, struct sccp_source_reference *ref);
67struct active_sccp_con *find_con_by_src_ref(struct bsc_msc_forward *,struct sccp_source_reference *src_ref);
68struct active_sccp_con *find_con_by_src_dest_ref(struct bsc_msc_forward *, struct sccp_source_reference *src_ref,
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080069 struct sccp_source_reference *dst_ref);
Holger Hans Peter Freythere86c02e2011-02-10 15:32:14 +010070unsigned int sls_for_src_ref(struct bsc_msc_forward *, struct sccp_source_reference *ref);
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080071
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080072#endif