Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 1 | /* |
| 2 | * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org> |
| 3 | * (C) 2010 by On-Waves |
| 4 | * All Rights Reserved |
| 5 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 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 |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 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 |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 14 | * GNU Affero General Public License for more details. |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 15 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 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/>. |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 18 | * |
| 19 | */ |
| 20 | |
| 21 | #ifndef bsc_sccp_h |
| 22 | #define bsc_sccp_h |
| 23 | |
Holger Hans Peter Freyther | 1cb634a | 2010-09-30 16:10:17 +0800 | [diff] [blame] | 24 | #include <inttypes.h> |
| 25 | |
| 26 | #include <osmocore/linuxlist.h> |
| 27 | #include <osmocore/timer.h> |
| 28 | |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 29 | #include <osmocore/protocol/gsm_08_08.h> |
| 30 | |
Holger Hans Peter Freyther | 1cb634a | 2010-09-30 16:10:17 +0800 | [diff] [blame] | 31 | #include <osmocom/sccp/sccp.h> |
| 32 | |
Holger Hans Peter Freyther | a7bc3aa | 2011-02-16 16:12:07 +0100 | [diff] [blame] | 33 | struct ss7_application; |
Holger Hans Peter Freyther | e86c02e | 2011-02-10 15:32:14 +0100 | [diff] [blame] | 34 | |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 35 | /* |
| 36 | * One SCCP connection. |
| 37 | * Use for connection tracking and fixups... |
| 38 | */ |
| 39 | struct active_sccp_con { |
| 40 | struct llist_head entry; |
| 41 | |
| 42 | struct sccp_source_reference src_ref; |
| 43 | struct sccp_source_reference dst_ref; |
| 44 | |
| 45 | int has_dst_ref; |
| 46 | |
| 47 | /* fixup stuff */ |
| 48 | |
| 49 | /* We get a RLSD from the MSC and need to send a RLC */ |
| 50 | int released_from_msc; |
| 51 | |
| 52 | /* timeout for waiting for the RLC */ |
| 53 | struct timer_list rlc_timeout; |
| 54 | |
| 55 | /* how often did we send a RLSD this */ |
| 56 | unsigned int rls_tries; |
| 57 | |
Holger Hans Peter Freyther | a7bc3aa | 2011-02-16 16:12:07 +0100 | [diff] [blame] | 58 | /* Link to the SS7 Application */ |
| 59 | struct ss7_application *app; |
Holger Hans Peter Freyther | 569f1e1 | 2011-01-02 18:47:49 +0100 | [diff] [blame] | 60 | struct mtp_link_set *link; |
Holger Hans Peter Freyther | 5d930f8 | 2010-10-08 23:18:15 +0800 | [diff] [blame] | 61 | |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 62 | /* sls id */ |
| 63 | int sls; |
| 64 | }; |
| 65 | |
Holger Hans Peter Freyther | 3594855 | 2010-09-30 17:30:50 +0800 | [diff] [blame] | 66 | void free_con(struct active_sccp_con *con); |
Holger Hans Peter Freyther | a7bc3aa | 2011-02-16 16:12:07 +0100 | [diff] [blame] | 67 | struct active_sccp_con *find_con_by_dest_ref(struct ss7_application *, struct sccp_source_reference *ref); |
| 68 | struct active_sccp_con *find_con_by_src_ref(struct ss7_application *,struct sccp_source_reference *src_ref); |
| 69 | struct active_sccp_con *find_con_by_src_dest_ref(struct ss7_application *, struct sccp_source_reference *src_ref, |
Holger Hans Peter Freyther | 1cb634a | 2010-09-30 16:10:17 +0800 | [diff] [blame] | 70 | struct sccp_source_reference *dst_ref); |
Holger Hans Peter Freyther | a7bc3aa | 2011-02-16 16:12:07 +0100 | [diff] [blame] | 71 | unsigned int sls_for_src_ref(struct ss7_application *, struct sccp_source_reference *ref); |
Holger Hans Peter Freyther | 1cb634a | 2010-09-30 16:10:17 +0800 | [diff] [blame] | 72 | |
Holger Hans Peter Freyther | c5200fc | 2011-02-16 22:35:30 +0100 | [diff] [blame] | 73 | void app_resources_released(struct ss7_application *ss7); |
| 74 | void app_clear_connections(struct ss7_application *ss7); |
Holger Hans Peter Freyther | 64b7d56 | 2011-02-16 23:00:50 +0100 | [diff] [blame] | 75 | void app_forward_sccp(struct ss7_application *ss7, struct msgb *_msg, int sls); |
Holger Hans Peter Freyther | c5200fc | 2011-02-16 22:35:30 +0100 | [diff] [blame] | 76 | |
Holger Hans Peter Freyther | b3e1068 | 2010-09-30 01:57:45 +0800 | [diff] [blame] | 77 | #endif |