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

local ffxiv_ipc_fellowship_joined_item = Proto("ffxiv_ipc_fellowship_joined_item", "FFXIV-IPC FellowshipJoinedItem")

local fellowship_joined_item_fields = {
  unique_id = ProtoField.uint64("ffxiv_ipc_fellowship_joined_item.unique_id", "UniqueID", base.HEX),
  unknown0  = ProtoField.uint64("ffxiv_ipc_fellowship_joined_item.unknown0", "Unknown0", base.DEC),
  unknown1  = ProtoField.uint8("ffxiv_ipc_fellowship_joined_item.unknown1", "Unknown1", base.DEC),
  name      = ProtoField.string("ffxiv_ipc_fellowship_joined_item.name", "Name", base.UNICODE),
  padding   = ProtoField.uint8("ffxiv_ipc_fellowship_joined_item.padding", "Padding", base.DEC),
}

ffxiv_ipc_fellowship_joined_item.fields = fellowship_joined_item_fields

function ffxiv_ipc_fellowship_joined_item.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_fellowship_joined_item, tvbuf)
  pktinfo.cols.info:set("FellowshipJoinedItem")

  local len = tvbuf:len()

  -- dissect the unique_id field
  local unique_id_tvbr = tvbuf:range(0, 8)
  local unique_id_val  = unique_id_tvbr:le_uint64()
  tree:add_le(fellowship_joined_item_fields.unique_id, unique_id_tvbr, unique_id_val)

  -- dissect the unknown0 field
  local unknown0_tvbr = tvbuf:range(8, 8)
  local unknown0_val  = unknown0_tvbr:le_uint64()
  tree:add_le(fellowship_joined_item_fields.unknown0, unknown0_tvbr, unknown0_val)

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

  -- dissect the name field
  local name_tvbr = tvbuf:range(17, 62)
  local name_val  = name_tvbr:string(ENC_UTF_8)
  tree:add(fellowship_joined_item_fields.name, name_tvbr, name_val)

  -- dissect the padding field
  local padding_tvbr = tvbuf:range(79, 1)
  local padding_val  = padding_tvbr:le_uint()
  tree:add_le(fellowship_joined_item_fields.padding, padding_tvbr, padding_val)

  return len
end