blob: 22bbb2ede9882bce56b0906fc7e6da455e0ef582 [file] [log] [blame]
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +01001/* Stuff to handle the SS7 application */
2/*
3 * (C) 2011 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * All Rights Reserved
5 *
6 * 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
9 * (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
14 * GNU Affero General Public License for more details.
15 *
16 * 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/>.
18 *
19 */
20
21#ifndef SS7_APPLICATION_H
22#define SS7_APPLICATION_H
23
Harald Welteff397ed2011-05-08 10:29:23 +020024#include <osmocom/core/linuxlist.h>
25#include <osmocom/core/timer.h>
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010026
27struct bsc_data;
28struct msc_connection;
29struct mtp_link_set;
30struct mtp_link;
31
32enum ss7_set_type {
33 SS7_SET_LINKSET,
34 SS7_SET_MSC,
35};
36
37enum ss7_app_type {
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010038 APP_NONE,
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010039 APP_CELLMGR,
40 APP_RELAY,
41 APP_STP,
42};
43
44struct ss7_application_route {
45 int type;
46 int nr;
47
Holger Hans Peter Freytherd38b87a2011-03-03 00:45:49 +010048 int up;
49
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010050 /* maybe they were resolved */
51 struct mtp_link_set *set;
52 struct msc_connection *msc;
53};
54
55struct ss7_application {
56 /* handling */
57 struct llist_head entry;
58 int nr;
59 char *name;
60
61 /* app type */
62 int type;
63
64 /* for the routing */
Holger Hans Peter Freyther71760302011-02-22 20:57:08 +010065 int route_is_set;
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010066 struct ss7_application_route route_src;
67 struct ss7_application_route route_dst;
68
69 struct bsc_data *bsc;
70
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +010071 /* isup handling */
72 int isup_pass;
73
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010074 /* handling for the NAT/State handling */
75 struct llist_head sccp_connections;
Harald Welteff397ed2011-05-08 10:29:23 +020076 struct osmo_timer_list reset_timeout;
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010077 struct mtp_link_set *target_link;
78 int forward_only;
79 int reset_count;
80};
81
82
83struct ss7_application *ss7_application_alloc(struct bsc_data *);
84struct ss7_application *ss7_application_num(struct bsc_data *, int nr);
85int ss7_application_setup(struct ss7_application *, int type,
86 int src_type, int src_num,
87 int dst_type, int dst_num);
88
Holger Hans Peter Freytherab7c6012011-02-16 22:23:52 +010089int ss7_application_start(struct ss7_application *);
90
Holger Hans Peter Freythercfe9d712011-02-17 20:32:09 +010091/* config changes */
92void ss7_application_pass_isup(struct ss7_application *, int pass);
93
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010094#endif