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 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 31 | struct msc_a; |
| 32 | struct vty; |
| 33 | |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 34 | /* |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 35 | * Signalling subsystems |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 36 | */ |
Harald Welte | 167df88 | 2009-02-17 14:35:45 +0000 | [diff] [blame] | 37 | enum signal_subsystems { |
| 38 | SS_PAGING, |
| 39 | SS_SMS, |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 40 | SS_SUBSCR, |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 41 | SS_SCALL, |
Harald Welte | 167df88 | 2009-02-17 14:35:45 +0000 | [diff] [blame] | 42 | }; |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 43 | |
Harald Welte | 595ad7b | 2009-02-16 22:05:44 +0000 | [diff] [blame] | 44 | /* SS_PAGING signals */ |
| 45 | enum signal_paging { |
Sylvain Munaut | ef24dff | 2009-12-19 12:38:10 +0100 | [diff] [blame] | 46 | S_PAGING_SUCCEEDED, |
| 47 | S_PAGING_EXPIRED, |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
Harald Welte | 7604218 | 2009-08-08 16:03:15 +0200 | [diff] [blame] | 50 | /* SS_SMS signals */ |
| 51 | enum signal_sms { |
| 52 | S_SMS_SUBMITTED, /* A SMS has been successfully submitted to us */ |
| 53 | S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */ |
| 54 | S_SMS_SMMA, /* A MS tells us it has more space available */ |
Harald Welte | cb8f443 | 2009-08-09 14:59:02 +0200 | [diff] [blame] | 55 | 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] | 56 | S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */ |
Harald Welte | 7604218 | 2009-08-08 16:03:15 +0200 | [diff] [blame] | 57 | }; |
| 58 | |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 59 | /* SS_SUBSCR signals */ |
| 60 | enum signal_subscr { |
| 61 | S_SUBSCR_ATTACHED, |
| 62 | S_SUBSCR_DETACHED, |
Harald Welte | 7659de1 | 2009-12-13 12:39:18 +0100 | [diff] [blame] | 63 | S_SUBSCR_IDENTITY, /* we've received some identity information */ |
Harald Welte | ea5cf30 | 2009-07-29 23:14:15 +0200 | [diff] [blame] | 64 | }; |
| 65 | |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 66 | /* SS_SCALL signals */ |
| 67 | enum signal_scall { |
| 68 | S_SCALL_SUCCESS, |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 69 | S_SCALL_FAILED, |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 70 | S_SCALL_DETACHED, |
| 71 | }; |
| 72 | |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 73 | struct paging_signal_data { |
Harald Welte | 2483f1b | 2016-06-19 18:06:02 +0200 | [diff] [blame] | 74 | struct vlr_subscr *vsub; |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 75 | struct msc_a *msc_a; |
Holger Freyther | 2b2d2e3 | 2009-02-14 22:51:00 +0000 | [diff] [blame] | 76 | }; |
| 77 | |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 78 | struct scall_signal_data { |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 79 | struct msc_a *msc_a; |
| 80 | struct vty *vty; |
Harald Welte | a148233 | 2009-11-14 10:08:40 +0100 | [diff] [blame] | 81 | }; |
Holger Hans Peter Freyther | 04144c1 | 2010-12-24 10:15:55 +0100 | [diff] [blame] | 82 | struct sms_signal_data { |
Thorsten Alteholz | 3a357de | 2019-07-16 20:51:16 +0200 | [diff] [blame] | 83 | /* The transaction where this occurred */ |
Holger Hans Peter Freyther | 04144c1 | 2010-12-24 10:15:55 +0100 | [diff] [blame] | 84 | struct gsm_trans *trans; |
| 85 | /* Can be NULL for SMMA */ |
| 86 | struct gsm_sms *sms; |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 87 | /* true when paging was successful */ |
| 88 | bool paging_result; |
Holger Hans Peter Freyther | 04144c1 | 2010-12-24 10:15:55 +0100 | [diff] [blame] | 89 | }; |