blob: 35f5b9c151cc3baa591cc2fe5941e27eef4ae983 [file] [log] [blame]
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +08001/* mgcp_ss7 helper coder */
2/*
Holger Hans Peter Freytherdcc33122011-03-01 01:24:10 +01003 * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
4 * (C) 2010-2011 by On-Waves
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +08005 * 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
Harald Welteff397ed2011-05-08 10:29:23 +020025#include <osmocom/core/timer.h>
26#include <osmocom/core/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 Freyther97f66e22010-07-28 03:32:52 +080032struct mgcp_ss7 {
33 struct mgcp_config *cfg;
Harald Welteff397ed2011-05-08 10:29:23 +020034 struct osmo_wqueue mgcp_fd;
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080035 struct msgb *mgcp_msg;
36
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080037 /* timer */
Harald Welteff397ed2011-05-08 10:29:23 +020038 struct osmo_timer_list poll_timer;
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080039
40 /* thread handling */
41 struct thread_notifier *cmd_queue;
42 pthread_t thread;
43};
44
45enum {
46 MGCP_SS7_MUTE_STATUS,
47 MGCP_SS7_ALLOCATE,
48 MGCP_SS7_DELETE,
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080049};
50
51struct mgcp_ss7_cmd {
52 struct llist_head entry;
Holger Hans Peter Freyther5aa17012010-07-31 04:37:26 +080053 uint8_t type;
Holger Hans Peter Freytherdcc33122011-03-01 01:24:10 +010054 struct mgcp_endpoint *endp;
Holger Hans Peter Freyther9ed3e1b2010-07-31 05:22:56 +080055 uint32_t param;
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080056};
57
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080058void mgcp_ss7_reset(struct mgcp_ss7 *mgcp);
Holger Hans Peter Freytherdcc33122011-03-01 01:24:10 +010059
60void mgcp_mgw_vty_init();
Holger Hans Peter Freyther97f66e22010-07-28 03:32:52 +080061
62#endif