Chapter 15. Creating ASN.1 Dissectors

Table of Contents

15.1. About ASN.1
15.2. ASN.1 Dissector Requirements
15.2.1. Building An ASN.1-Based Plugin
15.3. Understanding Error Messages
15.4. Hand-Massaging The ASN.1 File
15.5. Command Line Syntax
15.6. Generated Files
15.7. Step By Step Instructions
15.8. Hints For Using Asn2wrs
15.8.1. ANY And Parameterized Types
15.8.2. Tagged Assignments
15.8.3. Untagged CHOICEs
15.8.4. Imported Module Name Conflicts
15.9. Simple ASN.1-Based Dissector
15.10. Conformance (.cnf) Files
15.10.1. Example .cnf File
15.10.2. Example packet-protocol-template.h File
15.10.3. Example packet-protocol-template.c File
15.11. Conformance File Directive Reference
15.11.1. #.END
15.11.2. #.EXPORTS
15.11.3. #.FN_BODY
15.11.4. #.MODULE_IMPORT, #.INCLUDE and #.IMPORT
15.11.5. #.MODULE_IMPORT
15.11.6. #.INCLUDE and #.IMPORT
15.11.7. #.NO_EMIT And #.USER_DEFINED
15.11.8. #.PDU and #.PDU_NEW
15.11.9. #.REGISTER and #.REGISTER_NEW

The asn2wrs compiler can be used to create a dissector from an ASN.1 specification of a protocol. It is a work in progress but has been used to create a number of dissectors.

It supports:

It has inbuilt support for:

15.1. About ASN.1

The most useful first step in writing an ASN.1-based dissector is to learn about ASN.1. There are a number of free resources available to help with this. One collection of such resources is maintained on the ASN.1 Consortium’s web site.