Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Fields with symbolic values defined in another file

Date: Tue, 23 Jul 2013 09:39:43 -0400 (EDT)
Or possibly merge all of the small packet-scsi-*.h files into a single header file and add the necessary osd values there?  I'm torn between encapsulation and too many files.  The dissectors themselves are large enough to warrant their own files, but all of the header files are rather small.
-----Original Message-----
From: Evan Huus <eapache@xxxxxxxxx>
To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Sent: Tue, Jul 23, 2013 9:25 am
Subject: Re: [Wireshark-dev] Fields with symbolic values defined in another file

Is it enough to create a packet-scsi-osd.h file and expose the
necessary values there for packet-scsi.c to include?

Evan

On Tue, Jul 23, 2013 at 5:44 AM, Javier Godoy <mail@xxxxxxxxxxxxxx> wrote:
> In the SCSI dissector, I would like to add support for the OSD attribute
> identification sense data descriptor.
> The descriptor is a list of attribute page and attribute number fields.
>
> The code would be added to dissect_scsi_descriptor_snsinfo in packet-scsi.c
> because the SCSI dissector does not forward sense data to the sub-dissector.
> My issue is that symbolic names for attribute pages and attribute numbers
> are defined in packet-scsi-osd.c (page names are just a string_value array,
> and attribute number names are given by function osd_lookup_attribute).
>
> What approach do you recommend for including the attribute names in the
> fields of the sense data descriptor?
>
> For reference, in packet-scsi-osd.c the fields that represent page/number
> values are defined as
> { &hf_scsi_osd_attributes_page,
>   {"Attributes Page", "scsi_osd.attributes.page", FT_UINT32, BASE_HEX,
>      VALS(attributes_page_vals), 0, NULL, HFILL}},
> { &hf_scsi_osd_attribute_number,
>   {"Attribute Number", "scsi_osd.attribute.number", FT_UINT32, BASE_HEX,
>     NULL, 0, NULL, HFILL}},
>
> And they are dissected as:
>   const attribute_page_numbers_t *apn;
>   proto_item *item;
>   item=proto_tree_add_item(tt, hf_scsi_osd_attribute_number, tvb, offset, 4,
> ENC_BIG_ENDIAN);
>   apn= osd_lookup_attribute(page,number);
>   if (!apn) {
>   expert_add_info(pinfo, item, &ei_osd_attr_unknown);
>   proto_item_append_text(item, " (Unknown)");
>   } else {
>   proto_item_append_text(item, " (%s)", apn->name);
>   }
>
>
> Best Regards
>
> Javier
>
>
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe