Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 1 | #ifndef _GSM_SUBSCR_H |
| 2 | #define _GSM_SUBSCR_H |
| 3 | |
Neels Hofmeyr | ab04fb2 | 2016-05-30 22:32:51 +0200 | [diff] [blame] | 4 | #include <stdbool.h> |
| 5 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 6 | #include <osmocom/core/linuxlist.h> |
Harald Welte | d3fa84d | 2016-04-20 17:50:17 +0200 | [diff] [blame] | 7 | #include <osmocom/gsm/protocol/gsm_23_003.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 8 | |
Neels Hofmeyr | 9084396 | 2017-09-04 15:04:35 +0200 | [diff] [blame] | 9 | #include <osmocom/msc/gsm_data.h> |
Max | e6052c4 | 2016-06-30 10:25:49 +0200 | [diff] [blame] | 10 | |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 11 | struct ran_conn; |
Neels Hofmeyr | 1263bc8 | 2018-11-30 03:32:20 +0100 | [diff] [blame] | 12 | struct msgb; |
| 13 | |
| 14 | typedef int gsm_cbfn(unsigned int hooknum, unsigned int event, struct msgb *msg, |
| 15 | void *data, void *param); |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 16 | |
Neels Hofmeyr | e2f24d5 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 17 | /* |
| 18 | * Struct for pending channel requests. This is managed in the |
| 19 | * llist_head requests of each subscriber. The reference counting |
| 20 | * should work in such a way that a subscriber with a pending request |
| 21 | * remains in memory. |
| 22 | */ |
| 23 | struct subscr_request { |
| 24 | struct llist_head entry; |
| 25 | |
Neels Hofmeyr | 84da6b1 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 26 | /* human readable label to be able to log pending request kinds */ |
| 27 | const char *label; |
| 28 | |
Neels Hofmeyr | e2f24d5 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 29 | /* the callback data */ |
| 30 | gsm_cbfn *cbfn; |
| 31 | void *param; |
| 32 | }; |
| 33 | |
Holger Hans Peter Freyther | d6d7aff | 2015-04-06 12:03:45 +0200 | [diff] [blame] | 34 | /* |
| 35 | * Paging handling with authentication |
| 36 | */ |
Neels Hofmeyr | e2f24d5 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 37 | struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub, |
Neels Hofmeyr | 84da6b1 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 38 | gsm_cbfn *cbfn, void *param, |
| 39 | const char *label); |
Neels Hofmeyr | e2f24d5 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 40 | |
Holger Hans Peter Freyther | d6d7aff | 2015-04-06 12:03:45 +0200 | [diff] [blame] | 41 | void subscr_remove_request(struct subscr_request *req); |
| 42 | |
Neels Hofmeyr | facd57a | 2017-12-15 03:48:48 +0100 | [diff] [blame] | 43 | void subscr_paging_cancel(struct vlr_subscr *vsub, enum gsm_paging_event event); |
Harald Welte | 2483f1b | 2016-06-19 18:06:02 +0200 | [diff] [blame] | 44 | int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, |
| 45 | struct msgb *msg, void *data, void *param); |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 46 | |
Harald Welte | d35038d | 2018-01-25 00:07:33 +0100 | [diff] [blame] | 47 | /* Find an allocated channel for a specified subscriber */ |
Neels Hofmeyr | c036b79 | 2018-11-29 22:37:51 +0100 | [diff] [blame] | 48 | struct ran_conn *connection_for_subscr(struct vlr_subscr *vsub); |
Harald Welte | d35038d | 2018-01-25 00:07:33 +0100 | [diff] [blame] | 49 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 50 | #endif /* _GSM_SUBSCR_H */ |