aboutsummaryrefslogtreecommitdiffstats
path: root/include/ss7_application.h
blob: adf18f17cf8275e4d7dfa5d74071efcb91276937 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* 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 <osmocom/core/linuxlist.h>
#include <osmocom/core/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;

	int up;

	/* 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 osmo_timer_list reset_timeout;
	struct mtp_link_set *target_link;
	int forward_only;
	int reset_count;

	/* mgcp handling for the cellmgr and stp */
	char *mgcp_domain_name;
	char *trunk_name;

	/* various hacks/quirks to deal with broken equipment */
	/*
	 * Some equipments do not look into the codec list but only the
	 * size of it.
	 */
	unsigned fixed_ass_cmpl_reply : 1;
};


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);

int ss7_application_mgcp_domain_name(struct ss7_application *,
				     const char *domain_name);
int ss7_application_trunk_name(struct ss7_application *,
				const char *trunk_name);

int ss7_application_msc_down(struct ss7_application *app);
int ss7_application_msc_up(struct ss7_application *app);

#endif