Wireshark-dev: Re: [Wireshark-dev] query regarding gtp_handle funtion and decoderfunction.
From: prashanth joshi <prashanthsjoshi2000@xxxxxxxxx>
Date: Tue, 5 Sep 2006 08:34:47 -0700 (PDT)
Hi Anders,
Thanks for the reply.
But I'm affraid i did not put the whole thing very clearly.
I should have been more specific.
Actually i need to have in the define statement the following :
#define GTP_EXT_XXX 0x7f /* Satement 1 */
and then the ( extension field , function pointer) pair :
( GTP_EXT_XXX My_decode_fun) /* Statement 2 */
And then
I need to check whether the value of the next byte is 0x30 , in the My_decode_fun(...),
and then call decode_XXX(...) function. /* Statement 3 */
Now in decode_XXX(...) function shall i include the same code that u have specified in your reply or that needs to be modified?
Also after Statement 2 , will the pointer tvb automatically incremented by 1 or i have to explicitly increment it? This i need to know because i need to compare the value 0x30 with the content of the next byte of tvb ( as given in Statement 2 )
regards,
Prashanth
"Anders Broman (AL/EAB)" <anders.broman@xxxxxxxxxxxx> wrote:
Hi,Are you adding decoding of:#define GTP_EXT_OMC_ID 0x8F /* 3G 143 TLV OMC Identity 7.7.42 */If so what you need to do is to add code inLine 4487static int
decode_gtp_omc_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {guint16 length;length = tvb_get_ntohs(tvb, offset + 1);proto_tree_add_text(tree, tvb, offset, 3+length, "%s length : %u", val_to_str(GTP_EXT_OMC_ID, gtp_val, "Unknown"), length);return 3 + length;}To do the actual decoding.Best regardsAnders
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of prashanth joshi
Sent: den 5 september 2006 12:06
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] query regarding gtp_handle funtion and decoderfunction.Hi all,I'm adding a decoder for the gtp protocol. My query is :1 ) So gtp_handle will do the dissection. It refers to the file packet_gtp.c .Finds the hex value for example in the following statement :#define GTP_EXT_XXX 0x8fand then if its value in the header matches 0x8f, refers to the (val, decode_fun) pair and then calls decode_fun to handle the decoding.Now my question is : will the pointer tvb ( which is tvb_buff * tvb) be incremented automatically when it enters the function decode_fun ? Or we have to explicitly increment the pointer tvb in the decoder functin to account for the byte containing 0x8f value in the tvb?My other questions are :2) I'm trying to locate the file containing the definition for the function gtp_handle. But I'm not able to find it. Kindly can one please tell me where its definition is?3) Before actually starting the decoding in our decode function what is the code that we have to write and what that is for?regards,Prashanth
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business. _______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
- Follow-Ups:
- Re: [Wireshark-dev] query regarding gtp_handle funtion anddecoderfunction.
- From: Anders Broman (AL/EAB)
- References:
- Re: [Wireshark-dev] query regarding gtp_handle funtion and decoderfunction.
- From: Anders Broman (AL/EAB)
- Prev by Date: Re: [Wireshark-dev] A question about ASN.1 encoding in wireshark
- Next by Date: Re: [Wireshark-dev] A question about ASN.1 encoding in wireshark
- Previous by thread: Re: [Wireshark-dev] query regarding gtp_handle funtion and decoderfunction.
- Next by thread: Re: [Wireshark-dev] query regarding gtp_handle funtion anddecoderfunction.
- Index(es):