Commit 25ef9194 authored by garciay's avatar garciay
Browse files

Create f_cf01Up_Aftr function

Multiple bug fixed (repeat missing, wrong parameters...)
parent 4af08c1f
Loading
Loading
Loading
Loading
+38 −4
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ module AtsDSLite_Functions {
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    
    // AtsCommon
//    import from AtsCommon_Interfaces all;
    import from AtsCommon_Interfaces {
        type DNSComponent, InterCompDataMsg
    }
    import from AtsCommon_TypesAndValues all;
    import from AtsCommon_Interfaces all;
    import from AtsCommon_Functions all;
@@ -71,11 +75,41 @@ module AtsDSLite_Functions {
            activate(a_default_MTC());
        } // End of function f_cf01Up_B4
        
        /**
         * @desc Setup communication port for simulation purposes
         * @verdict Unchanged
         */
        function f_cf01Up_Aftr() runs on DSLiteComponent {
            var integer v_hosts;
            var integer v_host;
            
            // Connect port
            if (vc_aftrComponent != null) { 
                connect(vc_aftrComponent:aftrPort, self:aftrPort);
            }
            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 synchronisation ports
            f_connect4SelfOrClientSync();
            
            // Default activation
            activate(a_default_MTC());
        } // End of function f_cf01Up_Aftr
        
        /**
         * @desc Setup communication port for sniffing purpose
         * @verdict Unchanged
         */
        function f_cf02Up_B4() runs on DSLiteComponent {
        function f_cf02Up_Aftr() runs on DSLiteComponent {
            var integer v_hosts;
            var integer v_host;
            
@@ -347,12 +381,12 @@ module AtsDSLite_Functions {
         * @param p_noOfDataRequests    The nimber of HTTP request to be sent
         * @return e_success on success, e_timeout on call timeout, e_error otherwise
         */
        function f_httpSendData(in Ipv4Address p_srcAddress, in Ipv4Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPComponent
        function f_httpSendDataV4(in Ipv4Address p_srcAddress, in Ipv4Address p_httpServerAddress, in UInt p_noOfDataRequests) runs on HostHTTPComponent
        return FncRetCode {
            var FncRetCode v_result := e_success;
            
            httpPort.call (s_httpSendData:{p_srcAddress, p_httpServerAddress, p_noOfDataRequests}, PX_TAC) {
                [] httpPort.getreply (s_httpSendData:{-, -, -} value true) {
            httpPort.call (s_httpSendDataV4:{p_srcAddress, p_httpServerAddress, p_noOfDataRequests, false}, PX_TAC) {
                [] httpPort.getreply (s_httpSendDataV4:{-, -, -, -} value true) {
                    log("*** " & __SCOPE__ & ": Successfully sent HTTP data. ***");
                    v_result := e_success;
                }
+17 −4
Original line number Diff line number Diff line
@@ -6,11 +6,20 @@
module AtsDSLite_Interfaces {
    
    // LibCommon
    import from LibCommon_DataStrings {const c_16ZeroBytes;}
    import from LibCommon_Sync {type SelfSyncComp;}
    import from LibCommon_Time {modulepar PX_TAC, PX_TNOAC, PX_TWAIT;}
    import from LibCommon_DataStrings all;
    import from LibCommon_Sync all;
    import from LibCommon_Time all;
    
    // LibIPv6
    import from LibIpv6_CommonRfcs_TypesAndValues all;
    import from LibIpv6_Interface_TypesAndValues {
        type 
            LibIpv6Node,
            Ipv4Packet,
            Ipv4Port, Ipv6Port 
    };
    import from LibIpv6_CommonRfcsDhcp_TypesAndValues all;
    import from LibIpv6_Rfc6334Dhcp_TypesAndValues all;
    import from LibIpv6_CommonRfcs_TypesAndValues {type Ipv6Address;}
    import from LibIpv6_Interface_TypesAndValues {type LibIpv6Node;}
    import from LibIpv6_CommonRfcsDhcp_TypesAndValues {type DHCPv6Msg, DomainName, DomainNameList;}
@@ -18,7 +27,11 @@ module AtsDSLite_Interfaces {
    
    // AtsCommon
    import from AtsCommon_DNS_CommonRfcs_TypesAndValues {type DnsMsg;}
    import from AtsCommon_Interfaces all;
    import from AtsCommon_Interfaces {
        type 
            DHCPv6Port, DNSPort, HttpPort, FtpPort, InterCompDataPort,
            DHCPv6Component, DNSComponent, UtComponent
    };
    import from AtsCommon_TypesAndValues all;
    
    // AtsDSLite
+1 −6
Original line number Diff line number Diff line
@@ -105,14 +105,9 @@ module AtsDSLite_Pixits {
        // TODO Could be extended 
    } // End of modulepar PX_HOST_V4_LIST_FTP

    
    modulepar integer PX_DS_MTU := 1500;
    
    modulepar Ipv4Address PX_FTP_SERVER_IPv4 := '00000000'O;
    
    modulepar charstring PX_FTP_USER := "ftpuser";
    
    modulepar charstring PX_FTP_PASSWORD := "ftppassword";
    
    modulepar charstring PX_FTP_FILENAME := "filename.toget";
    
} // End of module AtsDSLite_Pixits
 No newline at end of file
+14 −17
Original line number Diff line number Diff line
@@ -323,6 +323,7 @@ module AtsDSLite_TestCases {
                            [v_dataReceived == false] dataPort.receive(InterCompDataMsg:?) -> value v_data { 
                                v_dataReceived := true;
                                log("*** " & __SCOPE__ & ": INFO: Receive DHCPv6 Reply data. ***");
                                repeat;
                            }
                            [] dnsPort.receive(DnsMsg:?) { 
                                // Do not re-start timer
@@ -1167,7 +1168,7 @@ module AtsDSLite_TestCases {
                    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();
                    f_cf01Up_Aftr();
                    
                    // Test adapter configuration
                    
@@ -1368,7 +1369,7 @@ module AtsDSLite_TestCases {
                    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();
                    f_cf01Up_Aftr();
                    
                    // Test adapter configuration
                    
@@ -1562,10 +1563,7 @@ module AtsDSLite_TestCases {
                testcase TC_DSLITE_AFTR_ALG_BV_001() runs on DSLiteComponent system TestAdapter {
                    
                    // Local variables
                    var integer v_hostNum := lengthof(PX_HOST_V4_LIST_FTP);     /** Expected number of IPv6 packets to be forwarded */
                    var Ipv4Packet v_ipv4Packet;                                /** IPv4 packets */
                    var Ipv6Packet v_ipv6Packet;                                /** IPv6 packets address to IPv4 */
                    var integer v_host;                                         /** 'for' statement counter */
                    var UInt v_noOfDataRequests := 3;
                    
                    // Test control
                    if (not(PICS_ROLE_IS_AFTR)) {
@@ -1576,20 +1574,19 @@ module AtsDSLite_TestCases {
                    // Test component configuration
                   // vc_dhcpv6Component := DHCPv6Component.create(c_COMP_DHCP);
                    vc_aftrComponent := AFTRComponent.create(c_COMP_AFTR);
                    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));
                        vc_hostFtpComponents[v_host] := HostFTPComponent.create(c_COMP_FTP & int2str(v_host));
                    } // End of 'for' statement 
                    f_cf02Up_B4();
                    vc_hostFtpComponents[0] := HostFTPComponent.create(c_COMP_FTP);
                    f_cf02Up_Aftr();
                    
                    // Test adapter configuration
                    
                    // Start all components
                    vc_aftrComponent.start(f_TC_DSLITE_AFTR_ALG_BV_001_aftr(v_hostNum));
                    for (v_host := 0; v_host < v_hostNum; v_host := v_host + 1) {
                        vc_hostComponents[v_host].start(f_TC_DSLITE_AFTR_ALG_BV_001_host(v_host));
                        vc_hostFtpComponents[v_host].start(f_TC_DSLITE_AFTR_ALG_BV_001_ftp(v_host));
                    } // End of 'for' statement 
                    vc_aftrComponent.start(f_TC_DSLITE_AFTR_ALG_BV_001_aftr(v_noOfDataRequests));
                    vc_hostFtpComponents[0].start(
                        f_TC_DSLITE_AFTR_ALG_BV_001_ftp(
                        PX_HOST_V4_LIST_FTP[0].srcAddress, 
                        PX_HOST_V4_LIST_FTP[0].dstAddress, 
                        v_noOfDataRequests
                    ));
                    
                    // Test Body
                    // Clause 'when': 
@@ -1597,7 +1594,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(2, { c_prDone, c_tbDone, c_poDone });
                    
                    // Postamble
                    f_down();