Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 1 | /* 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 Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 25 | #include <osmocom/core/write_queue.h> |
| 26 | #include <osmocom/core/timer.h> |
| 27 | |
| 28 | struct bsc_msc_dest { |
| 29 | struct llist_head list; |
| 30 | |
| 31 | char *ip; |
| 32 | int port; |
| 33 | int dscp; |
| 34 | }; |
| 35 | |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 36 | |
| 37 | struct bsc_msc_connection { |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 38 | struct osmo_wqueue write_queue; |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 39 | int is_connected; |
| 40 | int is_authenticated; |
| 41 | int first_contact; |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 42 | |
| 43 | struct llist_head *dests; |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 44 | |
| 45 | void (*connection_loss) (struct bsc_msc_connection *); |
| 46 | void (*connected) (struct bsc_msc_connection *); |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 47 | struct osmo_timer_list reconnect_timer; |
| 48 | struct osmo_timer_list timeout_timer; |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 49 | }; |
| 50 | |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 51 | struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest); |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 52 | int bsc_msc_connect(struct bsc_msc_connection *); |
| 53 | void bsc_msc_schedule_connect(struct bsc_msc_connection *); |
| 54 | |
| 55 | void bsc_msc_lost(struct bsc_msc_connection *); |
| 56 | |
| 57 | struct msgb *bsc_msc_id_get_resp(const char *token); |
| 58 | |
| 59 | #endif |