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

local ffxiv_ipc_update_hp_mp_tp = Proto("ffxiv_ipc_update_hp_mp_tp", "FFXIV-IPC UpdateHpMpTp")

local update_hp_mp_tp_fields = {
  hp = ProtoField.uint32("ffxiv_ipc_update_hp_mp_tp.hp", "HP", base.DEC),
  mp = ProtoField.uint16("ffxiv_ipc_update_hp_mp_tp.mp", "MP", base.DEC),
  tp = ProtoField.uint16("ffxiv_ipc_update_hp_mp_tp.tp", "TP", base.DEC),
}

ffxiv_ipc_update_hp_mp_tp.fields = update_hp_mp_tp_fields

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

  local len = tvbuf:len()

  -- dissect the hp field
  local hp_tvbr = tvbuf:range(0, 4)
  local hp_val  = hp_tvbr:le_uint()
  tree:add_le(update_hp_mp_tp_fields.hp, hp_tvbr, hp_val)

  -- dissect the mp field
  local mp_tvbr = tvbuf:range(4, 2)
  local mp_val  = mp_tvbr:le_uint()
  tree:add_le(update_hp_mp_tp_fields.mp, mp_tvbr, mp_val)

  -- dissect the tp field
  local tp_tvbr = tvbuf:range(6, 2)
  local tp_val  = tp_tvbr:le_uint()
  tree:add_le(update_hp_mp_tp_fields.tp, tp_tvbr, tp_val)

  return len
end