2014-08-29 115 views
0

我看到在proto_register_field_array(const int parent, hf_register_info *hf, const int num_records);中使用的header_field中的位掩碼字段是guint32,因此我不能使用64位掩碼。無論如何,我可以去嗎?Wireshark解剖器UINT64位掩碼

具體來說,我有一個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, 

謝謝你提前做出迴應。

回答

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);函數。

無論如何感謝:)

0

如果該函數需要一個32位參數,那麼強制它理解一個64位參數是不對的。看看是否有其他功能可以做你想做的。

+0

是的我知道,這就是我想要的。如果有人會知道Wireshark中是否有某些功能或某些東西可以使用。 – gigashock 2014-08-29 13:52:34