aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/NS_Emulation.ttcnpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp
index 1b9b1df1..38f132a2 100644
--- a/library/NS_Emulation.ttcnpp
+++ b/library/NS_Emulation.ttcnpp
@@ -263,7 +263,8 @@ module NS_Emulation {
type enumerated NsCtrlRequest {
StartAliveProcedure (0),
DisableReq (1), /* administratively disable NS-VC */
- EnableReq (2) /* administratively enable NS-VC */
+ EnableReq (2), /* administratively enable NS-VC */
+ ForceAliveState (3)
};
/* add one NSVC (component and table entry */
@@ -487,6 +488,10 @@ module NS_Emulation {
-> value sind sender vc {
/* blindly acknowledge whatever the PCU sends */
NSVC.send(SnsRequest:{sind.nsvci, ts_SNS_CONFIG_ACK(g_config.nsei, omit)}) to vc;
+ /* switch to "alive" state already before sending the SNS-CONFIG, as otherwise
+ * there would be a race condition between internally performing the state change
+ * of all related NS-VCs and the first incoming NS-PDU after SNS-CONFIG-ACK */
+ f_broadcast_ns_ctrl(NsCtrlRequest:ForceAliveState);
/* send a SNS-CONFIG in response and expect a SNS-CONFIG-ACK */
var template (omit) IP4_Elements v4;
var template (omit) IP6_Elements v6;
@@ -494,6 +499,9 @@ module NS_Emulation {
NSVC.send(SnsRequest:{sind.nsvci,
ts_SNS_CONFIG(g_config.nsei, true, v4, v6)}) to vc;
alt {
+ [] as_ns_common_status() {
+ repeat;
+ }
[] NSVC.receive(SnsIndication:{sind.nsvci,
tr_SNS_CONFIG_ACK(g_config.nsei, omit)}) from vc {
/* success */
@@ -735,8 +743,10 @@ module NS_Emulation {
setverdict(fail, "Unexpected SNS from NSVC: ", sreq);
self.stop;
}
- [] NS_SP.receive(NsCtrlRequest:StartAliveProcedure) {
+ [] NS_SP.receive(NsCtrlRequest:ForceAliveState) {
f_change_state(NSVC_S_ALIVE_UNBLOCKED);
+ }
+ [] NS_SP.receive(NsCtrlRequest:StartAliveProcedure) {
f_sendAlive();
Tns_test.start;
}