Commit Graph

223 Commits

Author SHA1 Message Date
Jakub Zawadzki 1db996e051 MT: move global field_info_tmp to tree_data_t
svn path=/trunk/; revision=44747
2012-09-03 12:00:08 +00:00
Gerald Combs cd3cca7edc Make the corresponding packet_info available to each tree item. This
lets us pass a NULL pinfo to expert_add_info_format() and
expert_add_undecoded_item(), which makes it possible to use those
routines deep in the bowels of many dissectors. As a proof of concept
remove the recent pinfo additions to packet-afp.c. This should also make
it easier to fix bug 3884.

svn path=/trunk/; revision=44435
2012-08-10 20:33:01 +00:00
Guy Harris 835111692f From Richard Stearn: support for AX.25, including support for
LINKTYPE_AX25.

svn path=/trunk/; revision=44211
2012-08-02 16:54:43 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jakub Zawadzki 85aad38347 Add proto_tree_add_unicode_string() to add UTF-8 string to tree.
Convert some proto_tree_add_string_format_value(..., val, "%s", val); to use new function.

svn path=/trunk/; revision=43363
2012-06-19 14:32:24 +00:00
Guy Harris 14b616c35d Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

Add new "add_packet_field" method to the TreeItem class, taking a
protocol field (*not* a protocol), TvbRange, and encoding value as
arguments.

Add the ENC_ values to init.lua.  Make them all hex #defines so
make-init-lua.pl can easily extract them.

Export tvb_unicode_strsize() for use by Lua (and elsewhere as desired). 
Note that it handles UTF-16 and UTF-8, and fix the comment to note that
its count of hexadectets *does* include the null terminator (that's what
the code does).

svn path=/trunk/; revision=42621
2012-05-14 00:49:05 +00:00
Guy Harris 7a87d7b6a3 Add ENC_UTF_16 and ENC_UCS_2. Note that UTF-16 and UCS-2 are not the
same, and that the routines to get "Unicode" strings are really doing
UCS-2 (and not doing anything about code values that aren't valid in
UCS-2 strings).

Have tvb_get_ephemeral_string_enc() separate cases for ASCII and UTF-8,
even though they're *currently* treated the same.

For FT_UINT_STRING, treat an encoding value of TRUE as meaning
"little-endian ASCII"; pass all other encodings through to
tvb_get_ephemeral_string_enc().

svn path=/trunk/; revision=42592
2012-05-11 23:55:54 +00:00
Guy Harris f1b11f62f8 proto_registrar_get_ftype() returns an FT_ value; make its return type
"enum ftenum" to reflect that, and fix the "switch doesn't handle XXX"
warnings that provokes.

svn path=/trunk/; revision=42579
2012-05-11 17:29:56 +00:00
Anders Broman 0cea399fda From Jakub Zawadzki: Use custom model in Filter Expression dialog.
svn path=/trunk/; revision=42411
2012-05-04 04:44:23 +00:00
Anders Broman 82a60c13d0 From Evan Huus: Add DISSECTOR_ASSERT_HINT() macro https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7142
svn path=/trunk/; revision=42137
2012-04-19 05:44:50 +00:00
Gerald Combs 8b3024e57c Make bit_offset in _tvb_get_bits64 and related functions unsigned. This
removes a potential buffer overflow and should fix a bunch of Coverity
errors mentioned in bug 6878.

We might want to do the same for no_of_bits.

svn path=/trunk/; revision=41945
2012-04-04 21:54:22 +00:00
Anders Broman ff47bdf96c Use the expert system to show packet comments.
The packet comment widget should be replaced by a ListView with two columns,  packet no and Comment.

svn path=/trunk/; revision=41322
2012-03-02 13:31:16 +00:00
Anders Broman b28516dc00 From Mike Morrin: A small patch to correct the name of the function proto_tree_add_split_bits_item_ret_val()
svn path=/trunk/; revision=41255
2012-03-01 07:01:15 +00:00
Anders Broman 597047d253 From Mike Morrin:
The attached patches add the ability to dissect split bit-strings as discussed under bug 6797.
proto_tree_add_split_bits_ret_val()
proto_tree_add_split_bits_crumb()

svn path=/trunk/; revision=41246
2012-02-29 17:13:43 +00:00
Gerald Combs 3c1b8a6ca1 Add a "-G ftypes" option, which dumps our supprted FT_… names and
descriptions. Captitalize and fix up the descriptions. Use its output to
create the field type list in the wireshark-filter man page.

svn path=/trunk/; revision=40306
2011-12-27 20:35:41 +00:00
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