Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 29 | struct bsc_data; |
| 30 | struct ss7_application; |
| 31 | |
| 32 | struct 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 Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 58 | |
| 59 | /* mgcp messgaes */ |
| 60 | struct write_queue mgcp_agent; |
| 61 | |
| 62 | /* application pointer */ |
Holger Hans Peter Freyther | a7bc3aa | 2011-02-16 16:12:07 +0100 | [diff] [blame] | 63 | struct ss7_application *app; |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | /* msc related functions */ |
| 67 | void msc_send_rlc(struct msc_connection *bsc, struct sccp_source_reference *src, struct sccp_source_reference *dest); |
| 68 | void msc_send_reset(struct msc_connection *bsc); |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 69 | void msc_send_direct(struct msc_connection *bsc, struct msgb *msg); |
| 70 | void msc_close_connection(struct msc_connection *data); |
| 71 | |
| 72 | struct msc_connection *msc_connection_create(struct bsc_data *bsc, int mgcp); |
| 73 | struct msc_connection *msc_connection_num(struct bsc_data *bsc, int num); |
| 74 | int msc_connection_start(struct msc_connection *msc); |
| 75 | |
| 76 | /* MGCP */ |
Holger Hans Peter Freyther | c5200fc | 2011-02-16 22:35:30 +0100 | [diff] [blame] | 77 | void msc_mgcp_reset(struct msc_connection *msc); |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 78 | |
Holger Hans Peter Freyther | 3d4d8c7 | 2011-02-15 21:14:09 +0100 | [diff] [blame] | 79 | /* Called by the MSC Connection */ |
| 80 | void msc_dispatch_sccp(struct msc_connection *msc, struct msgb *msg); |
| 81 | |
| 82 | |
Holger Hans Peter Freyther | 84ec871 | 2011-02-15 20:01:47 +0100 | [diff] [blame] | 83 | #endif |