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] Good TLV dissection

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

From: Yaniv Kaul <ykaul@xxxxxxxxxxxx>
Date: Tue, 28 Sep 2004 10:53:33 +0200
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?