0

我看到 in 中header_field使用的位掩码字段proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);guint32,因此我不能使用 64 位掩码。反正我可以去吗?

具体来说,我有一个 60 位字段,因此我试图为此创建一个具有类型FT_UINT64和位掩码的字段0xfffffffffffffff,但是当然,在编译 C 代码时,我得到:

warning: implicit conversion from 'long' to 'guint32' (aka 'unsigned int') changes value from 1152921504606846975 to 4294967295 [-Wconstant-conversion]
            NULL, 0xfffffffffffffff,

预先感谢您的回复。

4

2 回答 2

0

在深度搜索之后,似乎唯一可能的解决方案是忘记头字段定义中的位掩码并使用该proto_tree_add_bits_item(proto_tree *tree, const int hf_index, tvbuff_t *tvb, const guint bit_offset, const gint no_of_bits, const guint encoding);函数。

不管怎么说,还是要谢谢你 :)

于 2014-09-01T11:25:46.513 回答
0

如果该函数采用 32 位参数,则无法强制它理解 64 位参数,抱歉。寻找其他功能是否可以满足您的需求。

于 2014-08-29T12:20:23.100 回答