Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] OID Syntax Proposal/Patch

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Graeme Lunt" <graeme.lunt@xxxxxxxxx>
Date: Wed, 12 Oct 2005 21:51:19 +0200
Hi,

Attached in a *proposed* patch for the BER dissector to support the "syntax"
concept. 

This allows a dissector to register a syntax name against a given OID for
use by 
call_ber_oid_callback(). (Note, the calling of call_ber_oid_callback() is
unchanged.)

So, for example, a dissector with a common PDU format can register it as a
syntax with:

	register_ber_syntax_dissector("XXX", dissect_XXX_PDU)

And another dissector can use the registered syntax dissector by calling:

	register_ber_oid_syntax("1.2.3.4", "id-oid-name", "XXX")

It doesn't actually matter if the "XXX" syntax isn't yet
implemented/registered - nothing is lost.
But as, and when, another dissector implements the XXX PDU, the original
dissector will pick it up, and won't need recompiling. 

The patch currently maintains the existing behaviour (of
register_ber_oid_dissector()) and only attempts a syntax-based dissection if
there is no dissector directly registered on the OID. 
The patch also includes a new BER preference to identify an OID information
file that can allow user specified local OID/name/syntax registrations. A
very simple example file is attached. The file can also be used just to name
OIDs.

One of my main motivators for this change is to support the X.500 protocol
dissectors (DAP, DSP and DISP) I am currently working on. X.500 allows an
arbitrary set of attributes (basically ANY defined by type(OID)) to be
transferred in the protocol. I don't want to hardwire all possible
attributes into a dissector, but offer the user to be able to define any
additional attributes that may be used in their local directory service.

Ultimately, I'd like to see asn2eth generate register_ber_syntax_dissector()
from the #.PDU directive, and  generate a register_ber_oid_syntax() call
from the #.REGISTER (or maybe a new directives).

I think this all bears some discussion before I request this be patched into
the tree.

Any comments on this approach? 

Graeme

Attachment: oid_info.patch
Description: Binary data

Attachment: oids
Description: Binary data