| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // Copyright (c) 2000-2016 Ericsson Telecom AB |
| // |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v1.0 |
| // which accompanies this distribution, and is available at |
| // http://www.eclipse.org/legal/epl-v10.html |
| /////////////////////////////////////////////////////////////////////////////// |
| // |
| // File: WTP_Types.ttcn |
| // Rev: R1B |
| // Prodnr: CNL 113 619 |
| // Updated: 2008-11-13 |
| // Contact: http://ttcn.ericsson.se |
| // Reference: WAP-224-WTP-20010710-a |
| |
| module WTP_Types |
| { |
| |
| import from General_Types all; |
| |
| external function enc_PDU_WTP(in PDU_WTP wtp_pdu) return octetstring |
| |
| external function dec_PDU_WTP(in octetstring stream) return PDU_WTP |
| with { extension "prototype(convert)" |
| extension "decode(RAW)" |
| } |
| |
| type record InvokeHeader |
| { |
| BIT1 rID, |
| BIT1 tTR, |
| BIT1 gTR, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID, |
| BIT2 tCL, |
| BIT2 reserved, |
| BIT1 uP, |
| BIT1 tID_New, |
| BIT2 version |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record ResultHeader |
| { |
| BIT1 rID, |
| BIT1 tTR, |
| BIT1 gTR, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record AckHeader |
| { |
| BIT1 rID, |
| BIT1 rES, |
| BIT1 tve_Tok, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID |
| }with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record AbortHeader |
| { |
| BIT3 abortType, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID, |
| OCT1 abortReason |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record SegmentedInvokeHeader |
| { |
| BIT1 rID, |
| BIT1 tTR, |
| BIT1 gTR, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID, |
| integer packetSequenceNumber |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record SegmentedResultHeader |
| { |
| BIT1 rID, |
| BIT1 tTR, |
| BIT1 gTR, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID, |
| integer packetSequenceNumber |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| } |
| |
| type record of integer PacketSequenceNrList; |
| |
| type record NegativeAckHeader |
| { |
| BIT1 rID, |
| BIT2 reserved, |
| BIT4 pDU_Type, |
| BIT1 continueFlag, |
| BIT1 tID_Resp, |
| integer transactionID, |
| integer nrOfMissingPackets, |
| PacketSequenceNrList missingPacketSequenceNrs |
| } with { |
| variant (tID_Resp,transactionID) "FIELDORDER(msb)"; |
| variant (transactionID) "FIELDLENGTH(15)"; |
| variant (transactionID) "BYTEORDER(last)"; |
| variant (nrOfMissingPackets) "LENGTHTO (missingPacketSequenceNrs)"; |
| variant (nrOfMissingPackets) "UNIT (elements)"; |
| } |
| |
| type record WTP_PDUs |
| { |
| BIT1 lengthType, |
| PDU_Length pDU_Length, |
| PDU_WTP pDU_WTP |
| } with { |
| variant "FIELDORDER(msb)"; |
| variant (pDU_Length) "CROSSTAG( short_len, lengthType = '0'B; |
| long_len, lengthType = '1'B;)"; |
| variant (pDU_Length) "LENGTHTO (pDU_WTP)"; |
| } |
| |
| type union PDU_Length |
| { |
| integer short_len, |
| integer long_len |
| }with { |
| variant (short_len) "FIELDLENGTH(7)"; |
| variant (long_len) "FIELDLENGTH(15)"; |
| variant (long_len) "BYTEORDER(last)"; |
| variant (short_len) "FIELDORDER(msb)"; |
| variant (long_len) "FIELDORDER(msb)"; |
| } |
| |
| type record of WTP_PDUs WTP_PDU_List; |
| |
| type record WTP_Concatenation |
| { |
| OCT1 concatenationIndicator, //'00'O |
| WTP_PDU_List wTP_PDUs |
| } with { variant "PRESENCE (concatenationIndicator = '00'O)"; }; |
| |
| type record WTP_Invoke |
| { |
| InvokeHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0001'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| |
| type record WTP_Result |
| { |
| ResultHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0010'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| type record WTP_Ack |
| { |
| AckHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0011'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| type record WTP_Abort |
| { |
| AbortHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0100'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| |
| type record WTP_SegmentedInvoke |
| { |
| SegmentedInvokeHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0101'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| type record WTP_SegmentedResult |
| { |
| SegmentedResultHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0110'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| type record WTP_NegativeAck |
| { |
| NegativeAckHeader header, |
| TPI tPIs optional, |
| octetstring dataField optional // encoded WSP |
| } with { variant "PRESENCE (header.pDU_Type = '0111'B)"; |
| variant (tPIs) "PRESENCE(header.continueFlag = '1'B)"; |
| }; |
| |
| |
| type union TPI_length |
| { |
| integer short_len, |
| integer long_len |
| }with { |
| variant (short_len) "FIELDLENGTH(2)"; |
| variant (long_len) "FIELDLENGTH(8)"; |
| variant (long_len) "BYTEORDER(last)"; |
| variant (short_len) "FIELDORDER(msb)"; |
| variant (long_len) "FIELDORDER(msb)"; |
| } |
| |
| |
| type record Error_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, //'0'B |
| integer tPI_Length, |
| BIT4 errorCode, |
| BIT4 badTPI_ID, |
| OCT1 firstOctetTPT optional, |
| TPI nextTPI optional |
| } with { |
| variant "PRESENCE (tPI_ID = '0000'B)"; |
| variant "FIELDORDER(msb)"; |
| variant (tPI_Length) "FIELDLENGTH(2)"; |
| variant (tPI_Length) "LENGTHTO (badTPI_ID,errorCode,firstOctetTPT)"; |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| type record Info_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, |
| TPI_length tPI_Length, |
| octetstring information, |
| TPI nextTPI optional |
| } with { |
| variant "PRESENCE (tPI_ID = '0001'B)"; |
| variant "FIELDORDER(msb)"; |
| |
| variant (tPI_Length) "CROSSTAG( short_len, lengthType = '0'B; |
| long_len, lengthType = '1'B;)"; |
| variant (tPI_Length) "LENGTHTO (information)"; |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| type record Option_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, |
| TPI_length tPI_Length, |
| OCT1 optionID, |
| octetstring optionValue, |
| TPI nextTPI optional |
| } with { |
| variant "PRESENCE (tPI_ID = '0010'B)"; |
| variant "FIELDORDER(msb)"; |
| |
| variant (tPI_Length) "CROSSTAG( short_len, lengthType = '0'B; |
| long_len, lengthType = '1'B;)"; |
| variant (tPI_Length) "LENGTHTO (optionID,optionValue)"; |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| |
| |
| type union PacketSequenceNr |
| { |
| integer oneByte, |
| integer twoBytes, |
| integer threeBytes |
| } with { |
| variant (twoBytes) "FIELDLENGTH(16)"; |
| variant (threeBytes) "FIELDLENGTH(24)"; |
| } |
| |
| type record PacketSeqNr_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, //'0'B |
| integer tPI_Length, |
| PacketSequenceNr packetSequenceNr, |
| TPI nextTPI optional |
| }with { |
| variant "PRESENCE (tPI_ID = '0011'B)"; |
| variant "FIELDORDER(msb)"; |
| variant (tPI_Length) "FIELDLENGTH(2)"; |
| variant (tPI_Length) "LENGTHTO (packetSequenceNr)"; |
| variant (packetSequenceNr) "CROSSTAG |
| ( |
| oneByte, tPI_Length = 1; |
| twoBytes, tPI_Length = 2; |
| threeBytes, tPI_Length = 3; |
| )" |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| type record SDU_Boundary_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, //'0'B |
| integer tPI_Length, //0 |
| TPI nextTPI optional |
| }with { |
| variant "PRESENCE (tPI_ID = '0100'B)"; |
| variant "FIELDORDER(msb)"; |
| variant (tPI_Length) "FIELDLENGTH(2)"; |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| type record Frame_Boundary_TPI |
| { |
| BIT1 continueFlag, |
| BIT4 tPI_ID, |
| BIT1 lengthType, //'0'B |
| integer tPI_Length, //0 |
| TPI nextTPI optional |
| }with { |
| variant "PRESENCE (tPI_ID = '0101'B)"; |
| variant "FIELDORDER(msb)"; |
| variant (tPI_Length) "FIELDLENGTH(2)"; |
| variant (nextTPI) "PRESENCE(continueFlag = '1'B)"; |
| } |
| |
| type union TPI |
| { |
| Error_TPI errorField, |
| Info_TPI info, |
| Option_TPI option, |
| PacketSeqNr_TPI packetSeqNr, |
| SDU_Boundary_TPI sDU_Boundary_TPI, |
| Frame_Boundary_TPI frame_Boundary_TPI |
| } |
| |
| type union PDU_WTP |
| { |
| WTP_Concatenation concatenation, |
| WTP_Invoke invoke, |
| WTP_Result result, |
| WTP_Ack ack, |
| WTP_Abort abort, |
| WTP_SegmentedInvoke segmentedInvoke, |
| WTP_SegmentedResult segmentedResult, |
| WTP_NegativeAck negativeAck |
| } |
| |
| } with{ encode "RAW"} // end of module |