blob: 205106782ea6aa3c2c62ab25e0810226255a2a04 [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001#ifndef _GSM_SUBSCR_H
2#define _GSM_SUBSCR_H
3
Neels Hofmeyrab04fb22016-05-30 22:32:51 +02004#include <stdbool.h>
5
Pablo Neira Ayuso136f4532011-03-22 16:47:59 +01006#include <osmocom/core/linuxlist.h>
Harald Welted3fa84d2016-04-20 17:50:17 +02007#include <osmocom/gsm/protocol/gsm_23_003.h>
Harald Welte52b1f982008-12-23 20:25:15 +00008
Neels Hofmeyr90843962017-09-04 15:04:35 +02009#include <osmocom/msc/gsm_data.h>
Maxe6052c42016-06-30 10:25:49 +020010
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010011struct ran_conn;
Neels Hofmeyr1263bc82018-11-30 03:32:20 +010012struct msgb;
13
14typedef int gsm_cbfn(unsigned int hooknum, unsigned int event, struct msgb *msg,
15 void *data, void *param);
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010016
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020017/*
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 */
23struct subscr_request {
24 struct llist_head entry;
25
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020026 /* human readable label to be able to log pending request kinds */
27 const char *label;
28
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020029 /* the callback data */
30 gsm_cbfn *cbfn;
31 void *param;
32};
33
Holger Hans Peter Freytherd6d7aff2015-04-06 12:03:45 +020034/*
35 * Paging handling with authentication
36 */
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020037struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub,
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020038 gsm_cbfn *cbfn, void *param,
39 const char *label);
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020040
Holger Hans Peter Freytherd6d7aff2015-04-06 12:03:45 +020041void subscr_remove_request(struct subscr_request *req);
42
Neels Hofmeyrfacd57a2017-12-15 03:48:48 +010043void subscr_paging_cancel(struct vlr_subscr *vsub, enum gsm_paging_event event);
Harald Welte2483f1b2016-06-19 18:06:02 +020044int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
45 struct msgb *msg, void *data, void *param);
Holger Freyther12aa50d2009-01-01 18:02:05 +000046
Harald Welted35038d2018-01-25 00:07:33 +010047/* Find an allocated channel for a specified subscriber */
Neels Hofmeyrc036b792018-11-29 22:37:51 +010048struct ran_conn *connection_for_subscr(struct vlr_subscr *vsub);
Harald Welted35038d2018-01-25 00:07:33 +010049
Harald Welte52b1f982008-12-23 20:25:15 +000050#endif /* _GSM_SUBSCR_H */