/* * @author STF 435 * @version $Id$ * @desc This module defines MSRP Templates for message, header, and * structured types.
* 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 all; /** * @desc Declaration of constants used by templates */ group constants { group codes { /** * @desc 200 status OK * @see RFC 4975 - Clause 10.1 */ const StatusCode c_OKCode := 200; /** * @desc 400 status Bad request * @see RFC 4975 - Clause 10.2 */ const StatusCode c_BadRequestCode := 400; /** * @desc 403 status Forbidden * @see RFC 4975 - Clause 10.3 */ const StatusCode c_ForbiddenCode := 403; /** * @desc 408 status Request Time-out * @see RFC 4975 - Clause 10.4 */ const StatusCode c_RequestTimeoutCode := 408; /** * @desc 413 status Request Entity Too Large * @see RFC 4975 - Clause 10.5 */ const StatusCode c_RequestEntityTooLargeCode := 413; /** * @desc 415 status Unsupported Media Type * @see RFC 4975 - Clause 10.6 */ const StatusCode c_UnsupportedMediaTypeCode := 415; /** * @desc 423 status Locked * @see RFC 4975 - Clause 10.7 */ const StatusCode c_LockedCode := 423; /** * @desc 481 status Call/Transaction Does Not Exist * @see RFC 4975 - Clause 10.8 */ const StatusCode c_CallTransactionDoesNotExistCode := 481; /** * @desc 501 status Not Implemented * @see RFC 4975 - Clause 10.9 */ const StatusCode c_NotImplementedCode := 501; /** * @desc 506 status Variant also negotiates * @see RFC 4975 - Clause 10.10 */ const StatusCode c_VariantNegotiatesCode := 506; } // End of group codes group comments { /** * @desc Comment for 200 status * @see RFC 4975 - Clause 10.1 */ const charstring c_OKComment := "OK"; /** * @desc Comment for 400 Bad request * @see RFC 4975 - Clause 10.2 */ const charstring c_BadRequestComment := "Bad request"; /** * @desc Comment for 403 Forbidden * @see RFC 4975 - Clause 10.3 */ const charstring c_ForbiddenComment := "Forbidden"; /** * @desc Comment for 408 Request Time-out * @see RFC 4975 - Clause 10.4 */ const charstring c_RequestTimeoutComment := "Request Time-out"; /** * @desc 413 status Request Entity Too Large * @see RFC 4975 - Clause 10.5 */ const charstring c_RequestEntityTooLargeComment := "Request Entity Too Large"; /** * @desc 415 status Unsupported Media Type * @see RFC 4975 - Clause 10.6 */ const charstring c_UnsupportedMediaTypeComment := "Unsupported Media Type"; /** * @desc 423 status Locked * @see RFC 4975 - Clause 10.7 */ const charstring c_LockedComment := "Locked"; /** * @desc 481 status Call/Transaction Does Not Exist * @see RFC 4975 - Clause 10.8 */ const charstring c_CallTransactionDoesNotExistComment := "Call/Transaction Does Not Exist"; /** * @desc 501 status Not Implemented * @see RFC 4975 - Clause 10.9 */ const charstring c_NotImplementedComment := "Not Implemented"; /** * @desc 506 status Variant also negotiates * @see RFC 4975 - Clause 10.10 */ const charstring c_VariantNegotiatesComment := "Variant also negotiates"; } // End of group comments } // End of group constants /** * @desc Start and End line descriptions */ group delimiterLines { /** * @desc Generic receive template for SEND start request line */ template MsrpRequestLine mw_RequestLine_SEND_any := { tagMsrp := e_MSRP, transactionID := ?, method := SEND_E } // End of template mw_RequestLine_SEND_any template MsrpRequestLine mw_RequestLine_REPORT_any := { tagMsrp := e_MSRP, transactionID := ?, method := REPORT_E } // End of template mw_RequestLine_SEND_any /** * @desc Generic receive template for RECEIVE start response line */ template MsrpResponseLine mw_ResponseLine_any := { tagMsrp := e_MSRP, transactionID := ?, statusCode := ?, comment := * } // End of template mw_ResponseLine_any template MsrpResponseLine mw_ResponseLine_success modifies mw_ResponseLine_any := { statusCode := c_OKCode, comment := c_OKComment } // End of template mw_ResponseLine_success /** * @desc Receive template for SEND/RECEIVE end line, assuming that message are small enought to prevent chunk */ template EndLine mw_EndLine_noMore := { transactionID := ?, continuationFlag := e_endMessage // No chunk } // End of template mw_EndLine_noMore } // End of group delimiterLines /** * @see RFC 4975 - Clause 5.2. MSRP Addressing */ group msrpAddressing { /** * @desc Dummy send template for MsrpURI used by ToPath * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
msrp://biloxi.example.com:12763/kjhd37s2s20w2a;tcp
*/ template (value) MsrpURI m_msrpURIs_ToPath_Dummy := { scheme := { scheme := e_SCHEME }, authority := { userinfo := omit, host := "biloxi.example.com", portNumber := 12763 }, sessionID := "kjhd37s2s20w2a", transport := "tcp", uriParams := omit } // End of template m_msrpURIs_ToPath_Dummy /** * @desc Dummy send template for MsrpURI used by FromPath * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
msrp://atlanta.example.com:7654/jshA7weztas;tcp
*/ template (value) MsrpURI m_msrpURIs_FromPath_Dummy := { scheme := { scheme := e_SCHEME }, authority := { userinfo := omit, host := "atlanta.example.com", portNumber := 7654 }, sessionID := "jshA7weztas", transport := "tcp", uriParams := omit } // End of template m_msrpURIs_FromPath_Dummy /** * @desc Dummy send template for ToPath * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
msrp://atlanta.example.com:7654/jshA7weztas;tcp
*/ template (value) ToPath m_msrpToPath_Dummy := { headerName := TO_PATH_E, msrpURIs := { m_msrpURIs_ToPath_Dummy } } // End of template m_msrpToPath_Dummy /** * @desc Dummy send template for FromPath * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
msrp://atlanta.example.com:7654/jshA7weztas;tcp
*/ template (value) FromPath m_msrpFromPath_Dummy := { headerName := FROM_PATH_E, msrpURIs := { m_msrpURIs_FromPath_Dummy } } // End of template m_msrpFromPath_Dummy template ToPath mw_toPath(in template (present) MsrpURI p_path) := { headerName := TO_PATH_E, msrpURIs := { p_path } } // End of template mw_toPath template FromPath mw_fromPath(in template (present) MsrpURI p_path) := { headerName := FROM_PATH_E, msrpURIs := { p_path } } // End of template mw_fromPath } // End of group msrpAddressing group msrpHeaders { /** * @desc Dummy send template for MessageID * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
Message-ID: 87652491
*/ template (value) MessageID m_msrpMessageID_Dummy := { headerName := MESSAGE_ID_E, messageId := "87652491" } // End of template m_msrpMessageID_Dummy /** * @desc Dummy send template for ByteRange * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
Byte-Range: 1-25/25
*/ template (value) ByteRange m_msrpByteRange_Dummy := { headerName := BYTE_RANGE_E, startValue := 1, endValue := { intValue := 25 }, totalValue := { intValue := 25 } } // End of template m_msrpByteRange_Dummy template Headers mw_Headers_any := { toPath := ?, fromPath := ?, headers := * } // End of template mw_Headers_any template Headers mw_Headers_toPath_FromPath( in template ToPath p_toPath, in template FromPath p_fromPath ) modifies mw_Headers_any := { toPath := p_toPath, fromPath := p_fromPath } // End of template mw_Headers_toPath_FromPath } // End of group msrpHeaders group msrpContent { /** * @desc Dummy send template for ContentStuff * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
         * Content-Type: text/plain
         * 
         * 
         * Hey Bob, are you there?
         * 
*/ template (value) ContentStuff m_msrpContentStuff_Dummy := { mimeHeaders := omit, contentType := { headerName := CONTENT_TYPE_E, mediaType := { mediaType := "text", subType := "plain", genParams := omit } // End of 'mediaType' field }, // End of 'contentType' field data := char2oct("Hey Bob, are you there?") } // End of template m_msrpByteRange_Dummy template MediaType mw_mediaType_any := { mediaType := ?, subType := ?, genParams := * } // End of template mw_mediaType_any template MsrpContentType mw_contentType_any := { headerName := CONTENT_TYPE_E, 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 template MsrpContentType mw_contentType( in charstring p_mediaType, in charstring p_subType ) modifies mw_contentType_any := { headerName := CONTENT_TYPE_E, mediaType := { mediaType := p_mediaType, subType := p_subType, genParams := * } // End of 'mediaType' field } // End of template mw_contentType } // End of group msrpContent /** * 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 msrpRequest { group msrpAUTH { } // End of group msrpSEND group msrpSEND { /** * @desc Dummy send template for SEND request * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
             *     MSRP a786hjs2 SEND
             *     To-Path: msrp://biloxi.example.com:12763/kjhd37s2s20w2a;tcp
             *     From-Path: msrp://atlanta.example.com:7654/jshA7weztas;tcp
             *     Message-ID: 87652491
             *     Byte-Range: 1-25/25
             *     Content-Type: text/plain
             *  
             *     Hey Bob, are you there?
             *     -------a786hjs2$
             *  
             *     MSRP a786hjs2 200 OK
             *     To-Path: msrp://atlanta.example.com:7654/jshA7weztas;tcp
             *     From-Path: msrp://biloxi.example.com:12763/kjhd37s2s20w2a;tcp
             *     -------a786hjs2$
             * 
*/ template (value) SEND_request m_msrpSend_Dummy := { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", method := SEND_E }, // End of 'startLine' field headers := { toPath := m_msrpToPath_Dummy, fromPath := m_msrpFromPath_Dummy, headers := { authenticationInfo := omit, authorization := omit, byteRange := m_msrpByteRange_Dummy, expires := omit, extHeaders := omit, failureReport := omit, maxExpires := omit, messageID := m_msrpMessageID_Dummy, minExpires := omit, status := omit, successReport := omit, usePath := omit, wwwAuthenticate := omit } }, // End of 'headers' field contentStuff := m_msrpContentStuff_Dummy, endLine := { transactionID := "a786hjs2", continuationFlag := e_endMessage } } // End of template m_msrpSend_Dummy /** * @desc Dummy send template for SEND request * @ see RFC 4975 - Figure 2: Example MSRP Exchange *
             *      MSRP a786hjs2 REPORT
             *      To-Path: msrp://alicepc.example.com:7777/iau39soe2843z;tcp
             *      From-Path: msrp://bob.example.com:8888/9di4eae923wzd;tcp
             *      Message-ID: 87652491
             *      Byte-Range: 1-25/25
             *      Status: 000 200 OK
             *      ——-a786hjs2$
             * 
*/ template (value) SEND_request m_msrpReport_Dummy modifies m_msrpSend_Dummy := { headers := { toPath := m_msrpToPath_Dummy, fromPath := m_msrpFromPath_Dummy, headers := { messageID := m_msrpMessageID_Dummy, byteRange := m_msrpByteRange_Dummy } } // End of 'headers' field } // End of template m_msrpSend_Dummy /** * @desc Generic receive template for SEND request */ template SEND_request mw_msrpSEND_any := { startLine := mw_RequestLine_SEND_any, headers := mw_Headers_any, contentStuff := mw_contentStuff_any, endLine := mw_EndLine_noMore } // End of template mw_msrpSEND_any template SEND_request mw_msrpSEND_toPath_fromPath_contentType( in template (present) ToPath p_toPath, in template (present) FromPath p_fromPath, in template (present) MsrpContentType p_contentType ) modifies mw_msrpSEND_any := { headers := mw_Headers_toPath_FromPath( p_toPath, p_fromPath), contentStuff := { contentType := p_contentType } } // End of template mw_msrpSEND_toPath_fromPath_contentType template SEND_request mw_msrpREPORT_success modifies mw_msrpSEND_any := { startLine := mw_RequestLine_REPORT_any, headers := { headers := { messageID := *, successReport := *, failureReport := *, byteRange := *, status := { headerName := STATUS_E, namespace := 0, statusCode := c_OKCode, comment := c_OKComment }, // End of 'status' field expires := *, minExpires := *, maxExpires := *, usePath := *, wwwAuthenticate := *, authorization := *, authenticationInfo := *, extHeaders := * } } // End of 'headers' field } // End of template mw_msrpREPORT_success } // End of group msrpSEND } // End of group msrpRequest group msrpResponse { /** * @desc Dummy send template for RECEIVE response * @ see RFC 4975 - Figure 2: Example MSRP Exchange */ template (value) RECEIVE_response m_msrpResponse_Dummy := { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", statusCode := c_OKCode, comment := c_OKComment }, // End of 'startLine' field headers := { toPath := m_msrpToPath_Dummy, fromPath := m_msrpFromPath_Dummy, headers := { authenticationInfo := omit, authorization := omit, byteRange := omit, expires := omit, extHeaders := omit, failureReport := omit, maxExpires := omit, messageID := m_msrpMessageID_Dummy, minExpires := omit, status := omit, successReport := omit, usePath := omit, wwwAuthenticate := omit } }, // End of 'headers' field endLine := { transactionID := "a786hjs2", continuationFlag := e_endMessage } } // End of template m_msrpResponse_Dummy template RECEIVE_response mw_msrpResponse_any := { startLine := mw_ResponseLine_any, headers := mw_Headers_any, 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 template RECEIVE_response mw_msrpResponse_toPath_fromPath( in template (present) ToPath p_toPath, in template (present) FromPath p_fromPath ) modifies mw_msrpResponse_success := { headers := { toPath := p_toPath, fromPath := p_fromPath } // End of 'headers' field } // End of template mw_msrpResponse_toPath_fromPath template RECEIVE_response mw_msrpResponse_toPath_fromPath_with_transferReports( // TODO Check if it it really used in template (present) ToPath p_toPath, in template (present) FromPath p_fromPath ) modifies mw_msrpResponse_toPath_fromPath := { headers := { headers := { authenticationInfo := *, authorization := *, byteRange := *, expires := *, extHeaders := *, maxExpires := *, messageID := *, minExpires := *, status := *, successReport := { headerName := SUCCESS_REPORT_E, reportStatus := e_YES }, failureReport := { headerName := FAILURE_REPORT_E, reportStatus := e_NO }, usePath := *, wwwAuthenticate := * } // End of 'header' field } // End of 'headers' field } // // End of template mw_msrpResponse_toPath_fromPath_with_transferReports } // End of group msrpResponse } // End of LibMsrp_Templates