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

disply info on column of customise protocol

0

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