Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 1 | /* mgcp_ss7 helper coder */ |
| 2 | /* |
| 3 | * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org> |
| 4 | * (C) 2010 by On-Waves |
| 5 | * All Rights Reserved |
| 6 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 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 |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 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 |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 16 | * |
Holger Hans Peter Freyther | de56c22 | 2011-01-16 17:45:14 +0100 | [diff] [blame] | 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/>. |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
| 22 | #ifndef mgcp_ss7_h |
| 23 | #define mgcp_ss7_h |
| 24 | |
Holger Hans Peter Freyther | cbf7d18 | 2010-07-31 05:25:35 +0800 | [diff] [blame] | 25 | #include <osmocore/timer.h> |
| 26 | #include <osmocore/write_queue.h> |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 27 | |
Holger Hans Peter Freyther | 5fb3057 | 2010-08-06 15:56:01 +0000 | [diff] [blame] | 28 | #include <osmocom/vty/command.h> |
| 29 | |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 30 | #include "thread.h" |
| 31 | |
Holger Hans Peter Freyther | 5fb3057 | 2010-08-06 15:56:01 +0000 | [diff] [blame] | 32 | enum cellmgr_node { |
| 33 | MGCP_NODE = _LAST_OSMOVTY_NODE + 1, |
| 34 | }; |
| 35 | |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 36 | |
| 37 | struct mgcp_ss7_endpoint; |
| 38 | struct mgcp_ss7 { |
| 39 | struct mgcp_config *cfg; |
| 40 | struct write_queue mgcp_fd; |
| 41 | struct msgb *mgcp_msg; |
| 42 | |
| 43 | struct mgcp_ss7_endpoint *mgw_end; |
| 44 | |
| 45 | /* timer */ |
| 46 | struct timer_list poll_timer; |
| 47 | |
| 48 | /* thread handling */ |
| 49 | struct thread_notifier *cmd_queue; |
| 50 | pthread_t thread; |
| 51 | }; |
| 52 | |
| 53 | enum { |
| 54 | MGCP_SS7_MUTE_STATUS, |
| 55 | MGCP_SS7_ALLOCATE, |
| 56 | MGCP_SS7_DELETE, |
| 57 | MGCP_SS7_SHUTDOWN, |
| 58 | }; |
| 59 | |
| 60 | struct mgcp_ss7_cmd { |
| 61 | struct llist_head entry; |
Holger Hans Peter Freyther | 5aa1701 | 2010-07-31 04:37:26 +0800 | [diff] [blame] | 62 | uint8_t type; |
Holger Hans Peter Freyther | 9ed3e1b | 2010-07-31 05:22:56 +0800 | [diff] [blame] | 63 | uint32_t port; |
| 64 | uint32_t param; |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 65 | }; |
| 66 | |
Holger Hans Peter Freyther | 9ed3e1b | 2010-07-31 05:22:56 +0800 | [diff] [blame] | 67 | void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, uint8_t type, uint32_t port, uint32_t param); |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 68 | |
Holger Hans Peter Freyther | 97f66e2 | 2010-07-28 03:32:52 +0800 | [diff] [blame] | 69 | void mgcp_ss7_reset(struct mgcp_ss7 *mgcp); |
| 70 | void mgcp_ss7_free(struct mgcp_ss7 *mgcp); |
| 71 | |
| 72 | #endif |