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

local ffxiv_ipc_content_finder_duty_info = Proto("ffxiv_ipc_content_finder_duty_info", "FFXIV-IPC Content Finder Duty Info")

local content_finder_duty_info_fields = {
  penalty_time = ProtoField.uint8("ffxiv_ipc_content_finder_duty_info.penalty_time", "PenaltyTime", base.DEC),
  unknown1     = ProtoField.uint8("ffxiv_ipc_content_finder_duty_info.unknown1", "Unknown1", base.DEC),
  unknown2     = ProtoField.uint16("ffxiv_ipc_content_finder_duty_info.unknown2", "Unknown2", base.DEC),
  unknown3     = ProtoField.uint32("ffxiv_ipc_content_finder_duty_info.unknown3", "Unknown3", base.DEC),
}

ffxiv_ipc_content_finder_duty_info.fields = content_finder_duty_info_fields

function ffxiv_ipc_content_finder_duty_info.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_content_finder_duty_info, tvbuf)
  pktinfo.cols.info:set("Content Finder Duty Info")

  local len = tvbuf:len()

  -- dissect the penalty_time field
  local penalty_time_tvbr = tvbuf:range(0, 1)
  local penalty_time_val  = penalty_time_tvbr:le_uint()
  tree:add_le(content_finder_duty_info_fields.penalty_time, penalty_time_tvbr, penalty_time_val)

  -- dissect the unknown1 field
  local unknown1_tvbr = tvbuf:range(1, 1)
  local unknown1_val  = unknown1_tvbr:le_uint()
  tree:add_le(content_finder_duty_info_fields.unknown1, unknown1_tvbr, unknown1_val)

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

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

  return len
end