Commit Graph

361 Commits

Author SHA1 Message Date
Jaap Keuter ee2043792f Tighten header field checks.
svn path=/trunk/; revision=30410
2009-10-08 21:26:26 +00:00
Kovarththanan Rajaratnam e981de7a99 Don't attempt to fill custom columns if we don't have a valid column expression.
svn path=/trunk/; revision=30407
2009-10-08 16:35:58 +00:00
Stig Bjørlykke 5bc9611d56 Removed a redundant prototype.
Made wrs_count_bitshift static.

svn path=/trunk/; revision=30387
2009-10-07 08:37:18 +00:00
Bill Meier bf85ecb308 Rename hfinfo.ref_count to hfinfo.ref_type since that's now how it's used.
svn path=/trunk/; revision=30216
2009-09-30 14:02:49 +00:00
Stig Bjørlykke ad14865ce0 Removed unused variable 'hfinfo' in proto_tree_set_time().
svn path=/trunk/; revision=30197
2009-09-29 19:16:52 +00:00
Kovarththanan Rajaratnam 778fe81f72 (Trivial) White space changes
svn path=/trunk/; revision=30095
2009-09-23 16:27:37 +00:00
Bill Meier 5bbec764db (Trivial) Rework a comment slightly.
svn path=/trunk/; revision=30080
2009-09-22 20:17:31 +00:00
Kovarththanan Rajaratnam 56b8d36e03 Introduce a few FT_XXX lengths defines and use those instead of hard coding constants
svn path=/trunk/; revision=29846
2009-09-10 18:22:33 +00:00
Gerald Combs c238175acf Move the infinite loop check from proto_tree_add_node to
TRY_TO_FAKE_THIS_ITEM. Partial fix for bug 3986.

svn path=/trunk/; revision=29811
2009-09-08 22:56:55 +00:00
Kovarththanan Rajaratnam d2db67480c Use g_strlcpy when possible
svn path=/trunk/; revision=29808
2009-09-08 20:06:52 +00:00
Anders Broman c6d4c80371 From : Didier Gautheron
speed up a little proto_custom_set.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3972

svn path=/trunk/; revision=29789
2009-09-08 10:33:15 +00:00
Kovarththanan Rajaratnam 571e69fdfa We don't currently fake fields if they are referenced indirectly through some other fields (currently only FT_PROTOCOL's can be indirectly referenced) . However, there doesn't seem to be any reason for this restriction. We already have proto_tree_set_fake_protocols() to disable 'faking' if any clients requires this. So, this changelist removes this restriction on indirectly referenced fields.
svn path=/trunk/; revision=29742
2009-09-06 11:30:41 +00:00
Kovarththanan Rajaratnam 820ce62af5 This fix was supposed to be in r29731 which some how only contained whitespace changes.
svn path=/trunk/; revision=29732
2009-09-06 07:33:07 +00:00
Kovarththanan Rajaratnam 9c512f7cb4 Introduce TRY_TO_FAKE_THIS_REPR which is an optimization similar to the existing TRY_TO_FAKE_THIS_ITEM. The purpose of TRY_TO_FAKE_THIS_REPR is to avoid generating the string representation for the protocol item. There is no point in doing this if the protocol tree isn't visible. In this case the result will be discarded any way.
svn path=/trunk/; revision=29731
2009-09-06 07:24:54 +00:00
Kovarththanan Rajaratnam 4df25480b7 The frame dissector disables the TRY_TO_FAKE_THIS_ITEM() optimization by marking the protocol tree as permamently visible. It only needs to disable the optimization temporarily while it creates the protocol item it intends to use proto_item_append_string() on
svn path=/trunk/; revision=29730
2009-09-06 06:33:13 +00:00
Kovarththanan Rajaratnam 17f010119a From Jakub Zawadzki via. Bug 3330:
* Fix memleak (df->deprecated in dfilter_free())
* Free protocol hash tables on cleanup.
* Free protocols list on cleanup.
* Free memory allocated by fgetline() in parse_services_file()

From me:

* proto.c: set gmc_hfinfo to NULL after free
* proto.c: switch order of g_free() and g_list_remove() in proto_cleanup()

svn path=/trunk/; revision=29656
2009-09-01 18:16:55 +00:00
Kovarththanan Rajaratnam 8cba530c81 From Richard Brodie via. Bug 3913:
Free ptr array allocated through proto_find_finfo()

