nat: Add NAT_NODE and BSC_NODE for the nat

Implement the go to parent and exit functions for the nat.
This commit is contained in:
Holger Hans Peter Freyther
2010-06-15 20:11:16 +08:00
parent 3d73e0d235
commit ab52c84889
2 changed files with 22 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ enum bsc_vty_node {
NS_NODE,
BSSGP_NODE,
OML_NODE,
NAT_NODE,
BSC_NODE,
};
#endif

View File

@@ -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 @@ 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;