Commit dbb98439 authored by tepelmann's avatar tepelmann
Browse files

Added initial version of TC_NAT64_LSN_ALG_BV_001, TC_NAT64_LSN_ALG_BV_002,...

Added initial version of TC_NAT64_LSN_ALG_BV_001, TC_NAT64_LSN_ALG_BV_002, TC_NAT64_LSN_ALG_BV_003, TC_NAT64_LSN_ALG_BV_004.
parent 93e3c9a5
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
 */
module AtsCommon_Interfaces {
    
    import from AtsNat64_Interfaces all;

    // LibCommon
    import from LibCommon_Sync {type SelfSyncComp;}
    import from LibCommon_Time {modulepar PX_TAC, PX_TNOAC, PX_TWAIT;}
@@ -69,10 +71,18 @@ module AtsCommon_Interfaces {
         * @member ipPort IPv6 port to be mapped to the Test Adapter
         */
        type component TestAdapter extends UtComponent {
            /** IPv4 port. Only UDP protocol is used */
            /** IPv4 port. */
            port Ipv4Port ipv4Port;
            /** IPv6 port. Only UDP protocol is used */
            /** IPv6 port. */
            port Ipv6Port ipPort;
            /** FTP port. */
            port FtpPort  ftpPort;
            /** SIP port. */
            port SipPort  sipPort;
            /** RTSP port. */
            port RtspPort rtspPort;
            /** PPTP port. */
            port PptpPort pptpPort;
        } // End of type TestAdapter
        
    } // End of component TestAdapter
+378 −4
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ module AtsNat64_Functions {
    }
    import from LibCommon_VerdictControl all;
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    import from LibCommon_Time all;
    import from LibCommon_BasicTypesAndValues all;
    
