blob: 8811a2b073e032d78b8f27e5a1b608eba384f06f [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 Freytherb3e10682010-09-30 01:57:45 +080033/*
34 * One SCCP connection.
35 * Use for connection tracking and fixups...
36 */
37struct active_sccp_con {
38 struct llist_head entry;
39
40 struct sccp_source_reference src_ref;
41 struct sccp_source_reference dst_ref;
42
43 int has_dst_ref;
44
45 /* fixup stuff */
46
47 /* We get a RLSD from the MSC and need to send a RLC */
48 int released_from_msc;
49
50 /* timeout for waiting for the RLC */
51 struct timer_list rlc_timeout;
52
53 /* how often did we send a RLSD this */
54 unsigned int rls_tries;
55
Holger Hans Peter Freyther5d930f82010-10-08 23:18:15 +080056 /* MTP link this was coming in */
Holger Hans Peter Freyther569f1e12011-01-02 18:47:49 +010057 struct mtp_link_set *link;
Holger Hans Peter Freyther5d930f82010-10-08 23:18:15 +080058
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080059 /* sls id */
60 int sls;
61};
62
Holger Hans Peter Freyther35948552010-09-30 17:30:50 +080063void free_con(struct active_sccp_con *con);
64struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref);
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080065struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_ref);
66struct active_sccp_con *find_con_by_src_dest_ref(struct sccp_source_reference *src_ref,
67 struct sccp_source_reference *dst_ref);
68unsigned int sls_for_src_ref(struct sccp_source_reference *ref);
69
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080070#endif