woww: Add update mask

This commit is contained in:
Gtker 2022-10-02 11:09:54 +02:00 committed by Alexis La Goutte
parent 2c921dd098
commit 238a49fcc5
1 changed files with 39 additions and 0 deletions

View File

@ -71,6 +71,9 @@ static int hf_woww_string_length = -1;
static int hf_woww_aura_mask = -1;
static int hf_woww_aura = -1;
static int hf_woww_amount_of_masks = -1;
static int hf_woww_update_mask = -1;
static int hf_woww_update_mask_value = -1;
/* AUTOGENERATED_START_HF */
static int hf_woww_absorb = -1;
@ -9025,6 +9028,25 @@ add_aura_mask(ptvcursor_t* ptv) {
}
}
static void
add_update_mask(ptvcursor_t* ptv) {
guint32 amount_of_masks = 0;
ptvcursor_add_ret_uint(ptv, hf_woww_amount_of_masks, 1, ENC_NA, &amount_of_masks);
guint32* masks = (guint32*)wmem_alloc0(wmem_packet_scope(), amount_of_masks * 4);
for (guint32 i = 0; i < amount_of_masks; ++i) {
ptvcursor_add_ret_uint(ptv, hf_woww_update_mask, 4, ENC_LITTLE_ENDIAN, masks + i);
}
for (guint32 mask = 0; mask < amount_of_masks; ++mask) {
for (guint32 i = 0; i < 32; ++i) {
if (masks[mask] & (1 << i)) {
ptvcursor_add(ptv, hf_woww_update_mask_value, 4, ENC_LITTLE_ENDIAN);
}
}
}
}
static void
add_packed_guid(ptvcursor_t* ptv, packet_info* pinfo) {
tvbuff_t* tvb = ptvcursor_tvbuff(ptv);
@ -14732,6 +14754,7 @@ add_body_fields(guint32 opcode,
ptvcursor_add_ret_uint(ptv, hf_woww_update_type, 1, ENC_LITTLE_ENDIAN, &update_type);
if (update_type == UPDATE_TYPE_VALUES) {
add_packed_guid(ptv, pinfo);
add_update_mask(ptv);
}
else if (update_type == UPDATE_TYPE_MOVEMENT) {
add_packed_guid(ptv, pinfo);
@ -14932,6 +14955,7 @@ add_body_fields(guint32 opcode,
ptvcursor_add(ptv, hf_woww_transport_progress_in_ms, 4, ENC_LITTLE_ENDIAN);
}
ptvcursor_pop_subtree(ptv);
add_update_mask(ptv);
}
else if (update_type == UPDATE_TYPE_OUT_OF_RANGE_OBJECTS
|| update_type == UPDATE_TYPE_NEAR_OBJECTS) {
@ -15143,6 +15167,21 @@ proto_register_woww(void)
FT_UINT32, BASE_DEC_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_woww_amount_of_masks,
{ "Amount of Masks", "woww.amount_of_masks",
FT_UINT8, BASE_DEC_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_woww_update_mask,
{ "Update Mask", "woww.update_mask",
FT_UINT32, BASE_DEC_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_woww_update_mask_value,
{ "Update Mask Value", "woww.update_mask_value",
FT_UINT32, BASE_DEC_HEX, NULL, 0,
NULL, HFILL }
},
/* AUTOGENERATED_START_REGISTER */
{ &hf_woww_absorb,
{ "Absorb", "woww.absorb",