nat: Add NAT_NODE and BSC_NODE for the nat
Implement the go to parent and exit functions for the nat.
diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h
index ed21e88..3346a2c 100644
--- a/openbsc/include/openbsc/vty.h
+++ b/openbsc/include/openbsc/vty.h
@@ -30,6 +30,8 @@
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 16d6815..ffa676d 100644
--- a/openbsc/src/common_vty.c
+++ b/openbsc/src/common_vty.c
@@ -28,6 +28,7 @@
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_subscriber.h>
+#include <openbsc/bsc_nat.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/command.h>
@@ -71,6 +72,17 @@
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 @@
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;