blob: 9543002a7c56c03fd2beb060b73cdebe9d641a4a [file] [log] [blame]
Jonathan Santos03fd8d02011-05-25 13:54:02 -04001/* Routines to talk to the MSC using the IPA Protocol */
2/*
3 * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * (C) 2010 by On-Waves
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BSC_MSC_H
23#define BSC_MSC_H
24
Jonathan Santos5a45b152011-08-17 15:33:57 -040025#include <osmocom/core/write_queue.h>
26#include <osmocom/core/timer.h>
27
28struct bsc_msc_dest {
29 struct llist_head list;
30
31 char *ip;
32 int port;
33 int dscp;
34};
35
Jonathan Santos03fd8d02011-05-25 13:54:02 -040036
37struct bsc_msc_connection {
Jonathan Santos5a45b152011-08-17 15:33:57 -040038 struct osmo_wqueue write_queue;
Jonathan Santos03fd8d02011-05-25 13:54:02 -040039 int is_connected;
40 int is_authenticated;
41 int first_contact;
Jonathan Santos5a45b152011-08-17 15:33:57 -040042
43 struct llist_head *dests;
Jonathan Santos03fd8d02011-05-25 13:54:02 -040044
45 void (*connection_loss) (struct bsc_msc_connection *);
46 void (*connected) (struct bsc_msc_connection *);
Jonathan Santos5a45b152011-08-17 15:33:57 -040047 struct osmo_timer_list reconnect_timer;
48 struct osmo_timer_list timeout_timer;
Jonathan Santos03fd8d02011-05-25 13:54:02 -040049};
50
Jonathan Santos5a45b152011-08-17 15:33:57 -040051struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040052int bsc_msc_connect(struct bsc_msc_connection *);
53void bsc_msc_schedule_connect(struct bsc_msc_connection *);
54
55void bsc_msc_lost(struct bsc_msc_connection *);
56
57struct msgb *bsc_msc_id_get_resp(const char *token);
58
59#endif