blob: 76e4437c456b4124229451e37f29e90cc2ec4f1b [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 Freythera7bc3aa2011-02-16 16:12:07 +010033struct ss7_application;
Holger Hans Peter Freythere86c02e2011-02-10 15:32:14 +010034
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 Freythera7bc3aa2011-02-16 16:12:07 +010058 /* Link to the SS7 Application */
59 struct ss7_application *app;
Holger Hans Peter Freyther569f1e12011-01-02 18:47:49 +010060 struct mtp_link_set *link;
Holger Hans Peter Freyther5d930f82010-10-08 23:18:15 +080061
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080062 /* sls id */
63 int sls;
64};
65
Holger Hans Peter Freyther35948552010-09-30 17:30:50 +080066void free_con(struct active_sccp_con *con);
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010067struct active_sccp_con *find_con_by_dest_ref(struct ss7_application *, struct sccp_source_reference *ref);
68struct active_sccp_con *find_con_by_src_ref(struct ss7_application *,struct sccp_source_reference *src_ref);
69struct active_sccp_con *find_con_by_src_dest_ref(struct ss7_application *, struct sccp_source_reference *src_ref,
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080070 struct sccp_source_reference *dst_ref);
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010071unsigned int sls_for_src_ref(struct ss7_application *, struct sccp_source_reference *ref);
Holger Hans Peter Freyther1cb634a2010-09-30 16:10:17 +080072
Holger Hans Peter Freytherc5200fc2011-02-16 22:35:30 +010073void app_resources_released(struct ss7_application *ss7);
74void app_clear_connections(struct ss7_application *ss7);
Holger Hans Peter Freyther64b7d562011-02-16 23:00:50 +010075void app_forward_sccp(struct ss7_application *ss7, struct msgb *_msg, int sls);
Holger Hans Peter Freytherc5200fc2011-02-16 22:35:30 +010076
Holger Hans Peter Freytherb3e10682010-09-30 01:57:45 +080077#endif