Ethereal-dev: Re: [Ethereal-dev] Good TLV dissection

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

From: Michael Tuexen <Michael.Tuexen@xxxxxxxxxxxxxxxxx>
Date: Wed, 29 Sep 2004 20:01:31 +0200
I'm using the switch method in several dissectors (packet-sctp.c, packet-m3ua.c, ...).
I have not encountered (yet) any performance problems...

Best regards
Michael

On Sep 28, 2004, at 10:53 Uhr, Yaniv Kaul wrote:

I'm looking for suggestion for a good (performance-wise, development-wise) dissection for TLV (Type-Length-Value) attributes.
I can make something like:

switch (T):
   case A: dissect_A();
      break;
...

I could do something else (packet-isakmp.c):

static struct strfunc {
 const char *  str;
void (*func)(tvbuff_t *, int, int, proto_tree *, packet_info *, int);
} strfuncs[NUM_LOAD_TYPES] = {
 {"NONE",                      NULL              },
 {"A",      dissect_A        },
...

Any other options people are happy with?

_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev