Differences between revisions 6 and 7
Revision 6 as of 2008-04-12 17:50:43
Size: 2969
Editor: localhost
Comment: converted to 1.6 markup
Revision 7 as of 2020-04-05 17:59:52
Size: 298
Editor: GeraldCombs
Comment: Point readers to the Developer's Guide.
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
This directive in the [[Asn2wrs]] conformation file can be used to register a dissector for an object to an OID.<<BR>>
This is very useful for X.509 and similar protocols where structures and objects are frequently associated with an OID. In particular, some of the structures here encode an OID in a field and then the content in a different field
later, and how that field is to be dissected depends on the previously seen OID.<<BR>>
One such example can be seen in the ASN.1 description for X.509/Authentication``Framework which has a structure defined such as<<BR>>
`AlgorithmIdentifier ::= SEQUENCE {`<<BR>>
` algorithm ALGORITHM.&id({SupportedAlgorithms}),`<<BR>>
` parameters ALGORITHM.&Type({SupportedAlgorithms}{@algorithm}) OPTIONAL`<<BR>>
Which means that the parameters field in this structure, what this field contains and how it is to be dissected depends entirely upon what OID is stored inside algorithm.<<BR>>
A whole bunch of protocols use similar types of constructs. While dissection of this particular structure itself currently has to be hand implemented inside the template (see x509af for examples of how this very structure is handled there).
the #.REGISTER option in the conformance file will at least make it easy and painless to attach the actual OID to dissector mappings.
Line 15: Line 3:

== Usage ==
To get [[Asn2wrs]] to generate such automatic registration of OID to dissector mappings just use the #.REGISTER directive in the conformation file.

== Example ==
Certificate B "" "id-at-userCertificate"
Which will generate the extra code to make sure that anytime Wireshark needs to dissect the blob associated to the OID "" it now knows that that is done by calling the subroutine to dissect a Certificate in the current protocol file.<<BR>>
The "id-at-userCertificate" is just a free form text string to make Wireshark print a nice name together with the OID when it presents it in the decode pane. While this can be just about anything you want I would STRONGLY use the
name used to this object/oid in the actual ASN.1 definition file.

== Include File ==
During the compilation phase [[Asn2wrs]] will put all the extra registration code for this in the include file packet-protocol-dis-tab.c<<BR>>
Make sure that you include this file from the template file or the registration to an OID will never occur.<<BR>>
`#include "packet-protocol-dis-tab.c"` should be included from the proto_reg_handoff_protocol function in the template file.

== See Also ==
The various dissectors we have for X.509 such as the X.509AF which contains several examples of how to use this option.<<BR>>
That dissector can also serve as an example on how one would handle structures of the type Algorithm``Identifier above. ([[Asn2wrs]] can NOT handle these types of structures so we need to implement them by hand inside the template)
This has been merged with the [[https://www.wireshark.org/docs/wsdg_html_chunked/ASN1ConformanceFileDirectiveReference.html|Conformance File Directive Reference section]] in the [[https://www.wireshark.org/docs/wsdg_html_chunked|Wireshark Developer's Guide]].


This has been merged with the Conformance File Directive Reference section in the Wireshark Developer's Guide.

#.REGISTER (last edited 2020-04-05 17:59:52 by GeraldCombs)