blob: c7d7fe129faa83f89e64c04f4d22145fd440b8c6 [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
22#ifndef OPENBSC_SIGNAL_H
23#define OPENBSC_SIGNAL_H
24
Harald Welte595ad7b2009-02-16 22:05:44 +000025#include <stdlib.h>
26#include <errno.h>
27
Neels Hofmeyrc0164792017-09-04 15:15:32 +020028#include <osmocom/bsc/gsm_data.h>
Holger Freyther2b2d2e32009-02-14 22:51:00 +000029
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +010030#include <osmocom/core/signal.h>
Holger Freyther2b2d2e32009-02-14 22:51:00 +000031
32/*
Harald Welte595ad7b2009-02-16 22:05:44 +000033 * Signalling subsystems
Holger Freyther2b2d2e32009-02-14 22:51:00 +000034 */
Harald Welte167df882009-02-17 14:35:45 +000035enum signal_subsystems {
36 SS_PAGING,
Harald Welte167df882009-02-17 14:35:45 +000037 SS_ABISIP,
Harald Weltef9a8cc32009-05-01 15:39:49 +000038 SS_NM,
Holger Freyther7c19f742009-06-06 13:54:35 +000039 SS_LCHAN,
Harald Weltec0d83b02010-03-28 15:58:03 +080040 SS_CHALLOC,
Harald Welte549faad2010-03-05 19:36:20 +010041 SS_IPAC_NWL,
Holger Hans Peter Freyther12b917d2010-07-29 02:27:27 +080042 SS_RF,
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +080043 SS_MSC,
Holger Hans Peter Freyther6c4d2442011-01-06 13:31:41 +010044 SS_HO,
Holger Hans Peter Freyther54fa2c72012-02-03 20:26:25 +010045 SS_CCCH,
Harald Welte167df882009-02-17 14:35:45 +000046};
Holger Freyther2b2d2e32009-02-14 22:51:00 +000047
Harald Welte595ad7b2009-02-16 22:05:44 +000048/* SS_PAGING signals */
49enum signal_paging {
Sylvain Munautef24dff2009-12-19 12:38:10 +010050 S_PAGING_SUCCEEDED,
51 S_PAGING_EXPIRED,
Holger Freyther2b2d2e32009-02-14 22:51:00 +000052};
53
Harald Welte167df882009-02-17 14:35:45 +000054/* SS_ABISIP signals */
55enum signal_abisip {
Holger Hans Peter Freyther231163d2009-11-18 21:06:12 +010056 S_ABISIP_CRCX_ACK,
Harald Welte5e3d91b2009-12-19 16:42:06 +010057 S_ABISIP_MDCX_ACK,
Holger Hans Peter Freyther231163d2009-11-18 21:06:12 +010058 S_ABISIP_DLCX_IND,
Harald Welte167df882009-02-17 14:35:45 +000059};
60
Harald Weltef9a8cc32009-05-01 15:39:49 +000061/* SS_NM signals */
62enum signal_nm {
63 S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */
64 S_NM_FAIL_REP, /* GSM 12.21 failure event report */
Holger Hans Peter Freyther500f3ca2009-06-10 10:48:14 +020065 S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */
Holger Hans Peter Freythera7cd9fc2009-07-07 12:40:07 +020066 S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */
Holger Hans Peter Freyther086ffa52009-12-29 11:26:38 +010067 S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */
Holger Hans Peter Freyther1356c082009-12-30 09:00:01 +010068 S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */
69 S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */
Harald Weltec7310382009-08-08 00:02:36 +020070 S_NM_TEST_REP, /* GSM 12.21 Test Report */
Harald Weltef338a032011-01-14 15:55:42 +010071 S_NM_STATECHG_OPER, /* Operational State changed*/
72 S_NM_STATECHG_ADM, /* Administrative State changed */
Harald Welte40d1c3f2011-03-06 23:20:28 +010073 S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */
Neels Hofmeyrf0ff9a62018-06-15 20:39:58 +020074 S_NM_OPSTART_ACK, /* Received OPSTART ACK, arg is struct msgb *oml_msg */
Pau Espin Pedrolc74daf02018-11-08 13:53:40 +010075 S_NM_GET_ATTR_REP, /* Received Get Attributes Response, arg is struct msgb *oml_msg */
Pau Espin Pedrol1a7e3cc2020-09-17 18:43:50 +020076 S_NM_SET_RADIO_ATTR_ACK, /* Received Set Radio Carrier Attributes Ack, arg is struct msgb *oml_msg */
Harald Weltef9a8cc32009-05-01 15:39:49 +000077};
78
Holger Freyther7c19f742009-06-06 13:54:35 +000079/* SS_LCHAN signals */
80enum signal_lchan {
81 /*
82 * The lchan got freed with an use_count != 0 and error
83 * recovery needs to be carried out from within the
84 * signal handler.
85 */
86 S_LCHAN_UNEXPECTED_RELEASE,
Harald Welted011e8b2009-11-29 22:45:52 +010087 S_LCHAN_ACTIVATE_ACK, /* 08.58 Channel Activate ACK */
88 S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */
89 S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */
90 S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */
Andreas Eversberge0cba562013-06-02 20:46:32 +020091 S_LCHAN_ASSIGNMENT_COMPL, /* 04.08 Assignment Completed */
92 S_LCHAN_ASSIGNMENT_FAIL, /* 04.08 Assignment Failed */
Harald Welted011e8b2009-11-29 22:45:52 +010093 S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */
Harald Weltedbb1d882009-11-30 19:16:47 +010094 S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */
Holger Freyther7c19f742009-06-06 13:54:35 +000095};
96
Harald Weltec0d83b02010-03-28 15:58:03 +080097/* SS_CHALLOC signals */
98enum signal_challoc {
99 S_CHALLOC_ALLOC_FAIL, /* allocation of lchan has failed */
100 S_CHALLOC_FREED, /* lchan has been successfully freed */
101};
102
Harald Welte549faad2010-03-05 19:36:20 +0100103/* SS_IPAC_NWL signals */
104enum signal_ipaccess {
105 S_IPAC_NWL_COMPLETE,
106};
107
Harald Welte3961fcc2009-11-30 19:37:18 +0100108enum signal_global {
Harald Weltef338a032011-01-14 15:55:42 +0100109 S_GLOBAL_BTS_CLOSE_OM,
Harald Welte3961fcc2009-11-30 19:37:18 +0100110};
111
Holger Hans Peter Freyther12b917d2010-07-29 02:27:27 +0800112/* SS_RF signals */
113enum signal_rf {
114 S_RF_OFF,
115 S_RF_ON,
116 S_RF_GRACE,
117};
118
Holger Hans Peter Freyther2e837822009-12-30 08:38:43 +0100119struct ipacc_ack_signal_data {
Holger Hans Peter Freyther52fd4e42010-05-12 23:34:51 +0800120 struct gsm_bts_trx *trx;
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +0200121 uint8_t msg_type;
Holger Hans Peter Freyther2e837822009-12-30 08:38:43 +0100122};
123
Harald Welteaf9b8102011-03-06 21:20:38 +0100124struct abis_om2k_mo;
125
Harald Weltef338a032011-01-14 15:55:42 +0100126struct nm_statechg_signal_data {
Harald Weltef38ca9a2011-03-06 22:11:32 +0100127 struct gsm_bts *bts;
Holger Hans Peter Freytherc42ad8b2011-04-18 17:04:00 +0200128 uint8_t obj_class;
Harald Weltef338a032011-01-14 15:55:42 +0100129 void *obj;
130 struct gsm_nm_state *old_state;
131 struct gsm_nm_state *new_state;
Harald Welteaf9b8102011-03-06 21:20:38 +0100132
133 /* This pointer is vaold for TS 12.21 MO */
Harald Weltef338a032011-01-14 15:55:42 +0100134 struct abis_om_obj_inst *obj_inst;
Harald Welteaf9b8102011-03-06 21:20:38 +0100135 /* This pointer is vaold for RBS2000 MO */
136 struct abis_om2k_mo *om2k_mo;
Harald Weltef338a032011-01-14 15:55:42 +0100137};
138
Harald Welte40d1c3f2011-03-06 23:20:28 +0100139struct nm_om2k_signal_data {
140 struct gsm_bts *bts;
141 void *obj;
142 struct abis_om2k_mo *om2k_mo;
143
144 uint8_t accordance_ind;
145};
146
Holger Hans Peter Freyther6d2b66e2010-07-14 02:08:35 +0800147struct nm_nack_signal_data {
148 struct msgb *msg;
Holger Hans Peter Freytherde1674a2012-11-11 18:26:23 +0100149 struct gsm_bts *bts;
Holger Hans Peter Freyther6d2b66e2010-07-14 02:08:35 +0800150 uint8_t mt;
151};
152
Harald Welte35d07b72019-05-25 09:39:53 +0200153struct nm_fail_rep_signal_data {
154 struct gsm_bts *bts;
155 /* raw data */
156 struct msgb *msg;
Oliver Smithcd1df992020-03-24 13:37:17 +0100157 struct tlv_parsed tp;
Harald Welte35d07b72019-05-25 09:39:53 +0200158 /* parsed data */
159 struct {
160 const char *event_type;
161 const char *severity;
162 const char *additional_text;
163 const uint8_t *probable_cause;
164 } parsed;
165};
166
Harald Weltec0d83b02010-03-28 15:58:03 +0800167struct challoc_signal_data {
168 struct gsm_bts *bts;
169 struct gsm_lchan *lchan;
170 enum gsm_chan_t type;
171};
172
Holger Hans Peter Freyther12b917d2010-07-29 02:27:27 +0800173struct rf_signal_data {
174 struct gsm_network *net;
175};
176
Holger Hans Peter Freyther08eebd52010-12-27 13:28:20 +0100177struct lchan_signal_data {
178 /* The lchan the signal happened on */
179 struct gsm_lchan *lchan;
180 /* Measurement reports on this lchan */
181 struct gsm_meas_rep *mr;
182};
183
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +0800184/* MSC signals */
185enum signal_msc {
186 S_MSC_LOST,
187 S_MSC_CONNECTED,
Holger Hans Peter Freythered0374f2011-08-17 17:37:16 +0200188 S_MSC_AUTHENTICATED,
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +0800189};
190
Neels Hofmeyra369e242017-02-23 21:57:23 +0100191struct bsc_msc_data;
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +0800192struct msc_signal_data {
Neels Hofmeyra369e242017-02-23 21:57:23 +0100193 struct bsc_msc_data *data;
Holger Hans Peter Freyther0d711632010-09-16 02:30:36 +0800194};
195
Holger Hans Peter Freyther54fa2c72012-02-03 20:26:25 +0100196/* SS_CCCH signals */
197enum signal_ccch {
198 S_CCCH_PAGING_LOAD,
199 S_CCCH_RACH_LOAD,
200};
201
202struct ccch_signal_data {
203 struct gsm_bts *bts;
204 uint16_t pg_buf_space;
205 uint16_t rach_slot_count;
206 uint16_t rach_busy_count;
207 uint16_t rach_access_count;
208};
209
Holger Freyther2b2d2e32009-02-14 22:51:00 +0000210#endif