Commit Graph

208 Commits

Author SHA1 Message Date
Bill Meier eeaf3993ad (Trivial) remove an extra blank line.
svn path=/trunk/; revision=39909
2011-11-17 17:36:29 +00:00
Chris Maynard 934c2ce1a2 Move FI_RESET_FLAG and PROTO_ITEM_SET_VISIBLE macros to proto.h and fix the FI_RESET_FLAG macro, being sure to use the 1's complement operator, '~', instead of the logical negation operator, '!'. (Fixes Coverity CID 1326).
svn path=/trunk/; revision=39888
2011-11-16 20:09:49 +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
Guy Harris 6358754048 Note some character encodings that can probably be used Real Soon Now,
and the dissectors that deal with them.

svn path=/trunk/; revision=39456
2011-10-18 06:50:20 +00:00
Chris Maynard cf4d497af4 Some minor documentation changes: little_endian -> encoding. Also, fully parenthesize FI_BITS_OFFSET, FI_BITS_SIZE, and FI_GET_FLAG macro arguments.
svn path=/trunk/; revision=39273
2011-10-05 18:22:30 +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
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
Guy Harris 0989347195 Add an ENC_ASCII; right now, it's the same as ENC_UTF_8, but it should
eventually cause all bytes with the 8th bit set to be displayed as error
indications.

svn path=/trunk/; revision=39064
2011-09-20 17:42:27 +00:00
Gerald Combs 49b92440de 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.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Guy Harris 338af96b2e 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.

svn path=/trunk/; revision=37876
2011-07-03 17:08:25 +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
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
Jeff Morriss ecf8cbed34 As suggested by Jakub Zawadzki:
Rename g_gnuc_malloc.h to g_gnuc.h (since it contains non-malloc related
GNUC stuff).

Use G_GNUC_WARN_UNUSED_RESULT from glib instead of using warn_unused_result
directly.

svn path=/trunk/; revision=36825
2011-04-22 17:57:10 +00:00
Stephen Fisher 6da2292163 Fix whitespace a bit and add field names from doc/README.developer to
comments such as FIELDNAME, FIELDABBREV, etc.


svn path=/trunk/; revision=36817
2011-04-22 17:08:59 +00:00
Jeff Morriss 64e31d0b0d If we're using GNUC, use attribute warn_unused_result to verify that the
return value of proto_item_add_subtree() is used.

