-- This file is generated by tools/json2lua.js

local ffxiv_ipc_triple_traid = Proto("ffxiv_ipc_triple_traid", "FFXIV-IPC Triple Traid")

local triple_traid_fields = {
  traid_id = ProtoField.uint32("ffxiv_ipc_triple_traid.traid_id", "TraidId", base.DEC),
  unknown2 = ProtoField.uint32("ffxiv_ipc_triple_traid.unknown2", "unknown2", base.DEC),
  unknown3 = ProtoField.uint32("ffxiv_ipc_triple_traid.unknown3", "unknown3", base.DEC),
  unknown4 = ProtoField.uint32("ffxiv_ipc_triple_traid.unknown4", "unknown4", base.DEC),
}

ffxiv_ipc_triple_traid.fields = triple_traid_fields

function ffxiv_ipc_triple_traid.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_triple_traid, tvbuf)
  pktinfo.cols.info:set("Triple Traid")

  local len = tvbuf:len()

  -- dissect the traid_id field
  local traid_id_tvbr = tvbuf:range(0, 4)
  local traid_id_val  = traid_id_tvbr:le_uint()
  tree:add_le(triple_traid_fields.traid_id, traid_id_tvbr, traid_id_val)

  -- dissect the unknown2 field
  local unknown2_tvbr = tvbuf:range(4, 4)
  local unknown2_val  = unknown2_tvbr:le_uint()
  tree:add_le(triple_traid_fields.unknown2, unknown2_tvbr, unknown2_val)

  -- dissect the unknown3 field
  local unknown3_tvbr = tvbuf:range(8, 4)
  local unknown3_val  = unknown3_tvbr:le_uint()
  tree:add_le(triple_traid_fields.unknown3, unknown3_tvbr, unknown3_val)

  -- dissect the unknown4 field
  local unknown4_tvbr = tvbuf:range(12, 4)
  local unknown4_val  = unknown4_tvbr:le_uint()
  tree:add_le(triple_traid_fields.unknown4, unknown4_tvbr, unknown4_val)

  return len
end