Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 6878] New: Overhaul of tvb_get_bitsxx() functions

Date: Mon, 27 Feb 2012 23:53:59 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6878

           Summary: Overhaul of tvb_get_bitsxx() functions
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: wireshark@xxxxxxxxxxxxxxx


Created attachment 7906
  --> https://bugs.wireshark.org/bugzilla/attachment.cgi?id=7906
patch for tvbuff.c and tvbuff.h

Build Information:
svn 41218
--
The initial problem was that tvb_get_bits64() had deficiencies: - it would
throw an exception if the requested bitlength was less than 32, and it would
throw an exception if the tvb had less than 8 octets after the the initial
offset (could not get a 40 bit number from a 7 octet tvb).

So I wrote a new generalised version of tvb_get_bits64() which will fetch 1-64
bits from any tvb that can contain them.

I then thought that this new function could replace tvb_get_bits(), as it
appears to be at least as efficient, and that extended to replacing all of the
tvb_get_bitsxx() functions.

I am submitting the patch now for comments, it has not had sufficient testing
yet to be considered ready for merge.

If the entire patch is considered too radical, then I would resubmit just the
tvb_get_bits64() function.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.