Ask Your Question
0

masking a proto_field of type uint64

asked 2022-02-03 15:01:23 +0000

itamar gravatar image

updated 2022-02-03 15:18:51 +0000

grahamb gravatar image

I have a field which has the following properties:

offset_in_bits: 6112
size_in_bits: 51

This means I need to i need to add the field in the following way:

pf_my_field = ProtoField.uint64(
    "my_protocol.my_field", "my_field",
    base.DEC,
    nil,
    0x7ffffffffffff)

The issue is that it doesn't work. the mask only works for the first 32 bits, but ignores the mask of the other 32. is this a bug? or am I missing something? note: I use masking for a lot of 32 bits or smaller fields and didn't have this kind of issue.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-02-03 19:31:58 +0000

André gravatar image

The page https://www.wireshark.org/docs/wsdg_h... describes how to handle 64-bit integers in LUA.

So a 64-bit value can be specified with UInt64. For example: UInt64(0xFFFFFFFF, 0x7FFFF).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2022-02-03 15:01:23 +0000

Seen: 466 times

Last updated: Feb 03 '22