From Mike Morrin: Overhaul of tvb_get_bitsxx() functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6878 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41226 f5534014-38df-0310-8fa8-9805f1628bb7
Add 'extern "C"' wrappers and #include guards to various header files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40321 f5534014-38df-0310-8fa8-9805f1628bb7
A simplified version of tvbuffs: - 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]. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40264 f5534014-38df-0310-8fa8-9805f1628bb7
Fix tpo. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39240 f5534014-38df-0310-8fa8-9805f1628bb7
tvb_get_bits{16,32,64} get passed encoding values. Rename the argument 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39237 f5534014-38df-0310-8fa8-9805f1628bb7
Move tvb_new_octet_aligned() to tvbuff.c and use it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39150 f5534014-38df-0310-8fa8-9805f1628bb7
More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37978 f5534014-38df-0310-8fa8-9805f1628bb7
Add some additional routine variants that handle string encodings, and 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(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37909 f5534014-38df-0310-8fa8-9805f1628bb7
Add a tvb_get_ephemeral_string_enc() routine that's like 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37876 f5534014-38df-0310-8fa8-9805f1628bb7
Squelch some compiler warnings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37685 f5534014-38df-0310-8fa8-9805f1628bb7
Make TVBs opaque for most users. Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37422 f5534014-38df-0310-8fa8-9805f1628bb7
- Optimize tvb_get_bits_buf - Add lsb0 (read: least significant bit is 0) parameter to tvb_get_bits_buf() (not tested, might be buggy...) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37254 f5534014-38df-0310-8fa8-9805f1628bb7
Add generic tvb_get_bits_buf() which accepts any no_of_bits. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37217 f5534014-38df-0310-8fa8-9805f1628bb7
Mention that the fake tvb unicode functions have been superceded git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35689 f5534014-38df-0310-8fa8-9805f1628bb7
Add tvb_get_[n|le]toh[40|48|56]() accessors. Addresses bug 5082. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35538 f5534014-38df-0310-8fa8-9805f1628bb7
Introduce, and start using, tvb_get_const_stringz(). This function returns a 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35493 f5534014-38df-0310-8fa8-9805f1628bb7
Introduce two new functions for Unicode (UTF-16) string handling: 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35344 f5534014-38df-0310-8fa8-9805f1628bb7
Add tvb_bcd_dig_to_ep_str() /* * 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. */ git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35286 f5534014-38df-0310-8fa8-9805f1628bb7
Introduce new function called tvb_get_ephemeral_unicode_stringz(), which 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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35253 f5534014-38df-0310-8fa8-9805f1628bb7
Make tvb_strncaseeql()'s size parameter be a size_t. Cast the size to int before calling ensure_contiguous_no_exception() (also in tvb_strneql()). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34727 f5534014-38df-0310-8fa8-9805f1628bb7