Loading ttcn/LibMsrp/LibMsrp_Templates.ttcn3 +38 −44 Original line number Diff line number Diff line Loading @@ -163,13 +163,13 @@ module LibMsrp_Templates { template RequestLine mw_RequestLine_SEND_any := { tagMsrp := e_MSRP, transactionID := ?, method := e_SEND method := SEND_E } // End of template mw_RequestLine_SEND_any template RequestLine mw_RequestLine_REPORT_any := { tagMsrp := e_MSRP, transactionID := ?, method := e_REPORT method := REPORT_E } // End of template mw_RequestLine_SEND_any /** Loading @@ -193,7 +193,7 @@ module LibMsrp_Templates { */ template EndLine mw_EndLine_noMore := { transactionID := ?, continuationFlag := false // No chunk continuationFlag := e_endMessage // No chunk } // End of template mw_EndLine_noMore } // End of group delimiterLines Loading Loading @@ -239,7 +239,7 @@ module LibMsrp_Templates { * <pre>msrp://atlanta.example.com:7654/jshA7weztas;tcp</pre> */ template (value) ToPath m_msrpToPath_Dummy := { pathID := e_TO_PATH, headerName := TO_PATH_E, msrpURIs := { m_msrpURIs_ToPath_Dummy } Loading @@ -251,21 +251,21 @@ module LibMsrp_Templates { * <pre>msrp://atlanta.example.com:7654/jshA7weztas;tcp</pre> */ template (value) FromPath m_msrpFromPath_Dummy := { pathID := e_FROM_PATH, 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) := { pathID := e_TO_PATH, headerName := TO_PATH_E, msrpURIs := { p_path } } // End of template mw_toPath template FromPath mw_fromPath(in template (present) MsrpURI p_path) := { pathID := e_FROM_PATH, headerName := FROM_PATH_E, msrpURIs := { p_path } Loading @@ -281,8 +281,8 @@ module LibMsrp_Templates { * <pre>Message-ID: 87652491</pre> */ template (value) MessageID m_msrpMessageID_Dummy := { messageID := e_MESSAGEID, messageValue := "87652491" headerName := MESSAGE_ID_E, messageId := "87652491" } // End of template m_msrpMessageID_Dummy Loading @@ -292,7 +292,7 @@ module LibMsrp_Templates { * <pre>Byte-Range: 1-25/25</pre> */ template (value) ByteRange m_msrpByteRange_Dummy := { byteRangeID := e_BYTE_RANGE, headerName := BYTE_RANGE_E, startValue := 1, endValue := 25, totalValue := 25 Loading @@ -301,7 +301,7 @@ module LibMsrp_Templates { template Headers mw_Headers_any := { toPaths := ?, fromPaths := ?, headers := { ? } headers := ? } // End of template mw_Headers_any template Headers mw_Headers_toPath_FromPath( Loading Loading @@ -333,7 +333,7 @@ module LibMsrp_Templates { template (value) ContentStuff m_msrpContentStuff_Dummy := { mimeHeaders := omit, contentType := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := { mediaType := char2oct("text"), subType := char2oct("plain"), Loading @@ -350,7 +350,7 @@ module LibMsrp_Templates { } // End of template mw_mediaType_any template ContentType mw_contentType_any := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := mw_mediaType_any } // End of template mw_contentType_any Loading @@ -365,7 +365,7 @@ module LibMsrp_Templates { in charstring p_mediaType, in charstring p_subType ) modifies mw_contentType_any := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := { mediaType := char2oct(p_mediaType), subType := char2oct(p_subType), Loading Loading @@ -412,7 +412,7 @@ module LibMsrp_Templates { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", method := e_SEND method := SEND_E }, // End of 'startLine' field headers := { toPaths := { Loading @@ -422,14 +422,14 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy }, { byteRange := m_msrpByteRange_Dummy } messageID := m_msrpMessageID_Dummy, byteRange := m_msrpByteRange_Dummy } }, // End of 'headers' field contentStuff := m_msrpContentStuff_Dummy, endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpSend_Dummy Loading @@ -450,7 +450,7 @@ module LibMsrp_Templates { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", method := e_REPORT method := REPORT_E }, // End of 'startLine' field headers := { toPaths := { Loading @@ -460,14 +460,14 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy }, { byteRange := m_msrpByteRange_Dummy } messageID := m_msrpMessageID_Dummy, byteRange := m_msrpByteRange_Dummy } }, // End of 'headers' field contentStuff := m_msrpContentStuff_Dummy, endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpSend_Dummy Loading Loading @@ -498,15 +498,13 @@ module LibMsrp_Templates { startLine := mw_RequestLine_REPORT_any, headers := { headers := { { status := { statusID := e_STATUS, headerName := STATUS_E, namespace := 0, statusCode := c_OKCode, comment := c_OKComment } // End of 'status' field } } } // End of 'headers' field } // End of template mw_msrpREPORT_success Loading Loading @@ -535,12 +533,12 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy } messageID := m_msrpMessageID_Dummy } }, // End of 'headers' field endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpResponse_Dummy Loading Loading @@ -575,18 +573,14 @@ module LibMsrp_Templates { ) modifies mw_msrpResponse_toPath_fromPath := { headers := { headers := { { reportStatus := { reportID := e_SUCCESS, successReport := { headerName := SUCCESS_REPORT_E, reportStatus := e_YES } }, // End of 'item#1' of the list { reportStatus := { reportID := e_FAILURE, }, failureReport := { headerName := FAILURE_REPORT_E, reportStatus := e_NO } } // End of 'item#2' of the list } // End of 'header' field } // End of 'headers' field } // // End of template mw_msrpResponse_toPath_fromPath_with_transferReports Loading ttcn/LibMsrp/LibMsrp_TypesAndValues.ttcn3 +194 −106 Original line number Diff line number Diff line Loading @@ -16,22 +16,41 @@ module LibMsrp_TypesAndValues { 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:" e_PARTIAL // "partial" } // End of type MsrpKeywords type enumerated Method { //RFC 4975 SEND_E, // mSEND = %x53.45.4e.44 ; SEND in caps REPORT_E, // mREPORT = %x52.45.50.4f.52.54; REPORT in caps //RFC 4976 AUTH_E, // mAUTH = %x41.55.54.48 ; AUTH in caps UNKNOWN_METHOD_E } type enumerated HeaderName { //RFC 4975 TO_PATH_E, // "To-Path" FROM_PATH_E, // "From-Path" MESSAGE_ID_E, // "Message-ID" SUCCESS_REPORT_E, //"Success-Report" FAILURE_REPORT_E, //"Failure-Report" BYTE_RANGE_E, // "Byte-Range" STATUS_E, // "Status" CONTENT_TYPE_E, // "Content-Type" //RFC 4976 EXPIRES_E, //"Expires" MIN_EXPIRES_E, // "Min-Expires" MAX_EXPIRES_E, // "Max-Expires" USE_PATH_E, // "Use-Path" WWW_AUTHENTICATE_E, // "WWW-Authenticate" AUTHORIZATION_E, // "Authorization" AUTHENTICATION_INFO_E, // "Authentication-Info" EXT_HEADER_E //any other header } } // End of group tokens /** Loading @@ -39,6 +58,12 @@ module LibMsrp_TypesAndValues { */ group delimiterLines { type enumerated ContinuationFlag { e_endMessage, // "$" e_continueMessage, // "+" e_cancelMessage // "#" } /** * @desc Desciption of the start line * @see RFC 4975 - Clause 7.1. Constructing Requests Loading @@ -47,7 +72,7 @@ module LibMsrp_TypesAndValues { type record RequestLine { MsrpKeywords tagMsrp (e_MSRP), // MSRP keyword TransactionID transactionID, // The transaction identifier created by sender MsrpKeywords method // The method name Method method // The method name } // End of type RequestLine /** Loading @@ -69,52 +94,34 @@ module LibMsrp_TypesAndValues { */ 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 ContinuationFlag continuationFlag // "+"/"$"/"#" } // 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; group RFC4975HeaderTypes { /** * @desc Used to correlate status reports with the original message * @member messageID Message ID identifier * @member messageValue Value of the message-ID * @member headerName Message-ID identifier * @member messageId Value of the Message-ID * @see RFC 4975 - Clause 9. Formal Syntax */ type record MessageID { MsrpKeywords messageID (e_MESSAGEID), Ident messageValue HeaderName headerName (MESSAGE_ID_E), Ident messageId } // 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, type record SuccessReport { HeaderName headerName (SUCCESS_REPORT_E), MsrpKeywords reportStatus } // End of type ReportStatus } type record FailureReport { HeaderName headerName (FAILURE_REPORT_E), MsrpKeywords reportStatus } /** * @desc TODO Loading @@ -125,24 +132,12 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ByteRange { MsrpKeywords byteRangeID (e_BYTE_RANGE), integer startValue, integer endValue, integer totalValue HeaderName headerName (BYTE_RANGE_E), integer startValue, // [1..infinity) integer endValue, // [0..infinity) TODO can take also wilcard value: "*" integer totalValue // [0..infinity) TODO can take also wilcard value: "*" } // 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 Loading @@ -152,11 +147,43 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record Status { MsrpKeywords statusID (e_STATUS), HeaderName headerName (STATUS_E), Namespace namespace, StatusCode statusCode, charstring comment optional } // End of type Status } group RFC4976HeaderTypes { type record Expires { HeaderName headerName (STATUS_E) } type record MinExpires { HeaderName headerName (MIN_EXPIRES_E) } type record MaxExpires { HeaderName headerName (MAX_EXPIRES_E) } type record UsePath { HeaderName headerName (USE_PATH_E) } type record WWWAuthenticate { HeaderName headerName (WWW_AUTHENTICATE_E) } type record Authorization { HeaderName headerName (AUTHORIZATION_E) } type record AuthenticationInfo { HeaderName headerName (AUTHENTICATION_INFO_E) } } /** * @desc TODO Loading @@ -178,22 +205,67 @@ module LibMsrp_TypesAndValues { * @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 type record HeaderList { //RFC 4975 MessageID messageID optional, SuccessReport successReport optional, FailureReport failureReport optional, ByteRange byteRange optional, Status status optional, //RFC 4976 Expires expires optional, MinExpires minExpires optional, MaxExpires maxExpires optional, UsePath usePath optional, WWWAuthenticate wwwAuthenticate optional, Authorization authorization optional, AuthenticationInfo authenticationInfo optional, ExtHeaderList extHeaders optional } // End of type Header type set of Header HeaderList;// length (1..infinity); type set of ExtHeader ExtHeaderList; type record Headers { ToPaths toPaths, FromPaths fromPaths, HeaderList headers HeaderList headers optional // for AUTH, a request with only To-Path and From-Path is valid } // End of type Headers /** * @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 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); } // End of group msrpHeaders /** Loading Loading @@ -263,7 +335,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ToPath { MsrpKeywords pathID (e_TO_PATH), HeaderName headerName (TO_PATH_E), MsrpURIs msrpURIs } // End of type Path Loading @@ -274,7 +346,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record FromPath { MsrpKeywords pathID (e_FROM_PATH), HeaderName headerName (FROM_PATH_E), MsrpURIs msrpURIs } // End of type Path Loading Loading @@ -367,7 +439,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ContentType { MsrpKeywords contentTypeID (e_CONTENT_TYPE), HeaderName headerName (CONTENT_TYPE_E), MediaType mediaType } // End of type ContentType Loading Loading @@ -404,21 +476,37 @@ module LibMsrp_TypesAndValues { /** * @desc TODO * @see RFC 4976 - Clause 5.1. Connecting to Relays Acting on Your Behalf * @see RFC 4975 - Clause 7.1.1. Sending SEND Requests */ type record AUTH_request { } // End of type AUTH_request type record SEND_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, EndLine endLine } // End of type SEND_request /** * @desc TODO * @see RFC 4975 - Clause 7.1.1. Sending SEND Requests * @see RFC 4975 - Clause 7.1.2. Sending REPORT Requests */ type record SEND_request { type record REPORT_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, EndLine endLine } // End of type SEND_request } // End of type REPORT_request /** * @desc TODO * @see RFC 4976 - Clause 5.1. Connecting to Relays Acting on Your Behalf */ type record AUTH_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, // TODO not sure is body is allowed or not EndLine endLine } // End of type AUTH_request } // End of group msrpRequests Loading Loading
ttcn/LibMsrp/LibMsrp_Templates.ttcn3 +38 −44 Original line number Diff line number Diff line Loading @@ -163,13 +163,13 @@ module LibMsrp_Templates { template RequestLine mw_RequestLine_SEND_any := { tagMsrp := e_MSRP, transactionID := ?, method := e_SEND method := SEND_E } // End of template mw_RequestLine_SEND_any template RequestLine mw_RequestLine_REPORT_any := { tagMsrp := e_MSRP, transactionID := ?, method := e_REPORT method := REPORT_E } // End of template mw_RequestLine_SEND_any /** Loading @@ -193,7 +193,7 @@ module LibMsrp_Templates { */ template EndLine mw_EndLine_noMore := { transactionID := ?, continuationFlag := false // No chunk continuationFlag := e_endMessage // No chunk } // End of template mw_EndLine_noMore } // End of group delimiterLines Loading Loading @@ -239,7 +239,7 @@ module LibMsrp_Templates { * <pre>msrp://atlanta.example.com:7654/jshA7weztas;tcp</pre> */ template (value) ToPath m_msrpToPath_Dummy := { pathID := e_TO_PATH, headerName := TO_PATH_E, msrpURIs := { m_msrpURIs_ToPath_Dummy } Loading @@ -251,21 +251,21 @@ module LibMsrp_Templates { * <pre>msrp://atlanta.example.com:7654/jshA7weztas;tcp</pre> */ template (value) FromPath m_msrpFromPath_Dummy := { pathID := e_FROM_PATH, 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) := { pathID := e_TO_PATH, headerName := TO_PATH_E, msrpURIs := { p_path } } // End of template mw_toPath template FromPath mw_fromPath(in template (present) MsrpURI p_path) := { pathID := e_FROM_PATH, headerName := FROM_PATH_E, msrpURIs := { p_path } Loading @@ -281,8 +281,8 @@ module LibMsrp_Templates { * <pre>Message-ID: 87652491</pre> */ template (value) MessageID m_msrpMessageID_Dummy := { messageID := e_MESSAGEID, messageValue := "87652491" headerName := MESSAGE_ID_E, messageId := "87652491" } // End of template m_msrpMessageID_Dummy Loading @@ -292,7 +292,7 @@ module LibMsrp_Templates { * <pre>Byte-Range: 1-25/25</pre> */ template (value) ByteRange m_msrpByteRange_Dummy := { byteRangeID := e_BYTE_RANGE, headerName := BYTE_RANGE_E, startValue := 1, endValue := 25, totalValue := 25 Loading @@ -301,7 +301,7 @@ module LibMsrp_Templates { template Headers mw_Headers_any := { toPaths := ?, fromPaths := ?, headers := { ? } headers := ? } // End of template mw_Headers_any template Headers mw_Headers_toPath_FromPath( Loading Loading @@ -333,7 +333,7 @@ module LibMsrp_Templates { template (value) ContentStuff m_msrpContentStuff_Dummy := { mimeHeaders := omit, contentType := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := { mediaType := char2oct("text"), subType := char2oct("plain"), Loading @@ -350,7 +350,7 @@ module LibMsrp_Templates { } // End of template mw_mediaType_any template ContentType mw_contentType_any := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := mw_mediaType_any } // End of template mw_contentType_any Loading @@ -365,7 +365,7 @@ module LibMsrp_Templates { in charstring p_mediaType, in charstring p_subType ) modifies mw_contentType_any := { contentTypeID := e_CONTENT_TYPE, headerName := CONTENT_TYPE_E, mediaType := { mediaType := char2oct(p_mediaType), subType := char2oct(p_subType), Loading Loading @@ -412,7 +412,7 @@ module LibMsrp_Templates { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", method := e_SEND method := SEND_E }, // End of 'startLine' field headers := { toPaths := { Loading @@ -422,14 +422,14 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy }, { byteRange := m_msrpByteRange_Dummy } messageID := m_msrpMessageID_Dummy, byteRange := m_msrpByteRange_Dummy } }, // End of 'headers' field contentStuff := m_msrpContentStuff_Dummy, endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpSend_Dummy Loading @@ -450,7 +450,7 @@ module LibMsrp_Templates { startLine := { tagMsrp := e_MSRP, transactionID := "a786hjs2", method := e_REPORT method := REPORT_E }, // End of 'startLine' field headers := { toPaths := { Loading @@ -460,14 +460,14 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy }, { byteRange := m_msrpByteRange_Dummy } messageID := m_msrpMessageID_Dummy, byteRange := m_msrpByteRange_Dummy } }, // End of 'headers' field contentStuff := m_msrpContentStuff_Dummy, endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpSend_Dummy Loading Loading @@ -498,15 +498,13 @@ module LibMsrp_Templates { startLine := mw_RequestLine_REPORT_any, headers := { headers := { { status := { statusID := e_STATUS, headerName := STATUS_E, namespace := 0, statusCode := c_OKCode, comment := c_OKComment } // End of 'status' field } } } // End of 'headers' field } // End of template mw_msrpREPORT_success Loading Loading @@ -535,12 +533,12 @@ module LibMsrp_Templates { m_msrpFromPath_Dummy }, headers := { { messageID := m_msrpMessageID_Dummy } messageID := m_msrpMessageID_Dummy } }, // End of 'headers' field endLine := { transactionID := "a786hjs2", continuationFlag := false continuationFlag := e_endMessage } } // End of template m_msrpResponse_Dummy Loading Loading @@ -575,18 +573,14 @@ module LibMsrp_Templates { ) modifies mw_msrpResponse_toPath_fromPath := { headers := { headers := { { reportStatus := { reportID := e_SUCCESS, successReport := { headerName := SUCCESS_REPORT_E, reportStatus := e_YES } }, // End of 'item#1' of the list { reportStatus := { reportID := e_FAILURE, }, failureReport := { headerName := FAILURE_REPORT_E, reportStatus := e_NO } } // End of 'item#2' of the list } // End of 'header' field } // End of 'headers' field } // // End of template mw_msrpResponse_toPath_fromPath_with_transferReports Loading
ttcn/LibMsrp/LibMsrp_TypesAndValues.ttcn3 +194 −106 Original line number Diff line number Diff line Loading @@ -16,22 +16,41 @@ module LibMsrp_TypesAndValues { 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:" e_PARTIAL // "partial" } // End of type MsrpKeywords type enumerated Method { //RFC 4975 SEND_E, // mSEND = %x53.45.4e.44 ; SEND in caps REPORT_E, // mREPORT = %x52.45.50.4f.52.54; REPORT in caps //RFC 4976 AUTH_E, // mAUTH = %x41.55.54.48 ; AUTH in caps UNKNOWN_METHOD_E } type enumerated HeaderName { //RFC 4975 TO_PATH_E, // "To-Path" FROM_PATH_E, // "From-Path" MESSAGE_ID_E, // "Message-ID" SUCCESS_REPORT_E, //"Success-Report" FAILURE_REPORT_E, //"Failure-Report" BYTE_RANGE_E, // "Byte-Range" STATUS_E, // "Status" CONTENT_TYPE_E, // "Content-Type" //RFC 4976 EXPIRES_E, //"Expires" MIN_EXPIRES_E, // "Min-Expires" MAX_EXPIRES_E, // "Max-Expires" USE_PATH_E, // "Use-Path" WWW_AUTHENTICATE_E, // "WWW-Authenticate" AUTHORIZATION_E, // "Authorization" AUTHENTICATION_INFO_E, // "Authentication-Info" EXT_HEADER_E //any other header } } // End of group tokens /** Loading @@ -39,6 +58,12 @@ module LibMsrp_TypesAndValues { */ group delimiterLines { type enumerated ContinuationFlag { e_endMessage, // "$" e_continueMessage, // "+" e_cancelMessage // "#" } /** * @desc Desciption of the start line * @see RFC 4975 - Clause 7.1. Constructing Requests Loading @@ -47,7 +72,7 @@ module LibMsrp_TypesAndValues { type record RequestLine { MsrpKeywords tagMsrp (e_MSRP), // MSRP keyword TransactionID transactionID, // The transaction identifier created by sender MsrpKeywords method // The method name Method method // The method name } // End of type RequestLine /** Loading @@ -69,52 +94,34 @@ module LibMsrp_TypesAndValues { */ 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 ContinuationFlag continuationFlag // "+"/"$"/"#" } // 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; group RFC4975HeaderTypes { /** * @desc Used to correlate status reports with the original message * @member messageID Message ID identifier * @member messageValue Value of the message-ID * @member headerName Message-ID identifier * @member messageId Value of the Message-ID * @see RFC 4975 - Clause 9. Formal Syntax */ type record MessageID { MsrpKeywords messageID (e_MESSAGEID), Ident messageValue HeaderName headerName (MESSAGE_ID_E), Ident messageId } // 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, type record SuccessReport { HeaderName headerName (SUCCESS_REPORT_E), MsrpKeywords reportStatus } // End of type ReportStatus } type record FailureReport { HeaderName headerName (FAILURE_REPORT_E), MsrpKeywords reportStatus } /** * @desc TODO Loading @@ -125,24 +132,12 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ByteRange { MsrpKeywords byteRangeID (e_BYTE_RANGE), integer startValue, integer endValue, integer totalValue HeaderName headerName (BYTE_RANGE_E), integer startValue, // [1..infinity) integer endValue, // [0..infinity) TODO can take also wilcard value: "*" integer totalValue // [0..infinity) TODO can take also wilcard value: "*" } // 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 Loading @@ -152,11 +147,43 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record Status { MsrpKeywords statusID (e_STATUS), HeaderName headerName (STATUS_E), Namespace namespace, StatusCode statusCode, charstring comment optional } // End of type Status } group RFC4976HeaderTypes { type record Expires { HeaderName headerName (STATUS_E) } type record MinExpires { HeaderName headerName (MIN_EXPIRES_E) } type record MaxExpires { HeaderName headerName (MAX_EXPIRES_E) } type record UsePath { HeaderName headerName (USE_PATH_E) } type record WWWAuthenticate { HeaderName headerName (WWW_AUTHENTICATE_E) } type record Authorization { HeaderName headerName (AUTHORIZATION_E) } type record AuthenticationInfo { HeaderName headerName (AUTHENTICATION_INFO_E) } } /** * @desc TODO Loading @@ -178,22 +205,67 @@ module LibMsrp_TypesAndValues { * @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 type record HeaderList { //RFC 4975 MessageID messageID optional, SuccessReport successReport optional, FailureReport failureReport optional, ByteRange byteRange optional, Status status optional, //RFC 4976 Expires expires optional, MinExpires minExpires optional, MaxExpires maxExpires optional, UsePath usePath optional, WWWAuthenticate wwwAuthenticate optional, Authorization authorization optional, AuthenticationInfo authenticationInfo optional, ExtHeaderList extHeaders optional } // End of type Header type set of Header HeaderList;// length (1..infinity); type set of ExtHeader ExtHeaderList; type record Headers { ToPaths toPaths, FromPaths fromPaths, HeaderList headers HeaderList headers optional // for AUTH, a request with only To-Path and From-Path is valid } // End of type Headers /** * @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 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); } // End of group msrpHeaders /** Loading Loading @@ -263,7 +335,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ToPath { MsrpKeywords pathID (e_TO_PATH), HeaderName headerName (TO_PATH_E), MsrpURIs msrpURIs } // End of type Path Loading @@ -274,7 +346,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record FromPath { MsrpKeywords pathID (e_FROM_PATH), HeaderName headerName (FROM_PATH_E), MsrpURIs msrpURIs } // End of type Path Loading Loading @@ -367,7 +439,7 @@ module LibMsrp_TypesAndValues { * @see RFC 4975 - Clause 9. Formal Syntax */ type record ContentType { MsrpKeywords contentTypeID (e_CONTENT_TYPE), HeaderName headerName (CONTENT_TYPE_E), MediaType mediaType } // End of type ContentType Loading Loading @@ -404,21 +476,37 @@ module LibMsrp_TypesAndValues { /** * @desc TODO * @see RFC 4976 - Clause 5.1. Connecting to Relays Acting on Your Behalf * @see RFC 4975 - Clause 7.1.1. Sending SEND Requests */ type record AUTH_request { } // End of type AUTH_request type record SEND_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, EndLine endLine } // End of type SEND_request /** * @desc TODO * @see RFC 4975 - Clause 7.1.1. Sending SEND Requests * @see RFC 4975 - Clause 7.1.2. Sending REPORT Requests */ type record SEND_request { type record REPORT_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, EndLine endLine } // End of type SEND_request } // End of type REPORT_request /** * @desc TODO * @see RFC 4976 - Clause 5.1. Connecting to Relays Acting on Your Behalf */ type record AUTH_request { RequestLine startLine, Headers headers, ContentStuff contentStuff optional, // TODO not sure is body is allowed or not EndLine endLine } // End of type AUTH_request } // End of group msrpRequests Loading