blob: 9fb8cf3f18144cc19e731f3d45cfc46af591bd13 [file] [log] [blame]
Holger Freyther2b2d2e32009-02-14 22:51:00 +00001/* Generic signalling/notification infrastructure */
2/* (C) 2009 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 Freyther2b2d2e32009-02-14 22:51:00 +00004 * All Rights Reserved
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
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
Holger Freyther2b2d2e32009-02-14 22:51:00 +000028#include <openbsc/gsm_data.h>
29#include <openbsc/gsm_subscriber.h>
30
31
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,
37 SS_SMS,
38 SS_ABISIP,
39};
Holger Freyther2b2d2e32009-02-14 22:51:00 +000040
Harald Welte595ad7b2009-02-16 22:05:44 +000041/* SS_PAGING signals */
42enum signal_paging {
43 S_PAGING_COMPLETED,
Holger Freyther2b2d2e32009-02-14 22:51:00 +000044};
45
Harald Welte167df882009-02-17 14:35:45 +000046/* SS_ABISIP signals */
47enum signal_abisip {
48 S_ABISIP_BIND_ACK,
49};
50
Harald Welte595ad7b2009-02-16 22:05:44 +000051typedef int signal_cbfn(unsigned int subsys, unsigned int signal,
52 void *handler_data, void *signal_data);
Holger Freyther2b2d2e32009-02-14 22:51:00 +000053
54struct paging_signal_data {
Holger Freyther2b2d2e32009-02-14 22:51:00 +000055 struct gsm_subscriber *subscr;
56 struct gsm_bts *bts;
57
58 /* NULL in case the paging didn't work */
59 struct gsm_lchan *lchan;
60};
61
Holger Freyther2b2d2e32009-02-14 22:51:00 +000062/* Management */
Harald Welte595ad7b2009-02-16 22:05:44 +000063int register_signal_handler(unsigned int subsys, signal_cbfn *cbfn, void *data);
64void unregister_signal_handler(unsigned int subsys, signal_cbfn *cbfn, void *data);
Holger Freyther2b2d2e32009-02-14 22:51:00 +000065
66/* Dispatch */
Harald Welte595ad7b2009-02-16 22:05:44 +000067void dispatch_signal(unsigned int subsys, unsigned int signal, void *signal_data);
Holger Freyther2b2d2e32009-02-14 22:51:00 +000068
69
70#endif