Commit Graph

457 Commits

Author SHA1 Message Date
Stig Bjørlykke 447de1178d Allow signed integers displayed as BASE_HEX_DEC.
svn path=/trunk/; revision=39571
2011-10-25 19:04:10 +00:00
Stig Bjørlykke 48f714096a Display BASE_DEC_HEX correct for int64/uint64.
svn path=/trunk/; revision=39569
2011-10-25 17:58:08 +00:00
Stig Bjørlykke 9cc2219ff8 Added missing support for FT_INT64 in proto_tree_add_bits_format_value().
svn path=/trunk/; revision=39561
2011-10-25 10:55:52 +00:00
Stig Bjørlykke b5b8fadc6d Simplified code checking if FT_UINT64 is displayed as BASE_NONE.
svn path=/trunk/; revision=39560
2011-10-25 10:48:20 +00:00
Stig Bjørlykke a37dff8930 Allow signed integers displayed as DEC_HEX.
svn path=/trunk/; revision=39559
2011-10-25 10:48:11 +00:00
Stig Bjørlykke fdc15f6cd5 Fixed using signed 64-bits integer in custom column.
svn path=/trunk/; revision=39558
2011-10-25 10:48:03 +00:00
Stig Bjørlykke 9a4f284ed4 Revert "Allow value_strings for FT_INT64 and FT_UINT64.", as we
haven't generic support for value_strings for 64-bit values yet.

svn path=/trunk/; revision=39557
2011-10-25 10:26:30 +00:00
Stig Bjørlykke f3f1b20539 Allow value_strings for FT_INT64 and FT_UINT64.
svn path=/trunk/; revision=39556
2011-10-25 07:46:25 +00:00
Bill Meier 6a5895b2de Convert proto_tree_add_bitmask(), proto_tree_add_bitmask_text(), proto_tree_add_bitmask_tree() to have 'encoding' arg rather than 'little_endian' arg
svn path=/trunk/; revision=39538
2011-10-24 19:52:43 +00:00
Stig Bjørlykke d2922fb136 Use g_tree_steal to remove an entry without calling the destroy function.
This because we use the destroy function to determine same_name_hfinfo.

svn path=/trunk/; revision=39267
2011-10-05 11:44:19 +00:00
Stig Bjørlykke 21dbaea387 Add proto_unregister_field().
This can be used to unregister fields registered in dissector UAT's.

svn path=/trunk/; revision=39248
2011-10-04 10:12:55 +00:00
Stig Bjørlykke 64c2355b67 Removed the protocol registration updates in the splash screen for Python
dissectors, because it does not work as expected and causes an assert.

Added generic splash updates for python register and handoff instead.

This should fix bug 5431.

svn path=/trunk/; revision=39221
2011-10-02 16:19:55 +00:00
Anders Broman 00e46951ad In proto_tree_add_bits... use const guint encoding to be consistent with proto_tree_add_item().
svn path=/trunk/; revision=39163
2011-09-27 12:04:29 +00:00
Anders Broman ec41ae8a1b From Sylvain Munaut:
Add support for signed types in _proto_tree_add_bits_ret_val

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6363

svn path=/trunk/; revision=39060
2011-09-20 11:29:53 +00:00
Anders Broman 54dc8d1f54 From Sylvain Munaut:
proto: Use fill_label_xxx helpers in _proto_tree_add_bits_ret_val

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6329

svn path=/trunk/; revision=39026
2011-09-16 06:12:12 +00:00
Guy Harris 053c583fda 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().

svn path=/trunk/; revision=37909
2011-07-05 23:59:23 +00:00
Guy Harris ae7f40cbfc Add ENC_ values for UTF-8 and EBCDIC, support them for FT_STRINGZ
values, and use them in the MQ dissector, so EBCDIC strings are
displayed as such.

Fix up some other final arguments to proto_tree_add_item().

svn path=/trunk/; revision=37872
2011-07-03 01:40:12 +00:00
Stig Bjørlykke 7491b68a3a Make guy's fix in revision 37236 actually work:
"You cannot just make the "len" field of a GByteArray larger, if there's
no data to back that length; you can only make it smaller."

Two equal values are always equal!

This fixes bug 5941.

