I brought this up once in the past, never really heard anything back.
I think ethereal source needs some facility for creating/maintaining large
tables. For example, the kerberos dissector has error codes - about 60 of
them. It's highly annoying to have to #define every one of those codes, and
then use it later to create the lookup table, especially since it all has to
be done by hand initially.
I'd like to see something like a preprocessed (hand-run by developers and
not generated at build time) table include that you could cleanly define
lists of 'code', 'value', 'text'. With 'code' being optional - since alot of
people don't need that in their sources. You'd only need the code if you're
actually comparing against that constant anywhere directly as opposed to
everything being table lookups.
Some sort of standardized naming for these tables would be good as well.
------krb5_tables.tbl-------
table krb5_error_codes
KRB5_ERROR_1, 1, this is the first kerberos error
table krb5_encryption_types
1, this is the first kerberos encryption type
------
would generate either into krb5_tables.c AND krb5_tables.h, or just
krb5_tables.c, depending on how we wanted to do things.
------krb5_tables.c--------
/* Definitions for table 'krb5_error_codes' */
#define KRB5_ERROR_1 1
/* Table content for 'krb5_error_codes' */
static const value_string krb5_error_codes[] = {
{ KRB5_ERROR_1, "this is the first kerberos error" }
};
/* Definitions for table 'krb5_encryption_types' */
/* no definitions provided */
/* Table content for 'krb5_encryption_types' */
static const value_string krb5_encryption_types[] = {
{ 1, "this it the first encryption type" }
};
----------------------------
If split into two files, the #define's would be in the .h.
Just an idea. I think it would clean up the code for kerberos, and a number
of the other large-table dissectors as well.
-- Nathan
------------------------------------------------------------
Nathan Neulinger EMail: nneul@xxxxxxx
University of Missouri - Rolla Phone: (573) 341-4841
Computing Services Fax: (573) 341-4216