diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-23 19:20:48 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-23 19:48:13 +0100 |
commit | 6db40339dec58e37f3ae4f279a596a5f3562d80b (patch) | |
tree | 2eabce9ab1b7392e13bf7f06dca985d261d6c184 | |
parent | 6a514a588fb43b8f79dbf77308e29cac3d1b5519 (diff) |
rsl: Implement the positive CRCX, MDCX and DLCX messages
-rw-r--r-- | fakebts/RSLMsg.st | 182 | ||||
-rw-r--r-- | fakebts/Test.st | 45 |
2 files changed, 222 insertions, 5 deletions
diff --git a/fakebts/RSLMsg.st b/fakebts/RSLMsg.st index da8a9e7..d93eee0 100644 --- a/fakebts/RSLMsg.st +++ b/fakebts/RSLMsg.st @@ -151,7 +151,7 @@ Osmo.TLVParserBase subclass: RSLMessageBase [ RSLMessageBase class >> ignoredBaseClasses [ <category: 'handling'> ^ {RSLCommonChannelManagement. RSLTRXManagement. - RSLDedicatedChannelManagement. RSLRadioLinkManagement} + RSLDedicatedChannelManagement. RSLRadioLinkManagement. RSLIPAVendorManagement} ] RSLMessageBase class >> canHandle: aDiscrim transparent: aTrans type: aType [ @@ -290,6 +290,14 @@ Object subclass: RSLMessageDefinitions [ beTV; valueSize: 1; yourself ] + causeIE [ + <category: 'common-ie'> + ^ Osmo.TLVDescription new + tag: RSLInformationElement attrCause; + instVarName: #cause; parseClass: RSLAttributeData; + beTLV; minSize: 1; yourself + ] + radioLinkMessageBase [ <category: 'radio-link'> ^ OrderedCollection new @@ -473,10 +481,7 @@ Object subclass: RSLMessageDefinitions [ channelActivationNackMessage [ <category: 'dedicated-channel'> ^ self dedicatedChannelMessageBase - add: (Osmo.TLVDescription new - tag: RSLInformationElement attrCause; - instVarName: #cause; parseClass: RSLAttributeData; - beTLV; minSize: 1; yourself); + add: self causeIE; yourself ] @@ -1120,3 +1125,170 @@ RSLRadioLinkManagement subclass: RSLReleaseIndication [ <rslMessageType: #messageRadioLinkReleaseIndication> <rslMessageDefinition: #releaseIndicationMessage> ] + +RSLMessageDefinitions subclass: RSLIPAMessageDefinitions [ + RSLIPAMessageDefinitions class [ + connectionIdentifierIE [ + ^ Osmo.TLVDescription new + tag: 16rF8; instVarName: #conn_id; parseClass: RSLAttributeData; + beTV; valueSize: 2; yourself + ] + + localIPIE [ + ^ Osmo.TLVDescription new + tag: 16rF5; instVarName: #local_ip; parseClass: RSLAttributeData; + beTV; valueSize: 4; yourself + ] + + localPortIE [ + ^ Osmo.TLVDescription new + tag: 16rF3; instVarName: #local_port; parseClass: RSLAttributeData; + beTV; valueSize: 2; yourself + ] + + remoteIPIE [ + ^ self localIPIE + tag: 16rF0; instVarName: #remote_ip; yourself + ] + + remotePortIE [ + ^ self localPortIE + tag: 16rF1; instVarName: #remote_port; yourself. + ] + + speechModeIE [ + ^ Osmo.TLVDescription new + tag: 16rF4; instVarName: #speech_mode; parseClass: RSLAttributeData; + beTV; valueSize: 1; yourself + ] + + rtpPayloadTypeIE [ + ^ Osmo.TLVDescription new + tag: 16rF2; instVarName: #rtp_payload; parseClass: RSLAttributeData; + beTV; valueSize: 1; yourself + ] + + connectionStatisticsIE [ + ^ Osmo.TLVDescription new + tag: 16rF6; instVarName: #stats; parseClass: RSLAttributeData; + beTLV; valueSize: 28; yourself + ] + + createConnectionMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self speechModeIE; + add: self rtpPayloadTypeIE; + yourself + ] + + createConnectionAckMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self localPortIE; + add: self localIPIE; + yourself + ] + + modifyConnectionMessage [ + <category: 'ipa'> + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self remoteIPIE; + add: self remotePortIE; + add: self speechModeIE; + add: self rtpPayloadTypeIE; + yourself + ] + + modifyConnectionAckMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + yourself + ] + + deleteConnectionIndMessage [ + ^ OrderedCollection new + add: self channelNumberIE; + add: self connectionIdentifierIE; + add: self connectionStatisticsIE; + add: self causeIE; + yourself + ] + ] +] + +RSLMessageBase subclass: RSLIPAVendorManagement [ + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a ip.access vendor extension'> + + RSLIPAVendorManagement class [ + messageCRCX [ <category: 'tag'> ^ 16r70 ] + messageCRCXAck [ <category: 'tag'> ^ 16r71 ] + messageCRCXNack [ <category: 'tag'> ^ 16r72 ] + messageMDCX [ <category: 'tag'> ^ 16r73 ] + messageMDCXAck [ <category: 'tag'> ^ 16r74 ] + messageMDCXNack [ <category: 'tag'> ^ 16r75 ] + messageDLCXInd [ <category: 'tag'> ^ 16r76 ] + messageDLCX [ <category: 'tag'> ^ 16r77 ] + messageDLCXAck [ <category: 'tag'> ^ 16r78 ] + messageDLCXNack [ <category: 'tag'> ^ 16r79 ] + ] + + RSLIPAVendorManagement class >> messageDiscrimator [ + <category: 'parsing'> + ^ 63 + ] + + RSLIPAVendorManagement class >> isTransparent [ + ^ 0 + ] + + RSLIPAVendorManagement class >> tlvDescription [ + <category: 'tlv'> + ^ RSLIPAMessageDefinitions perform: messageDefinition + ] +] + +RSLIPAVendorManagement subclass: RSLIPACreateConnection [ + | channel_number speech_mode rtp_payload | + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a Create Connection (CRCX) message'> + <rslMessageType: #messageCRCX> + <rslMessageDefinition: #createConnectionMessage> +] + +RSLIPAVendorManagement subclass: RSLIPACreateConnectionAck [ + | channel_number conn_id local_port local_ip | + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a Create Connection (CRCX) ACK message'> + <rslMessageType: #messageCRCXAck> + <rslMessageDefinition: #createConnectionAckMessage> +] + +RSLIPAVendorManagement subclass: RSLIPAModifyConnection [ + | channel_number conn_id remote_ip remote_port speech_mode rtp_payload | + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a Modify Connection (MDCX) message'> + <rslMessageType: #messageMDCX> + <rslMessageDefinition: #modifyConnectionMessage> +] + +RSLIPAVendorManagement subclass: RSLIPAModifyConnectionAck [ + | channel_number conn_id | + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a Modify Connection (MDCX) ACK message'> + <rslMessageType: #messageMDCXAck> + <rslMessageDefinition: #modifyConnectionAckMessage> +] + +RSLIPAVendorManagement subclass: RSLIPADeleteConnectionInd [ + | channel_number conn_id stats cause | + <category: 'BTS-RSL-IPA'> + <comment: 'I represent a Delete Connection (DLCX) Indication message'> + <rslMessageType: #messageDLCXInd> + <rslMessageDefinition: #deleteConnectionIndMessage> +] diff --git a/fakebts/Test.st b/fakebts/Test.st index 5e254a4..79c9ff2 100644 --- a/fakebts/Test.st +++ b/fakebts/Test.st @@ -472,6 +472,51 @@ RoundTripTestCase subclass: RSLRoundTripTest [ ^ #(8 41 1 10 6 4 0 1 8 17 ) ] + ipaCrcxData [ + ^ #(126 112 1 10 244 17 242 97) + ] + + ipaCrcxAckData [ + ^ #(16r7E 16r71 16r01 16r0A 16rF8 16r00 16r27 16rF3 16r0F + 16rAE 16rF5 16rC0 16rA8 16r0A 16r4E) + ] + + ipaDlcxIndData [ + ^ #(16r7E 16r76 16r01 16r0A 16rF8 16r00 16r27 16rF6 16r1C + 16r00 16r00 16r06 16rE4 16r00 16r00 16rD5 16r9C 16r00 + 16r00 16r07 16r14 16r00 16r00 16rDB 16r6C 16r00 16r00 + 16r00 16r2A 16r00 16r00 16r00 16r35 16r00 16r00 16r00 + 16r00 16r1A 16r01 16r0F) + ] + + ipaMdcxData [ + ^ #(126 115 1 10 248 0 0 240 0 0 0 0 241 0 0 244 1 242 97) + ] + + ipaMdcxDataAck [ + ^ #(16r7E 16r74 16r01 16r0A 16rF8 16r00 16r27) + ] + + testIpaCrcxAck [ + self roundtripTestFor: #ipaCrcxAckData class: RSLIPACreateConnectionAck. + ] + + testIpaCrcx [ + self roundtripTestFor: #ipaCrcxData class: RSLIPACreateConnection. + ] + + testIpaDlcx [ + self roundtripTestFor: #ipaDlcxIndData class: RSLIPADeleteConnectionInd. + ] + + testIpaMdcx [ + self roundtripTestFor: #ipaMdcxData class: RSLIPAModifyConnection. + ] + + testIpaMdcxAck [ + self roundtripTestFor: #ipaMdcxDataAck class: RSLIPAModifyConnectionAck. + ] + testBCCHInformation [ self roundtripTestFor: #bcchInformationData class: RSLBCCHInformation ] |