svn path=/trunk/; revision=29654
2009-09-01 17:09:36 +00:00
Kovarththanan Rajaratnam cd49063473 Revert r29614 until I figure out why buildbot doesn't like it
svn path=/trunk/; revision=29615
2009-08-29 07:53:48 +00:00
Kovarththanan Rajaratnam cc948586bf Use G_STRINGIFY/G_PASTE
svn path=/trunk/; revision=29614
2009-08-29 06:42:23 +00:00
Jörg Mayer 4d8506486f After asking on the list and receiving no feedback, I'll
just commit this:

Change the checks for type FT_IPv6 to no longer require
a lenght of exaclty 16 bytes, but something between
0 and 16 bytes. That way, we can filter on prefixes
that do not provide the whole length of 16 bytes.

svn path=/trunk/; revision=29594
2009-08-28 09:38:34 +00:00
Anders Broman 32e7cddf70 From Didier Gautheron:
move custom col set from  proto_tree_set_xxx() to
epan_dissect_fill_in_columns().
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3930

I'v added the new functions to the .h files.

svn path=/trunk/; revision=29551
2009-08-25 21:10:35 +00:00
Kovarththanan Rajaratnam da1e555499 Don't dereference pointer before checking for NULL
svn path=/trunk/; revision=29503
2009-08-21 23:02:59 +00:00
Kovarththanan Rajaratnam 8a3f4f53eb Delay TRY_TO_FAKE_THIS_ITEM() in proto_tree_add_bits_ret_val() until we know it is safe.
Thanks to Martin for pointing this out in r29493.

svn path=/trunk/; revision=29494
2009-08-21 17:11:02 +00:00
Martin Mathieson 044aabb9ea Don't try TRY_TO_FAKE_THIS_ITEM in proto_tree_add_bits_ret_val(), as otherwise
the side effect 'return_value' getting set doesn't happen.

svn path=/trunk/; revision=29493
2009-08-21 15:16:27 +00:00
Kovarththanan Rajaratnam 27f7d88c84 Also fake empty field_info's by gracefully handling NULL field_info pointer elsewhere.
svn path=/trunk/; revision=29490
2009-08-21 11:03:30 +00:00
Kovarththanan Rajaratnam 0f6b75b7ea Move TRY_TO_FAKE_THIS_ITEM to all public proto_xxx methods. Currently we rely on our internal (static) helper functions to do the faking. However, when they fake a protocol tree, they usually return a valid tree (although a dummy tree it is still a valid one). This means that we end up calling proto_tree_set_representation + friends on it for no reason. By moving TRY_TO_FAKE_THIS_ITEM to the public proto_xxx methods we're able to bail immediately (when we're allowed to do so).
svn path=/trunk/; revision=29480
2009-08-19 19:08:34 +00:00
Kovarththanan Rajaratnam 460eacaae1 Move the NULL pointer 'tree' check under TRY_TO_FAKE_THIS_ITEMs umbrella
svn path=/trunk/; revision=29453
2009-08-17 11:21:33 +00:00
Kovarththanan Rajaratnam 69babcb4a6 Don't do PROTO_REGISTRAR_GET_NTH twice.
svn path=/trunk/; revision=29452
2009-08-17 11:13:36 +00:00
Kovarththanan Rajaratnam da97c3e2b6 This should have been part of r29428. This patch forces proto_field_is_referenced() to respect the fake_protocols flag set by Protocol Hierarchy stats tap.
svn path=/trunk/; revision=29429
2009-08-15 08:38:50 +00:00
Kovarththanan Rajaratnam 9eec025c49 DISSECTOR_ASSERT on FT_PCRE in construct_match_selected_string().
svn path=/trunk/; revision=29396
2009-08-12 18:24:49 +00:00
Kovarththanan Rajaratnam 261a8406bc TRY_TO_FAKE_THIS_ITEM now fakes FT_PROTOCOL per default. If there are any users (e.g. proto_hier_stats.c, others?) that relies on FT_PROTOCOL nodes being created they'll now need to call the newly introduced epan_dissect_fake_protocols() to disable this optimization.
Also make use of TRY_TO_FAKE_THIS_ITEM in proto_tree_add_text_node(), proto_tree_add_none_format() and proto_tree_add_protocol_format().

