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

I have created the customise protocol in Lua and I want to display the subtree info on the same line of main tree ( which display the name of my customise protocol).

please find the code below and let me know what should I do .

function cus_proto.dissector(tvbuf, pktinfo, root)
    dprint2("cus_proto.dissector called")
    -- reset the save Tvbs
    tvbs = {}

    -- get the length of the packet buffer (Tvb).
    local pktlen = tvbuf:len()

    --local bytes_consumed = 0
    if pklen==0 then return end

    pktinfo.cols.protocol=cus_proto.name

    --create subtree for cus proto
    subtree=root:add(cus_proto,tvbuf(0))

    -- add protocol fields to subtree
    subtree:add(hdr_fields.msg_data_length, tvbuf(0,4))
    subtree:add(hdr_fields.msg_id, tvbuf(4,1))
    subtree:add(hdr_fields.msg_type, tvbuf(5,1))
    subtree:add(hdr_fields.msg_method_id, tvbuf(6,1))
end

asked 04 Dec '15, 03:41

Tony_2013's gravatar image

Tony_2013
11559
accept rate: 0%

edited 04 Dec '15, 03:50

grahamb's gravatar image

grahamb ♦
19.8k330206

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:

×431
×124
×29
×18
×1

question asked: 04 Dec '15, 03:41

question was seen: 895 times

last updated: 04 Dec '15, 03:50

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