blob: 7d3d354d8ffdddad33cc1c08fb1aa894db162158 [file] [log] [blame]
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +01001/*
2 * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
3 * (C) 2010-2011 by On-Waves
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#ifndef MSC_CONNECTION_H
21#define MSC_CONNECTION_H
22
23#include <osmocore/linuxlist.h>
24#include <osmocore/write_queue.h>
25#include <osmocore/timer.h>
26
27#include <osmocom/sccp/sccp.h>
28
29struct bsc_data;
30struct ss7_application;
31
32struct msc_connection {
33 /* management */
34 struct llist_head entry;
35 int nr;
36 char *name;
37
38 /* ip management */
39 int dscp;
40 char *ip;
41 char *token;
42
43 /* connection management */
44 int msc_link_down;
45 struct write_queue msc_connection;
46 struct timer_list reconnect_timer;
47 int first_contact;
48
49 /* time to wait for first message from MSC */
50 struct timer_list msc_timeout;
51 int msc_time;
52
53 /* timeouts for the msc connection */
54 int ping_time;
55 int pong_time;
56 struct timer_list ping_timeout;
57 struct timer_list pong_timeout;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010058
59 /* mgcp messgaes */
60 struct write_queue mgcp_agent;
61
62 /* application pointer */
Holger Hans Peter Freythera7bc3aa2011-02-16 16:12:07 +010063 struct ss7_application *app;
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010064};
65
66/* msc related functions */
67void msc_send_rlc(struct msc_connection *bsc, struct sccp_source_reference *src, struct sccp_source_reference *dest);
68void msc_send_reset(struct msc_connection *bsc);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010069void msc_send_direct(struct msc_connection *bsc, struct msgb *msg);
70void msc_close_connection(struct msc_connection *data);
71
72struct msc_connection *msc_connection_create(struct bsc_data *bsc, int mgcp);
73struct msc_connection *msc_connection_num(struct bsc_data *bsc, int num);
74int msc_connection_start(struct msc_connection *msc);
75
76/* MGCP */
Holger Hans Peter Freytherc5200fc2011-02-16 22:35:30 +010077void msc_mgcp_reset(struct msc_connection *msc);
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010078
Holger Hans Peter Freyther3d4d8c72011-02-15 21:14:09 +010079/* Called by the MSC Connection */
80void msc_dispatch_sccp(struct msc_connection *msc, struct msgb *msg);
81
82
Holger Hans Peter Freyther84ec8712011-02-15 20:01:47 +010083#endif