THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

LUA: pinfo affected by NSTime ?

  • retag add tags

Hello,

I finally narrow down the issue I'm facing with the pinfo...

my LUA protocol dissector is iterating multiple TLV with specific function analysis which might return some valuable information to be added to "pinfo.cols.info"

There is one specific function though that once executed break the pinfo value:

function decode_tlv92(tlv_tree, buffer, offset, len)
  -- Event Timestamp
  local secs = buffer(offset,4):le_uint()
  local msecs = buffer(offset+4,4):le_uint()
  tlv_tree:add_le (f.secs, buffer(offset, 4))
  tlv_tree:add_le (f.msecs, buffer(offset+4, 4))
  local ti = tlv_tree:add(f.time, buffer(offset,8), NSTime.new(secs, msecs))
  tlv_tree:append_text (", " .. string.sub(ti.text, 12))
end

if I prevent such decode_tlv92 execution (or I comment out the line containing NSTime.new) then everything works fine.

If I let to run decode_tlv92 fully then pinfo can't be used anymore...

So my question for you is why NSTime affect pinfo and more important how I can prevent that.

Thx, A.

sezb51's avatar
9
sezb51
asked 2021-09-17 20:56:58 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Fixed the issue... I had to wrap the below ti.text into a tostring()

So the NSTIme was not part of the problem.

function decode_tlv92(tlv_tree, buffer, offset, len)
  -- Event Timestamp
  local secs = buffer(offset,4):le_uint()
  local msecs = buffer(offset+4,4):le_uint()
  tlv_tree:add_le (f.secs, buffer(offset, 4))
  tlv_tree:add_le (f.msecs, buffer(offset+4, 4))
  local ti = tlv_tree:add(f.time, buffer(offset,8), NSTime.new(secs, msecs))
  tlv_tree:append_text (", " .. string.sub(tostring(ti.text), 12))
end
sezb51's avatar
9
sezb51
answered 2021-09-18 08:44:51 +0000, updated 2021-09-18 15:08:50 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer