TAP Labs

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).

buildGrammar.sh

Sample output;

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.

getTagId.sh

Sample output;

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.

getRecordDefinition.sh


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…

getRecordDefinitions.sh

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.

Advertisements

About magvar

Technical guy, worked with computers since I was twelve, complete nerd, but managed to get married and am now the happy father of three kids.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s