};
guint16
-tvb_get_bits16(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits,const gboolean little_endian)
+tvb_get_bits16(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits,const guint encoding)
{
gint offset;
guint16 value = 0;
/* If bits <= 8 use tvb_get_bits8 */
DISSECTOR_ASSERT_NOT_REACHED();
}
- if(little_endian){
+ /*
+ * For backwards compatibility, treat all non-zero values as
+ * meaning "little-endian".
+ */
+ if(encoding){
DISSECTOR_ASSERT_NOT_REACHED();
/* This part is not implemented yet */
}
};
guint32
-tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboolean little_endian)
+tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const guint encoding)
{
gint offset;
guint32 value = 0;
/* If bits <= 16 use tvb_get_bits8 or tvb_get_bits16 */
DISSECTOR_ASSERT_NOT_REACHED();
}
- if(little_endian){
+ /*
+ * For backwards compatibility, treat all non-zero values as
+ * meaning "little-endian".
+ */
+ if(encoding){
DISSECTOR_ASSERT_NOT_REACHED();
/* This part is not implemented yet */
}
}
guint64
-tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboolean little_endian)
+tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const guint encoding)
{
gint offset;
guint64 value = 0;
/* If bits <= 32 use tvb_get_bits8, tvb_get_bits16 or tvb_get_bits32 */
DISSECTOR_ASSERT_NOT_REACHED();
}
- if(little_endian){
+ /*
+ * For backwards compatibility, treat all non-zero values as
+ * meaning "little-endian".
+ */
+ if(encoding){
DISSECTOR_ASSERT_NOT_REACHED();
/* This part is not implemented yet */
}
}
guint32
-tvb_get_bits(tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const gboolean little_endian)
+tvb_get_bits(tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const guint encoding)
{
/* This function can handle only up to 32 requested bits */
if (no_of_bits > 32)
/* Number of requested bits is in range [17, 32] */
if (no_of_bits > 16)
- return tvb_get_bits32(tvb, bit_offset, no_of_bits, little_endian);
+ return tvb_get_bits32(tvb, bit_offset, no_of_bits, encoding);
/* Number of requested bits is in range [9, 16] */
if (no_of_bits > 8)
- return tvb_get_bits16(tvb, bit_offset, no_of_bits, little_endian);
+ return tvb_get_bits16(tvb, bit_offset, no_of_bits, encoding);
/* Number of requested bits is in range [1, 8] */
return tvb_get_bits8(tvb, bit_offset, no_of_bits);
/* Fetch a specified number of bits from bit offset in a tvb */
extern guint8 tvb_get_bits8(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits);
-extern guint16 tvb_get_bits16(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboolean little_endian);
-extern guint32 tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboolean little_endian);
-extern guint64 tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboolean little_endian);
+extern guint16 tvb_get_bits16(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gint encoding);
+extern guint32 tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const guint encoding);
+extern guint64 tvb_get_bits64(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const guint encoding);
/* Fetch a specified number of bits from bit offset in a tvb, but allow number
* of bits to range between 1 and 32. If the requested number of bits is known
* beforehand, or its range can be handled by a single function of the group
* above, use one of them instead.
*/
-extern guint32 tvb_get_bits(tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const gboolean little_endian);
+extern guint32 tvb_get_bits(tvbuff_t *tvb, const gint bit_offset, const gint no_of_bits, const guint encoding);
void tvb_get_bits_buf(tvbuff_t *tvb, gint bit_offset, gint no_of_bits, guint8 *buf, gboolean lsb0);
guint8 *ep_tvb_get_bits(tvbuff_t *tvb, gint bit_offset, gint no_of_bits, gboolean lsb0);