Ethereal-dev: Re: [Ethereal-dev] Protocol definition table loaded (problems)

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 7 Mar 2001 14:08:57 -0800 (PST)
> But is it posible to do what I am trying to do?  Should the arguement
> for "proto_register_field_array" be the total num,ber of elements in
> the array, or just the number of elements used?

The number of elements used.

Note that *all* of the items to which elements in an element of "hf"
points *must* stay around forever, with the same contents.

For example:

      strcpy(abbrev_tmp,"pep.");
      strcat(abbrev_tmp,pep_data_struct[data_cnt].data_struct);
      strcat(abbrev_tmp,".");
      strcat(abbrev_tmp,(*pep_data_struct[data_cnt].field[field_cnt]).name);
      hf[hf_field_cnt].hfinfo.abbrev = abbrev_tmp;

won't work - you'd have to do

      hf[hf_field_cnt].hfinfo.abbrev = strdup(abbrev_tmp);