Loading ttcn/AtsCommon/AtsCommon_Functions.ttcn3 +30 −0 Original line number Diff line number Diff line Loading @@ -10,7 +10,11 @@ module AtsCommon_Functions { import from LibCommon_VerdictControl all; // LibIpv6 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 all; Loading Loading @@ -122,6 +126,32 @@ module AtsCommon_Functions { return v_result; } /** * @desc This finalyzes (checksum calculations...) 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_finalyzeIpv4Packet (in template Ipv4Packet p_ipv4Packet, out Ipv4Packet p_result) return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); //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 ); p_result := v_ipPkt; return e_success; } // End of function f_finalyzeIpv4Packet } // End of group auxiliary } // End of module AtsCommon_Functions ttcn/AtsCommon/AtsCommon_TypesAndValues.ttcn +64 −11 Original line number Diff line number Diff line Loading @@ -6,6 +6,15 @@ */ module AtsCommon_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; //LibIpv6 import from LibIpv6_CommonRfcs_TypesAndValues all; // AtsCommon import from AtsCommon_Tcp_Rfc793_TypesAndValues all; group componentConstants { const charstring c_COMP_DHCP := "DHCPv6"; Loading @@ -18,4 +27,48 @@ } // end componentConstants group ipv4Hosts { /** * @desc Description of an IPv6 host service * @member srcAddress * @member dstAddress */ type record HostV6Description { Ipv6Address hostAddress } // End of type HostV4Description /** * @desc Defines a list of IPv6 host services */ type set of HostV6Description HostV6Descriptions; } // End of group ipv6Hosts group ipv4Hosts { /** * @desc Description of an IPv4 host service * @member srcAddress * @member srcPort * @member dstAddress * @member dstPort * @member payload */ type record HostV4Description { Ipv4Address srcAddress, UInt16 srcPort, Ipv4Address dstAddress, UInt16 dstPort, TcpPayload payload } // End of type HostV4Description /** * @desc Defines a list of IPv4 host services * @see TC_DSLITE_B4_BF_BV_001 */ type set of HostV4Description HostV4Descriptions; } // End of group ipv4Hosts } // end AtsCommon_TypesAndValues ttcn/AtsDSlite/AtsDSLite_Functions.ttcn3 +1 −30 Original line number Diff line number Diff line Loading @@ -27,9 +27,6 @@ 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 @@ -62,7 +59,7 @@ module AtsDSLite_Functions { if (vc_aftrComponent != null) { connect(vc_aftrComponent:aftrPort, self:aftrPort); } if (vc_hostComponents != null) { if (isbound(vc_hostComponents)) { v_hosts := lengthof(vc_hostComponents); for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) { connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); Loading Loading @@ -281,32 +278,6 @@ module AtsDSLite_Functions { return e_error; } /** * @desc This finalyzes (checksum calculations...) 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_finalyzeIpv4Packet (in template Ipv4Packet p_ipv4Packet, out Ipv4Packet p_result) return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); //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 ); p_result := v_ipPkt; return e_success; } // End of function f_finalyzeIpv4Packet } // End of group auxiliary } // End of module AtsDSLite_Functions ttcn/AtsDSlite/AtsDSLite_Pixits.ttcn3 +5 −6 Original line number Diff line number Diff line Loading @@ -6,18 +6,17 @@ module AtsDSLite_Pixits { // LibCommon import from LibCommon_DataStrings { const c_16ZeroBytes }; import from LibCommon_DataStrings {const c_16ZeroBytes;} // LibIPv6 import from LibIpv6_CommonRfcs_TypesAndValues { type Ipv6Address }; import from LibIpv6_CommonRfcs_TypesAndValues {type Ipv6Address;} // DSLite import from AtsDSLite_TypesAndValues all; // AtsCommon import from AtsCommon_TypesAndValues all; /** * @desc Indicates the IPv6 address of the B4 equipment */ Loading ttcn/AtsDSlite/AtsDSLite_TestCases.ttcn3 +8 −3 Original line number Diff line number Diff line Loading @@ -588,7 +588,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading Loading @@ -1189,7 +1189,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading @@ -1216,6 +1216,11 @@ module AtsDSLite_TestCases { // Test Body // Clause 'when': the IUT receives multiple HTML IPv6 packets //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(p_host.payload.ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_host.payload.ipv6Packet); // Clause 'then': the IUT does a 1:1 NAT mapping for each public IPv6 B4 address sourced and, the IUT forwards packets to the destination with different IPv4 public addresses Loading Loading @@ -1385,7 +1390,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading Loading
ttcn/AtsCommon/AtsCommon_Functions.ttcn3 +30 −0 Original line number Diff line number Diff line Loading @@ -10,7 +10,11 @@ module AtsCommon_Functions { import from LibCommon_VerdictControl all; // LibIpv6 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 all; Loading Loading @@ -122,6 +126,32 @@ module AtsCommon_Functions { return v_result; } /** * @desc This finalyzes (checksum calculations...) 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_finalyzeIpv4Packet (in template Ipv4Packet p_ipv4Packet, out Ipv4Packet p_result) return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); //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 ); p_result := v_ipPkt; return e_success; } // End of function f_finalyzeIpv4Packet } // End of group auxiliary } // End of module AtsCommon_Functions
ttcn/AtsCommon/AtsCommon_TypesAndValues.ttcn +64 −11 Original line number Diff line number Diff line Loading @@ -6,6 +6,15 @@ */ module AtsCommon_TypesAndValues { // LibCommon import from LibCommon_BasicTypesAndValues all; //LibIpv6 import from LibIpv6_CommonRfcs_TypesAndValues all; // AtsCommon import from AtsCommon_Tcp_Rfc793_TypesAndValues all; group componentConstants { const charstring c_COMP_DHCP := "DHCPv6"; Loading @@ -18,4 +27,48 @@ } // end componentConstants group ipv4Hosts { /** * @desc Description of an IPv6 host service * @member srcAddress * @member dstAddress */ type record HostV6Description { Ipv6Address hostAddress } // End of type HostV4Description /** * @desc Defines a list of IPv6 host services */ type set of HostV6Description HostV6Descriptions; } // End of group ipv6Hosts group ipv4Hosts { /** * @desc Description of an IPv4 host service * @member srcAddress * @member srcPort * @member dstAddress * @member dstPort * @member payload */ type record HostV4Description { Ipv4Address srcAddress, UInt16 srcPort, Ipv4Address dstAddress, UInt16 dstPort, TcpPayload payload } // End of type HostV4Description /** * @desc Defines a list of IPv4 host services * @see TC_DSLITE_B4_BF_BV_001 */ type set of HostV4Description HostV4Descriptions; } // End of group ipv4Hosts } // end AtsCommon_TypesAndValues
ttcn/AtsDSlite/AtsDSLite_Functions.ttcn3 +1 −30 Original line number Diff line number Diff line Loading @@ -27,9 +27,6 @@ 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 @@ -62,7 +59,7 @@ module AtsDSLite_Functions { if (vc_aftrComponent != null) { connect(vc_aftrComponent:aftrPort, self:aftrPort); } if (vc_hostComponents != null) { if (isbound(vc_hostComponents)) { v_hosts := lengthof(vc_hostComponents); for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) { connect(vc_hostComponents[v_host]:ipv6Port, self:ipv6HostPort); Loading Loading @@ -281,32 +278,6 @@ module AtsDSLite_Functions { return e_error; } /** * @desc This finalyzes (checksum calculations...) 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_finalyzeIpv4Packet (in template Ipv4Packet p_ipv4Packet, out Ipv4Packet p_result) return FncRetCode { var Ipv4Packet v_ipPkt := valueof(p_ipv4Packet); //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 ); p_result := v_ipPkt; return e_success; } // End of function f_finalyzeIpv4Packet } // End of group auxiliary } // End of module AtsDSLite_Functions
ttcn/AtsDSlite/AtsDSLite_Pixits.ttcn3 +5 −6 Original line number Diff line number Diff line Loading @@ -6,18 +6,17 @@ module AtsDSLite_Pixits { // LibCommon import from LibCommon_DataStrings { const c_16ZeroBytes }; import from LibCommon_DataStrings {const c_16ZeroBytes;} // LibIPv6 import from LibIpv6_CommonRfcs_TypesAndValues { type Ipv6Address }; import from LibIpv6_CommonRfcs_TypesAndValues {type Ipv6Address;} // DSLite import from AtsDSLite_TypesAndValues all; // AtsCommon import from AtsCommon_TypesAndValues all; /** * @desc Indicates the IPv6 address of the B4 equipment */ Loading
ttcn/AtsDSlite/AtsDSLite_TestCases.ttcn3 +8 −3 Original line number Diff line number Diff line Loading @@ -588,7 +588,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading Loading @@ -1189,7 +1189,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading @@ -1216,6 +1216,11 @@ module AtsDSLite_TestCases { // Test Body // Clause 'when': the IUT receives multiple HTML IPv6 packets //TODO needs to be called as it sets length and checksum fields // if(f_setExtensionHeaders(p_host.payload.ipv6Packet) != e_success) { // log(" **** " & __SCOPE__ & ": Error when calculating length of extension headers ****"); // f_selfOrClientSyncAndVerdict(c_tbDone, e_error); // } ipv6Port.send(p_host.payload.ipv6Packet); // Clause 'then': the IUT does a 1:1 NAT mapping for each public IPv6 B4 address sourced and, the IUT forwards packets to the destination with different IPv4 public addresses Loading Loading @@ -1385,7 +1390,7 @@ module AtsDSLite_TestCases { // Clause 'then': Nothing to do, refer to a_default f_serverSyncNClientsAndStop(v_hostNum + 1, { c_prDone, c_tbDone, c_poDone }); f_serverSyncNClientsAndStop(v_hostNum, { c_prDone, c_tbDone, c_poDone }); // Postamble f_down(); Loading