1
0
Fork 0

isup: Begin to align the MessageStructure and the TLV description

Change #structure to #tlvDescription. The descriptions now need
to be changed.
This commit is contained in:
Holger Hans Peter Freyther 2012-12-11 11:48:13 +01:00
parent 17ee24015f
commit 5fa3bb680f
4 changed files with 76 additions and 76 deletions

View File

@ -33,7 +33,7 @@ TestCase subclass: ISUPGeneratedTest [
testGeneration [
ISUPMessage allSubclassesDo: [:class |
| struct |
struct := class structure.
struct := class tlvDescription.
struct fixed do: [:each |
self playWith: each].
struct variable do: [:each |

View File

@ -42,37 +42,37 @@ Object subclass: MSGStructure [
instVarNamed: #type put: aType; yourself
]
MSGStructure class >> findStructure: aType [
MSGStructure class >> findTLVDescription: aType [
<category: 'creation'>
self allSubclassesDo: [:each | | struct |
struct := each structure.
struct := each tlvDescription.
struct type = aType ifTrue: [
^ struct
]
].
^ self error: 'Can not find structure for type: %1' % {aType.}
^ self error: 'Can not find TLV Description for type: %1' % {aType.}
]
MSGStructure class >> decodeByteStream: aStream type: aType [
| structure |
| description |
<category: 'parsing'>
"This is a generic decoding method that works by finding the
message structure and then following the structure and will
return an OrderedCollection with tuples."
structure := self findStructure: aType.
^ structure decodeByteStream: aStream.
description := self findTLVDescription: aType.
^ description decodeByteStream: aStream.
]
MSGStructure class >> encodeCollection: aCollection type: aType [
| structure |
| description |
<category: 'encoding'>
"This is a generic encoding method that will put the collection
onto a MessageBuffer class."
structure := self findStructure: aType.
^ structure encodeCollection: aCollection.
description := self findTLVDescription: aType.
^ description encodeCollection: aCollection.
]
type: aType [
@ -306,7 +306,7 @@ Object subclass: MSGStructure [
stream := aCollection readStream.
aState := self createState.
"Try to match the fields of the structure with the fields of
"Try to match the fields of the TLV description with the fields of
the collection. We keep some local state to check if we are
passed the fixed and variable fields."

View File

@ -237,7 +237,7 @@ ISUPMessage subclass: ISUP%1 [
<category: ''OsmoNetwork-ISUP''>
<comment: ''I am auto-generated ISUP message.''>
ISUP%1 class >> structure [
ISUP%1 class >> tlvDescription [
<category: ''field''>
^ (self initWith: ISUPConstants msg%1)' % {structName. }.
^ true
@ -281,9 +281,9 @@ ISUP%1 subclass: ISUP%2 [
<category: ''OsmoNetwork-ISUP''>
<comment: ''I am an auto generated ISUP message.''>
ISUP%2 class >> structure [
ISUP%2 class >> tlvDescription [
<category: ''field''>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msg%2; yourself
]
]' % {baseName. className}.

View File

@ -1080,7 +1080,7 @@ ISUPMessage subclass: ISUPACM [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPACM class >> structure [
ISUPACM class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgACM)
addFixed: ISUPBackwardCallIndicators;
@ -1118,7 +1118,7 @@ ISUPMessage subclass: ISUPAMN [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPAMN class >> structure [
ISUPAMN class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgAMN)
addOptional: ISUPBackwardCallIndicators;
@ -1156,7 +1156,7 @@ ISUPMessage subclass: ISUPAPT [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPAPT class >> structure [
ISUPAPT class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgAPT)
addOptional: ISUPMessageCompatibilityInformation;
@ -1172,7 +1172,7 @@ ISUPMessage subclass: ISUPBLO [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPBLO class >> structure [
ISUPBLO class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgBLO)
yourself.
@ -1184,7 +1184,7 @@ ISUPMessage subclass: ISUPCFN [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCFN class >> structure [
ISUPCFN class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCFN)
addVariable: ISUPCauseIndicators;
@ -1198,7 +1198,7 @@ ISUPMessage subclass: ISUPCGB [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCGB class >> structure [
ISUPCGB class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCGB)
addFixed: ISUPCircuitGroupSupervisionMessageType;
@ -1212,7 +1212,7 @@ ISUPMessage subclass: ISUPCON [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCON class >> structure [
ISUPCON class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCON)
addFixed: ISUPBackwardCallIndicators;
@ -1249,7 +1249,7 @@ ISUPMessage subclass: ISUPCOT [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCOT class >> structure [
ISUPCOT class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCOT)
addFixed: ISUPContinuityIndicators;
@ -1262,7 +1262,7 @@ ISUPMessage subclass: ISUPCPG [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCPG class >> structure [
ISUPCPG class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCPG)
addFixed: ISUPEventInformation;
@ -1305,7 +1305,7 @@ ISUPMessage subclass: ISUPCQR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPCQR class >> structure [
ISUPCQR class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgCQR)
addVariable: ISUPRange;
@ -1319,7 +1319,7 @@ ISUPMessage subclass: ISUPFAA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPFAA class >> structure [
ISUPFAA class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgFAA)
addFixed: ISUPFacilityIndicator;
@ -1337,7 +1337,7 @@ ISUPMessage subclass: ISUPFAC [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPFAC class >> structure [
ISUPFAC class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgFAC)
addOptional: ISUPMessageCompatibilityInformation;
@ -1363,7 +1363,7 @@ ISUPMessage subclass: ISUPFOT [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPFOT class >> structure [
ISUPFOT class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgFOT)
addOptional: ISUPCallReference;
@ -1377,7 +1377,7 @@ ISUPMessage subclass: ISUPFRJ [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPFRJ class >> structure [
ISUPFRJ class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgFRJ)
addFixed: ISUPFacilityIndicator;
@ -1393,7 +1393,7 @@ ISUPMessage subclass: ISUPGRA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPGRA class >> structure [
ISUPGRA class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgGRA)
addVariable: ISUPRangeAndStatus;
@ -1406,7 +1406,7 @@ ISUPMessage subclass: ISUPGRS [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPGRS class >> structure [
ISUPGRS class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgGRS)
addVariable: ISUPRange;
@ -1419,7 +1419,7 @@ ISUPMessage subclass: ISUPIAM [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPIAM class >> structure [
ISUPIAM class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgIAM)
addFixed: ISUPNatureOfConnectionIndicators;
@ -1493,7 +1493,7 @@ ISUPMessage subclass: ISUPIDR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPIDR class >> structure [
ISUPIDR class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgIDR)
addOptional: ISUPMCIDRequestIndicators;
@ -1509,7 +1509,7 @@ ISUPMessage subclass: ISUPIDS [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPIDS class >> structure [
ISUPIDS class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgIDS)
addOptional: ISUPMCIDResponseIndicators;
@ -1529,7 +1529,7 @@ ISUPMessage subclass: ISUPINF [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPINF class >> structure [
ISUPINF class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgINF)
addFixed: ISUPInformationIndicators;
@ -1549,7 +1549,7 @@ ISUPMessage subclass: ISUPINR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPINR class >> structure [
ISUPINR class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgINR)
addFixed: ISUPInformationRequestIndicators;
@ -1566,7 +1566,7 @@ ISUPMessage subclass: ISUPLPR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPLPR class >> structure [
ISUPLPR class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgLPR)
addOptional: ISUPMessageCompatibilityInformation;
@ -1583,7 +1583,7 @@ ISUPMessage subclass: ISUPNRM [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPNRM class >> structure [
ISUPNRM class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgNRM)
addOptional: ISUPMessageCompatibilityInformation;
@ -1599,7 +1599,7 @@ ISUPMessage subclass: ISUPPRI [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPPRI class >> structure [
ISUPPRI class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgPRI)
addOptional: ISUPMessageCompatibilityInformation;
@ -1617,7 +1617,7 @@ ISUPMessage subclass: ISUPREL [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPREL class >> structure [
ISUPREL class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgREL)
addVariable: ISUPCauseIndicators;
@ -1646,7 +1646,7 @@ ISUPMessage subclass: ISUPRES [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPRES class >> structure [
ISUPRES class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgRES)
addFixed: ISUPSuspendResumeIndicators;
@ -1661,7 +1661,7 @@ ISUPMessage subclass: ISUPRLC [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPRLC class >> structure [
ISUPRLC class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgRLC)
addOptional: ISUPCauseIndicators;
@ -1675,7 +1675,7 @@ ISUPMessage subclass: ISUPSAM [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPSAM class >> structure [
ISUPSAM class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgSAM)
addVariable: ISUPSubsequentNumber;
@ -1689,7 +1689,7 @@ ISUPMessage subclass: ISUPSAN [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPSAN class >> structure [
ISUPSAN class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgSAN)
addOptional: ISUPSubsequentNumber;
@ -1704,7 +1704,7 @@ ISUPMessage subclass: ISUPSEG [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPSEG class >> structure [
ISUPSEG class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgSEG)
addOptional: ISUPAccessTransport;
@ -1723,7 +1723,7 @@ ISUPMessage subclass: ISUPUPT [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPUPT class >> structure [
ISUPUPT class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgUPT)
addOptional: ISUPParameterCompatibilityInformation;
@ -1737,7 +1737,7 @@ ISUPMessage subclass: ISUPUSR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am auto-generated ISUP message.'>
ISUPUSR class >> structure [
ISUPUSR class >> tlvDescription [
<category: 'field'>
^ (self initWith: ISUPConstants msgUSR)
addVariable: ISUPUserToUserInformation;
@ -1752,9 +1752,9 @@ ISUPBLO subclass: ISUPBLA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPBLA class >> structure [
ISUPBLA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgBLA; yourself
]
]
@ -1764,9 +1764,9 @@ ISUPBLO subclass: ISUPCCR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPCCR class >> structure [
ISUPCCR class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgCCR; yourself
]
]
@ -1776,9 +1776,9 @@ ISUPCGB subclass: ISUPCGBA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPCGBA class >> structure [
ISUPCGBA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgCGBA; yourself
]
]
@ -1788,9 +1788,9 @@ ISUPCGB subclass: ISUPCGUA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPCGUA class >> structure [
ISUPCGUA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgCGUA; yourself
]
]
@ -1800,9 +1800,9 @@ ISUPCGB subclass: ISUPCGU [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPCGU class >> structure [
ISUPCGU class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgCGU; yourself
]
]
@ -1812,9 +1812,9 @@ ISUPFAA subclass: ISUPFAR [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPFAR class >> structure [
ISUPFAR class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgFAR; yourself
]
]
@ -1824,9 +1824,9 @@ ISUPGRS subclass: ISUPGRA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPGRA class >> structure [
ISUPGRA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgGRA; yourself
]
]
@ -1836,9 +1836,9 @@ ISUPBLO subclass: ISUPLPA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPLPA class >> structure [
ISUPLPA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgLPA; yourself
]
]
@ -1848,9 +1848,9 @@ ISUPBLO subclass: ISUPOLM [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPOLM class >> structure [
ISUPOLM class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgOLM; yourself
]
]
@ -1860,9 +1860,9 @@ ISUPBLO subclass: ISUPRSC [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPRSC class >> structure [
ISUPRSC class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgRSC; yourself
]
]
@ -1872,9 +1872,9 @@ ISUPRES subclass: ISUPSUS [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPSUS class >> structure [
ISUPSUS class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgSUS; yourself
]
]
@ -1884,9 +1884,9 @@ ISUPBLO subclass: ISUPUBA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPUBA class >> structure [
ISUPUBA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgUBA; yourself
]
]
@ -1896,9 +1896,9 @@ ISUPBLO subclass: ISUPUBL [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPUBL class >> structure [
ISUPUBL class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgUBL; yourself
]
]
@ -1908,9 +1908,9 @@ ISUPBLO subclass: ISUPUCIC [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPUCIC class >> structure [
ISUPUCIC class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgUCIC; yourself
]
]
@ -1920,9 +1920,9 @@ ISUPUPT subclass: ISUPUPA [
<category: 'OsmoNetwork-ISUP'>
<comment: 'I am an auto generated ISUP message.'>
ISUPUPA class >> structure [
ISUPUPA class >> tlvDescription [
<category: 'field'>
^ (super structure)
^ (super tlvDescription)
type: ISUPConstants msgUPA; yourself
]
]