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

I'm trying to write a chained dissector for the CFLOW protocol, and was attempting to follow the example here: https://wiki.wireshark.org/Lua/Dissectors#chained_dissectors
However, when I try to use it in Wireshark I get the Lua Error: attempt to index upvalue 'original_cflow_dissector' (a nil value).

Does anyone have insight as to what I've done wrong?

I think it has to do with my get_dissector call calling the udp dissector instead of the cflow dissector, but I'm not sure how to fix that. Replacing udp.port with tcp.port obviously didn't work, but it does compile and run so that makes me think its not an issue with the depth of my variable declaration.

Here's the code - I replaced some parts with comments, but they should be working fine.

do
        --create the protocol

        --create the fields for our protocol

        --add the fields to the protocol

        --declare the fields to read

        local original_cflow_dissector
        function cflow_wrapper_proto.dissector(buffer, pinfo, tree)
            original_cflow_dissector:call(buffer, pinfo, tree)
            --do things
        end
        udp_dissector_table = DissectorTable.get("udp.port")
        original_cflow_dissector = udp_dissector_table:get_dissector(2055)
        udp_dissector_table:add(2055, cflow_wrapper_proto)
    end

asked 27 May '16, 16:13

osarkar's gravatar image

osarkar
6334
accept rate: 0%

Be the first one to answer this question!
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:

×637
×431
×10
×7

question asked: 27 May '16, 16:13

question was seen: 1,203 times

last updated: 27 May '16, 16:13

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