Did a few little scripts to deal with TAP (and ASN.1 in general) definitions.
First, here’s a little something to get the tags and their types from a definitions file (tested with CISCO GGSN and TAP 3.11 spec files).
AbsoluteAmount, INTEGER ,
AccessPointNameNI, AsciiString ,
AccessPointNameOI, AsciiString ,
AccountingInfo, SEQUENCE ,
ActualDeliveryTimeStamp, DateTime ,
AddressStringDigits, BCDString ,
Now, to use this grammar for something, we need to get the tag numbers out of the files as well.
TotalAdvisedCharge, AbsoluteAmount , 356
TotalAdvisedChargeRefund, AbsoluteAmount , 357
TotalAdvisedChargeValueList, SEQUENCE OF TotalAdvisedChargeValue , 361
TotalAdvisedChargeValue, SEQUENCE , 360
To get the definition of a single record, we need to extract the definition from the spec file.
TrackedCustomerInformation ::= [APPLICATION 367] SEQUENCE
trackedCustomerIdList TrackedCustomerIdList OPTIONAL,
trackedCustomerHomeIdList TrackedCustomerHomeIdList OPTIONAL,
trackedCustomerLocList TrackedCustomerLocList OPTIONAL,
trackedCustomerEquipment TrackedCustomerEquipment OPTIONAL,
To get the definition of every tag, use this little handy repeater script…
One of the things I’m working on right now is to get a script running, preferably in Python, that will generate Java classes out of all this. The bash script I’ve got doing it right now isn’t that complex, and the results are kind of pleasing, but there’s still a need for some handcoding. With the 300 classes generated by the TAP spec, that must be avoided. Worked nicely for the CISCO GGSN records, though.