(The WARN_IF_UNUSED macro doesn't belong here...  But where should it go?)

svn path=/trunk/; revision=36812
2011-04-22 15:15:10 +00:00
Gerald Combs 33819c43c8 Add a hint for Visual C++ to DISSECTOR_ASSERT. Hopefully this will
reduce some of the /analyze false positives.

svn path=/trunk/; revision=35990
2011-02-17 23:21:07 +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
Jeff Morriss 6deff94555 Add comments indicating that the DISSECTOR_ASSERT() routines should not be used to report malformed packets.
svn path=/trunk/; revision=34466
2010-10-11 01:28:22 +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
Sake Blok 7364bef1b3 When using a custom column, make it possible to select which occurrence to show if the field has multiple occurrences.
svn path=/trunk/; revision=34186
2010-09-22 20:56:14 +00:00
Anders Broman a009cc0605 Doxygen changes.
svn path=/trunk/; revision=33990
2010-08-29 10:47:38 +00:00
Anders Broman a96e6b2047 Doxygen changes.
svn path=/trunk/; revision=33981
2010-08-28 19:27:19 +00:00
Anders Broman a20bf7af0d Fix doxygen errors.
svn path=/trunk/; revision=33938
2010-08-26 19:40:08 +00:00
Stig Bjørlykke 90cb202dbd Added proto_item_prepend_text().
svn path=/trunk/; revision=33800
2010-08-14 17:24:21 +00:00
Martin Mathieson 7c4ec2e051 Expert severity was still overlapping with bits length, so separate them.
svn path=/trunk/; revision=32974
2010-05-26 13:53:17 +00:00
Martin Mathieson ee5c636603 Re-organise which FI bits are used to store expert severity and event info, in order to avoid clash with bit offset and length as added in 4413 (Improve bitview display).
The event info values were (mostly) done as though they were flags rather than values, but as it doesn't really make sense to combine events I changed them to use contiguous values.  They now use the 8 m.s. bits, so there are now 9 unused bits available for new uses.

svn path=/trunk/; revision=32945
2010-05-25 11:21:51 +00:00
Guy Harris 1b444c55fd Refer to the endianness arguments as "encoding" rather than
"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-05-24 06:06:17 +00:00
Guy Harris 998677339e Create a new REP_NA value for fields where there are no representations
from which to choose; use that for protocol fields in some protocols
(modify the CORBA generator to use it, and manually update the generated
CORBA dissectors accordingly).

svn path=/trunk/; revision=32777
2010-05-13 00:20:40 +00:00
Guy Harris 4ff4ebe3c5 Add REP_{BIG,LITTLE}_ENDIAN #defines, for possible future use in
proto_tree_add_item() and field definitions, and for current use if
somebody finds it more self-documenting (some dissectors already have
their own #defines for that purpose).

svn path=/trunk/; revision=32775
2010-05-12 22:35:56 +00:00
Anders Broman e87ddd657c From Jakub Zawadzki:
Fix copy&paste error + add support for proto_tree_add_bits API
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4413

svn path=/trunk/; revision=32634
2010-05-02 15:37:23 +00:00
Anders Broman ab825ec9d9 From Jakub Zawadzki:
- use function pointers instead of switch.
 - initalize ->match_type during first use of match_str() func.

svn path=/trunk/; revision=32576
2010-04-27 12:38:49 +00:00
Anders Broman fab55e4772 From Jakub Zawadzki:
Itroduce value_string_ext for faster value matching in value_strings.

svn path=/trunk/; revision=32574
2010-04-27 10:32:34 +00:00
Anders Broman c705b3bc88 From Jakub Zawadzki:
Add support for multi byte entries.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4413

svn path=/trunk/; revision=32525
2010-04-20 17:32:12 +00:00
Bill Meier 9aea38f51c Revise comment on use of 'display' field in hf[] entry to show
that for FT_BOOLEAN the display field contains the bit-field width
only when hf[] entry bitmask is non-zero.


svn path=/trunk/; revision=32476
2010-04-15 19:40:11 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
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-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Jaap Keuter bedb8715e9 Fix for bug 4565:
As a true 'pseudo' GLib function, act benign when presented a NULL pointer.

svn path=/trunk/; revision=32193
2010-03-15 08:14:58 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Stig Bjørlykke 9092486f58 Changed from using own defined GNUC_FORMAT_CHECK to G_GNUC_PRINTF
defined in GLib.  Removed epan/gnuc_format_check.h.

svn path=/trunk/; revision=31657
2010-01-25 13:20:53 +00:00
Gerasimos Dimitriadis 383f6a65dc Add _format_value variants of the proto_tree_add_bits function
for different header field types; now possible to add bits item
for FT_FLOAT and FT_INT types.

svn path=/trunk/; revision=31633
2010-01-23 16:17:17 +00:00
Gerald Combs 2efa26e0e1 Fix a double-free bug which was causing a crash. Our decryption buffer
length doesn't change, so allocate it just once. Add an expert item for
a successful decryption.

svn path=/trunk/; revision=31571
2010-01-19 19:28:30 +00:00
Guy Harris 8e236e55de For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.

svn path=/trunk/; revision=31319
2009-12-19 03:17:44 +00:00
Stig Bjørlykke 29a4a0789a Added expert info group PI_PROTOCOL.
svn path=/trunk/; revision=31308
2009-12-18 15:13:44 +00:00
Guy Harris a4b7135ce3 Rename BASE_STRUCTURE_RESET to BASE_DISPLAY_E_MASK, to clarify that it's
a mask to select the base_display_e value from a display field in a
header_field_info structure.

Never select that value by masking out the BASE_RANGE_STRING flag bit,
as that won't continue to work if more flag bits, or other bitfields,
are added.  Instead, mask with BASE_DISPLAY_E_MASK.

Note that the base_display_e value and BASE_RANGE_STRING flag are only
for integral field types, and clarify what BASE_DISPLAY_E_MASK is.

Give at least one of the reasons why hiding protocol fields is not
considered a good idea.

svn path=/trunk/; revision=31249
2009-12-12 03:15:28 +00:00
Kovarththanan Rajaratnam a2f211d07b Don't rely on G_STMT
svn path=/trunk/; revision=31042
2009-11-21 11:03:14 +00:00
Kovarththanan Rajaratnam 9bbbd6ef0e Rewrite macros to not use ternary operator
svn path=/trunk/; revision=31041
2009-11-21 10:45:35 +00:00
Jeff Morriss 8ec5a160ec Make sure no one calls PROTO_ITEM_SET_*(proto_tree_add_*) by forcing a compile error if they do.
svn path=/trunk/; revision=30645
2009-10-20 17:39:22 +00:00