Loading ttcn/AtsDSlite/AtsDSLite_Functions.ttcn3 +41 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ module AtsDSLite_Functions { import from LibIpv6_Interface_Templates all; import from LibIpv6_Interface_TypesAndValues all; import from LibIpv6_CommonRfcsDhcp_TypesAndValues all; import from LibIpv6_ExternalFunctions { function fx_calcIpv4PayloadChecksum, fx_ipv4PacketTotalLength, fx_calcIpv4Hcs }; // AtsCommon import from AtsCommon_Interfaces { Loading Loading @@ -157,6 +160,44 @@ module AtsDSLite_Functions { } // End of group postambleFunctions group helpers { /** * @desc This sends an Tcp packet from an dual stack IPv4/IPv6 node to * any NUT. Prior it modifies * @remark The template passed in must NOT contain any matching expressions! * @param p_ipv4Packet Ipv4 packet value or template with echo request to be sent * @return execution status */ function f_sendIpv4Packet (in template Ipv4Packet p_ipv4Packet) runs on HostComponent return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); if(ischosen(v_ipPkt.ipv4Payload.ipv4EchoReplyMsg)) { v_ipPkt.ipv4Payload.ipv4EchoReplyMsg.checksum := fx_calcIpv4PayloadChecksum ( v_ipPkt.ipv4Payload ); } //Build IPv4 Packet //IHL is set in templates // Update the total length v_ipPkt.ipv4Hdr.totalLength := fx_ipv4PacketTotalLength (v_ipPkt); // Compute header checksum (HCS) v_ipPkt.ipv4Hdr.hcs := fx_calcIpv4Hcs ( v_ipPkt.ipv4Hdr ); //send ipv4Port.send(v_ipPkt); return e_success; } // End of function f_sendIpv4Packet } // End of group helpers group globalSteps { /** Loading ttcn/AtsDSlite/AtsDSLite_TestCases.ttcn3 +26 −6 Original line number Diff line number Diff line Loading @@ -532,13 +532,14 @@ module AtsDSLite_TestCases { testcase TC_DSLITE_B4_BF_BV_001() runs on DSLiteComponent system TestAdapter { // Local variables var integer v_hostNum := lengthof(PX_HOST_V4_LIST); var integer v_host; // Test control // Test component configuration vc_aftrComponent := AFTRComponent.create(c_COMP_AFTR); for (v_host := 0; v_host < PX_HOST_NUM; v_host := v_host + 1) { for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { vc_hostComponents[v_host] := HostComponent.create(c_COMP_HOST & int2str(v_host)); } // End of 'for' statement f_cf01Up_B4(); Loading @@ -547,11 +548,11 @@ module AtsDSLite_TestCases { // Start all components vc_aftrComponent.start(f_TC_DSLITE_B4_BF_BV_001_aftr()); for (v_host := 0; v_host < PX_HOST_NUM; v_host := v_host + 1) { for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { vc_hostComponents[v_host].start(f_TC_DSLITE_B4_BF_BV_001_host(v_host)); } // End of 'for' statement f_serverSyncNClientsAndStop(PX_HOST_NUM + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); // Test Body // Clause 'when': Loading @@ -576,7 +577,17 @@ module AtsDSLite_TestCases { log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': // Clause 'then':the IUT encapsulates each HTML IPv4 packet unchanged into IPv6 packet tc_ac.start; alt { [] aftrPort.receive { // TODO To be continued (Ipv6Packet:?) tc_ac.stop; } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***"); } } // End of 'altstep' statement // Postamble f_postamble_aftr(); Loading @@ -596,7 +607,16 @@ module AtsDSLite_TestCases { log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': // Clause 'when': the IUT receives multiple HTML IPv4 packets f_sendIpv4Packet( m_ipv4Packet_dummy( PX_HOST_V4_LIST[p_hostId].srcAddress, PX_HOST_V4_LIST[p_hostId].dstAddress, m_tcpv4_packet( PX_HOST_V4_LIST[p_hostId].srcPort, PX_HOST_V4_LIST[p_hostId].dstPort, PX_HOST_V4_LIST[p_hostId].payload ))); // Postamble f_postamble_host(); Loading Loading
ttcn/AtsDSlite/AtsDSLite_Functions.ttcn3 +41 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ module AtsDSLite_Functions { import from LibIpv6_Interface_Templates all; import from LibIpv6_Interface_TypesAndValues all; import from LibIpv6_CommonRfcsDhcp_TypesAndValues all; import from LibIpv6_ExternalFunctions { function fx_calcIpv4PayloadChecksum, fx_ipv4PacketTotalLength, fx_calcIpv4Hcs }; // AtsCommon import from AtsCommon_Interfaces { Loading Loading @@ -157,6 +160,44 @@ module AtsDSLite_Functions { } // End of group postambleFunctions group helpers { /** * @desc This sends an Tcp packet from an dual stack IPv4/IPv6 node to * any NUT. Prior it modifies * @remark The template passed in must NOT contain any matching expressions! * @param p_ipv4Packet Ipv4 packet value or template with echo request to be sent * @return execution status */ function f_sendIpv4Packet (in template Ipv4Packet p_ipv4Packet) runs on HostComponent return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); if(ischosen(v_ipPkt.ipv4Payload.ipv4EchoReplyMsg)) { v_ipPkt.ipv4Payload.ipv4EchoReplyMsg.checksum := fx_calcIpv4PayloadChecksum ( v_ipPkt.ipv4Payload ); } //Build IPv4 Packet //IHL is set in templates // Update the total length v_ipPkt.ipv4Hdr.totalLength := fx_ipv4PacketTotalLength (v_ipPkt); // Compute header checksum (HCS) v_ipPkt.ipv4Hdr.hcs := fx_calcIpv4Hcs ( v_ipPkt.ipv4Hdr ); //send ipv4Port.send(v_ipPkt); return e_success; } // End of function f_sendIpv4Packet } // End of group helpers group globalSteps { /** Loading
ttcn/AtsDSlite/AtsDSLite_TestCases.ttcn3 +26 −6 Original line number Diff line number Diff line Loading @@ -532,13 +532,14 @@ module AtsDSLite_TestCases { testcase TC_DSLITE_B4_BF_BV_001() runs on DSLiteComponent system TestAdapter { // Local variables var integer v_hostNum := lengthof(PX_HOST_V4_LIST); var integer v_host; // Test control // Test component configuration vc_aftrComponent := AFTRComponent.create(c_COMP_AFTR); for (v_host := 0; v_host < PX_HOST_NUM; v_host := v_host + 1) { for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { vc_hostComponents[v_host] := HostComponent.create(c_COMP_HOST & int2str(v_host)); } // End of 'for' statement f_cf01Up_B4(); Loading @@ -547,11 +548,11 @@ module AtsDSLite_TestCases { // Start all components vc_aftrComponent.start(f_TC_DSLITE_B4_BF_BV_001_aftr()); for (v_host := 0; v_host < PX_HOST_NUM; v_host := v_host + 1) { for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) { vc_hostComponents[v_host].start(f_TC_DSLITE_B4_BF_BV_001_host(v_host)); } // End of 'for' statement f_serverSyncNClientsAndStop(PX_HOST_NUM + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); // Test Body // Clause 'when': Loading @@ -576,7 +577,17 @@ module AtsDSLite_TestCases { log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': // Clause 'then':the IUT encapsulates each HTML IPv4 packet unchanged into IPv6 packet tc_ac.start; alt { [] aftrPort.receive { // TODO To be continued (Ipv6Packet:?) tc_ac.stop; } [] tc_ac.timeout { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); log("*** " & __SCOPE__ & ": INCONC: Message was not received in due time. ***"); } } // End of 'altstep' statement // Postamble f_postamble_aftr(); Loading @@ -596,7 +607,16 @@ module AtsDSLite_TestCases { log("*** " & __SCOPE__ & ": INFO: Preamble done. ***"); // Test Body // Clause 'when': // Clause 'when': the IUT receives multiple HTML IPv4 packets f_sendIpv4Packet( m_ipv4Packet_dummy( PX_HOST_V4_LIST[p_hostId].srcAddress, PX_HOST_V4_LIST[p_hostId].dstAddress, m_tcpv4_packet( PX_HOST_V4_LIST[p_hostId].srcPort, PX_HOST_V4_LIST[p_hostId].dstPort, PX_HOST_V4_LIST[p_hostId].payload ))); // Postamble f_postamble_host(); Loading