diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index ed21e88d2..3346a2c6c 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -30,6 +30,8 @@ enum bsc_vty_node { NS_NODE, BSSGP_NODE, OML_NODE, + NAT_NODE, + BSC_NODE, }; #endif diff --git a/openbsc/src/common_vty.c b/openbsc/src/common_vty.c index 16d6815cd..ffa676d77 100644 --- a/openbsc/src/common_vty.c +++ b/openbsc/src/common_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -71,6 +72,17 @@ enum node_type bsc_vty_go_parent(struct vty *vty) talloc_free(vty->index); vty->index = NULL; break; + case NAT_NODE: + vty->node = CONFIG_NODE; + vty->index = NULL; + break; + case BSC_NODE: + vty->node = NAT_NODE; + { + struct bsc_config *bsc_config = vty->index; + vty->index = bsc_config->nat; + } + break; default: vty->node = CONFIG_NODE; } @@ -114,11 +126,19 @@ gDEFUN(ournode_exit, vty->index_sub = &ts->trx->description; } break; + case BSC_NODE: + vty->node = NAT_NODE; + { + struct bsc_config *bsc_config = vty->index; + vty->index = bsc_config->nat; + } + break; case MGCP_NODE: case GBPROXY_NODE: case SGSN_NODE: case NS_NODE: case BSSGP_NODE: + case NAT_NODE: vty->node = CONFIG_NODE; vty->index = NULL; break;