2010-11-17 15:56:10 +00:00
|
|
|
"Messages for GSM04.08"
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
"""
|
|
|
|
IEs for GSM48MSG
|
|
|
|
"""
|
|
|
|
Object subclass: GSM48KeySeqLuType [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
| val |
|
2010-11-17 15:56:10 +00:00
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
GSM48KeySeqLuType class >> createDefault [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 15:56:10 +00:00
|
|
|
^ (self new)
|
2010-11-17 20:19:42 +00:00
|
|
|
val: 16r70;
|
2010-11-17 15:56:10 +00:00
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
val: aVal [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 20:19:42 +00:00
|
|
|
val := aVal.
|
|
|
|
]
|
|
|
|
|
|
|
|
storeOnDirect: aMsg [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 20:19:42 +00:00
|
|
|
aMsg putByte: val.
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
Object subclass: GSM48Lai [
|
|
|
|
| mcc mnc lac |
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
GSM48Lai class >> createDefault [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 15:56:10 +00:00
|
|
|
^ (self new)
|
2010-11-17 20:19:42 +00:00
|
|
|
mcc: 0;
|
|
|
|
mnc: 0;
|
|
|
|
lac: 0;
|
2010-11-17 15:56:10 +00:00
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
2010-11-19 08:02:26 +00:00
|
|
|
mcc: aMcc [ <category: 'creation'> mcc := aMcc ]
|
|
|
|
mnc: aMnc [ <category: 'creation'> mnc := aMnc ]
|
|
|
|
lac: aLac [ <category: 'creation'> lac := aLac ]
|
2010-11-17 20:19:42 +00:00
|
|
|
|
|
|
|
storeOnDirect: aMsg [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 21:43:43 +00:00
|
|
|
aMsg putByteArray: (LAI generateLAI: mcc mnc: mnc).
|
|
|
|
aMsg putLen16: lac.
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
Object subclass: GSM48Classmark1 [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
| cm1 |
|
|
|
|
|
|
|
|
GSM48Classmark1 class >> createDefault [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 20:19:42 +00:00
|
|
|
^ (self new)
|
|
|
|
cm1: 16r33;
|
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
2010-11-19 08:02:26 +00:00
|
|
|
cm1: aCm [ <category: 'creation'> cm1 := aCm ]
|
2010-11-17 20:19:42 +00:00
|
|
|
storeOnDirect: aMsg [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 20:19:42 +00:00
|
|
|
aMsg putByte: cm1.
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
Object subclass: GSM48MIdentity [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
| imsi tmsi |
|
2010-11-19 19:26:59 +00:00
|
|
|
|
|
|
|
GSM48MIdentity class >> miIMSI [ <category: 'spec'> ^ 16r1 ]
|
|
|
|
GSM48MIdentity class >> miIMEI [ <category: 'spec'> ^ 16r2 ]
|
|
|
|
GSM48MIdentity class >> miIMEISV [ <category: 'spec'> ^ 16r3 ]
|
|
|
|
GSM48MIdentity class >> miTMSI [ <category: 'sepc'> ^ 16r4 ]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
GSM48MIdentity class >> createDefault [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-17 20:19:42 +00:00
|
|
|
^ (self new)
|
|
|
|
imsi: '000000000000';
|
|
|
|
yourself
|
|
|
|
]
|
|
|
|
|
2010-11-19 08:02:26 +00:00
|
|
|
imsi: aImsi [ <category: 'creation'> imsi := aImsi. ]
|
2010-11-17 20:19:42 +00:00
|
|
|
storeOnDirect: aMsg [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'creation'>
|
2010-11-18 14:31:25 +00:00
|
|
|
imsi ifNotNil: [
|
|
|
|
^ self storeImsiDirect: aMsg.
|
|
|
|
].
|
2010-11-17 21:39:28 +00:00
|
|
|
self notYetImplemented
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
2010-11-18 14:31:25 +00:00
|
|
|
|
|
|
|
storeImsiDirect: aMsg [
|
2010-11-19 19:26:59 +00:00
|
|
|
| odd len head encoded bcds |
|
2010-11-19 18:10:38 +00:00
|
|
|
<category: 'private'>
|
2010-11-19 19:26:59 +00:00
|
|
|
|
|
|
|
odd := imsi size odd.
|
|
|
|
|
|
|
|
"Calculate the length. We can fit two digits into one byte"
|
|
|
|
len := odd
|
|
|
|
ifTrue: [ (imsi size + 1) / 2 ]
|
|
|
|
ifFalse: [ (imsi size / 2) + 1 ].
|
|
|
|
aMsg putByte: len.
|
|
|
|
|
|
|
|
"Create the first data"
|
|
|
|
head := ((imsi at: 1) digitValue) bitShift: 4.
|
|
|
|
odd ifTrue: [
|
|
|
|
head := head bitOr: (1 bitShift: 3).
|
|
|
|
].
|
|
|
|
head := head bitOr: self class miIMSI.
|
|
|
|
aMsg putByte: head.
|
|
|
|
|
|
|
|
"Encode everything from 2..n into a ByteArray of len - 1"
|
|
|
|
bcds := OrderedCollection new.
|
|
|
|
2 to: imsi size do: [:pos |
|
|
|
|
bcds add: (imsi at: pos) digitValue.
|
|
|
|
].
|
|
|
|
|
|
|
|
odd ifFalse: [
|
|
|
|
bcds add: 16r0F.
|
|
|
|
].
|
|
|
|
|
|
|
|
"now fold the bcds into and encoded array"
|
|
|
|
|
|
|
|
encoded := OrderedCollection new.
|
|
|
|
1 to: bcds size by: 2 do: [:pos |
|
|
|
|
| lower upper |
|
|
|
|
lower := bcds at: pos.
|
|
|
|
upper := bcds at: pos + 1.
|
|
|
|
|
|
|
|
encoded add: ((upper bitShift: 4) bitOr: lower).
|
|
|
|
].
|
|
|
|
|
|
|
|
aMsg putByteArray: encoded asByteArray.
|
2010-11-18 14:31:25 +00:00
|
|
|
]
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
|
|
|
|
IEMessage subclass: GSM48MSG [
|
2010-11-19 18:11:55 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
<comment: 'GSM48 has helper code for mandantory types'>
|
|
|
|
|
2010-11-19 18:11:24 +00:00
|
|
|
GSM48MSG class >> addMandantory: aName with: aClass [
|
|
|
|
<comment: 'creation'>
|
|
|
|
self addInstVarName: aName asSymbol.
|
|
|
|
self compile: '%1 [ ^ %1 ifNil: [%1 := %2 createDefault.]]' % {aName. aClass}.
|
|
|
|
self Mandantory add: aName asSymbol.
|
2010-11-17 20:19:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
storeOn: aMsg [
|
|
|
|
"Write the header. Skip Ind, Sequence are hardcoded"
|
|
|
|
aMsg putByte: self class classType.
|
|
|
|
aMsg putByte: self class messageType.
|
|
|
|
|
|
|
|
"Write all Mandantory parts"
|
2010-11-19 19:26:59 +00:00
|
|
|
self class Mandantory do: [:each | | tmp |
|
2010-11-18 14:31:25 +00:00
|
|
|
tmp := self perform: each.
|
2010-11-19 18:11:24 +00:00
|
|
|
tmp storeOnDirect: aMsg.
|
|
|
|
].
|
2010-11-17 20:19:42 +00:00
|
|
|
|
|
|
|
"TODO: Handle the Conditionals too"
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
|
|
|
]
|
|
|
|
|
2010-11-17 20:19:42 +00:00
|
|
|
GSM48MSG subclass: GSM48MMMessage [
|
2010-11-19 08:02:26 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
<comment: 'Baseclass for mobility managamenet'>
|
|
|
|
|
|
|
|
GSM48MMMessage class >> classType [ ^ 5 ]
|
|
|
|
GSM48MMMessage class >> msgLU [ ^ 8 ]
|
|
|
|
]
|
|
|
|
|
2010-11-18 14:31:25 +00:00
|
|
|
GSM48MMMessage subclass: LocationUpdatingRequest [
|
2010-11-19 18:11:24 +00:00
|
|
|
<category: 'osmo-message'>
|
|
|
|
Mandantory := nil.
|
2010-11-17 20:19:42 +00:00
|
|
|
|
|
|
|
LocationUpdatingRequest class >> messageType [ ^ self msgLU ]
|
2010-11-19 18:11:24 +00:00
|
|
|
|
|
|
|
LocationUpdatingRequest class >> Mandantory [
|
|
|
|
^ Mandantory ifNil: [ Mandantory := OrderedCollection new ].
|
|
|
|
]
|
|
|
|
|
|
|
|
LocationUpdatingRequest class >> initialize [
|
|
|
|
self addMandantory: 'luType' with: GSM48KeySeqLuType.
|
|
|
|
self addMandantory: 'lai' with: GSM48Lai.
|
|
|
|
self addMandantory: 'cm1' with: GSM48Classmark1.
|
|
|
|
self addMandantory: 'mi' with: GSM48MIdentity.
|
|
|
|
]
|
2010-11-17 20:19:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Object subclass: LocationUpdatingAccept [
|
2010-11-19 18:11:55 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Object subclass: LocationUpdatingReject [
|
2010-11-19 18:11:55 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
Object subclass: IdentityRequest [
|
2010-11-19 18:11:55 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 20:19:42 +00:00
|
|
|
]
|
|
|
|
|
2010-11-17 15:56:10 +00:00
|
|
|
Object subclass: IdentityResponse [
|
2010-11-19 18:11:55 +00:00
|
|
|
<category: 'osmo-message'>
|
2010-11-17 15:56:10 +00:00
|
|
|
]
|
2010-11-19 18:11:24 +00:00
|
|
|
|
|
|
|
Eval [
|
|
|
|
LocationUpdatingRequest initialize.
|
|
|
|
]
|