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

local ffxiv_ipc_inventory_transaction_finish = Proto("ffxiv_ipc_inventory_transaction_finish", "FFXIV-IPC Inventory Transaction Finish")

local inventory_transaction_finish_fields = {
  sequence_id0 = ProtoField.uint32("ffxiv_ipc_inventory_transaction_finish.sequence_id0", "SequenceId0", base.DEC),
  sequence_id1 = ProtoField.uint32("ffxiv_ipc_inventory_transaction_finish.sequence_id1", "SequenceId1", base.DEC),
  unknown1     = ProtoField.uint32("ffxiv_ipc_inventory_transaction_finish.unknown1", "Unknown1", base.DEC),
  unknown2     = ProtoField.uint32("ffxiv_ipc_inventory_transaction_finish.unknown2", "Unknown2", base.DEC),
}

ffxiv_ipc_inventory_transaction_finish.fields = inventory_transaction_finish_fields

function ffxiv_ipc_inventory_transaction_finish.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_inventory_transaction_finish, tvbuf)
  pktinfo.cols.info:set("Inventory Transaction Finish")

  local len = tvbuf:len()

  -- dissect the sequence_id0 field
  local sequence_id0_tvbr = tvbuf:range(0, 4)
  local sequence_id0_val  = sequence_id0_tvbr:le_uint()
  tree:add_le(inventory_transaction_finish_fields.sequence_id0, sequence_id0_tvbr, sequence_id0_val)

  local sequence_id0_display = ", SequenceId0: " .. sequence_id0_val
  pktinfo.cols.info:append(sequence_id0_display)
  tree:append_text(sequence_id0_display)

  -- dissect the sequence_id1 field
  local sequence_id1_tvbr = tvbuf:range(4, 4)
  local sequence_id1_val  = sequence_id1_tvbr:le_uint()
  tree:add_le(inventory_transaction_finish_fields.sequence_id1, sequence_id1_tvbr, sequence_id1_val)

  -- dissect the unknown1 field
  local unknown1_tvbr = tvbuf:range(8, 4)
  local unknown1_val  = unknown1_tvbr:le_uint()
  tree:add_le(inventory_transaction_finish_fields.unknown1, unknown1_tvbr, unknown1_val)

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

  return len
end