aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.h
AgeCommit message (Collapse)AuthorFilesLines
2011-10-03Fix tpo.Guy Harris1-1/+1
svn path=/trunk/; revision=39240
2011-10-03tvb_get_bits{16,32,64} get passed encoding values. Rename the argumentGuy Harris1-4/+4
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-26Move tvb_new_octet_aligned() to tvbuff.c and use it.Anders Broman1-0/+7
svn path=/trunk/; revision=39150
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-10/+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-1/+12
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-0/+5
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-69/+6
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions. svn path=/trunk/; revision=37422
2011-05-18- Optimize tvb_get_bits_bufJakub Zawadzki1-2/+2
- 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/+3
svn path=/trunk/; revision=37217
2011-01-28Mention that the fake tvb unicode functions have been supercededStephen Fisher1-0/+3
svn path=/trunk/; revision=35689
2011-01-14Add tvb_get_[n|le]toh[40|48|56]() accessors. Addresses bug 5082.Chris Maynard1-0/+6
svn path=/trunk/; revision=35538
2011-01-12Introduce, and start using, tvb_get_const_stringz(). This function returns aJeff Morriss1-2/+8
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-0/+6
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-1/+18
/* * 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-23Introduce new function called tvb_get_ephemeral_unicode_stringz(), whichStephen Fisher1-0/+3
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-10-30Make tvb_strncaseeql()'s size parameter be a size_t. Cast the size to int ↵Jeff Morriss1-1/+1
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-1/+1
now-unnecessary casts. svn path=/trunk/; revision=34725
2010-08-29Doxygen changes.Anders Broman1-9/+10
svn path=/trunk/; revision=33990
2010-05-24Refer to the endianness arguments as "encoding" rather thanGuy Harris1-1/+1
"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-03 From Yaniv Kaul: constify parametersBill Meier1-86/+86
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-70/+70
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-70/+70
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-2/+3
svn path=/trunk/; revision=32144
2009-11-14From yy:Gerasimos Dimitriadis1-0/+7
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
2009-09-10offset_from_real_beginning() is only called with 0 as second argument, so ↵Kovarththanan Rajaratnam1-2/+2
remove the argument completely. It seems that the second argument only acts as an accumulator allowing offset_from_real_beginning() to call itself recursively. To be consistent offset_from_real_beginning() is renamed to tvb_offset_from_real_beginning(). svn path=/trunk/; revision=29844
2009-08-16Add a new function, tvb_new_subset_remaining(), which is a sligtly optimized ↵Kovarththanan Rajaratnam1-0/+4
version of tvb_new_subset(). The latter can be mapped to the former by tvb_new_subset(tvb, offset, -1 /* backing_length */, -1 /* reported_length */). We can disable some bounds checking because 'backing_length' and 'reported_length' are hardcoded to -1. The current implementation of tvb_new_subset_remaining() only has the THROW_ON(reported_length < 1) check removed when compared to tvb_new_subset(). So there's room for improvement in this function. We should be able to disable some more (redundant) bounds checking. svn path=/trunk/; revision=29445
2009-08-11Be a little more explicit in our description of tvb_get_ptr.Gerald Combs1-5/+12
svn path=/trunk/; revision=29379
2009-04-24Added tvb_format_stringzpad_wsp().Stig Bjørlykke1-0/+6
svn path=/trunk/; revision=28140
2009-04-05Back out the previous change. As Guy pointed out, we might not want toGerald Combs1-13/+13
be so size_t-happy. svn path=/trunk/; revision=27962
2009-04-04tvbuff.[ch]: Accept more size_t's.Gerald Combs1-13/+13
packet-wcp.c: Add size_t casts. packet-x11.c: Use string buffers. svn path=/trunk/; revision=27959
2009-04-03Make the "length" argument of the tvb_mem* functions a size_t since it'sGerald Combs1-4/+4
not uncommon to pass them the result of pointer arithmetic. Add size_t casts in other areas. svn path=/trunk/; revision=27941
2009-04-01Add to new functions from the optimization patch:Anders Broman1-0/+10
tvb_child_uncompress() tvb_new_child_real_data() svn path=/trunk/; revision=27924
2009-03-27Introduce two new functions:Stephen Fisher1-0/+10
tvb_get_seasonal_string(); tvb_get_seasonal_stringz(); .. which work the same as the ephemeral versions of the functions, but use se_alloc() instead of ep_alloc(). svn path=/trunk/; revision=27868
2008-04-09Remove:Anders Broman1-4/+0
#ifdef NEED_G_ASCII_STRCASECMP_H #include "g_ascii_strcasecmp.h" #endif svn path=/trunk/; revision=24859
2007-12-09Move the routines tvb_skip_wsp() to tvbuff.cAnders Broman1-0/+21
svn path=/trunk/; revision=23818
2007-11-27strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delendaGuy Harris1-2/+6
est. Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our own versions if they're missing from GLib (as is the case with GLib 1.x). In the code to build the list of named fields for Diameter, don't use g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping in the hash function and use g_ascii_strcasecmp() in the compare function. We do this because there is no guarantee that toupper(), tolower(), and functions that use them will, for example, map between "I" and "i" in all locales; in Turkish locales, for example, there are, in both upper case and lower case, versions of "i" with and without a dot, and the upper-case version of "i" is "I"-with-a-dot and the lower-case version of "I" is "i"-without-a-dot. This causes strings that should match not to match. This finishes fixing bug 2010 - an earlier checkin prevented the crash (as there are other ways to produce the same crash, e.g. a bogus dictionary.xml file), but didn't fix the case-insensitive string matching. svn path=/trunk/; revision=23623
2007-05-18Split tvb_get_bits64 into tvb_get_bits8 tvb_get_bits16 tvb_get_bits32 and ↵Anders Broman1-1/+4
tvb_get_bits64 and use them in proto_tree_add_bits_ret_val(). svn path=/trunk/; revision=21828
2007-04-28Make tvb_memdup(), like ep_tvb_memdup(), return a "void *".Guy Harris1-1/+1
svn path=/trunk/; revision=21610
2007-04-28Add:Anders Broman1-0/+2
proto_tree_add_bits_ret_val() tvb_get_bits() And modify proto_tree_add_bits() not to return a value. little endian is not yet implemented. svn path=/trunk/; revision=21607
2007-04-24"memcpy()" takes void *'s as arguments and returns a void *; haveGuy Harris1-2/+2
tvb_memcpy() be similar, to avoid unnecessarily alignment warnings. Do the same with "ep_tvb_memdup()". svn path=/trunk/; revision=21554
2007-04-23Add some GCC warnings to the standard set, and add some others to theGuy Harris1-1/+1
--enable-extra-gcc-checks set. If we turn on -pedantic, try turning on -Wno-long-long as well, so that it's not *so* pedantic that it rejects the 64-bit integral data types that we explicitly require. Constify a bunch of stuff, and make some other changes, to get rid of warnings. Clean up some indentation. svn path=/trunk/; revision=21526
2006-06-19New rutine tvb_format_text_wsp() which will change "whiite space" characters ↵Anders Broman1-0/+6
to space before output. svn path=/trunk/; revision=18519
2006-05-21name changeRonnie Sahlberg1-3/+3
svn path=/trunk/; revision=18197
2006-03-10new FT_GUID handling - big/little endian supportedTomas Kukosa1-0/+7
svn path=/trunk/; revision=17566
2005-09-21fix/add doxygen commentsUlf Lamping1-2/+2
svn path=/trunk/; revision=15941
2005-09-11Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,Guy Harris1-0/+1
and that extract IPv6 addresses into a "struct e_in6_addr", with tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we remove, by using proto_tree_add_item(), rather than replacing. Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct e_in6_addr" (not necessary to declare the tvbuff routines, but including it there means "struct e_in6_addr" is guaranteed to be defined before those declarations, so we don't get compiler complaints if we define it *after* those declarations). svn path=/trunk/; revision=15758
2005-09-10Add "tvb_get_ipv4()" and "tvb_get_ipv6()" addresses, to fetch IPv4 andGuy Harris1-0/+9
IPv6 addresses. Use "tvb_get_ipv4()" in the WINS Replication dissector, so that it gets the right answer on little-endian *AND* big-endian machines. svn path=/trunk/; revision=15753
2005-08-17snprintf -> g_snprintfUlf Lamping1-1/+1
svn path=/trunk/; revision=15398
2005-08-10add new function tvb_get_ephemeral_stringz()Ronnie Sahlberg1-0/+9
svn path=/trunk/; revision=15273