svn path=/trunk/; revision=29380
2009-08-11 18:08:03 +00:00
Kovarththanan Rajaratnam 083729e02c Add PTREE_FINFO and use PITEM_FINFO when possible.
svn path=/trunk/; revision=29355
2009-08-09 17:57:31 +00:00
Kovarththanan Rajaratnam 3512e485ca Add PNODE_FINFO. We've been using PITEM_FINFO on proto_node's. This works because proto_item is typedefed to proto_node. We shouldn't rely on this since this is an implementation detail.
svn path=/trunk/; revision=29354
2009-08-09 17:33:23 +00:00
Bill Meier dd2a488581 g_error() if registering a subtree item type already registered (or not initialized to -1).
svn path=/trunk/; revision=29352
2009-08-09 15:49:02 +00:00
Anders Broman ded297677f From Kovarththanan Rajaratnam:
Precompile custom columns filters.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3767

svn path=/trunk/; revision=29174
2009-07-23 05:48:39 +00:00
Stig Bjørlykke 221225e0f3 From Kovarththanan Rajaratnam via bug 3719:
This patch optimizes proto_tree_prime_hfid() + friends and
plugs a memleak in the process.

From me:
Removed unused hfindex in proto_tree_new_item()
Fixed ref_count entry in struct header_field_info.

svn path=/trunk/; revision=29137
2009-07-18 20:10:14 +00:00
Stig Bjørlykke 3ebdfb7c9c From Kovarththanan Rajaratnam:
Add "text" abbrev + tighten FT_FRAMENUM checks.

svn path=/trunk/; revision=29100
2009-07-15 08:56:12 +00:00
Stig Bjørlykke 3f53109d7e Added some casts for true_false_string's.
svn path=/trunk/; revision=28992
2009-07-07 16:04:26 +00:00
Jeff Morriss ac43decf1c ptvcursor_add_text_with_subtree(): Don't crash if called with a NULL tree.
Also fix up some indenting.

svn path=/trunk/; revision=28712
2009-06-12 14:32:32 +00:00
Stig Bjørlykke f6826c9c02 Fix a small indent issue in a comment.
svn path=/trunk/; revision=28693
2009-06-11 10:10:42 +00:00
Sebastien Tandel 52cc5fb1e8 python binding for wireshark (first commit)
* ability to write dissectors with python for wireshark.
        documentation (http://wiki.wireshark.org/Python)


svn path=/trunk/; revision=28529
2009-05-29 21:10:40 +00:00
Bill Meier d349ab0061 proto.c: proto_registrar_dump...() fixes/changes:
- dump_values: Handle range_strings (prevents crash);
- dump_fields:
   a. Formats 2,3: If type==FT_BOOLEAN: output integer "parent bitfield width"
      in Field 7 instead of "BASE_NONE", etc. to allow addt'l
      field validation when using ftsanity.py.
   b. Format 3: Output bitmask (Field 8) in hex (0x...) instead of decimal.

svn path=/trunk/; revision=28134
2009-04-22 19:50:34 +00:00
Gerald Combs f0eeb0bdf1 More size_t fixes. Use a string buffer in range.c.
svn path=/trunk/; revision=27999
2009-04-08 16:50:20 +00:00
Bill Meier 1e66f1a63f From Jakub Zawadzki: g_snprintf() & etc since glib 1.3.12
don't return -1, and also always NUL terminate the string.
We can clean sources by removing dead/unnecessary code.
From me: A few additional changes re use of g_snprintf.

svn path=/trunk/; revision=27818
2009-03-22 15:31:44 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Stig Bjørlykke c16347358f From Jakub Zawadzki (bug3330):
Initialize hfinfo->display for FT_PROTOCOL.

svn path=/trunk/; revision=27711
2009-03-12 20:35:43 +00:00
Stig Bjørlykke 628f229936 Removed support for FT_UINT64/BASE_NONE/VALS combination.
svn path=/trunk/; revision=27671
2009-03-09 08:45:01 +00:00
Stig Bjørlykke de14669997 Added FT_INT*/FT_UINT* with BASE_NONE and a value string as a valid combination.
With this combination we get tree items with only the string match and not
the value, and the filter is created with the string.  This is usefull
when having generated items with wireshark internals as values.

Also rewrote some string constructions.

svn path=/trunk/; revision=27667
2009-03-09 00:24:21 +00:00
Jaap Keuter d27c92e496 Add posibility to mark protocol as private. This prevents inadvertent Wiki access.
svn path=/trunk/; revision=27533
2009-02-24 17:24:03 +00:00
Gerald Combs 6d04f793f0 Back out r27047 and r27053.
svn path=/trunk/; revision=27062
2008-12-19 17:39:52 +00:00