Files
wireshark/prodigy_tocs.lua
2025-02-18 19:07:45 -07:00

34 lines
1.2 KiB
Lua

local M = {}
------------------------------
-- TOCS: Trintex Object Caching Subsystem
------------------------------
local tocs_proto = Proto("TOCS", "Trintex Object Caching Subsystem")
tocs_proto.fields.packet_seq = ProtoField.uint8("tocs.packet_seq", "TOCS Message Sequence", base.DEC)
tocs_proto.fields.block_num = ProtoField.uint8("tocs.block_num", "TOCS Message Block Number", base.DEC)
tocs_proto.fields.blocks_tot = ProtoField.uint8("tocs.block_tot", "TOCS Message Blocks Total", base.DEC)
tocs_proto.fields.obj_len = ProtoField.uint16("tocs.obj_len", "TOCS Object Length", base.DEC)
tocs_proto.fields.object = ProtoField.bytes("tocs.object", "TOCS Object")
function tocs_proto.dissector(tvb, pinfo, subtree)
pinfo.cols.protocol = "TOCS"
subtree:add(tocs_proto.fields.packet_seq, tvb(1,1))
subtree:add(tocs_proto.fields.block_num, tvb(2,1))
subtree:add(tocs_proto.fields.blocks_tot, tvb(3,1))
subtree:add(tocs_proto.fields.obj_len, tvb(4, 2))
local obj_len = tvb(4,2):uint()
if obj_len == 0 then
subtree:add_expert_info(PI_PROTOCOL, PI_CHAT, "TOCS indicates the client has the latest version of the requested object")
else
subtree:add(tocs_proto.fields.object, tvb(6, obj_len))
end
end
M.proto = tocs_proto
return M