This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

asn2wrs: how to handle import definitions with the same definition name? Use tags?

0

Hi, I am trying to create a ASN.1 dissector using asn2wrs. To do so, I need a asn file. The asn protocol requires IMPORTS of definitions from several other asn files. Unfortunately the naming of some definitions is identical. Resulting in a 'Duplicate type' error

This problem could be circumvented using tags. eg. filename1.parameters filename2.parameters

Has anyone an idea how to deal with this? Can I rename parameters from filename1 to let's say 'parameters1' using the .cnf file? There is something like #.FIELD RENAME and #.TYPE RENAME

By the way, any additional documentation (next to http://wiki.wireshark.org/Asn2wrsAuxiliary) on how to modify cnf files is welcome :-)

asked 11 Jul '12, 05:13

Michel's gravatar image

Michel
1222
accept rate: 0%

That sounds weird - using the same name for different definitions? Perhaps you need to break it up into more than one dissector? You may need to comment out duplicated IMPORTS when using multiple ASN1 files however. Is this for a standard protcol for which you will offer the dissector back to Wireshark? If so you could open up an enhancement bug report in bugzilla and get help there.

(11 Jul '12, 06:04) Anders ♦

Weird? Its the new ETSI standard! :-) Anyway, the use of imports did not help me in the end, because when including the packet that was created by asn2wrs in the Wireshark build I end up with Undeclared Identifier errors. I fixed this by copying and paste all asn protocols into a single asn file, while renaming duplicate definitions. FYI: I need to build Wireshark because I am working on a reader and a packet encapsulation.

(12 Jul '12, 05:19) Michel