From 7be811ed95d004f92d98880bc8eaef6c28c3373d Mon Sep 17 00:00:00 2001 From: Ivan Kluchnikov Date: Fri, 8 Apr 2016 10:44:28 +0300 Subject: Add support of virtual networks for sending network name to ms depending on imsi Before sending mm info message to ms: - try to find virtual network with the imsi prefix which matches subscriber's imsi - if virtual network was found, use long and short network names of this virtual network for subscriber - if virtual network was not found, use long and short network names of main network for subscriber --- openbsc/src/libcommon/common_vty.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbsc/src/libcommon/common_vty.c') diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0f1..66a82d8bc 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -42,6 +42,15 @@ int bsc_vty_go_parent(struct vty *vty) vty->node = CONFIG_NODE; vty->index = NULL; break; + case VIRT_NET_NODE: + vty->node = GSMNET_NODE; + { + /* set vty->index correctly ! */ + struct gsm_virt_network *virt_net = vty->index; + vty->index = virt_net->network; + vty->index_sub = NULL; + } + break; case BTS_NODE: vty->node = GSMNET_NODE; { @@ -141,3 +150,13 @@ void bsc_replace_string(void *ctx, char **dst, const char *newstr) talloc_free(*dst); *dst = talloc_strdup(ctx, newstr); } + +int osmo_is_digits(const char *str) +{ + int i; + for (i = 0; i < strlen(str); i++) { + if (!isdigit(str[i])) + return 0; + } + return 1; +} -- cgit v1.2.3