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

Hi,

I have an disssector that calls another post-dissector.

That works fine in Wireshark 2.2.0 with

function my_proto.dissector(tvb,pinfo,tree)
    local ptp_dissector_table = DissectorTable.get("ptp.data")
    local packet_dissector = ptp_dissector_table:get_dissector('ptp') 
    packet_dissector(tvb, pinfo, tree) 
 end

but fails as soon as I use

  packet_dissector(tvb(some_offset), pinfo, tree)

with 'Bad argument #2 to packet_dissector (Tvb expected, got userdata)

Any hints?

asked 21 Oct '16, 04:52

Thomas%20E's gravatar image

Thomas E
36459
accept rate: 0%


Use

packet_dissector(tvb:range(some_offset,some_length):tvb(), pinfo, tree)

(fixed according to the comment of @Thomas E).

permanent link

answered 21 Oct '16, 05:07

sindy's gravatar image

sindy
6.0k4851
accept rate: 24%

edited 21 Oct '16, 10:46

Actually it is

packet_dissector(tvb:range(some_offset,some_length):tvb(), pinfo, tree)

Thanks, Thomas

(21 Oct '16, 07:54) Thomas E
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×431
×19
×13

question asked: 21 Oct '16, 04:52

question was seen: 1,181 times

last updated: 21 Oct '16, 10:46

p​o​w​e​r​e​d by O​S​Q​A