Ask Your Question
0

WSGD Bitfields and byte order

asked 2019-03-22 07:44:56 +0000

bilgehan gravatar image

updated 2019-03-22 13:02:36 +0000

grahamb gravatar image

Hi,

I am trying to dissect a protocol with Wireshark Generic dissector. Byte order is big endian for the protocol but bit order is LSB. Relevant fields are below:

enum1 Truth
{
    FALSE 0
    TRUE 1
} 

struct Message
{

   .....

   .....

    Truth[8] fastEth;

    Truth[3] gigaEth;

   .....

   .....
}

When I receive a message in which fastEth[0]=TRUE and rest is FALSE. Dissector shows fastEth[7]=TRUE and rest as FALSE, values are shown as reversed.

  • WSGD has a keyword for byte order (byte_order=big_endian). How can I handle bit order in this situation?

  • Also can I only define bitfieldN when N is multiple of 8?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-22 11:24:55 +0000

grahamb gravatar image

Does this page on bitfields in WSGD help?

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

1 follower

Stats

Asked: 2019-03-22 07:44:56 +0000

Seen: 32 times

Last updated: Mar 22