misc: Add categories for all selectors in this nanespace.
This commit is contained in:
parent
023d7a78d4
commit
cdad29f032
|
@ -67,16 +67,18 @@ CPackedStruct subclass: IPASCCPState [
|
|||
#(#imsi (#array #char 17))) >
|
||||
|
||||
srcAddr [
|
||||
<category: 'accessing'>
|
||||
^ SCCPAddrReference fromCData: self src.
|
||||
]
|
||||
|
||||
dstAddr [
|
||||
<category: 'accessing'>
|
||||
^ SCCPAddrReference fromCData: self dst.
|
||||
]
|
||||
|
||||
imsiString [
|
||||
"We will need to count how many chars of the array are used"
|
||||
<category: 'access'>
|
||||
<category: 'accessing'>
|
||||
|
||||
0 to: 16 do: [:index | | c |
|
||||
c := self imsi at: index.
|
||||
|
|
|
@ -23,17 +23,20 @@ Object subclass: IPADispatcher [
|
|||
<comment: 'I am a hub and one can register handlers for the streams'>
|
||||
|
||||
initialize [
|
||||
<category: 'initialize'>
|
||||
handlers := Dictionary new.
|
||||
]
|
||||
|
||||
addHandler: aStream on: anObject with: aSelector [
|
||||
| handler |
|
||||
<category: 'handler'>
|
||||
handler := Array with: anObject with: aSelector.
|
||||
handlers at: aStream put: handler.
|
||||
]
|
||||
|
||||
dispatch: aStream with: aData [
|
||||
| handler |
|
||||
<category: 'handler'>
|
||||
handler := handlers at: aStream ifAbsent: [
|
||||
self logError: 'No registered handler for ', aStream displayString area: #ipa.
|
||||
^ false
|
||||
|
|
|
@ -31,6 +31,7 @@ Object subclass: IPADemuxer [
|
|||
|
||||
next [
|
||||
"Return a tuple of stream and bytearray"
|
||||
<category: 'reading'>
|
||||
|
||||
| size stream data |
|
||||
|
||||
|
@ -48,6 +49,7 @@ Object subclass: IPADemuxer [
|
|||
]
|
||||
|
||||
socket: aSocket [
|
||||
<category: 'accessing'>
|
||||
socket := aSocket.
|
||||
]
|
||||
]
|
||||
|
@ -69,6 +71,7 @@ Object subclass: IPAMuxer [
|
|||
prepareNext: aData with: aStream [
|
||||
"Write the data onto the stream"
|
||||
| msg |
|
||||
<category: 'accessing'>
|
||||
|
||||
aData size > 65535
|
||||
ifTrue: [
|
||||
|
@ -92,10 +95,12 @@ Object subclass: IPAMuxer [
|
|||
]
|
||||
|
||||
nextPut: aData with: aStream [
|
||||
<category: 'encoding'>
|
||||
socket nextPut: (self prepareNext: aData with: aStream).
|
||||
]
|
||||
|
||||
socket: aSocket [
|
||||
<category: 'accessing'>
|
||||
socket := aSocket.
|
||||
]
|
||||
]
|
||||
|
|
20
M2UA.st
20
M2UA.st
|
@ -228,11 +228,13 @@ Object subclass: M2UATag [
|
|||
number of the tag and the data associated with it.'>
|
||||
|
||||
M2UATag class >> fromStream: aStream [
|
||||
<category: 'parsing'>
|
||||
^ self new
|
||||
parseFrom: aStream
|
||||
]
|
||||
|
||||
M2UATag class >> initWith: aTag data: aData [
|
||||
<category: 'creation'>
|
||||
^ self new
|
||||
instVarNamed: #tag_nr put: aTag;
|
||||
instVarNamed: #data put: aData;
|
||||
|
@ -241,6 +243,8 @@ Object subclass: M2UATag [
|
|||
|
||||
parseFrom: aStream [
|
||||
| len padding |
|
||||
<category: 'parsing'>
|
||||
|
||||
tag_nr := ((aStream next: 2) shortAt: 1) swap16.
|
||||
len := ((aStream next: 2) shortAt: 1) swap16.
|
||||
data := aStream next: len - 4.
|
||||
|
@ -285,6 +289,7 @@ Object subclass: M2UAMSG [
|
|||
to see the class, type and include tags.'>
|
||||
|
||||
M2UAMSG class >> parseFrom: aMsg [
|
||||
<category: 'parsing'>
|
||||
self logDataContext: aMsg area: #m2ua.
|
||||
|
||||
^ self new
|
||||
|
@ -293,14 +298,22 @@ Object subclass: M2UAMSG [
|
|||
]
|
||||
|
||||
M2UAMSG class >> fromClass: aClass type: aType [
|
||||
<category: 'parsing'>
|
||||
^ self new
|
||||
instVarNamed: #msg_class put: aClass;
|
||||
instVarNamed: #msg_type put: aType;
|
||||
yourself.
|
||||
]
|
||||
|
||||
msgClass [ ^ msg_class ]
|
||||
msgType [ ^ msg_type ]
|
||||
msgClass [
|
||||
<category: 'accessing'>
|
||||
^ msg_class
|
||||
]
|
||||
|
||||
msgType [
|
||||
<category: 'accessing'>
|
||||
^ msg_type
|
||||
]
|
||||
|
||||
findTag: aTag ifAbsent: aBlock [
|
||||
"I find a tag with a tag identifier"
|
||||
|
@ -321,6 +334,8 @@ Object subclass: M2UAMSG [
|
|||
|
||||
parseFrom: aStream [
|
||||
| version spare len end |
|
||||
<category: 'parsing'>
|
||||
|
||||
version := aStream next.
|
||||
version = M2UAConstants version ifFalse: [
|
||||
self logError: 'M2UA version is wrong %1.' % {version} area: #m2ua.
|
||||
|
@ -353,6 +368,7 @@ Object subclass: M2UAMSG [
|
|||
]
|
||||
|
||||
addTag: aTag [
|
||||
<category: 'encoding'>
|
||||
self tags add: aTag.
|
||||
]
|
||||
|
||||
|
|
|
@ -29,27 +29,33 @@ Collection subclass: MessageBuffer [
|
|||
]
|
||||
|
||||
initialize [
|
||||
<category: 'accessing'>
|
||||
chunks := OrderedCollection new.
|
||||
]
|
||||
|
||||
toMessage [
|
||||
<category: 'creation'>
|
||||
^ self
|
||||
]
|
||||
|
||||
prependByteArray: aByteArray [
|
||||
<category: 'creation'>
|
||||
chunks addFirst: aByteArray.
|
||||
]
|
||||
|
||||
putByte: aByte [
|
||||
<category: 'creation'>
|
||||
chunks add: (ByteArray with: aByte)
|
||||
]
|
||||
|
||||
putByteArray: aByteArray [
|
||||
<category: 'creation'>
|
||||
chunks add: aByteArray.
|
||||
]
|
||||
|
||||
put16: aInt [
|
||||
| data low high |
|
||||
<category: 'creation'>
|
||||
low := (aInt bitAnd: 16rFF).
|
||||
high := (aInt bitShift: -8) bitAnd: 16rFF.
|
||||
data := ByteArray with: low with: high.
|
||||
|
@ -58,6 +64,7 @@ Collection subclass: MessageBuffer [
|
|||
|
||||
putLen16: aInt [
|
||||
| data low high |
|
||||
<category: 'creation'>
|
||||
low := (aInt bitShift: -8) bitAnd: 16rFF.
|
||||
high := aInt bitAnd: 16rFF.
|
||||
data := ByteArray with: low with: high.
|
||||
|
@ -66,6 +73,7 @@ Collection subclass: MessageBuffer [
|
|||
|
||||
putLen32: aInt [
|
||||
| a b c d data |
|
||||
<category: 'creation'>
|
||||
a := (aInt bitShift: -24) bitAnd: 16rFF.
|
||||
b := (aInt bitShift: -16) bitAnd: 16rFF.
|
||||
c := (aInt bitShift: -8) bitAnd: 16rFF.
|
||||
|
@ -81,10 +89,12 @@ Collection subclass: MessageBuffer [
|
|||
|
||||
size [
|
||||
"Count of how much data we have collected"
|
||||
<category: 'accessing'>
|
||||
^ chunks inject: 0 into: [:acc :each | acc + each size ]
|
||||
]
|
||||
|
||||
do: aBlock [
|
||||
<category: 'accessing'>
|
||||
chunks do: [:chunk |
|
||||
chunk do: aBlock.
|
||||
].
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
Object extend [
|
||||
subclassResponsibility [
|
||||
<category: '*-OsmoCore-message'>
|
||||
thisContext backtrace printNl.
|
||||
SystemExceptions.SubclassResponsibility signal
|
||||
]
|
||||
|
@ -76,38 +77,44 @@ Object subclass: MSGStructure [
|
|||
]
|
||||
|
||||
type [
|
||||
<category: 'The type of this message'>
|
||||
<category: 'accessing'>
|
||||
^ type
|
||||
]
|
||||
|
||||
addFixed: aType [
|
||||
<category: 'fields'>
|
||||
self fields add: {#fixed. aType}
|
||||
]
|
||||
|
||||
addOptional: aType [
|
||||
<category: 'fields'>
|
||||
self fields add: {#optional. aType}
|
||||
]
|
||||
|
||||
addOptionals: aType [
|
||||
<category: 'fields'>
|
||||
"Optional Parameters that may appear more than once."
|
||||
self fields add: {#optionals. aType}
|
||||
]
|
||||
|
||||
addVariable: aType [
|
||||
<category: 'fields'>
|
||||
self fields add: {#variable. aType}
|
||||
]
|
||||
|
||||
fields [
|
||||
<category: 'private'>
|
||||
<category: 'fields'>
|
||||
^ fields ifNil: [fields := OrderedCollection new]
|
||||
]
|
||||
|
||||
fieldsDo: aBlock [
|
||||
<category: 'fields'>
|
||||
^ self fields do: [:each | aBlock value: each first value: each second]
|
||||
]
|
||||
|
||||
filter: aFilter [
|
||||
| lst |
|
||||
<category: 'fields'>
|
||||
lst := OrderedCollection new.
|
||||
self fields inject: lst into: [:list :each |
|
||||
each first = aFilter ifTrue: [
|
||||
|
@ -201,6 +208,7 @@ Object subclass: MSGStructure [
|
|||
]
|
||||
|
||||
prepareOptional: aStream [
|
||||
<category: 'decoding'>
|
||||
"Nothing to be done here. Subclasses can manipulate the stream"
|
||||
]
|
||||
|
||||
|
|
161
SCCP.st
161
SCCP.st
|
@ -97,10 +97,12 @@ Object subclass: SCCPPNC [
|
|||
]
|
||||
|
||||
at: aKey put: aValue [
|
||||
<category: 'accessing'>
|
||||
self dict at: aKey put: aValue.
|
||||
]
|
||||
|
||||
at: aKey [
|
||||
<category: 'accessing'>
|
||||
^ self dict at: aKey.
|
||||
]
|
||||
|
||||
|
@ -115,6 +117,7 @@ Object subclass: SCCPPNC [
|
|||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'encoding'>
|
||||
self dict keysAndValuesDo: [:key :val |
|
||||
| dat |
|
||||
dat := val toMessageOrByteArray.
|
||||
|
@ -252,15 +255,27 @@ SCCPGTI subclass: SCCPGTITranslation [
|
|||
]
|
||||
|
||||
translation [
|
||||
<category: 'accessing'>
|
||||
^ trans ifNil: [ 0 ]
|
||||
]
|
||||
|
||||
translation: aTrans [ trans := aTrans ]
|
||||
translation: aTrans [
|
||||
<category: 'accessing'>
|
||||
trans := aTrans
|
||||
]
|
||||
|
||||
plan [ ^ plan ]
|
||||
plan: aPlan [ plan := aPlan ]
|
||||
plan [
|
||||
<category: 'accessing'>
|
||||
^ plan
|
||||
]
|
||||
|
||||
plan: aPlan [
|
||||
<category: 'accessing'>
|
||||
plan := aPlan
|
||||
]
|
||||
|
||||
encoding [
|
||||
<category: 'accessing'>
|
||||
^ enc ifNil: [
|
||||
addr size odd
|
||||
ifTrue: [
|
||||
|
@ -271,16 +286,34 @@ SCCPGTI subclass: SCCPGTITranslation [
|
|||
].
|
||||
].
|
||||
]
|
||||
encoding: aEnc [ enc := aEnc ]
|
||||
encoding: aEnc [
|
||||
<category: 'accessing'>
|
||||
enc := aEnc
|
||||
]
|
||||
|
||||
nature [ ^ nature ]
|
||||
nature: aNai [ nature := aNai ]
|
||||
nature [
|
||||
<category: 'accessing'>
|
||||
^ nature
|
||||
]
|
||||
|
||||
addr [ ^ addr ]
|
||||
addr: anAddr [ addr := anAddr ]
|
||||
nature: aNai [
|
||||
<category: 'accessing'>
|
||||
nature := aNai
|
||||
]
|
||||
|
||||
addr [
|
||||
<category: 'accessing'>
|
||||
^ addr
|
||||
]
|
||||
|
||||
addr: anAddr [
|
||||
<category: 'accessing'>
|
||||
addr := anAddr
|
||||
]
|
||||
|
||||
asByteArray [
|
||||
| data |
|
||||
<category: 'encoding'>
|
||||
data := OrderedCollection new.
|
||||
|
||||
"write the header"
|
||||
|
@ -368,46 +401,56 @@ Object subclass: SCCPAddress [
|
|||
]
|
||||
|
||||
routedOnSSN: aFlag [
|
||||
<category: 'ssn'>
|
||||
route_ssn := aFlag
|
||||
]
|
||||
|
||||
routedOnSSN [
|
||||
<category: 'ssn'>
|
||||
^ route_ssn ifNil: [false]
|
||||
]
|
||||
|
||||
gti [
|
||||
<category: 'gti'>
|
||||
^ gti
|
||||
]
|
||||
|
||||
gtiInd [
|
||||
<category: 'gti'>
|
||||
^ gti_ind
|
||||
]
|
||||
|
||||
gti: aGti indicator: aGtiInd [
|
||||
<category: 'gti'>
|
||||
gti := aGti.
|
||||
gti_ind := aGtiInd bitAnd: 16rF.
|
||||
]
|
||||
|
||||
gtiAsParsed [
|
||||
<category: 'gti'>
|
||||
^ gti_ind = 0
|
||||
ifTrue: [nil]
|
||||
ifFalse: [SCCPGTI initWith: gti_ind data: gti].
|
||||
]
|
||||
|
||||
gtiFromAddr: aGti [
|
||||
<category: 'gti'>
|
||||
gti_ind := aGti class subType.
|
||||
gti := aGti asByteArray.
|
||||
]
|
||||
|
||||
poi: aPoi [
|
||||
<category: 'point-code-indicator'>
|
||||
poi := aPoi.
|
||||
]
|
||||
|
||||
poi [
|
||||
<category: 'point-code-indicator'>
|
||||
^ poi
|
||||
]
|
||||
|
||||
ssn: assn [
|
||||
<category: 'ssn'>
|
||||
ssn := assn
|
||||
]
|
||||
|
||||
|
@ -419,6 +462,7 @@ Object subclass: SCCPAddress [
|
|||
asByteArray [
|
||||
"Most simple address storing routine"
|
||||
| ai data |
|
||||
<category: 'encoding'>
|
||||
|
||||
data := OrderedCollection new.
|
||||
|
||||
|
@ -587,17 +631,19 @@ SCCPMessage subclass: SCCPConnectionRequest [
|
|||
]
|
||||
|
||||
data: aData [
|
||||
<category: 'accessing'>
|
||||
pnc at: SCCPHelper pncData put: aData.
|
||||
]
|
||||
|
||||
src: aSrc dest: aDest pnc: aPnc [
|
||||
<category: 'accessing'>
|
||||
src := aSrc.
|
||||
dst := aDest.
|
||||
pnc := aPnc.
|
||||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'conversion'>
|
||||
<category: 'encoding'>
|
||||
| dat len addr |
|
||||
|
||||
addr := dst asByteArray.
|
||||
|
@ -648,7 +694,7 @@ SCCPMessage subclass: SCCPConnectionConfirm [
|
|||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'conversion'>
|
||||
<category: 'encoding'>
|
||||
|
||||
aMsg putByte: SCCPHelper msgCc.
|
||||
SCCPAddrReference store: dst on: aMsg.
|
||||
|
@ -659,13 +705,25 @@ SCCPMessage subclass: SCCPConnectionConfirm [
|
|||
]
|
||||
|
||||
src: aSrc dst: aDst [
|
||||
<category: 'accessing'>
|
||||
src := aSrc.
|
||||
dst := aDst.
|
||||
]
|
||||
|
||||
src [ ^ src ]
|
||||
dst [ ^ dst ]
|
||||
pnc [ ^ pnc ifNil: [ pnc := SCCPPNC new. ] ]
|
||||
src [
|
||||
<category: 'accessing'>
|
||||
^ src
|
||||
]
|
||||
|
||||
dst [
|
||||
<category: 'accessing'>
|
||||
^ dst
|
||||
]
|
||||
|
||||
pnc [
|
||||
<category: 'accessing'>
|
||||
^ pnc ifNil: [ pnc := SCCPPNC new. ]
|
||||
]
|
||||
]
|
||||
|
||||
SCCPMessage subclass: SCCPConnectionData [
|
||||
|
@ -716,16 +774,18 @@ SCCPMessage subclass: SCCPConnectionData [
|
|||
]
|
||||
|
||||
dst [
|
||||
<category: 'accessing'>
|
||||
^ dst
|
||||
]
|
||||
|
||||
data [
|
||||
<category: 'accessing'>
|
||||
^ data
|
||||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
| dat |
|
||||
<category: 'conversion'>
|
||||
<category: 'encoding'>
|
||||
|
||||
aMsg putByte: self class msgType.
|
||||
SCCPAddrReference store: dst on: aMsg.
|
||||
|
@ -769,19 +829,44 @@ SCCPMessage subclass: SCCPConnectionReleased [
|
|||
^ SCCPConnectionReleased initWithDst: dst src: src cause: cause.
|
||||
]
|
||||
|
||||
dst [ ^ dst ]
|
||||
src [ ^ src ]
|
||||
cause [ ^ cause ]
|
||||
dst: aDst [ dst := aDst ]
|
||||
src: aSrc [ src := aSrc ]
|
||||
cause: aCause [ cause := aCause ]
|
||||
dst [
|
||||
<category: 'accessing'>
|
||||
^ dst
|
||||
]
|
||||
|
||||
src [
|
||||
<category: 'accessing'>
|
||||
^ src
|
||||
]
|
||||
|
||||
cause [
|
||||
<category: 'accessing'>
|
||||
^ cause
|
||||
]
|
||||
|
||||
dst: aDst [
|
||||
<category: 'accessing'>
|
||||
dst := aDst
|
||||
]
|
||||
|
||||
src: aSrc [
|
||||
<category: 'accessing'>
|
||||
src := aSrc
|
||||
]
|
||||
|
||||
cause: aCause [
|
||||
<category: 'accessing'>
|
||||
cause := aCause
|
||||
]
|
||||
|
||||
pnc [
|
||||
<category: 'accessing'>
|
||||
^ pnc ifNil: [pnc := SCCPPNC new]
|
||||
]
|
||||
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'encoding'>
|
||||
aMsg putByte: self class msgType.
|
||||
SCCPAddrReference store: dst on: aMsg.
|
||||
SCCPAddrReference store: src on: aMsg.
|
||||
|
@ -814,12 +899,28 @@ SCCPMessage subclass: SCCPConnectionReleaseComplete [
|
|||
yourself
|
||||
]
|
||||
|
||||
dst [ ^ dst ]
|
||||
dst: aDst [ dst := aDst. ]
|
||||
src [ ^ src ]
|
||||
src: aSrc [ src := aSrc. ]
|
||||
dst [
|
||||
<category: 'accessing'>
|
||||
^ dst
|
||||
]
|
||||
|
||||
dst: aDst [
|
||||
<category: 'accessing'>
|
||||
dst := aDst.
|
||||
]
|
||||
|
||||
src [
|
||||
<category: 'accessing'>
|
||||
^ src
|
||||
]
|
||||
|
||||
src: aSrc [
|
||||
<category: 'accessing'>
|
||||
src := aSrc.
|
||||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'encoding'>
|
||||
aMsg putByte: self class msgType.
|
||||
SCCPAddrReference store: dst on: aMsg.
|
||||
SCCPAddrReference store: src on: aMsg.
|
||||
|
@ -866,47 +967,58 @@ SCCPMessage subclass: SCCPUDT [
|
|||
]
|
||||
|
||||
calledAddr: aCalled [
|
||||
<category: 'accessing'>
|
||||
called := aCalled
|
||||
]
|
||||
|
||||
calledAddr [
|
||||
<category: 'accessing'>
|
||||
^ called
|
||||
]
|
||||
|
||||
callingAddr: aCalling [
|
||||
<category: 'accessing'>
|
||||
calling := aCalling
|
||||
]
|
||||
|
||||
callingAddr [
|
||||
<category: 'accessing'>
|
||||
^ calling
|
||||
]
|
||||
|
||||
data [
|
||||
<category: 'accessing'>
|
||||
^ data
|
||||
]
|
||||
|
||||
data: aData [
|
||||
<category: 'accessing'>
|
||||
data := aData.
|
||||
]
|
||||
|
||||
errorHandling: aStrategy [
|
||||
<category: 'accessing'>
|
||||
error := aStrategy.
|
||||
]
|
||||
|
||||
errorHandling [
|
||||
<category: 'accessing'>
|
||||
^ error ifNil: [0]
|
||||
]
|
||||
|
||||
udtClass: aClass [
|
||||
<category: 'accessing'>
|
||||
udtClass := aClass.
|
||||
]
|
||||
|
||||
udtClass [
|
||||
<category: 'accessing'>
|
||||
^ udtClass ifNil: [0]
|
||||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
| calledData callingData dat |
|
||||
<category: 'encoding'>
|
||||
calledData := called asByteArray.
|
||||
callingData := calling asByteArray.
|
||||
|
||||
|
@ -1011,6 +1123,7 @@ SCCPMessage subclass: SCCPInactivityTest [
|
|||
]
|
||||
|
||||
writeOn: aMsg [
|
||||
<category: 'encoding'>
|
||||
aMsg putByte: self class msgType.
|
||||
SCCPAddrReference store: dst on: aMsg.
|
||||
SCCPAddrReference store: src on: aMsg.
|
||||
|
|
Reference in New Issue