De : wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] De la part de Martin Corraine (mcorrain)
Envoyé : jeudi 21 août 2008 15:03
À : Developer support list for Wireshark
Objet : Re: [Wireshark-dev] fetching numbers < 8 bits
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Anders Broman
Sent: Thursday, August 21, 2008 8:56 AM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] fetching numbers < 8 bits
Bit accessors for a maximum of 8-bits, 16-bits 32-bits and 64-bits:
guint8 tvb_get_bits8(tvbuff_t *tvb, gint bit_offset, gint no_of_bits);
guint16 tvb_get_bits16(tvbuff_t *tvb, gint bit_offset, gint no_of_bits,gboolean little_endian);
guint32 tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, gint no_of_bits,gboolean little_endian);
guint64 tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, gint no_of_bits,gboolean little_endian);
:
proto_item*
proto_tree_add_bits_item(tree, id, tvb, bit_offset, no_of_bits, little_endian);
proto_item *
proto_tree_add_bits_ret_val(tree, id, tvb, bit_offset, no_of_bits, return_value, little_endian);
:
proto_tree_add_bits_item()
--------------------------
Adds a number of bits to the protocol tree which does not have to be byte aligned.
The offset and length is in bits.
Output format:
..10 1010 10.. .... "value" (formated as FT_ indicates).
proto_tree_add_bits_ret_val()
-----------------------------
Works in the same way but alo returns the value of the read bits.
/Regards
Anders
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Martin Corraine (mcorrain)
Sent: den 21 augusti 2008 14:47
To: Developer support list for Wireshark
Subject: [Wireshark-dev] fetching numbers < 8 bits
- Follow-Ups:
- Prev by Date: Re: [Wireshark-dev] plugin
- Next by Date: Re: [Wireshark-dev] fetching numbers < 8 bits (functions not in libwireshark.def and not available for plugins)
- Previous by thread: Re: [Wireshark-dev] plugin
- Next by thread: Re: [Wireshark-dev] fetching numbers < 8 bits (functions not in libwireshark.def and not available for plugins)
- Index(es):