Neels Hofmeyr | 6d804b1 | 2017-02-18 22:20:46 +0100 | [diff] [blame] | 1 | /* 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 | |
| 10 | struct log_target; |
| 11 | |
| 12 | struct 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 | |
| 21 | const char *bsc_subscr_name(struct bsc_subscr *bsub); |
| 22 | |
| 23 | struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list, |
| 24 | const char *imsi); |
| 25 | struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list, |
| 26 | uint32_t tmsi); |
| 27 | |
| 28 | struct bsc_subscr *bsc_subscr_find_by_imsi(struct llist_head *list, |
| 29 | const char *imsi); |
| 30 | struct bsc_subscr *bsc_subscr_find_by_tmsi(struct llist_head *list, |
| 31 | uint32_t tmsi); |
| 32 | |
| 33 | void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi); |
| 34 | |
| 35 | struct bsc_subscr *_bsc_subscr_get(struct bsc_subscr *bsub, |
| 36 | const char *file, int line); |
| 37 | struct 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 | |
| 42 | void log_set_filter_bsc_subscr(struct log_target *target, |
| 43 | struct bsc_subscr *bsub); |