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
Raw Normal View History

2010-11-14 21:43:29 +00:00
PackageLoader fileInPackage: 'OsmoNetwork'.
Object subclass: SCCPConnection [
| src dst |
srcRef [
^ src
]
srcRef: aRef [
src := aRef
]
dstRef: aRef [
dst := aRef
]
]
2010-11-14 21:43:29 +00:00
Object subclass: SCCPHadler [
| connections last_ref |
2010-11-14 21:43:29 +00:00
<comment: 'I handle SCCP messages'>
registerOn: aDispatcher [
aDispatcher addHandler: Osmo.IPAConstants protocolSCCP
on: self with: #handleMsg:.
2010-11-14 21:43:29 +00:00
]
handleMsg: aMsg [
2010-11-14 21:43:29 +00:00
'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. ]
]
2010-11-14 21:43:29 +00:00
]