    // AtsCommon
    import from AtsCommon_Tcp_Rfc793_TypesAndValues all;
@@ -25,6 +27,7 @@ module AtsNat64_Functions {
    // AtsNat64
    import from AtsNat64_Pixits all;
    import from AtsNat64_Interfaces all;
    import from AtsNat64_TypesAndValues all;
    
    group initialiseFunctions {
        
@@ -75,7 +78,63 @@ module AtsNat64_Functions {
            map(self:ipv4Port, system:ipv4Port) param (p_ip4Address);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_aftr
        } // End of function f_preamble_lsn
        
        /**
         * @desc Preamble processing for LSNComponent using FTP
         * @see LSNComponent
         */
        function f_preamble_lsn_ftp(Ipv4Address p_ip4Address) runs on LSNFTPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ftpPort, system:ftpPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_lsn_ftp
        
        /**
         * @desc Preamble processing for LSNComponent using SIP
         * @see LSNComponent
         */
        function f_preamble_lsn_sip(Ipv4Address p_ip4Address) runs on LSNSIPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:sipPort, system:sipPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_lsn_sip
        
        /**
         * @desc Preamble processing for LSNComponent using RTSP
         * @see LSNComponent
         */
        function f_preamble_lsn_rtsp(Ipv4Address p_ip4Address) runs on LSNRTSPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:rtspPort, system:rtspPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_lsn_rtsp
        
        /**
         * @desc Preamble processing for LSNComponent using PPTP
         * @see LSNComponent
         */
        function f_preamble_lsn_pptp(Ipv4Address p_ip4Address) runs on LSNPPTPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:pptpPort, system:pptpPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_lsn_pptp
        
        /**
         * @desc Preamble processing for HostComponent
@@ -92,6 +151,62 @@ module AtsNat64_Functions {
            
        } // End of function f_preamble_host
        
        /**
         * @desc Preamble processing for HostComponent using FTP
         * @see HostComponent
         */
        function f_preamble_host_ftp() runs on HostFTPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:ftpPort, system:ftpPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_host_ftp
        
        /**
         * @desc Preamble processing for HostComponent using SIP
         * @see HostComponent
         */
        function f_preamble_host_sip() runs on HostSIPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:sipPort, system:sipPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_host_sip
        
        /**
         * @desc Preamble processing for HostComponent using RTSP
         * @see HostComponent
         */
        function f_preamble_host_rtsp() runs on HostRTSPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:rtspPort, system:rtspPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_host_rtsp
        
        /**
         * @desc Preamble processing for HostComponent using PPTP
         * @see HostComponent
         */
        function f_preamble_host_pptp() runs on HostPPTPComponent system TestAdapter {
            // Connect synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Map ports
            map(self:pptpPort, system:pptpPort);
            map(self:utPort, system:utPort);
            
        } // End of function f_preamble_host_pptp
        
    } // End of group preambleFunctions
    
    group postambleFunctions {
@@ -103,7 +218,39 @@ module AtsNat64_Functions {
         */
        function f_postamble_lsn() runs on LSNComponent {
            // Nothing to do
        } // End of function f_postamble_aftr
        } // End of function f_postamble_lsn
        
        /**
         * @desc Postamble processing for LSNComponent using FTP
         * @see LSNComponent
         */
        function f_postamble_lsn_ftp() runs on LSNFTPComponent {
            // Nothing to do
        } // End of function f_postamble_lsn_ftp
        
        /**
         * @desc Postamble processing for LSNComponent using SIP
         * @see LSNComponent
         */
        function f_postamble_lsn_sip() runs on LSNSIPComponent {
            // Nothing to do
        } // End of function f_postamble_lsn_sip
        
        /**
         * @desc Postamble processing for LSNComponent using RTSP
         * @see LSNComponent
         */
        function f_postamble_lsn_rtsp() runs on LSNRTSPComponent {
            // Nothing to do
        } // End of function f_postamble_lsn_rtsp
        
        /**
         * @desc Postamble processing for LSNComponent using PPTP
         * @see LSNComponent
         */
        function f_postamble_lsn_pptp() runs on LSNPPTPComponent {
            // Nothing to do
        } // End of function f_postamble_lsn_pptp
        
        /**
         * @desc Postamble processing for HostComponent
@@ -114,6 +261,38 @@ module AtsNat64_Functions {
            // Nothing to do
        } // End of function f_postamble_host
        
        /**
         * @desc Postamble processing for HostComponent using FTP
         * @see HostComponent
         */
        function f_postamble_host_ftp() runs on HostFTPComponent {
            // Nothing to do
        } // End of function f_postamble_host_ftp
        
        /**
         * @desc Postamble processing for HostComponent using SIP
         * @see HostComponent
         */
        function f_postamble_host_sip() runs on HostSIPComponent {
            // Nothing to do
        } // End of function f_postamble_host_sip
        
        /**
         * @desc Postamble processing for HostComponent using RTSP
         * @see HostComponent
         */
        function f_postamble_host_rtsp() runs on HostRTSPComponent {
            // Nothing to do
        } // End of function f_postamble_host_rtsp
        
        /**
         * @desc Postamble processing for HostComponent using PPTP
         * @see HostComponent
         */
        function f_postamble_host_pptp() runs on HostPPTPComponent {
            // Nothing to do
        } // End of function f_postamble_host_pptp
        
    } // End of group postambleFunctions
    
    group commonfunctions {
@@ -121,7 +300,7 @@ module AtsNat64_Functions {
        function f_lsn_check_1_to_n_NAT_mapping(Ipv4Address p_localAddress, integer p_hostNum) runs on LSNComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            var IntList v_portList;
            var IntList v_portList := {};
            var Ipv4Packet v_ipv4Packet;
            var TcpPacket v_tcpPacket;
            var integer v_receivedNo := 0;
@@ -135,7 +314,11 @@ module AtsNat64_Functions {
                      ?
                  )
                ) -> value v_ipv4Packet {
                    tc_ac.stop;
                    if (e_success == f_decTcpPacket(v_ipv4Packet.ipv4Payload.rawPacket, v_tcpPacket)) {
                        if (lengthof(v_portList)==0) {
                            repeat;
                        }
                        if (match(v_portList, superset(v_tcpPacket.srcPort))) {
                            log("*** " & __SCOPE__ & ": IPv4 packet was forwarded with already used source port. ***");
                        }
@@ -151,7 +334,6 @@ module AtsNat64_Functions {
                    else {
                        v_result := e_error;
                    }
                    tc_ac.stop;
                    log("*** " & __SCOPE__ & ": IPv4 packets were correctly forwarded. ***");
                }
                [] tc_ac.timeout {
@@ -165,6 +347,198 @@ module AtsNat64_Functions {
        
    } // End of group commonFunctions
    
    group ftpFunctions {
        
        function f_ftpLogin(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress) runs on LSNFTPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            ftpPort.call (s_ftpLogin:{p_srcAddress, p_dstAddress}, PX_TAC) {
                [] ftpPort.getreply (s_ftpLogin:{-, -} value true) {
                    log("*** " & __SCOPE__ & ": FTP client successfully authenticated. ***");
                    v_result := e_success;
                }
                [] ftpPort.getreply {
                    log("*** " & __SCOPE__ & ": FTP client authentication was not successful. ***");
                    v_result := e_error;
                }
                [] ftpPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during FTP client authentication. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_ftpLogin
        
        function f_ftpSendData(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress, UInt16 p_dataPort, in UInt p_noOfDataRequests) runs on LSNFTPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            ftpPort.call (s_ftpSendData:{p_srcAddress, p_dstAddress, p_dataPort, p_noOfDataRequests}, PX_TAC) {
                [] ftpPort.getreply (s_ftpSendData:{-, -, -, -} value true) {
                    log("*** " & __SCOPE__ & ": Successfully sent FTP data. ***");
                    v_result := e_success;
                }
                [] ftpPort.getreply {
                    log("*** " & __SCOPE__ & ": Could not send FTP data. ***");
                    v_result := e_error;
                }
                [] ftpPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during sending of FTP data. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_ftpSendData
        
    } // End of group ftpFunctions
    
    group sipFunctions {
        
        function f_sipAuthenticate(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress) runs on LSNSIPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            sipPort.call (s_sipAuthenticate:{p_srcAddress, p_dstAddress}, PX_TAC) {
                [] sipPort.getreply (s_sipAuthenticate:{-, -} value true) {
                    log("*** " & __SCOPE__ & ": SIP client successfully authenticated. ***");
                    v_result := e_success;
                }
                [] sipPort.getreply {
                    log("*** " & __SCOPE__ & ": SIP client authentication was not successful. ***");
                    v_result := e_error;
                }
                [] sipPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during SIP client authentication. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_sipAuthenticate
        
        function f_sipSendPacket(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress, UInt16 p_dataPort, in UInt p_noOfDataRequests) runs on LSNSIPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            sipPort.call (s_sipSendPacket:{p_srcAddress, p_dstAddress, p_dataPort, p_noOfDataRequests}, PX_TAC) {
                [] sipPort.getreply (s_sipSendPacket:{-, -, -, -} value true) {
                    log("*** " & __SCOPE__ & ": Successfully sent SIP packets. ***");
                    v_result := e_success;
                }
                [] sipPort.getreply {
                    log("*** " & __SCOPE__ & ": Could not send SIP packets. ***");
                    v_result := e_error;
                }
                [] sipPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during sending of SIP packets. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_sipSendPacket
        
    } // End of group sipFunctions
    
    group rtspFunctions {
        
        function f_rtspSessionSetup(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress) runs on LSNRTSPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            rtspPort.call (s_rtspSessionSetup:{p_srcAddress, p_dstAddress}, PX_TAC) {
                [] rtspPort.getreply (s_rtspSessionSetup:{-, -} value true) {
                    log("*** " & __SCOPE__ & ": RTSP session successfully set-up. ***");
                    v_result := e_success;
                }
                [] rtspPort.getreply {
                    log("*** " & __SCOPE__ & ": RTSP session setup was not successful. ***");
                    v_result := e_error;
                }
                [] rtspPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during RTSP session setup. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_rtspSessionSetup
        
        function f_rtspSendPacket(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress, UInt16 p_dataPort, in UInt p_noOfDataRequests) runs on LSNRTSPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            rtspPort.call (s_rtspSendPacket:{p_srcAddress, p_dstAddress, p_dataPort, p_noOfDataRequests}, PX_TAC) {
                [] rtspPort.getreply (s_rtspSendPacket:{-, -, -, -} value true) {
                    log("*** " & __SCOPE__ & ": Successfully sent RTSP packets. ***");
                    v_result := e_success;
                }
                [] rtspPort.getreply {
                    log("*** " & __SCOPE__ & ": Could not send RTSP packets. ***");
                    v_result := e_error;
                }
                [] rtspPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during sending of RTSP packets. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_rtspSendPacket
        
    } // End of group rtspFunctions
    
    group pptpFunctions {
        
        function f_pptpSessionSetup(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress) runs on LSNPPTPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            pptpPort.call (s_pptpSessionSetup:{p_srcAddress, p_dstAddress}, PX_TAC) {
                [] pptpPort.getreply (s_pptpSessionSetup:{-, -} value true) {
                    log("*** " & __SCOPE__ & ": PPTP session successfully set-up. ***");
                    v_result := e_success;
                }
                [] pptpPort.getreply {
                    log("*** " & __SCOPE__ & ": PPTP session setup was not successful. ***");
                    v_result := e_error;
                }
                [] pptpPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during PPTP session setup. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_pptpSessionSetup
        
        function f_pptpSendPacket(Ipv6Address p_srcAddress, Ipv6Address p_dstAddress, UInt16 p_dataPort, in UInt p_noOfDataRequests) runs on LSNPPTPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            pptpPort.call (s_pptpSendPacket:{p_srcAddress, p_dstAddress, p_dataPort, p_noOfDataRequests}, PX_TAC) {
                [] pptpPort.getreply (s_pptpSendPacket:{-, -, -, -} value true) {
                    log("*** " & __SCOPE__ & ": Successfully sent PPTP packets. ***");
                    v_result := e_success;
                }
                [] pptpPort.getreply {
                    log("*** " & __SCOPE__ & ": Could not send PPTP packets. ***");
                    v_result := e_error;
                }
                [] pptpPort.catch (timeout) {
                    log("*** " & __SCOPE__ & ": Timeout during sending of PPTP packets. ***");
                    v_result := e_timeout
                }
            }
            
            return v_result;
        } // End of function f_pptpSendPacket
        
    } // End of group pptpFunctions
    
    group globalSteps {
        
        /**
+144 −12

File changed.

Preview size limit exceeded, changes collapsed.

+12 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
 */
module AtsNat64_Pixits {
    
    import from LibIpv6_CommonRfcs_TypesAndValues all;

    import from LibCommon_DataStrings all;

    // AtsCommon
@@ -89,4 +91,14 @@ module AtsNat64_Pixits {
    
    modulepar float PX_TCP_TIME_WAIT := 15.0;
    
    modulepar Ipv6Address PX_FTP_CLIENT_IPV6_ADDRESS := '20010db8000000000000000000000001'O;
    
    modulepar Ipv4Address PX_FTP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
    modulepar Ipv4Address PX_SIP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
    modulepar Ipv4Address PX_RTSP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
    modulepar Ipv4Address PX_PPTP_SERVER_IPV4_ADDRESS := '41d0e4df'O;
    
} // End of module AtsNat64_Pixits
 No newline at end of file
+654 −0

File changed.

Preview size limit exceeded, changes collapsed.

Loading