Wireshark-dev: Re: [Wireshark-dev] Query regarding GTP protocol

From: prashanth joshi <prashanthsjoshi2000@xxxxxxxxx>
Date: Fri, 15 Sep 2006 13:29:55 -0700 (PDT)
Hey i did not c that actually. In the last 24 hours i've had only three (it's 1.30 night here) I've had only 3 hours of sleep, may be i did not observe the Length field getting printed due to the  effect of loss of sleep. Thanks for pointing out that. Other wise i wud hav been frustrated.
Regards,
Prashanth


Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:


On Fri, 15 Sep 2006, prashanth joshi wrote:

> Hi ,
> I wanted to print a message in the decode_gtp_cause function. But i did not get any such result in the ethereal display. Please tell me what may be the reason.
> the following is the function :
> static int decode_gtp_cause(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, p
> roto_tree *tree) {
> guint8 cause;
> guint16 length; /* added by me */
> length = 222;
> cause = tvb_get_guint8(tvb, offset+1);
> printf("How are you\n"); /*added by me */
> proto_tree_add_uint(tree, hf_gtp_cause, tvb, offset, 2, cause);
> proto_tree_add_text(tree, tvb, offset+3, 2, "Length : %u", length); /*added by me */
> return 2;
> }
>
> The corresponding part of ethereal display is as follows :
>
> Cause : Request accepted (128)
> Length : 222
>
> I wanted my message "Length = 222" to occur along with the above output.
> But as it is clear here it did not appear.


What do you mean??? You use proto_tree_add_text(..... "Length : %u", length);
and that is what gets printed.

Thanx,
Jaap





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


All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.