Chapter 16. Creating ASN.1 Dissectors

Table of Contents

16.1. About ASN.1
16.2. ASN.1 Dissector Requirements
16.2.1. Building An ASN.1-Based Plugin
16.3. Understanding Error Messages
16.4. Hand-Massaging The ASN.1 File
16.5. Command Line Syntax
16.6. Generated Files
16.7. Step By Step Instructions
16.8. Hints For Using Asn2wrs
16.8.1. ANY And Parameterized Types
16.8.2. Tagged Assignments
16.8.3. Untagged CHOICEs
16.8.4. Imported Module Name Conflicts
16.9. Simple ASN.1-Based Dissector
16.10. Conformance (.cnf) Files
16.10.1. Example .cnf File
16.10.2. Example packet-protocol-template.h File
16.10.3. Example packet-protocol-template.c File
16.11. Conformance File Directive Reference
16.11.1. #.END
16.11.2. #.EXPORTS
16.11.3. #.FN_BODY
16.11.4. #.MODULE_IMPORT, #.INCLUDE and #.IMPORT
16.11.5. #.MODULE_IMPORT
16.11.6. #.INCLUDE and #.IMPORT
16.11.7. #.NO_EMIT And #.USER_DEFINED
16.11.8. #.PDU and #.PDU_NEW
16.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:

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