Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 1 | /* Generic signalling/notification infrastructure */ |
Holger Hans Peter Freyther | b100895 | 2015-05-02 19:55:38 +0200 | [diff] [blame] | 2 | /* (C) 2009-2010, 2015 by Holger Hans Peter Freyther <zecke@selfish.org> |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 3 | * (C) 2009 by Harald Welte <laforge@gnumonks.org> |
Holger Hans Peter Freyther | 0d71163 | 2010-09-16 02:30:36 +0800 | [diff] [blame] | 4 | * (C) 2010 by On-Waves |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 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 Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [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 |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * GNU Affero General Public License for more details. |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 16 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +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 Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
Vadim Yanitskiy | 29e8930 | 2018-08-04 01:01:12 +0700 | [diff] [blame] | 22 | #pragma once |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 23 | |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 24 | #include <stdlib.h> |
| 25 | #include <errno.h> |
| 26 | |
Neels Hofmeyr | 9084396 | 2017-09-04 15:04:35 +0200 | [diff] [blame] | 27 | #include <osmocom/msc/gsm_data.h> |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 28 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 29 | #include <osmocom/core/signal.h> |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 30 | |
| 31 | /* |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 32 | * Signalling subsystems |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 33 | */ |
Harald Welte | 167df88 | 2009-02-17 14:35:45 +0000 | [diff] [blame] | 34 | enum signal_subsystems { |
| 35 | SS_PAGING, |
| 36 | SS_SMS, |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 37 | SS_SUBSCR, |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 38 | SS_SCALL, |
Harald Welte | 167df88 | 2009-02-17 14:35:45 +0000 | [diff] [blame] | 39 | }; |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 40 | |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 41 | /* SS_PAGING signals */ |
| 42 | enum signal_paging { |
Sylvain Munaut | ef24dff | 2009-12-19 12:38:10 +0100 | [diff] [blame] | 43 | S_PAGING_SUCCEEDED, |
| 44 | S_PAGING_EXPIRED, |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
Harald Welte | 7604218 | 2009-08-08 16:03:15 +0200 | [diff] [blame] | 47 | /* SS_SMS signals */ |
| 48 | enum 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 Welte | cb8f443 | 2009-08-09 14:59:02 +0200 | [diff] [blame] | 52 | S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */ |
Holger Hans Peter Freyther | 0eb7666 | 2010-12-24 09:47:04 +0100 | [diff] [blame] | 53 | S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */ |
Harald Welte | 7604218 | 2009-08-08 16:03:15 +0200 | [diff] [blame] | 54 | }; |
| 55 | |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 56 | /* SS_SUBSCR signals */ |
| 57 | enum signal_subscr { |
| 58 | S_SUBSCR_ATTACHED, |
| 59 | S_SUBSCR_DETACHED, |
Harald Welte | 7659de1 | 2009-12-13 12:39:18 +0100 | [diff] [blame] | 60 | S_SUBSCR_IDENTITY, /* we've received some identity information */ |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 61 | }; |
| 62 | |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 63 | /* SS_SCALL signals */ |
| 64 | enum signal_scall { |
| 65 | S_SCALL_SUCCESS, |
| 66 | S_SCALL_EXPIRED, |
| 67 | S_SCALL_DETACHED, |
| 68 | }; |
| 69 | |
Harald Welte | 549faad | 2010-03-05 19:36:20 +0100 | [diff] [blame] | 70 | /* SS_IPAC_NWL signals */ |
| 71 | enum signal_ipaccess { |
| 72 | S_IPAC_NWL_COMPLETE, |
| 73 | }; |
| 74 | |
Harald Welte | 3961fcc | 2009-11-30 19:37:18 +0100 | [diff] [blame] | 75 | enum signal_global { |
Harald Welte | f338a03 | 2011-01-14 15:55:42 +0100 | [diff] [blame] | 76 | S_GLOBAL_BTS_CLOSE_OM, |
Harald Welte | 3961fcc | 2009-11-30 19:37:18 +0100 | [diff] [blame] | 77 | }; |
| 78 | |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 79 | struct paging_signal_data { |
Harald Welte | 2483f1b | 2016-06-19 18:06:02 +0200 | [diff] [blame] | 80 | struct vlr_subscr *vsub; |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 81 | struct gsm_bts *bts; |
| 82 | |
Holger Hans Peter Freyther | d3baf41 | 2010-12-23 18:19:17 +0100 | [diff] [blame] | 83 | int paging_result; |
| 84 | |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 85 | /* NULL in case the paging didn't work */ |
Neels Hofmeyr | c036b79 | 2018-11-29 22:37:51 +0100 | [diff] [blame] | 86 | struct ran_conn *conn; |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 87 | }; |
| 88 | |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 89 | struct scall_signal_data { |
Neels Hofmeyr | c036b79 | 2018-11-29 22:37:51 +0100 | [diff] [blame] | 90 | struct ran_conn *conn; |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 91 | void *data; |
| 92 | }; |
Holger Hans Peter Freyther | 04144c1 | 2010-12-24 10:15:55 +0100 | [diff] [blame] | 93 | struct 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 | }; |