Commit a7788828 authored by garciay's avatar garciay
Browse files

Create temporary repository for LibMsrp.

parent c44aceee
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
/*
 *	@author 	STF 435
 *  @version    $Id:$
 *	@desc		This module provides the functions used by the test component 
 */
module LibMsrp_Functions {
} // End of LibMsrp_Functions
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
/*
 *	@author		STF	435
 *	@version		$Id:$
 *	@desc		This module	provides PIXIT parameters	which	need to	be 
 *				changeable within	validation
 */
module LibMsrp_PIXITS {
} // End of module LibMsrp_PIXITS
 No newline at end of file
+136 −0
Original line number Diff line number Diff line
/*
 *  @author   STF 435
 *  @version  $Id$
 *	@desc     This module defines MSRP Templates for message, header, and 
 *            structured types. <br>
 *            Note that any changes made to the definitions in this module
 *            may be overwritten by future releases of this library
 *            End users are encouraged to contact the distributers of this  
 *            module regarding their modifications or additions
 *  @remark   Any additions to the templates shall follow the design rules
 *            and always modify base templates only;
 *            Existing templates shall not be changed or removed -
 *            change requests shall be made to http://t-ort.etsi.org
 */
module LibMsrp_Templates {
    
    // LibMsrp
    import from LibMsrp_TypesAndValues {
        type 
            StatusCode, 
            RequestLine, ResponseLine, EndLine, 
            Headers, 
            ContentStuff, ContentType, MediaType, 
            SEND_request, RECEIVE_response
    };
    
    group constants {
        
        const StatusCode c_OKCode := 200;
        
        const charstring c_OKComment := "OK";
        
    } // End of group constants
    
    group delimiterLines {
        
        template RequestLine mw_RequestLine_SEND_any := {
            tagMsrp := e_MSRP, 
            transactionID := ?, 
            method := e_SEND
        } // End of template mw_RequestLine_SEND_any
        
        template ResponseLine mw_ResponseLine_any := {
            tagMsrp := e_MSRP, 
            transactionID := ?, 
            statusCode := ?, 
            comment := * 
        } // End of template mw_ResponseLine_any
        
        template ResponseLine mw_ResponseLine_success 
        modifies mw_ResponseLine_any := { 
            statusCode := c_OKCode, 
            comment := c_OKComment 
        } // End of template mw_ResponseLine_success
        
        template EndLine mw_EndLine_noMore := {
            transactionID := ?, 
            continuationFlag := false
        } // End of template mw_EndLine_noMore
        
    } // End of group delimiterLines
    
    /**
     * @see RFC 4975 - Clause 5.2. MSRP Addressing 
     */
    group msrpAddressing {
        
    } // End of group msrpAddressing
    
    group msrpHeaders {
        
        template Headers mw_Headers_any := {
            toPaths := ?, 
            fromPaths := ?, 
            headers := { ? } 
        } // End of type Headers
        
    } // End of group msrpHeaders
    
    group msrpContent {
        
        template MediaType mw_mediaType_any := {
            mediaType := ?,
            subType := ?,
            genParams := *
        } // End of template mw_mediaType_any
        
        template ContentType mw_contentType_any := {
            contentTypeID := e_CONTENT_TYPE,
            mediaType := mw_mediaType_any
        } // End of template mw_contentType_any
        
        template ContentStuff mw_contentStuff_any := {
            mimeHeaders := *,
            contentType := mw_contentType_any,
            data := ?
            
        } // End of template mw_contentStuff_any
        
    } // End of group msrpContent
    
    group msrpRequest {
        
        group msrpAUTH {
            
        } // End of group msrpSEND
    
        group msrpSEND {
            
            template SEND_request mw_msrpSEND_any := {
                startLine := mw_RequestLine_SEND_any,
                headers := mw_Headers_any,
                contentStuff := ?,
                endLine := mw_EndLine_noMore
            } // End of template mw_msrpSEND_any
            
        } // End of group msrpSEND
    
    } // End of group msrpRequest
    
    group msrpResponse {
        
        template RECEIVE_response mw_msrpResponse_any := {
            startLine := mw_ResponseLine_any,
            headers := ?,
            endLine := mw_EndLine_noMore
        } // End of template mw_msrpResponse_any
        
        template RECEIVE_response mw_msrpResponse_success 
        modifies mw_msrpResponse_any := {
            startLine := mw_ResponseLine_success
        } // End of template mw_msrpResponse_success
        
    } // End of group msrpResponse
    
} // End of LibMsrp_Templates
 No newline at end of file
+436 −0
Original line number Diff line number Diff line
/*
 *	@author 	STF 435
 *  @version    $Id:$
 *	@desc		This module provides the (message) types and constants used by the test component 
 *              for MSRP tests. 
 */
module LibMsrp_TypesAndValues {
    
