Commit 44781a2e authored by garciay's avatar garciay
Browse files

Start FSAP changes

parent b48377ec
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@ module LibItsFntp_Templates {
        type Oct1 
    };
    
    // LibIts 

	// LibItsCalm 
    import from CALMllsap language "ASN.1:1997" {
        type 
+38 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ module LibItsFsap_Functions {
    };
    import from CALMfsap language "ASN.1:1997" {
        type
            GCsam, 
			GCschedule, ServiceDataReg, ServiceList 
    };
    import from CALMmsap language "ASN.1:1997" {
@@ -65,6 +66,7 @@ module LibItsFsap_Functions {
            // Map
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:cfPort, system:cfPort);
// TODO To be removed            map(self:mgtMfSapPort, system:mgtMfSapPort);
            
            // Connect
@@ -100,8 +102,9 @@ module LibItsFsap_Functions {
            // Map
            map(self:acPort, system:acPort);
            map(self:utPort, system:utPort);
            map(self:cfPort, system:cfPort);
// TODO To be removed            map(self:mgtMfSapPort, system:mgtMfSapPort);
            map(self:iicpPort, system:iicpPort);
//            map(self:iicpPort, system:iicpPort);
            
            // Connect
            f_connect4SelfOrClientSync();
@@ -127,6 +130,7 @@ module LibItsFsap_Functions {
            // Unmap
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            unmap(self:cfPort, system:cfPort);
// TODO To be removed            unmap(self:mgtMfSapPort, system:mgtMfSapPort);
            
            // Disconnect
@@ -144,8 +148,9 @@ module LibItsFsap_Functions {
            // Unmap
            unmap(self:acPort, system:acPort);
            unmap(self:utPort, system:utPort);
            unmap(self:cfPort, system:cfPort);
// TODO To be removed            unmap(self:mgtMfSapPort, system:mgtMfSapPort);
            unmap(self:iicpPort, system:iicpPort);
//            unmap(self:iicpPort, system:iicpPort);
            
            // Disconnect
            f_disconnect4SelfOrClientSync();
@@ -223,6 +228,36 @@ module LibItsFsap_Functions {
        
    } // End of group testerFunctions
    
    group internalFunctions { // TODO Use parametrized function (ETSI ES 202 784) insetad of the three oct2xxx functions
        
        /**
         * @desc  This function convert the specified octetstring into a template (GCsam)
         * This SHALL be done due to the ASN.1 description of IN-SAP service primitives DL_Unitdata_request/DL_Unitdata_indication
         * @param p_data        An octetstring to decode
         * @param p_syncPoint   Current synchronisation point, required to set verdict according to the LibCommon rules
         * @param p_decoded     The decoded message
         * @verdict Unchanged on success, set to fail otherwise
         * @see ISO/CD 21218 - Clause 8.2.2
         */
        function f_oct2gcSam(in octetstring p_data, in charstring p_syncPoint, out GCsam p_decoded) runs on ItsMgt {
            var bitstring v_data;
            var integer v_result;
            
//            log("*** f_oct2gcSam: INFO: pdu: " & oct2str(p_data) & " ***");
            v_data := oct2bit(p_data);
            v_result := decvalue(v_data, p_decoded);
            if (v_result == 1) {
                log("*** f_oct2gcSam: FAIL: 'decvalue' operation failed ***");
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
            } else if (v_result == 2) {
                log("*** f_oct2gcSam: FAIL: 'decvalue' operation failed, not enougth bits ***");
                f_selfOrClientSyncAndVerdictTestBody(p_syncPoint, e_error); 
            }
            log("*** f_oct2gcSam: INFO: Decoded message done ***");
        } // End of function f_oct2gcSam
        
    } // End of group internalFunctions
    
    group iutFunctions {
        
        /**
+23 −0
Original line number Diff line number Diff line
@@ -32,6 +32,29 @@ module LibItsFsap_Pixits {
            c_portNon 
    };
    
    /**
     * @desc    Source and destination Ports
     * @see     ISO/WD 29281-2 Clause 6.2.2.2
     */
    group portNumbers {
        
        /**
         * @desc Indicate the application port number, used instead of c_portDyn
         */
        modulepar PortNumber PX_APP_PORT_NUMBER := { portLong := 12345 } ;
        
        /**
         * @desc Indicate the source port number, i.e. the local endpoint
         */
        modulepar PortNumber PX_LOCAL_PORT_NUMBER := { portLong := 5555 } ;
        
        /**
         * @desc Indicate the destination port number, i.e. the peer ITS-SP
         */
        modulepar PortNumber PX_REMOTE_PORT_NUMBER := { portLong := 5556 } ;
        
    } // End of group portNumbers
    
    /**
     * @desc Local settings
     */
+58 −8
Original line number Diff line number Diff line
@@ -5,8 +5,11 @@
 *  @desc       Templates definitions for Fast service advertisement protocol (ISO 24102-5)
 */
module LibItsFsap_Templates {
    // LibCommon 
    
    // LibIts 
    
    // LibItsCalm 
    import from CALMmanagement language "ASN.1:1997" {
        type 
            ApplicationID, 
@@ -28,11 +31,13 @@ module LibItsFsap_Templates {
        type 
            LLserviceAddr, Link_ID, 
            UserPriority, 
            INsapPrimitivesUp, INsapPrimitivesDown 
            INsapPrimitivesUp, INsapPrimitivesDown, 
            IN_UNITDATA_request, IN_UNITDATA_indication
    }; 
    import from CALMfntp language "ASN.1:1997" {
        type 
            PortNumber, 
            ITSfpdu, 
            NFsapPrimitivesUp, NFsapPrimitivesDown 
    };
    import from CALMfsap language "ASN.1:1997" {
@@ -51,7 +56,7 @@ module LibItsFsap_Templates {
    import from LibItsFsap_Pixits {
        modulepar 
            PX_FMTID_CTX, PX_VERSION_FSAP, PX_FMTID_SAM, 
            PX_USER_PRIORITY
            PX_USER_PRIORITY, PX_REMOTE_PORT_NUMBER  
    };
    import from LibItsCalm_Pixits { 
        modulepar 
@@ -129,6 +134,44 @@ module LibItsFsap_Templates {
            
        } // End of group inSapPrimitives 
        
        /**
         * @desc    Primitive on IN-SAP interface
         * @see     ISO/CD 21218 - Clause 8.3
         * @see     ISO/CD 29281-2 - Clause 7.1.2
         */
        group nfSapPrimitives {
            
            group recvOperation {
                
                /**
                 * @desc    Receive template for a SAP primitive message on IN-SAP interface
                 * @param   p_inUnitdataRq  The IN-DATA.request SAP primitive message
                 * @see     ISO/CD 21218 - Clause 8.3.1
                 * @see     ISO/CD 29281-2 - Clause 7.1.2
                 */
                template (present) NFsapPrimitivesDown mw_fsapNfSapPrimitiveReq(
                    in template (present) PortNumber p_servicePort,
                    in template (present) Link_ID p_linkId,
                    in template (present) ITSfpdu p_data 
                ) := {
                    spRef := 1,
                    servPrimitive := { 
                        NFfntpCommRequest := { 
                            commRef := ?, 
                            servicePort := p_servicePort, 
                            remotePort := PX_REMOTE_PORT_NUMBER, 
                            linkID := p_linkId, 
                            data := p_data, 
                            priority := PX_USER_PRIORITY, 
                            controlField := ? 
                        } // End of field 'NFfntpCommRequest'
                    } // End of field 'servPrimitive'
                } // End of template mw_fsapNfSapPrimitiveReq
                
            } // End of group recvOperation 
            
        } // End of group nfSapPrimitives 
        
        /**
         * @desc Templates used to 
         * <li>trigger message on Upper Tester</li>
@@ -196,6 +239,13 @@ module LibItsFsap_Templates {
                    servPrimitive := { GCregServer := p_gcRegServer } 
                } // End of template m_generateGcRegServerReq
                
                template FAsapPrimitivesDown mw_faSapPrimitivesDown_gcRegServer( 
                    in template (present) GCregServer p_gcRegServer 
                ) := { 
                    spRef := 3, 
                    servPrimitive := { GCregServer := p_gcRegServer } 
                } // End of template mw_faSapPrimitivesDown_gcRegServer
                
                /**
                 * @desc    Send a GCregServer registration request for an ITS-S application
                 * @param   p_applicationId   The Application ID
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ module LibItsCalm_Interface {
                 */
                type port FsapPort message {
                    in 
                        FntpInd; 
                        FsapInd; 
                    out
                        FsapReq; 
                } // End of port FsapPort