svn path=/trunk/; revision=37783
2011-06-25 14:58:06 +00:00
Stig Bjørlykke e2994a1b0d Make creating a display filter from a custom column defined as integer with
strings and BASE_NONE equal to selecting the filter from the tree entry.

svn path=/trunk/; revision=37720
2011-06-19 19:29:19 +00:00
Stig Bjørlykke 63e273c2c5 Handle BASE_NONE as BASE_DEC for filter expression in custom columns.
This fixes bug 6035.

svn path=/trunk/; revision=37705
2011-06-19 10:15:05 +00:00
Guy Harris 4447b23f6b Squelch some compiler warnings.
svn path=/trunk/; revision=37685
2011-06-16 18:34:17 +00:00
Bill Meier 4f420ef6cd Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings
svn path=/trunk/; revision=37600
2011-06-07 22:28:55 +00:00
Jeff Morriss f3f9f2697f Make TVBs opaque for most users.
Convert TVB_RAW_OFFSET() and TVB_GET_DS_TVB() into functions.

svn path=/trunk/; revision=37422
2011-05-27 03:06:50 +00:00
Martin Mathieson af896ce356 Add a check that (plain) value_strings that are used in hf items don't have
any conflicting entries.  i.e. lots of value_strings have repeated items, but
for now only warn for cases where the same numeric value appears with a
different string.

Because this will slow down startup and output distracting warnings, it has been
#if 0'd out for now.  As discussed on the dev mailing list, it'd be good to
create a #define for developer/non-release builds so that tests such as this
can regularly be run.

svn path=/trunk/; revision=37274
2011-05-19 01:21:48 +00:00
Guy Harris aa392a40fe You cannot just make the "len" field of a GByteArray larger, if there's
no data to back that length; you can only make it smaller.

svn path=/trunk/; revision=37236
2011-05-18 07:20:45 +00:00
Guy Harris fc65604b7e Make some more routines not used outside epan/proto.c static.
svn path=/trunk/; revision=37235
2011-05-18 03:28:26 +00:00
Jakub Zawadzki 17f6352c2e Convert SLAB_-s, to sl_-API.
svn path=/trunk/; revision=37030
2011-05-09 12:52:55 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector 
* Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name
* Update Documentation (README.dev)
* Add new function in libwireshark.def
* Support of encoding for tvb_eui64_to_str
* Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector

svn path=/trunk/; revision=37015
2011-05-08 10:23:53 +00:00
Chris Maynard 50bad80299 Use g_strlcpy() instead of prohibited strncpy() to guarantee NULL-termination.
svn path=/trunk/; revision=36553
2011-04-11 13:38:32 +00:00
Stig Bjørlykke 332e0263ed strcpy -> strncpy.
Coverity 669.

svn path=/trunk/; revision=36543
2011-04-10 18:29:56 +00:00
Stig Bjørlykke 9e5a9badda Guard against NULL return from find_protocol_by_id().
svn path=/trunk/; revision=36393
2011-03-29 11:09:59 +00:00
Chris Maynard 15503bf4aa Don't use prohibited strncpy(). In this case, use g_strlcat() instead.
svn path=/trunk/; revision=36382
2011-03-28 16:42:25 +00:00
Stig Bjørlykke 33814e3b39 Added a FALLTHRU comment to avoid a coverity warning.
Coverity 480.

svn path=/trunk/; revision=36350
2011-03-26 15:24:36 +00:00
Guy Harris 5c3d724bca Clean up indentation.
svn path=/trunk/; revision=36213
2011-03-20 00:05:39 +00:00
Jeff Morriss 50e1634f4c Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()
so that if the start_ptr is NULL the bytes are extracted from the given TVB
using the given offset and length.

Replace a bunch of:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...])

with:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...])

svn path=/trunk/; revision=35896
2011-02-10 16:31:00 +00:00
Jeff Morriss b87a80f196 Add support for 4-byte NTP times (only the seconds) in proto_tree_add_item().
Use it in packet-diameter.c .  Eliminate an unnecessary local variable.

svn path=/trunk/; revision=35875
2011-02-08 02:38:51 +00:00
Guy Harris 4f7ae8bf3a For FT_{ABSOLUTE,RELATIVE}_TIME, make the rest of the encoding
orthogonal to the byte order.

