Wireshark-dev: Re: [Wireshark-dev] Preventing the display of the payload data in the proto tree

From: "ronnie sahlberg" <ronniesahlberg@xxxxxxxxx>
Date: Fri, 22 Sep 2006 22:33:47 +0000
Try  FT_NONE

not BASE_NONE

On 9/22/06, Bill Fassler <bill.fassler@xxxxxxxxx> wrote:
Hey guys I got over the last hump.  When I tried to add the payload item to
the tree as a size of 80 things blew up, but when I call a routine to
determine the number of bytes remaining (which is 80) things worked fine....
go figure.  Anyway, here is what I used to get it working:

    payload_size = tvb_reported_length_remaining(tvb, offset);
    tvb_ensure_bytes_exist(tvb, offset, payload_size);
    proto_tree_add_item(vppn_tree, hf_payload, tvb, offset, payload_size,
FALSE);

But now as you can see it tries to display all 80 bytes in the proto tree,
when I basically just wanted the payload highlighted in the packet info.  Is
there an easy way to stop the display of the value?  I thought just putting
BASE_NONE in the field would stop the display, but it didn't.

No.     Time        Source                Destination           Protocol
Info
    568 1.391747    IeeeRegi_33:7f:13     IeeeRegi_33:7f:00     vppn

Frame 568 (98 bytes on wire, 98 bytes captured)
Ethernet II, Src: IeeeRegi_33:7f:13 (00:50:c2:33:7f:13), Dst:
IeeeRegi_33:7f:00 (00:50:c2:33:7f:00)
VoCAL Private Phone Network
    Destination ID (DID): Master (0x00)
    Source ID (SID): Slave 4 (0x13)
    Endpoint Header: 0xc2
    Control Channel Command: Sends current switch input mask (0x00)
    Control Channel Data: 0x0000
    Payload: d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5d5...

0000  00 50 c2 33 7f 00 00 50 c2 33 7f 13 56 6f c2 00   .P.3...P.3..Vo..
0010  00 00 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5   ................
0020  d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5   ................
0030  d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d4   ................
0040  d5 d5 d5 d5 d5 d5 d5 d5 d5 d4 d5 d5 d5 d5 d5 d5   ................
0050  d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5 d5   ................
0060  d5 d5                                             ..


Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote: Hi,

How about feeding the data to the data dissector?
Create a sub_tvb from the current offset to the end of the frame (assuming
the data is at the end) and hand that to the data dissector. Lots of
samples in other dissectors.

Thanx,
Jaap

On Thu, 21 Sep 2006, Bill Fassler wrote:

> Ya know how the first branch of the plugin tree highlights the entire
packet, the header, data and everything? Well, my superiors (who is
everybody in the world it seems) insist that I add a final branch that
highlights the actual data packet (in this case -  an 80 byte audio packet).
 Everything I have tried throws a failed assertion.
>
> Here is the last working branch:
> proto_tree_add_item(vppn_tree, hf_channel_data, tvb, offset, 2, FALSE);
>
> Here is a few of the many worthless things I've tried: (I do not declare
hf_audio_data in the protocol field array)
>
> proto_tree_add_item(vppn_tree, hf_audio_data, tvb, offset, 80, FALSE);
> and
> proto_tree_add_item(vppn_tree, hf_audio_data, tvb, offset, -1, FALSE);
> and
> ti = proto_tree_add_item(audio_tree, hf_audio_data, tvb, 0, -1, FALSE);
>
> I know this is crazy since there is no need to dissect this, but for
cosmetic reasons I have been asked to implement it.  Can any of you Gurus
sell me some smoke and mirrors or maybe some pixie dust before I climb the
clock tower with my sling shot?
>
> BIll
>
>
> ---------------------------------
> Stay in the know. Pulse on the new Yahoo.com.  Check it out.

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev



---------------------------------
Get your email and more, right on the  new Yahoo.com