Skip to content

Commit f654095

Browse files
Another test
1 parent 1c57087 commit f654095

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

Asx/Asx_AsxSecurities_Ntp_Itch_v1_05_Dissector.lua

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,18 @@ asx_asxsecurities_ntp_itch_v1_05.conversation = {}
227227
-- Get/create our protocol's data record on the current packet's conversation
228228
asx_asxsecurities_ntp_itch_v1_05.conversation.data = function(packet)
229229
local conversation = packet.conversation
230-
local data = conversation[omi_asx_asxsecurities_ntp_itch_v1_05]
230+
io.stderr:write(string.format("[asx.conversation.data] frame=%d conv=%s type=%s\n", packet.number, tostring(conversation), type(conversation)))
231+
local ok, data = pcall(function() return conversation[omi_asx_asxsecurities_ntp_itch_v1_05] end)
232+
if not ok then
233+
io.stderr:write(string.format("[asx.conversation.data] index FAILED: %s\n", tostring(data)))
234+
return { second = { last = nil, frames = {} } }
235+
end
231236
if data == nil then
232237
data = { second = { last = nil, frames = {} } }
233-
conversation[omi_asx_asxsecurities_ntp_itch_v1_05] = data
238+
local ok2, err = pcall(function() conversation[omi_asx_asxsecurities_ntp_itch_v1_05] = data end)
239+
if not ok2 then
240+
io.stderr:write(string.format("[asx.conversation.data] assign FAILED: %s\n", tostring(err)))
241+
end
234242
end
235243
return data
236244
end
@@ -5213,13 +5221,20 @@ end
52135221

52145222
-- Dissector for Asx AsxSecurities Ntp Itch 1.05
52155223
function omi_asx_asxsecurities_ntp_itch_v1_05.dissector(buffer, packet, parent)
5224+
io.stderr:write(string.format("[asx.dispatcher] called frame=%d len=%d\n", packet.number, buffer:len()))
52165225

52175226
-- Set protocol name
52185227
packet.cols.protocol = omi_asx_asxsecurities_ntp_itch_v1_05.name
52195228

52205229
-- Dissect protocol
52215230
local protocol = parent:add(omi_asx_asxsecurities_ntp_itch_v1_05, buffer(), omi_asx_asxsecurities_ntp_itch_v1_05.description, "("..buffer:len().." Bytes)")
5222-
return asx_asxsecurities_ntp_itch_v1_05.packet.dissect(buffer, packet, protocol)
5231+
local ok, result = pcall(asx_asxsecurities_ntp_itch_v1_05.packet.dissect, buffer, packet, protocol)
5232+
if not ok then
5233+
io.stderr:write(string.format("[asx.dispatcher] packet.dissect THREW frame=%d: %s\n", packet.number, tostring(result)))
5234+
return 0
5235+
end
5236+
io.stderr:write(string.format("[asx.dispatcher] dissect OK frame=%d index=%s\n", packet.number, tostring(result)))
5237+
return result
52235238
end
52245239

52255240

@@ -5229,8 +5244,14 @@ end
52295244

52305245
-- Dissector Heuristic for Asx AsxSecurities Ntp Itch 1.05 (Udp)
52315246
local function omi_asx_asxsecurities_ntp_itch_v1_05_udp_heuristic(buffer, packet, parent)
5247+
io.stderr:write(string.format("[asx.heuristic] called frame=%d len=%d\n", packet.number, buffer:len()))
52325248
-- Verify packet length
5233-
if not asx_asxsecurities_ntp_itch_v1_05.packet.requiredsize(buffer) then return false end
5249+
if not asx_asxsecurities_ntp_itch_v1_05.packet.requiredsize(buffer) then
5250+
io.stderr:write(string.format("[asx.heuristic] requiredsize FAILED frame=%d len=%d\n", packet.number, buffer:len()))
5251+
return false
5252+
end
5253+
5254+
io.stderr:write(string.format("[asx.heuristic] claiming frame=%d\n", packet.number))
52345255

52355256
-- Protocol is valid, set conversation and dissect this packet
52365257
packet.conversation = omi_asx_asxsecurities_ntp_itch_v1_05

0 commit comments

Comments
 (0)