    group msrpKeywords {
        
        /**
         * @desc Enumerate MSRP keywords
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type enumerated MsrpKeywords {
            e_MSRP, // pMSRP = %x4D.53.52.50 ; MSRP in caps
            e_SCHEME, // msrp-scheme = "msrp" / ...
            e_SCHEMES, //"msrps"
            e_SEND, // mSEND = %x53.45.4e.44 ; SEND in caps
            e_REPORT, // mREPORT = %x52.45.50.4f.52.54; REPORT in caps
            e_AUTH, //  mAUTH  = %x41.55.54.48 ; AUTH in caps
            e_TO_PATH, // "To-Path:"
            e_FROM_PATH, // "From-Path:"
            e_MESSAGEID, // "Message-ID:"
            e_BYTE_RANGE, // "Byte-Range:"
            e_STATUS, // "Status:"
            e_SUCCESS, // "Success-Report:"
            e_FAILURE, // "Failure-Report:"
            e_YES, // "yes"
            e_NO, // "no"
            e_PARTIAL, // "partial"
            e_CONTENT_TYPE // "Content-Type:"
        } // End of type MsrpKeywords
        
    } // End of group tokens
    
    group delimiterLines {
        
        /**
         * @desc Desciption of the start line
         * @see RFC 4975 - Clause 7.1. Constructing Requests
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record RequestLine {
            MsrpKeywords tagMsrp (e_MSRP), // MSRP keyword
            TransactionID transactionID, // The transaction identifier created by sender
            MsrpKeywords method // The method name
        } // End of type RequestLine
        
        /**
         * @desc Desciption of the Response line
         * @see RFC 4975 - Clause 7.1. Constructing Requests
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ResponseLine {
            MsrpKeywords tagMsrp (e_MSRP), // MSRP keyword
            TransactionID transactionID, // The transaction identifier created by sender
            StatusCode statusCode, // The status code, e.g. 200
            charstring comment optional // E.g. OK
        } // End of type ResponseLine
        
        /**
         * @desc Desciption of the end line
         * @see RFC 4975 - Clause 5.1. MSRP Framing and Message Chunking
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record EndLine { // "-------" transact-id continuation-flag CRLF
            TransactionID transactionID, // The transaction identifier created by sender
            boolean continuationFlag // true if message is TODO, false is message is chunked
        } // End of type RequestLine
        
    } // End of group delimiterLines
    
    group msrpHeaders {
        
        /**
         * @desc Description of a transaction ID structure
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type charstring TransactionID;
        
        /**
         * @desc Description of an identifier structure
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type charstring Ident length (3..31);
        
        /**
         * @desc Description of a Token structure
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type octetstring Token;
        
        /**
         * @desc Used to correlate status reports with the original message
         * @member messageID Message ID identifier
         * @member messageValue Value of the message-ID
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record MessageID {
            MsrpKeywords messageID (e_MESSAGEID),
            Ident messageValue
        } // End of type MessageID
        
        /**
         * @desc TODO
         * @member reportID Report status identifier
         * @member reportStatus Value of the report-status
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ReportStatus {
            MsrpKeywords reportID (e_REPORT),
            MsrpKeywords reportStatus
        } // End of type ReportStatus
        
        /**
         * @desc TODO
         * @member byteRangeID Report status identifier
         * @member startValue TODO
         * @member endValue TODO
         * @member totalValue TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ByteRange {
            MsrpKeywords byteRangeID (e_BYTE_RANGE),
            integer startValue,
            integer endValue,
            integer totalValue
        } // End of type ByteRange
        
        /**
         * @desc Description of a Namespace structure
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type integer Namespace;// length (3);
        
        /**
         * @desc Description of a Status structure, e.g. 200
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type integer StatusCode; // FIXME Use range instead? length (3);
        
        /**
         * @desc TODO
         * @member statusID TODO
         * @member namespace TODO
         * @member statusCode TODO
         * @member comment TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record Status {
            MsrpKeywords statusID (e_STATUS),
            Namespace namespace,
            StatusCode statusCode, 
            charstring comment optional
        } // End of type Status
        
        /**
         * @desc  TODO
         * @member hname TODO
         * @member hval TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ExtHeader {
            charstring hname,
            charstring hval
        } // End of type ExtHeader
        
        /**
         * @desc Description of Header structure
         * @member messageID
         * @member reportStatus
         * @member byteRange
         * @member status
         * @member extheader
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type union Header {
            MessageID messageID,
            ReportStatus reportStatus, // Success-Report or Failure-Report
            ByteRange byteRange,
            Status status,
            ExtHeader extheader
        } // End of type Header
        
        type set of Header HeaderList;// length (1..infinity);
        
        type record Headers {
            ToPaths toPaths,
            FromPaths fromPaths,
            HeaderList headers
        } // End of type Headers
        
    } // End of group msrpHeaders
    
    /**
     * @see RFC 4975 - Clause 5.2. MSRP Addressing 
     */
    group msrpAddressing {
        
        /**
         * @desc Description of URI-parameter item
         * @member paramID Identifier of the parameter
         * @member paramValue Value of the parameter
         */
        type record GenericParam { // URI-parameter = token ["=" token]
            Token paramID, 
            Token paramValue optional
        } // End of type GenericParam
        
        /**
         * @desc Description of URI-parameter list, separated by a semicolon
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type set of GenericParam URIParams;
        
        /**
         * @desc Authorized MSRP scheme
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type union MsrpSchemes {
            MsrpKeywords scheme (e_SCHEME),
            MsrpKeywords secureScheme (e_SCHEMES)
        } // End of type MsrpSchemes
        
        /**
         * @desc identifies a participant in a particular MSRP session
         * @see RFC 4975 - Clause 6. MSRP URIs
         * @see RFC 4975 - Clause 9. Formal Syntax
         * @see RFC 3986
         */
        type charstring Authority;
        
        /**
         * @desc Identifies a particular session of the participant
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type charstring SessionID;
        
        /**
         * @desc Desciption of a MSRP-URI 
         * @member toPath The path of URIs to the destination
         * @member fromPath The path of URIs of the sender
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record MsrpURI { // scheme://domain:port/path?query_string#fragment_id
            MsrpSchemes scheme,
            Authority authority,
            SessionID sessionID optional,
            charstring transport, // transport = "tcp" / 1*ALPHANUM
            URIParams uriParams // List of URI-parameter
        } // End of type Values
        
        type set of MsrpURI MsrpURIs;// length (1..infinity);
        
        /**
         * @desc The path of URIs to the destination
         * @member pathID The To-Path identifier
         * @member msrpURIs The URIs to the destination
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ToPath {
            MsrpKeywords pathID (e_TO_PATH),
            MsrpURIs msrpURIs
        } // End of type Path
        
        /**
         * @desc The path of URIs of the sender
         * @member pathID The To-Path identifier
         * @member msrpURIs The URIs of the sender
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type ToPath FromPath;
        
        type set of ToPath ToPaths;// length (1..infinity);
        
        type set of FromPath FromPaths;// length (1..infinity);
        
    } // End of group msrpAddressing
    
    group msrpContent {
        
        group msrpMimeTypes { // TODO To be refined
            
            /**
             * @see RFC 2045 
             */
            type charstring ContentID;
            
            /**
             * @see RFC 2045 
             */
            type charstring ContentDescription;
            
            /**
             * @see RFC 2183 
             */
            type charstring ContentDisposition;
            
            /**
             * @see RFC 2045 
             */
            type charstring MimeExtensionField;
            
        } // End of group msrpMimeTypes
        
        /**
         * @desc TODO
         * @member id TODO
         * @member description TODO
         * @member disposition TODO
         * @member extensionField TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type union OtherMimeHeader {
            ContentID id,
            ContentDescription description,
            ContentDisposition disposition,
            MimeExtensionField extensionField
        } // End of type OtherMimeHeader
        
        /**
         * @desc TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type set of OtherMimeHeader MimeHeaders;
        
        /**
         * @desc TODO
         * @member pname TODO
         * @member pval TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record GenParam {
            Token pname,
            octetstring pval optional // TODO To be refined
        } // End of type GenParam
        
        /**
         * @desc TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type set of GenParam GenParams;
        
        /**
         * @desc TODO
         * @member mediaType TODO
         * @member subType TODO
         * @member genParams TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record MediaType {
            Token mediaType,
            Token subType,
            GenParams genParams optional
        } // End of type MediaType
        
        /**
         * @desc TODO
         * @member contentTypeID
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ContentType {
            MsrpKeywords contentTypeID (e_CONTENT_TYPE),
            MediaType mediaType
        } // End of type ContentType
        
        /**
         * @desc TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type octetstring Data;
        
        /**
         * @desc TODO
         * @member TODO
         * @see RFC 4975 - Clause 9. Formal Syntax
         */
        type record ContentStuff {
            MimeHeaders mimeHeaders optional,
            ContentType contentType,
            Data data
            
        } // End of type ContentStuff
        
    } // End of group msrpContent
    
