Ethereal-dev: RE: [Ethereal-dev] issues with large tables in ethereal source...

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

From: "Neulinger, Nathan R." <nneul@xxxxxxx>
Date: Tue, 26 Dec 2000 11:21:56 -0600
Additional ideas on this:

If no 'value' is specified, treat like an enum, where it starts at 0, (or if
in the middle, 1+ the last one where a value was given). 

If no text/string is given, just copy over the CONSTANT name.

Might want to be able to specify the constant names, but be able to say "I'm
not going to use these in source, so don't create #defines for them.".

-- Nathan

> -----Original Message-----
> From: Neulinger, Nathan R. [mailto:nneul@xxxxxxx]
> Sent: Tuesday, December 26, 2000 10:24 AM
> To: 'ethereal-dev@xxxxxxxxxxxx'
> Subject: [Ethereal-dev] issues with large tables in ethereal source...
> 
> 
> 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
> 
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
>