Ethereal-dev: [Ethereal-dev] What match made a dissector run?

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

Date: Mon, 7 Apr 2003 12:01:08 -0500
I'm working on writing dissectors for our internal POS network protocols,
and am hoping to find a generic solution so I don't have to write code to
deal with every one of about 300 messages.

Since the protocol consists of a header with message type, followed by the
message, it seems I should be able to build a dissector that takes a text
file as input and registers a bunch of dissectors based on that.

In the tiny amount of tinkering I've done so far, I've written a standard
dissector that deals with the header and one message type below that, and
it seems like doing the text file should be fairly straight forward, except
for one thing: since I want this to be a run-time thing, rather than a
compile-time code generator, I will only have one dissector function, and
that function needs to know somehow what it is decoding.

I could just write a dissector for our header and put the message type in a
global, then try to find the sub-dissector, but that seems ugly and
graceless.

I'd rather have some way to find out that I matched on "mcipc.ipctype ==
0x93" in the dissector function, because that would be something useful
that could be rolled back into the public version of Ethereal rather than
being something that would only be useful here.

Thanks,

Walt Dexter
walter.dexter@xxxxxxx

The information contained in this e-mail and any accompanying documents is
confidential, and is intended solely for the person and/or entity to which it
is addressed (i.e. those identified in the "To" and "cc" box).  They are the 
property of McDonald's Corporation.  Unauthorized review, use, disclosure, or 
copying of this communication, or any part thereof, is strictly prohibited 
and may be unlawful.  If you have received this email in error, please return 
the e-mail and attachments to the sender and delete the e-mail and attachments 
and any copy from your system.  McDonald's thanks you for your cooperation.