blob: 51269763eef42e38c7bcf31dc3fc881fb37976cb [file] [log] [blame]
Holger Freyther2b2d2e32009-02-14 22:51:00 +00001/* Generic signalling/notification infrastructure */
Holger Hans Peter Freytherb1008952015-05-02 19:55:38 +02002/* (C) 2009-2010, 2015 by Holger Hans Peter Freyther <zecke@selfish.org>
Harald Welte595ad7b2009-02-16 22:05:44 +00003 * (C) 2009 by Harald Welte <laforge@gnumonks.org>
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +08004 * (C) 2010 by On-Waves
Holger Freyther2b2d2e32009-02-14 22:51:00 +00005 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
Harald Welte9af6ddf2011-01-01 15:25:50 +01008 * 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 Freyther2b2d2e32009-02-14 22:51:00 +000010 * (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
Harald Welte9af6ddf2011-01-01 15:25:50 +010015 * GNU Affero General Public License for more details.
Holger Freyther2b2d2e32009-02-14 22:51:00 +000016 *
Harald Welte9af6ddf2011-01-01 15:25:50 +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 Freyther2b2d2e32009-02-14 22:51:00 +000019 *
20 */
21
Vadim Yanitskiy29e89302018-08-04 01:01:12 +070022#pragma once
Holger Freyther2b2d2e32009-02-14 22:51:00 +000023
Harald Welte595ad7b2009-02-16 22:05:44 +000024#include <stdlib.h>
25#include <errno.h>
26
Neels Hofmeyr90843962017-09-04 15:04:35 +020027#include <osmocom/msc/gsm_data.h>
Holger Freyther2b2d2e32009-02-14 22:51:00 +000028
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010029#include <osmocom/core/signal.h>
Holger Freyther2b2d2e32009-02-14 22:51:00 +000030
31/*
Harald Welte595ad7b2009-02-16 22:05:44 +000032 * Signalling subsystems
Holger Freyther2b2d2e32009-02-14 22:51:00 +000033 */
Harald Welte167df882009-02-17 14:35:45 +000034enum signal_subsystems {
35 SS_PAGING,
36 SS_SMS,
Harald Welteea5cf302009-07-29 23:14:15 +020037 SS_SUBSCR,
Harald Weltea1482332009-11-14 10:08:40 +010038 SS_SCALL,
Harald Welte167df882009-02-17 14:35:45 +000039};
Holger Freyther2b2d2e32009-02-14 22:51:00 +000040
Harald Welte595ad7b2009-02-16 22:05:44 +000041/* SS_PAGING signals */
42enum signal_paging {
Sylvain Munautef24dff2009-12-19 12:38:10 +010043 S_PAGING_SUCCEEDED,
44 S_PAGING_EXPIRED,
Holger Freyther2b2d2e32009-02-14 22:51:00 +000045};
46
Harald Welte76042182009-08-08 16:03:15 +020047/* SS_SMS signals */
48enum signal_sms {
49 S_SMS_SUBMITTED, /* A SMS has been successfully submitted to us */
50 S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */
51 S_SMS_SMMA, /* A MS tells us it has more space available */
Harald Weltecb8f4432009-08-09 14:59:02 +020052 S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */
Holger Hans Peter Freyther0eb76662010-12-24 09:47:04 +010053 S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */
Harald Welte76042182009-08-08 16:03:15 +020054};
55
Harald Welteea5cf302009-07-29 23:14:15 +020056/* SS_SUBSCR signals */
57enum signal_subscr {
58 S_SUBSCR_ATTACHED,
59 S_SUBSCR_DETACHED,
Harald Welte7659de12009-12-13 12:39:18 +010060 S_SUBSCR_IDENTITY, /* we've received some identity information */
Harald Welteea5cf302009-07-29 23:14:15 +020061};
62
Harald Weltea1482332009-11-14 10:08:40 +010063/* SS_SCALL signals */
64enum signal_scall {
65 S_SCALL_SUCCESS,
66 S_SCALL_EXPIRED,
67 S_SCALL_DETACHED,
68};
69
Harald Welte549faad2010-03-05 19:36:20 +010070/* SS_IPAC_NWL signals */
71enum signal_ipaccess {
72 S_IPAC_NWL_COMPLETE,
73};
74
Harald Welte3961fcc2009-11-30 19:37:18 +010075enum signal_global {
Harald Weltef338a032011-01-14 15:55:42 +010076 S_GLOBAL_BTS_CLOSE_OM,
Harald Welte3961fcc2009-11-30 19:37:18 +010077};
78
Holger Freyther2b2d2e32009-02-14 22:51:00 +000079struct paging_signal_data {
Harald Welte2483f1b2016-06-19 18:06:02 +020080 struct vlr_subscr *vsub;
Holger Freyther2b2d2e32009-02-14 22:51:00 +000081 struct gsm_bts *bts;
82
Holger Hans Peter Freytherd3baf412010-12-23 18:19:17 +010083 int paging_result;
84
Holger Freyther2b2d2e32009-02-14 22:51:00 +000085 /* NULL in case the paging didn't work */
Neels Hofmeyrc036b792018-11-29 22:37:51 +010086 struct ran_conn *conn;
Holger Freyther2b2d2e32009-02-14 22:51:00 +000087};
88
Harald Weltea1482332009-11-14 10:08:40 +010089struct scall_signal_data {
Neels Hofmeyrc036b792018-11-29 22:37:51 +010090 struct ran_conn *conn;
Harald Weltea1482332009-11-14 10:08:40 +010091 void *data;
92};
Holger Hans Peter Freyther04144c12010-12-24 10:15:55 +010093struct sms_signal_data {
94 /* The transaction where this occured */
95 struct gsm_trans *trans;
96 /* Can be NULL for SMMA */
97 struct gsm_sms *sms;
98 /* int paging result. Only the ones with > 0 */
99 int paging_result;
100};