Commit cdf4c0f2 authored by tepelmann's avatar tepelmann
Browse files

Introduced map param for Ipv4Port, so the test adaptation will provide only...

Introduced map param for Ipv4Port, so the test adaptation will provide only messages addressed to this address.
parent 23f87121
Loading
Loading
Loading
Loading
+29 −27
Original line number Diff line number Diff line
@@ -6,37 +6,39 @@
module AtsCommon_Interfaces {
    
    // LibCommon
    import from LibCommon_Sync {
        type SelfSyncComp
    };
    import from LibCommon_Time {
        modulepar PX_TAC, PX_TNOAC, PX_TWAIT
    };
    import from LibCommon_Sync {type SelfSyncComp;}
    import from LibCommon_Time {modulepar PX_TAC, PX_TNOAC, PX_TWAIT;}
    
    // LibIPv6
    import from LibIpv6_CommonRfcs_TypesAndValues {
        type Ipv6Address 
    };
    import from LibIpv6_Interface_TypesAndValues {
        type 
            LibIpv6Node,
            Ipv4Port, Ipv6Port 
    };
    import from LibIpv6_CommonRfcsDhcp_TypesAndValues {
        type 
            DHCPv6Msg, DomainName, DomainNameList 
    };
    import from LibIpv6_Rfc6334Dhcp_TypesAndValues {
        type AFTRNameOption
    };
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    import from LibIpv6_Interface_TypesAndValues all;
    import from LibIpv6_CommonRfcsDhcp_TypesAndValues {type DHCPv6Msg, DomainName, DomainNameList;}
    import from LibIpv6_Rfc6334Dhcp_TypesAndValues {type AFTRNameOption;}
    
    // AtsCommon
    import from AtsCommon_Dhcpv4_CommonRfcs_TypesAndValues {
        type DHCPv4Msg
    };
    import from AtsCommon_DNS_CommonRfcs_TypesAndValues {
        type DnsMsg
    };
    import from AtsCommon_Dhcpv4_CommonRfcs_TypesAndValues {type DHCPv4Msg;}
    import from AtsCommon_DNS_CommonRfcs_TypesAndValues {type DnsMsg;}
    
    group ports {
        /**
         * @desc    IPv4 Port
        */
        type port Ipv4Port message {
            map param (in Ipv4Address p_ip4Address);
            inout
            //Ipv4
            Ipv4Packet
        }
        
        /**
         * @desc    IPv6 Port
        */
        type port Ipv6Port message {
            inout
            //Ipv6
            Ipv6Packet
        }
    }
    
    group systemDesc {
        
+32 −40
Original line number Diff line number Diff line
@@ -5,30 +5,20 @@
 */
module AtsNat64_Functions {
    
    import from AtsCommon_Interfaces all;

    // LibCommon
    import from LibCommon_DataStrings {
        const c_16ZeroBytes
    };
    import from LibCommon_DataStrings {const c_16ZeroBytes;}
    import from LibCommon_Sync {
        function 
            f_connect4SelfOrClientSync, 
            f_selfOrClientSyncAndVerdict;
        altstep 
            a_shutdown;
        const 
            c_prDone, c_tbDone, c_poDone;
    };
    import from LibCommon_VerdictControl {
        type
            FncRetCode;
    };
        function f_connect4SelfOrClientSync, f_selfOrClientSyncAndVerdict;
        altstep a_shutdown;
        const c_prDone, c_tbDone, c_poDone;
    }
    import from LibCommon_VerdictControl {type FncRetCode;}
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    
    // Nat64
    import from AtsNat64_Interfaces {
        type 
            Nat64Component,
            LSNComponent, HostComponent
    };
    import from AtsNat64_Interfaces {type Nat64Component, LSNComponent, HostComponent;}
    
    group initialiseFunctions {
        
@@ -40,24 +30,20 @@ module AtsNat64_Functions {
            var integer v_hosts;
            var integer v_host;
            
            // Connect port
            if (isbound(vc_lsnComponents)) { 
                v_hosts := lengthof(vc_hostComponents);
                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
                    connect(vc_lsnComponents[v_host]:ipv4Port, self:ipv4Port);
                }
            }
            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); 
                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort);
                } 
            } 
            
            // Map ports
            map(self:ipPort, system:ipPort);
            map(self:ipv4Port, system:ipv4Port);
//            // Connect port
//            if (isbound(vc_lsnComponents)) { 
//                v_hosts := lengthof(vc_hostComponents);
//                for (v_host:=0; v_host<v_hosts; v_host:=v_host + 1) {
//                    connect(vc_lsnComponents[v_host]:ipv4Port, self:ipv4Port);
//                }
//            }
//            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); 
//                    connect(vc_hostComponents[v_host]:ipv4Port, self:ipv4HostPort);
//                } 
//            } 
            
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
@@ -75,10 +61,13 @@ module AtsNat64_Functions {
         * @verdict Unchanged
         * @see LSNComponent
         */
        function f_preamble_lsn() runs on LSNComponent {
        function f_preamble_lsn(Ipv4Address p_ip4Address) runs on LSNComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ipv4Port, system:ipv4Port) param (p_ip4Address);
            
        } // End of function f_preamble_aftr
        
        /**
@@ -86,10 +75,13 @@ module AtsNat64_Functions {
         * @verdict Unchanged
         * @see HostComponent
         */
        function f_preamble_host() runs on HostComponent {
        function f_preamble_host() runs on HostComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ipv6Port, system:ipPort);
            
        } // End of function f_preamble_host
        
    } // End of group preambleFunctions
