This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

offset value from other file

0

Hi Iam developing custom dissector. where in some part i need to pass the tvb to a externl function NAS message from the file packet-gsm_a_dtap.c.

SOme times im calculating remaining length by sustracting the step by step length used

example

        proto_tree_add_text(bm__subtree, next_tvb, offset_payload, 1 , "Instances : 0x%02x (%d)", instances, instances);
    offset_payload+=1;
    payload_length-=1;</code></pre><p>but when i call NAS message process Call dissector</p><pre><code>            call_dissector(NAS_handle, NAS_tvb , pinfo, NASPDU_tree);</code></pre><p>i copuld not get the correct figure of payload length . how can i get this? Any idea?</p></div><div id="question-tags" class="tags-container tags"><span class="post-tag tag-link-value" rel="tag" title="see questions tagged &#39;value&#39;">value</span> <span class="post-tag tag-link-offset" rel="tag" title="see questions tagged &#39;offset&#39;">offset</span></div><div id="question-controls" class="post-controls"></div><div class="post-update-info-container"><div class="post-update-info post-update-info-user"><p>asked <strong>20 Nov '14, 02:21</strong></p><img src="https://secure.gravatar.com/avatar/1339589a92af9455063c09e56bfc6299?s=32&amp;d=identicon&amp;r=g" class="gravatar" width="32" height="32" alt="umar&#39;s gravatar image" /><p><span>umar</span><br />

26222427
accept rate: 0%

1

I’m not sure I understand the question. As I understand it the gsm_a_detap dissector is called with a NAS message, it’s then distributed to the correct subdissector dependent on the Protocol Discriminator(PD). Are you calling your subdissector if one of the values of PD isn’t handled by the dissector or replacing an existing call? Regardles I think that the tvb given to gsm_dtap should be the complete Layer 3 message so it should be enough to check the length of the tvb. But perhaps you should look at changing the dissector calling the DTAP one to call your dissector instead? That dissector should know the length of the layer3 message I would think.

(20 Nov ‘14, 04:02) Anders ♦