NS_Emulation: Introduce status events from provider -> emulation

This allows NS_Emulation to react to changes of the underlying
transport layer (e.g. Frame Relay Link/DLCI up).

Change-Id: If00e9c50dc664ce62b6c0cbde99d741e8173169b
diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 32746b4..5872b00 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -120,9 +120,17 @@
 		/* lower layer ports (UDP/IP, Frame Relay) are added in derived components */
 	};
 
+	type enumerated NS_Provider_LinkStatus {
+		NS_PROV_LINK_STATUS_UP,
+		NS_PROV_LINK_STATUS_DOWN
+	};
+	type union NS_Provider_Evt {
+		NS_Provider_LinkStatus link_status
+	};
+
 	/* port between NS_Provider and NS_CT */
 	type port NS_PROVIDER_PT message {
-		inout PDU_NS;
+		inout PDU_NS, NS_Provider_Evt;
 	} with { extension "internal" };
 
 	type component NS_CT {
@@ -211,6 +219,12 @@
 			f_sendAlive();
 		}
 
+		[] NSCP.receive(NS_Provider_Evt:{link_status:=NS_PROV_LINK_STATUS_UP}) {
+			log("Provider Link came up: sending NS-ALIVE");
+			f_sendAlive();
+			Tns_test.start;
+			}
+
 		/* Stop t_alive when receiving ALIVE-ACK */
 		[Tns_alive.running] NSCP.receive(t_NS_ALIVE_ACK) {
 			log("NS-ALIVE-ACK received: stopping Tns-alive; starting Tns-test");