mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	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:
		@@ -30,6 +30,8 @@ enum bsc_vty_node {
 | 
			
		||||
	NS_NODE,
 | 
			
		||||
	BSSGP_NODE,
 | 
			
		||||
	OML_NODE,
 | 
			
		||||
	NAT_NODE,
 | 
			
		||||
	BSC_NODE,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user