NS_Emulation.ttcnpp: complete SGSN emulation with SNS

The emulation of an SGSN with SNS was incomplete. The SNS
procedure was completed. However the NSVCs didn't moved
into an unblocked state.
Also sending a NS_ALIVE at the beginning is wrong.

Change-Id: I54c2d9d5b34d791be354298171d04180a9b263c3
diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 2ccd399..ba859b0 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -497,14 +497,8 @@
 	 * of the protocol, merely sufficient to make the PCU/BSS side happy to proceed */
 	private altstep as_sns_sgsn() runs on NSVC_CT {
 		var PDU_NS rf;
-		[g_config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
-			log("Provider Link came up: sending NS-ALIVE");
-			f_sendAlive();
-			}
-
-		[not g_config.role_sgsn] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
-			log("Provider Link came up: sending NS-ALIVE");
-			f_sendAlive();
+		[] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+			log("Provider Link came up. Waiting for SNS Size");
 			}
 
 		[] NSCP.receive(tr_SNS_SIZE(g_config.nsei)) -> value rf {
@@ -527,6 +521,10 @@
 			alt {
 			[] NSCP.receive(tr_SNS_CONFIG_ACK(g_config.nsei, omit)) {
 				/* success */
+				log("SNS Config succeeded. Sending Alive");
+				f_change_state(NSVC_S_ALIVE_UNBLOCKED);
+				f_sendAlive();
+				Tns_test.start;
 				}
 			[] NSCP.receive(tr_SNS_CONFIG_ACK(g_config.nsei, ?)) {
 				setverdict(fail, "Unexpected SNS-CONFIG-NACK");