diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-04 15:15:32 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-09-06 16:26:13 +0200 |
commit | c01647914b97ab8a1079330e36d0e1d024d3a804 (patch) | |
tree | dc22a90b524e2a5517805a8757016997db9eb12d /include/osmocom/bsc/bsc_subscriber.h | |
parent | 538635ad5d5564087d285eda042b0cad9610c70e (diff) |
move include/openbsc to include/osmocom/bsc
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
Diffstat (limited to 'include/osmocom/bsc/bsc_subscriber.h')
-rw-r--r-- | include/osmocom/bsc/bsc_subscriber.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/osmocom/bsc/bsc_subscriber.h b/include/osmocom/bsc/bsc_subscriber.h new file mode 100644 index 000000000..324734f9a --- /dev/null +++ b/include/osmocom/bsc/bsc_subscriber.h @@ -0,0 +1,43 @@ +/* GSM subscriber details for use in BSC land */ + +#pragma once + +#include <stdint.h> + +#include <osmocom/core/linuxlist.h> +#include <osmocom/gsm/protocol/gsm_23_003.h> + +struct log_target; + +struct bsc_subscr { + struct llist_head entry; + int use_count; + + char imsi[GSM23003_IMSI_MAX_DIGITS+1]; + uint32_t tmsi; + uint16_t lac; +}; + +const char *bsc_subscr_name(struct bsc_subscr *bsub); + +struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list, + const char *imsi); +struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list, + uint32_t tmsi); + +struct bsc_subscr *bsc_subscr_find_by_imsi(struct llist_head *list, + const char *imsi); +struct bsc_subscr *bsc_subscr_find_by_tmsi(struct llist_head *list, + uint32_t tmsi); + +void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi); + +struct bsc_subscr *_bsc_subscr_get(struct bsc_subscr *bsub, + const char *file, int line); +struct bsc_subscr *_bsc_subscr_put(struct bsc_subscr *bsub, + const char *file, int line); +#define bsc_subscr_get(bsub) _bsc_subscr_get(bsub, __BASE_FILE__, __LINE__) +#define bsc_subscr_put(bsub) _bsc_subscr_put(bsub, __BASE_FILE__, __LINE__) + +void log_set_filter_bsc_subscr(struct log_target *target, + struct bsc_subscr *bsub); |