[PATCH] osmo-ttcn3-hacks[master]: bsc: Allow multiple subsequent calls of f_MscConnHdlr_init()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Mar 21 21:49:22 UTC 2018


Review at  https://gerrit.osmocom.org/7438

bsc: Allow multiple subsequent calls of f_MscConnHdlr_init()

If the function was called once, don't start another VTY/telnet
component.

Change-Id: I47bdeb0417a6814ed3a3f5c0c5797bd1bc7a59ba
---
M bsc/MSC_ConnectionHandler.ttcn
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/7438/1

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 32f834d..6bf3221 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -297,14 +297,19 @@
 
 	var MediaState g_media;
 	var TestHdlrParams g_pars;
+
+	var boolean g_vty_initialized := false;
 }
 
 /* initialize all parameters */
 function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw) runs on MSC_ConnHdlr {
 	f_MediaState_init(g_media, i, bts, mgw);
-	map(self:BSCVTY, system:BSCVTY);
-	f_vty_set_prompts(BSCVTY);
-	f_vty_transceive(BSCVTY, "enable");
+	if (not g_vty_initialized) {
+		map(self:BSCVTY, system:BSCVTY);
+		f_vty_set_prompts(BSCVTY);
+		f_vty_transceive(BSCVTY, "enable");
+		g_vty_initialized := true;
+	}
 }
 
 /* Callback function from general BSSMAP_Emulation whenever a connectionless

-- 
To view, visit https://gerrit.osmocom.org/7438
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47bdeb0417a6814ed3a3f5c0c5797bd1bc7a59ba
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list