aboutsummaryrefslogtreecommitdiffstats
path: root/include/ss7_application.h
blob: 084a8f744323804fa9e24f37aa8143e45beb467e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* Stuff to handle the SS7 application */
/*
 * (C) 2011 by Holger Hans Peter Freyther <zecke@selfish.org>
 * 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 <http://www.gnu.org/licenses/>.
 *
 */

#ifndef SS7_APPLICATION_H
#define SS7_APPLICATION_H

#include <osmocore/linuxlist.h>
#include <osmocore/timer.h>

struct bsc_data;
struct msc_connection;
struct mtp_link_set;
struct mtp_link;

enum ss7_set_type {
	SS7_SET_LINKSET,
	SS7_SET_MSC,
};

enum ss7_app_type {
	APP_NONE,
	APP_CELLMGR,
	APP_RELAY,
	APP_STP,
};

struct ss7_application_route {
	int type;
	int nr;

	/* maybe they were resolved */
	struct mtp_link_set *set;
	struct msc_connection *msc;
};

struct ss7_application {
	/* handling */
	struct llist_head entry;
	int nr;
	char *name;

	/* app type */
	int type;

	/* for the routing */
	int route_is_set;
	struct ss7_application_route route_src;
	struct ss7_application_route route_dst;

	struct bsc_data *bsc;

	/* isup handling */
	int isup_pass;

	/* handling for the NAT/State handling */
	struct llist_head sccp_connections;
	struct timer_list reset_timeout;
	struct mtp_link_set *target_link;
	int forward_only;
	int reset_count;
};


struct ss7_application *ss7_application_alloc(struct bsc_data *);
struct ss7_application *ss7_application_num(struct bsc_data *, int nr);
int ss7_application_setup(struct ss7_application *, int type,
			  int src_type, int src_num,
			  int dst_type, int dst_num);

int ss7_application_start(struct ss7_application *);

/* config changes */
void ss7_application_pass_isup(struct ss7_application *, int pass);

#endif