blob: ff0973b91d07d93779505bd1b794cca664f7e09a [file] [log] [blame]
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +08001/* 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 Freytherde56c222011-01-16 17:45:14 +01007 * 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 Freyther97f66e22010-07-28 03:32:52 +080010 * (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 Freytherde56c222011-01-16 17:45:14 +010015 * GNU Affero General Public License for more details.
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080016 *
Holger Hans Peter Freytherde56c222011-01-16 17:45:14 +010017 * 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 Freyther97f66e22010-07-28 03:32:52 +080019 *
20 */
21
22#ifndef mgcp_ss7_h
23#define mgcp_ss7_h
24
Holger Hans Peter Freythercbf7d182010-07-31 05:25:35 +080025#include <osmocore/timer.h>
26#include <osmocore/write_queue.h>
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080027
Holger Hans Peter Freyther5fb30572010-08-06 15:56:01 +000028#include <osmocom/vty/command.h>
29
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080030#include "thread.h"
31
Holger Hans Peter Freyther5fb30572010-08-06 15:56:01 +000032enum cellmgr_node {
33 MGCP_NODE = _LAST_OSMOVTY_NODE + 1,
34};
35
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080036
37struct mgcp_ss7_endpoint;
38struct 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
53enum {
54 MGCP_SS7_MUTE_STATUS,
55 MGCP_SS7_ALLOCATE,
56 MGCP_SS7_DELETE,
57 MGCP_SS7_SHUTDOWN,
58};
59
60struct mgcp_ss7_cmd {
61 struct llist_head entry;
Holger Hans Peter Freyther5aa17012010-07-31 04:37:26 +080062 uint8_t type;
Holger Hans Peter Freyther9ed3e1b2010-07-31 05:22:56 +080063 uint32_t port;
64 uint32_t param;
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080065};
66
Holger Hans Peter Freyther9ed3e1b2010-07-31 05:22:56 +080067void mgcp_ss7_exec(struct mgcp_ss7 *mgcp, uint8_t type, uint32_t port, uint32_t param);
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080068
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080069void mgcp_ss7_reset(struct mgcp_ss7 *mgcp);
70void mgcp_ss7_free(struct mgcp_ss7 *mgcp);
71
72#endif