smalltalk
/
osmo-st-gsm
Archived
1
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
osmo-st-gsm/SCCPHandler.st

52 lines
996 B
Smalltalk

PackageLoader fileInPackage: 'OsmoNetwork'.
Object subclass: SCCPConnection [
| src dst |
srcRef [
^ src
]
srcRef: aRef [
src := aRef
]
dstRef: aRef [
dst := aRef
]
]
Object subclass: SCCPHadler [
| connections last_ref |
<comment: 'I handle SCCP messages'>
registerOn: aDispatcher [
aDispatcher addHandler: Osmo.IPAConstants protocolSCCP
on: self with: #handleMsg:.
]
handleMsg: aMsg [
'Got a new SCCP message' printNl.
]
createConnection: aData [
| con res|
con := SCCPConnection new.
con srcRef: self assignSrcRef.
res := Osmo.SCCPConnectionRequest
initWith: (con srcRef) dest: (Osmo.SCCPAddress createWith: 254) data: aData.
self connections add: res.
^ res
]
assignSrcRef [
^ 666
]
connections [
^ connections ifNil: [ connections := OrderedCollection new. ]
]
]