Chapter 17. Creating ASN.1 Dissectors

Table of Contents

17.1. About ASN.1
17.2. ASN.1 Dissector Requirements
17.2.1. Building An ASN.1-Based Plugin
17.3. Understanding Error Messages
17.4. Hand-Massaging The ASN.1 File
17.5. Command Line Syntax
17.6. Generated Files
17.7. Step By Step Instructions
17.8. Hints For Using Asn2wrs
17.8.1. ANY And Parameterized Types
17.8.2. Tagged Assignments
17.8.3. Untagged CHOICEs
17.8.4. Imported Module Name Conflicts
17.9. Simple ASN.1-Based Dissector
17.10. Conformance (.cnf) Files
17.10.1. Example .cnf File
17.10.2. Example packet-protocol-template.h File
17.10.3. Example packet-protocol-template.c File
17.11. Conformance File Directive Reference
17.11.1. #.END
17.11.2. #.EXPORTS
17.11.3. #.FN_BODY
17.11.4. #.MODULE_IMPORT, #.INCLUDE and #.IMPORT
17.11.5. #.MODULE_IMPORT
17.11.6. #.INCLUDE and #.IMPORT
17.11.7. #.NO_EMIT And #.USER_DEFINED
17.11.8. #.PDU and #.PDU_NEW
17.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:

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