This means that we can't just test for a non-zero encoding to determine
whether the format is big-endian or little-endian when we set the
field's endianness flag; instead, for the types where we accept any
non-zero value as meaning "litle-endian", map it to ENC_LITTLE_ENDIAN.

When we use ENC_TIME_NTP, OR in the byte order flag.  While we're at it,
in the dissectors that used ENC_TIME_NTP, update all the other encoding
items in proto_tree_add_item() calls to use the appropriate ENC_ value.

svn path=/trunk/; revision=35841
2011-02-07 08:18:12 +00:00
Jeff Morriss 8fc6e28b6a Add support for passing NTP times to proto_tree_add_item() by specifying
an encoding of ENC_TIME_NTP.

This increases the number of decimal places shown for NTP times (from 6 to 9),
so round the value to the nearest microsecond.  (I can't tell if NTP times are
ever more precise than a microsecond--this rounding is mainly to be closer to
the old behavior.)

Use proto_tree_add_item() for some NTP times.

svn path=/trunk/; revision=35840
2011-02-07 03:31:40 +00:00
Anders Broman 758dc5b9a3 Fix Bug 5500 - failed assertion in ISAKMP dissector (proto.c:4002)
By reinseringt the check in proto_tree_move_item() if tree vissible
removed in http://anonsvn.wireshark.org/viewvc?view=rev&revision=32443
Hopefully not breaking tshark again.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5500

svn path=/trunk/; revision=35817
2011-02-04 12:16:26 +00:00
Guy Harris 97e4949828 Fix indentation.
svn path=/trunk/; revision=35329
2011-01-02 19:53:48 +00:00
Bill Meier a7063f9cc8 'tshark -G values' - Validate (somewhat) value_string_ext before use to prevent a crash.
svn path=/trunk/; revision=34869
2010-11-14 16:30:56 +00:00
Bill Meier cfdd78166f Enhance 'tshark -G values': Add info about extended value strings (including acess method).
svn path=/trunk/; revision=34854
2010-11-12 19:48:30 +00:00
Bill Meier 9e7d296e0b Use val_to_str_const & val_to_str_ext_const where appropriate.
svn path=/trunk/; revision=34850
2010-11-12 15:34:30 +00:00
Bill Meier 15851701e8 Rework "extended value strings":
- Allow direct access when a range of values begins with a value other than 0;
- Provide value_string_ext_new() for creating extended value strings at runtime;
- Do access to value_string_ext members via a macro (all but value_string.c);
- Update documentation.

svn path=/trunk/; revision=34514
2010-10-14 17:50:35 +00:00
Stig Bjørlykke 6ead8f1ae5 Support multiple header fields with the same abbreviation in custom columns.
We have some different fields using the same abbreviation (e.g "eth.dst"
used in both eth and tte), and this patch will fetch values from all fields.
When using occurrences the entries listed first is from the field registered
last when starting Wireshark, and not ordered from the occurrence in the
packet, but I don't see how we can easily fix this.

svn path=/trunk/; revision=34513
2010-10-14 13:11:03 +00:00
Bill Meier ce887cb60d Fix crash for 'tshark -G values' when printing "extended value string" value.
Fixes bug #5296 [ https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5296 ]

svn path=/trunk/; revision=34507
2010-10-14 04:53:07 +00:00
Sake Blok 7ec231f7f1 Fix the output of columns with "show resolved" disabled when all occurrences are displayed.
Limit the input field for occurrence to 4 characters to prevent an overflow.
Make sure "... as filter" does not result in an invalid filter string if all occurrences are displayed.


svn path=/trunk/; revision=34247
2010-09-25 09:33:29 +00:00
Jeff Morriss dfcc9ec3f7 Add some more casts.
svn path=/trunk/; revision=34208
2010-09-23 13:26:41 +00:00
Jeff Morriss f12ef203b3 Revert 34191 and add some casts instead
svn path=/trunk/; revision=34193
2010-09-23 06:00:22 +00:00
Jeff Morriss 7cdf98c245 Use gsize (size_t) in a couple of places to make the Win64 build happy.
svn path=/trunk/; revision=34191
2010-09-23 01:14:44 +00:00