aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-28From Mike Morrin: Fix for "The previous patch had an error and was returning ↵Bill Meier1-84/+96
too many bits." https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6878 From me: Correct the indentation to match the rest of the file. svn path=/trunk/; revision=41230
2012-02-28Initialize "value" in _tvb_get_bits64(). Clean up indentation.Guy Harris1-1/+2
svn path=/trunk/; revision=41228
2012-02-28Fix several messages of type:Jörg Mayer1-6/+6
epan/tvbuff.c: In function ‘tvb_get_bits16’: epan/tvbuff.c:1736:82: error: unused parameter ‘encoding’ [-Werror=unused-parameter] Compilation still fails with: epan/tvbuff.c: In function ‘_tvb_get_bits64’: epan/tvbuff.c:1829:19: error: ‘value’ may be used uninitialized in this function [-Werror=uninitialized svn path=/trunk/; revision=41227
2012-02-28From Mike Morrin:Anders Broman1-214/+96
Overhaul of tvb_get_bitsxx() functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6878 svn path=/trunk/; revision=41226
2012-01-13Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+1
svn path=/trunk/; revision=40473
2011-12-22(Trivial) Indentation, whitespace & formatting cleanup.Bill Meier1-381/+383
svn path=/trunk/; revision=40278
2011-12-21A simplified version of tvbuffs:Bill Meier1-104/+87
- Essentially no changes from current dissector de facto tvbuff usage; - Do away with 'usage_counts' and with 'used_in' GSLists; - Manage tvb chains via a simple doubly linked list. - API changes: a. tvb_increment_usage_count() and tvb_decrement_usage_count() no longer exist; b. tvb_free_chain() can only be called for the 'top-level' (initial) tvb of a chain) or for a tvb not in a chain. c. tvb_free() now just calls tvb_free_chain() [should have no impact on existing dissectors]. svn path=/trunk/; revision=40264
2011-10-23Add a comment about tvb_get_ephemeral_faked_unicode() has been replaced by ↵Bill Meier1-0/+1
tvb_get_ephemeral_unicode_string(). svn path=/trunk/; revision=39528
2011-10-03tvb_get_bits{16,32,64} get passed encoding values. Rename the argumentGuy Harris1-9/+21
appropriately; the only valid encoding is big-endian, so we don't actually do anything different with the argument, so as not to break code that passed it a gboolean endian flag. svn path=/trunk/; revision=39237
2011-09-26Yet another bug fix from Pascal.Anders Broman1-1/+1
svn path=/trunk/; revision=39161
2011-09-26Another bug fix from Pascal.Anders Broman1-1/+1
svn path=/trunk/; revision=39155
2011-09-26From Pascal Quantin:Anders Broman1-7/+25
When building the last byte, the remaining number of bits isn't masked. svn path=/trunk/; revision=39152
2011-09-26Move tvb_new_octet_aligned() to tvbuff.c and use it.Anders Broman1-0/+48
svn path=/trunk/; revision=39150
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-36/+0
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and reassemble_cleanup() since they were only used for older GLib versions which didn't support GSlices. Assume we always support the "matches" operator. svn path=/trunk/; revision=37978
2011-07-05Add some additional routine variants that handle string encodings, andGuy Harris1-7/+26
make FT_STRING and FT_UINT_STRING handle string encodings. Get rid of FT_EBCDIC in favor of FT_STRING with ENC_EBCDIC. Add some URLs for DRDA. Clean up some stuff in TN3270 and TN5250, including using ENC_ values for proto_tree_add_item(). svn path=/trunk/; revision=37909
2011-07-03Add a tvb_get_ephemeral_string_enc() routine that's likeGuy Harris1-5/+17
tvb_get_ephemeral_string() but takes an ENC_ value for the character encoding. Use it in the MQ dissector to fetch strings to put, for example, into the Info column, so we properly handle EBCDIC strings there. svn path=/trunk/; revision=37876
2011-06-16Squelch some compiler warnings.Guy Harris1-1/+1
svn path=/trunk/; revision=37685
2011-05-27Make TVBs opaque for most users.Jeff Morriss1-1/+14
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions. svn path=/trunk/; revision=37422
2011-05-18Fix tvb_get_bits_buf for LSB.Jakub Zawadzki1-3/+8
svn path=/trunk/; revision=37264
2011-05-18- Optimize tvb_get_bits_bufJakub Zawadzki1-11/+41
- Add lsb0 (read: least significant bit is 0) parameter to tvb_get_bits_buf() (not tested, might be buggy...) svn path=/trunk/; revision=37254
2011-05-17Add generic tvb_get_bits_buf() which accepts any no_of_bits.Jakub Zawadzki1-0/+53
svn path=/trunk/; revision=37217
2011-05-12Fix double free. Jakub Zawadzki1-1/+1
compr is also freed outside loop. So free it only when returning. Might be related with bug #5908, but I don't have access to that bug ;-) svn path=/trunk/; revision=37081
2011-04-04From jakub Zawadzki:Anders Broman1-0/+2
I've fixed composite tests #0 and #2 svn path=/trunk/; revision=36440
2011-01-30Fix various instances of "unreachable code".Bill Meier1-2/+0
svn path=/trunk/; revision=35713
2011-01-28Mention that the fake tvb unicode functions have been supercededStephen Fisher1-0/+1
svn path=/trunk/; revision=35689
2011-01-20Fix the dead initialization warnings found by clang's static analysisStephen Fisher1-1/+1
("Value stored to 'xxx' during its initialization is never read") svn path=/trunk/; revision=35598
2011-01-14Add tvb_get_[n|le]toh[40|48|56]() accessors. Addresses bug 5082.Chris Maynard1-0/+54
svn path=/trunk/; revision=35538
2011-01-12There's no need to call tvb_get_ptr() in here: just call ensure_contiguous() ↵Jeff Morriss1-5/+5
directly. svn path=/trunk/; revision=35509
2011-01-12Introduce, and start using, tvb_get_const_stringz(). This function returns aJeff Morriss1-9/+34
pointer to a NULL-terminated string in the TVB. It is no safer than dissectors which call tvb_get_strsize() and then tvb_get_ptr() but it makes it clear that this usage of tvb_get_ptr() is safe. This function is slightly more efficient than tvb_get_ephemeral_stringz()--but only as long as we're not using composite TVBs. svn path=/trunk/; revision=35493
2011-01-03Introduce two new functions for Unicode (UTF-16) string handling:Stephen Fisher1-1/+98
tvb_get_unicode_string() tvb_get_ephemeral_unicode_string() These function like their counterparts, tvb_get_string and tvb_get_epemeral_string, for standard strings. Also update comment on what the first such function, tvb_get_ephemeral_unicode_stringz does regarding updating lengthp. svn path=/trunk/; revision=35344
2010-12-28Add tvb_bcd_dig_to_ep_str()Anders Broman1-0/+65
/* * Given a tvbuff, an offset into the tvbuff, and a length that starts * at that offset (which may be -1 for "all the way to the end of the * tvbuff"), fetch BCD encoded digits from a tvbuff starting from either * the low or high half byte, formating the digits according to an input digit set, * if NUll a default digit set of 0-9 returning "?" for overdecadic digits will be used. * A pointer to the EP allocated string will be returned. * Note a tvbuff content of 0xf is considered a 'filler' and will end the conversion. */ svn path=/trunk/; revision=35286
2010-12-23Add a couple more comments to new unicode function to remind us when aStephen Fisher1-2/+2
variable is counting UTF-16 characters vs. normal bytes. svn path=/trunk/; revision=35256
2010-12-23Remove comment to myself that I forgot to remove before commiting r35253Stephen Fisher1-4/+7
and change comments to fit within 80 column display. svn path=/trunk/; revision=35255
2010-12-23Introduce new function called tvb_get_ephemeral_unicode_stringz(), whichStephen Fisher1-0/+68
is a unicode (UTF-16) version of tvb_get_ephemeral_stringz(). It scans a tvbuff for a UTF-16 string and converts it to UTF-8 upon return. svn path=/trunk/; revision=35253
2010-11-23From Vincent Helfre:Anders Broman1-1/+1
Bug in tvb_get_bits32(), The last bitshift is too large, which causes the least significant bits to be 0 all the time. svn path=/trunk/; revision=35015
2010-10-30Make tvb_strncaseeql()'s size parameter be a size_t. Cast the size to int ↵Jeff Morriss1-3/+3
before calling ensure_contiguous_no_exception() (also in tvb_strneql()). svn path=/trunk/; revision=34727
2010-10-30Make tvb_strneql()'s size parameter be a size_t. Remove some ↵Jeff Morriss1-3/+3
now-unnecessary casts. svn path=/trunk/; revision=34725
2010-08-16Clean up indentation.Guy Harris1-24/+25
svn path=/trunk/; revision=33814
2010-08-16From rodebiet:Anders Broman1-16/+24
tvb_get_bits32 produces malformed_packet if no_of_bits < 25 and tvb remaining = 3 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5080 svn path=/trunk/; revision=33811
2010-05-24Refer to the endianness arguments as "encoding" rather thanGuy Harris1-2/+8
"representation" - we already use "representation" to refer to the text representation of fields. Change some routines with an endianness argument to make it a representation argument instead; svn path=/trunk/; revision=32929
2010-04-28From Jakub Zawadzki:Anders Broman1-16/+1
- use Glibc:s highly optimized memchr() svn path=/trunk/; revision=32584
2010-04-28From Jakub Zawadzki:Anders Broman1-15/+13
- optimize guint8_pbrk(). svn path=/trunk/; revision=32583
2010-04-03 From Yaniv Kaul: constify parametersBill Meier1-100/+100
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 From me: Fix a number of instances where the function prototype or the function definition wasn't changed so there was a mismatch thus causing Windows (but not gcc) compilation errors. svn path=/trunk/; revision=32365
2010-04-02Revert SVN #32360 until Windows compilation errors corrected.Bill Meier1-100/+100
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-100/+100
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 svn path=/trunk/; revision=32360
2010-03-08Make tvb_pbrk_guint8() return the found needle.Anders Broman1-11/+14
svn path=/trunk/; revision=32144
2010-01-28Fix various gcc -Wshadow warnings.Bill Meier1-16/+16
svn path=/trunk/; revision=31720
2010-01-25parent is not unused in tvb_child_uncompress().Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=31658
2009-11-23Make more output parameters optional.Jaap Keuter1-8/+16
svn path=/trunk/; revision=31059
2009-11-14From yy:Gerasimos Dimitriadis1-0/+22
About GSM system information type 2quater Modified to use newly defined tvb_get_bits() in tvbuff.c https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4219 svn path=/trunk/; revision=30962