blob: 324734f9a5ea08514aa6bb176a389328f2273926 [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);
22
23struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
24 const char *imsi);
25struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
26 uint32_t tmsi);
27
28struct bsc_subscr *bsc_subscr_find_by_imsi(struct llist_head *list,
29 const char *imsi);
30struct bsc_subscr *bsc_subscr_find_by_tmsi(struct llist_head *list,
31 uint32_t tmsi);
32
33void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi);
34
35struct bsc_subscr *_bsc_subscr_get(struct bsc_subscr *bsub,
36 const char *file, int line);
37struct bsc_subscr *_bsc_subscr_put(struct bsc_subscr *bsub,
38 const char *file, int line);
39#define bsc_subscr_get(bsub) _bsc_subscr_get(bsub, __BASE_FILE__, __LINE__)
40#define bsc_subscr_put(bsub) _bsc_subscr_put(bsub, __BASE_FILE__, __LINE__)
41
42void log_set_filter_bsc_subscr(struct log_target *target,
43 struct bsc_subscr *bsub);