aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/common_vty.c
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2016-04-08 10:44:28 +0300
committerIvan Kluchnikov <kluchnikovi@gmail.com>2016-04-19 14:29:09 +0300
commit67fd3b1a0281c87f4f83e2771b0d851930d1fdaa (patch)
treea10b332e0594d096bb21caa81300476f87bc2dc9 /openbsc/src/libcommon/common_vty.c
parente85e7910d22374ba33a347839aa17289f4b9a077 (diff)
Add support of virtual networks for sending network name to ms depending on imsifairwaves/master
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
Diffstat (limited to 'openbsc/src/libcommon/common_vty.c')
-rw-r--r--openbsc/src/libcommon/common_vty.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c
index 186fbe0b7..7bfbdbee8 100644
--- a/openbsc/src/libcommon/common_vty.c
+++ b/openbsc/src/libcommon/common_vty.c
@@ -42,6 +42,15 @@ enum node_type 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;
+}