blob: 72e376c15bff1ba72869b3d3c35fe3876b68406e [file] [log] [blame]
Holger Hans Peter Freythereef86b52010-06-15 18:45:06 +08001/* Routines to talk to the MSC using the IPA Protocol */
2/*
3 * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
Holger Hans Peter Freytherdf6143a2010-06-15 18:46:56 +08004 * (C) 2010 by On-Waves
Holger Hans Peter Freythereef86b52010-06-15 18:45:06 +08005 * 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 General Public License as published by
9 * the Free Software Foundation; either version 2 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 General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 */
22
23#ifndef BSC_MSC_H
24#define BSC_MSC_H
25
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080026#include <osmocore/write_queue.h>
27#include <osmocore/timer.h>
Holger Hans Peter Freythereef86b52010-06-15 18:45:06 +080028
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080029struct bsc_msc_connection {
30 struct write_queue write_queue;
31 int is_connected;
Holger Hans Peter Freyther8bdcf552010-06-15 18:50:48 +080032 int is_authenticated;
Holger Hans Peter Freytherbec411b2010-07-05 14:14:18 +080033 int first_contact;
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080034 const char *ip;
35 int port;
Holger Hans Peter Freytherca999a92010-06-15 18:52:38 +080036 int prio;
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080037
38 void (*connection_loss) (struct bsc_msc_connection *);
39 void (*connected) (struct bsc_msc_connection *);
40 struct timer_list reconnect_timer;
Holger Hans Peter Freythere47a91b2010-05-05 22:48:56 +080041 struct timer_list timeout_timer;
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080042};
43
Holger Hans Peter Freytherca999a92010-06-15 18:52:38 +080044struct bsc_msc_connection *bsc_msc_create(const char *ip, int port, int prio);
Holger Hans Peter Freytherbaf2abe2010-06-15 18:47:29 +080045int bsc_msc_connect(struct bsc_msc_connection *);
46void bsc_msc_schedule_connect(struct bsc_msc_connection *);
47
48void bsc_msc_lost(struct bsc_msc_connection *);
Holger Hans Peter Freythereef86b52010-06-15 18:45:06 +080049
Holger Hans Peter Freytherf76e7ef2010-06-15 18:52:05 +080050struct msgb *bsc_msc_id_get_resp(const char *token);
51
Holger Hans Peter Freythereef86b52010-06-15 18:45:06 +080052#endif