+4 −2
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
 */
module AtsNat64_Interfaces {
    
    // AtsCommon
    import from AtsCommon_Interfaces all;
    
    // LibCommon
    import from LibCommon_Sync {
        type SelfSyncComp
@@ -20,8 +23,7 @@ module AtsNat64_Interfaces {
    };
    import from LibIpv6_Interface_TypesAndValues {
        type 
            LibIpv6Node,
            Ipv4Port, Ipv6Port 
            LibIpv6Node
    };
    
    group systemDesc {
+15 −10
Original line number Diff line number Diff line
@@ -135,13 +135,13 @@ module AtsNat64_TestCases {
                     * @desc Implement LSN protocol
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_NAT64_LSN_BF_BV_001_lsn(Ipv4Packet v_ipv4Packet) runs on LSNComponent {
                    function f_TC_NAT64_LSN_BF_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent {
                        
                        // Local variables
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_lsn();
                        f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress);
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
@@ -150,7 +150,7 @@ module AtsNat64_TestCases {
                        //                the IUT forwards packets to the destination with different IPv4 public addresses
                        tc_ac.start;
                        alt {
                            [] ipv4Port.receive(v_ipv4Packet) { 
                            [] ipv4Port.receive(p_ipv4Packet) { 
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": PASS: IPv4 packet was forwarded. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
@@ -293,13 +293,13 @@ module AtsNat64_TestCases {
                     * @desc Implement LSN protocol
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_NAT64_LSN_BF_BV_002_lsn(Ipv4Packet v_ipv4Packet) runs on LSNComponent {
                    function f_TC_NAT64_LSN_BF_BV_002_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent {
                        
                        // Local variables
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_lsn();
                        f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress);
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
@@ -308,7 +308,7 @@ module AtsNat64_TestCases {
                        //                the IUT forwards packets to the destination with same public IPv4 source address
                        tc_ac.start;
                        alt {
                            [] ipv4Port.receive(v_ipv4Packet) { 
                            [] ipv4Port.receive(p_ipv4Packet) { 
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": PASS: IPv4 packet was forwarded. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
@@ -410,7 +410,7 @@ module AtsNat64_TestCases {
                    
                    // Local variables
                    var integer v_groupNum := lengthof(PX_NAT64_MAPPING_TABLE_POOL);
                    var integer v_hostNum;
                    var integer v_hostNum := 0;
                    var Ipv4Packet v_ipv4Packet;                                /** IPv4 packets */
                    var Ipv6Packet v_ipv6Packet;                                /** IPv6 packets address to IPv4 */
                    var integer v_group;                                        /** 'for' statement counter */
@@ -419,6 +419,10 @@ module AtsNat64_TestCases {
                    // Test control
                    
                    // Test component configuration
                    for (v_group := 0; v_group < v_groupNum; v_group := v_group + 1) {
                        v_hostNum := v_hostNum + lengthof(PX_NAT64_MAPPING_TABLE_POOL[v_group].clientInfos);
                    } // End of 'for' statement 
                    
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_lsnComponents[v_host] := LSNComponent.create(c_COMP_LSN & int2str(v_host));
                        vc_hostComponents[v_host] := HostComponent.create(c_COMP_HOST & int2str(v_host));
@@ -471,13 +475,14 @@ module AtsNat64_TestCases {
                     * @desc Implement LSN protocol
                     * @verdict 'pass' on success, 'inconc' on 'timeout', fail otherwise
                     */
                    function f_TC_NAT64_LSN_NP_BV_001_lsn(Ipv4Packet v_ipv4Packet) runs on LSNComponent {
                    function f_TC_NAT64_LSN_NP_BV_001_lsn(Ipv4Packet p_ipv4Packet) runs on LSNComponent {
                        
                        // Local variables
                         
                        // Preamble
                        // Clause 'Initial conditions'
                        f_preamble_lsn();
                        f_preamble_lsn(p_ipv4Packet.ipv4Hdr.destinationAddress);
                        
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        log("*** " & __SCOPE__ & ": INFO: Preamble done. ***");
                        
@@ -486,7 +491,7 @@ module AtsNat64_TestCases {
                        //                the IUT forwards packets to the destination with different IPv4 public addresses
                        tc_ac.start;
                        alt {
                            [] ipv4Port.receive(v_ipv4Packet) { 
                            [] ipv4Port.receive(p_ipv4Packet) { 
                                tc_ac.stop;
                                log("*** " & __SCOPE__ & ": PASS: IPv4 packet was forwarded. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);