    group msrpAuth {
        
    } // End of group msrpAuth
    
    /**
     * Provides types for MSRP request
     * @see RFC 4975 - Clause 7.1. Constructing Requests
     * @see RFC 4976 - Relay Extensions for the Message Session Relay Protocol (MSRP)
     */
    group msrpRequests {
        
        /**
         * @desc 
         * @see RFC 4976 - Clause 5.1. Connecting to Relays Acting on Your Behalf
         */
        type record AUTH_request {
        } // End of type AUTH_request
        
        /**
         * @desc 
         * @see RFC 4975 - Clause 7.1.1. Sending SEND Requests
         */
        type record SEND_request {
            RequestLine startLine,
            Headers headers,
            ContentStuff contentStuff optional,
            EndLine endLine
        } // End of type SEND_request
        
    } // End of group msrpRequests
    
    group msrpResponses {
        
        /**
         * @desc 
         * @see RFC 4975 - Clause 7.1.2. Sending REPORT Requests
         */
        type record RECEIVE_response {
            ResponseLine startLine,
            Headers headers,
            EndLine endLine
        } // End of type RECEIVE_response
        
    } // End of group msrpResponses
    
} // End of LibMsrp_TypesAndValues
with { 
    encode "MSRPCodec"
}
 No newline at end of file