blob: 93b353935787171a39c257df323da2c2e9ea83de [file] [log] [blame]
Neels Hofmeyr6d804b12017-02-18 22:20:46 +01001/* GSM subscriber details for use in BSC land */
2
3#pragma once
4
5#include <stdint.h>
6
7#include <osmocom/core/linuxlist.h>
8#include <osmocom/gsm/protocol/gsm_23_003.h>
9
10struct log_target;
11
12struct bsc_subscr {
13 struct llist_head entry;
14 int use_count;
15
16 char imsi[GSM23003_IMSI_MAX_DIGITS+1];
17 uint32_t tmsi;
18 uint16_t lac;
19};
20
21const char *bsc_subscr_name(struct bsc_subscr *bsub);
Neels Hofmeyr31f525e2018-05-14 18:14:15 +020022const char *bsc_subscr_id(struct bsc_subscr *bsub);
Neels Hofmeyr6d804b12017-02-18 22:20:46 +010023
24struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
25 const char *imsi);
26struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
27 uint32_t tmsi);
28
29struct bsc_subscr *bsc_subscr_find_by_imsi(struct llist_head *list,
30 const char *imsi);
31struct bsc_subscr *bsc_subscr_find_by_tmsi(struct llist_head *list,
32 uint32_t tmsi);
33
34void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi);
35
36struct bsc_subscr *_bsc_subscr_get(struct bsc_subscr *bsub,
37 const char *file, int line);
38struct bsc_subscr *_bsc_subscr_put(struct bsc_subscr *bsub,
39 const char *file, int line);
Neels Hofmeyrc649c3f2018-08-20 12:40:43 +020040#define bsc_subscr_get(bsub) _bsc_subscr_get(bsub, __FILE__, __LINE__)
41#define bsc_subscr_put(bsub) _bsc_subscr_put(bsub, __FILE__, __LINE__)
Neels Hofmeyr6d804b12017-02-18 22:20:46 +010042
43void log_set_filter_bsc_subscr(struct log_target *target,
44 struct bsc_subscr *bsub);