diff options
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat_utils.c')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 51977f029..6655d43aa 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -253,6 +253,26 @@ struct msc_config *msc_config_by_con(struct bsc_nat *nat, struct bsc_msc_connect return NULL; } +struct bsc_msc_connection *msc_conn_by_imsi(struct bsc_nat *nat, const char *imsi) +{ + struct msc_config *conf; + + if (!imsi) + return NULL; + + llist_for_each_entry(conf, &nat->msc_configs, entry) { + struct bsc_msg_acc_lst *acc; + acc = bsc_msg_acc_lst_find(&nat->access_lists, conf->acc_lst_name); + if (!acc) + continue; + + if (!bsc_msg_acc_lst_check_allow(acc, imsi)) + return conf->msc_con; + } + + return NULL; +} + void msc_config_free(struct msc_config *cfg) { llist_del(&cfg->entry); |