Commit Graph

771 Commits

Author SHA1 Message Date
Jakub Zawadzki 9297c9e780 Rename swar_count_bits() to ws_count_ones()
Try to make ws_count_ones() inline function.

svn path=/trunk/; revision=53178
2013-11-09 04:47:08 +00:00
Jakub Zawadzki e6944e68b9 Try to split ws_ctz() from hfinfo_bitshift().
svn path=/trunk/; revision=53176
2013-11-08 22:01:12 +00:00
Jakub Zawadzki ce6ca9a05d Add infrastructure for section-initializing protocol hfis (without array).
configure implementation later.

svn path=/trunk/; revision=53146
2013-11-07 20:14:18 +00:00
Evan Huus 8a0ef07000 Effectively remove the tree memory pool and port some of its behaviour to the
pinfo memory pool, they have exactly the same scope. Simplification and minor
performance win (one GHashTable we longer have to create/destroy on every
packet).

svn path=/trunk/; revision=53076
2013-11-04 14:12:59 +00:00
Anders Broman 39515def5f Increase PROTO_PRE_ALLOC_HF_FIELDS_MEM
svn path=/trunk/; revision=53009
2013-10-31 21:26:27 +00:00
Anders Broman 1e6927dbb3 Fix proto.c:4498: warning: 'compare_filter_name' defined but not used
svn path=/trunk/; revision=52975
2013-10-29 23:18:26 +00:00
Anders Broman c864a20398 Optimize proto_get_id_by_filter_name() by using the existing hastable for proto_filter_names.
svn path=/trunk/; revision=52972
2013-10-29 22:17:18 +00:00
Jeff Morriss de0fda9436 Revert r52905 and r52908: they're causing plenty of fuzz failures.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9323 is tracking the fix.

svn path=/trunk/; revision=52966
2013-10-29 21:18:22 +00:00
Jeff Morriss 9259176f87 As pointed by Evan: don't leak memory when the string pointer is NULL.
svn path=/trunk/; revision=52908
2013-10-27 22:40:55 +00:00
Jeff Morriss 8e2f00bf3d Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9323 :
Actually handle non-NULL-terminated FT_STRINGs properly.

svn path=/trunk/; revision=52905
2013-10-27 21:56:58 +00:00
Evan Huus 5b9ec08eae Optimization: in test_length there's no need to validate that the count value
for FT_UINT_STRINGs and FT_UINT_BYTEs is still in the TVB. Any infinite loop
that adds a counted field ought to be extracting the length for its own offset
anyways, in which case it will overflow on the next iteration and won't actually
loop forever.

svn path=/trunk/; revision=52766
2013-10-22 16:02:13 +00:00
Jakub Zawadzki bad81b517f Reintroduce back epan_dissect_reset(), proto_tree_reset()
This time it makes more sense, cause for each dissection we need two wmem allocators.
Reseting wmem allocator is much faster than destroy & create.

svn path=/trunk/; revision=52706
2013-10-20 10:21:25 +00:00
Jakub Zawadzki 336befd903 Remove allocation stem from PROTO_NODE_NEW() macro.
Tree root-node will be allocated using g_slice()

svn path=/trunk/; revision=52704
2013-10-20 10:03:32 +00:00
Evan Huus cbe8af0a8b Revert the optimization in r52578. As Jakub predicted, it caused at least one
infinite loop to pop up. We're just going to have to eat the performance hit.
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9282)

svn path=/trunk/; revision=52660
2013-10-17 12:24:25 +00:00
Evan Huus efdbb598b8 So a while back Jeff added some code to check that the offset+length passed to
proto_tree_add_item was valid *before* we short-circuited based on a NULL tree.
This was good in that it removed a common source of really-long-loop bugs. It
was less good in that it cost us about 8% in speed when doing a tree-less
dissection, but we decided the tradeoff was worth it.

After Anders' recent mail to -dev about performance, I started thinking about
how to optimize this. It occurred to me that the vast majority of the logic
involved in the check was dealing with the length value - fetching the actual
length if it was a counted string, calculating the length if it was -1, adding
the length to the offset in a way that was free from overflows, etc.

All of this is (theoretically) unnecessary - simply checking the offset without
worrying about the length will still catch the very-long-loops, since it is the
offset that increases in each iteration, not the length.

All that to justify:
- implement tvb_ensure_offset_exists which throws an exception if the offset is
  not within the tvb
- use it instead of all the complicated other logic in the pre-short-circuit
  step of proto_tree_add_item and friends

This gives us back about 3/4 of the performance we lost in the original patch.
We're still ~2% slower than without any check, but this is the best I can think
of right now.

svn path=/trunk/; revision=52578
2013-10-13 04:54:14 +00:00
Evan Huus c2b2d204db Redo r52569 in a way that doesn't break the GUI. Add a mem_pool member to
tree_data and reference it directly when allocating/freeing tree items. This
lets us keep multiple around when we need them, and still lets us use
wmem_free_all for a major speedup. It also, coincidentally, lets us get rid of
the annoying fi_tmp hack that was needed before, since that element gets swept
up in the free_all with everything else.

Keep one pool cached to avoid creating/destroying a pool for each packet,
another minor performance win.

The various changes in approach seem to balance out pretty much exactly, this
still gives ~11% over pre-52569.

svn path=/trunk/; revision=52573
2013-10-12 21:01:17 +00:00
Evan Huus 2e1497b532 Revert r52569, it breaks the GUI since that sometimes has multiple trees active
at once.

svn path=/trunk/; revision=52572
2013-10-12 18:14:19 +00:00
Evan Huus 540e9c745d Use wmem_free_all on the tree pool rather than freeing each node, label and
field_info separately. We still have to walk the tree in order to free certain
fvalues, but that's not a big deal. Another ~11% speed-up running "tshark -nVr"
on a large capture.

svn path=/trunk/; revision=52569
2013-10-12 17:57:51 +00:00
Evan Huus d19a20746b Use a wmem block allocator to allocate field_infos, proto_nodes and item_labels.
Even without making use of free_all (which should be possible) this still
results in ~8% speedup running "tshark -nVr" on a large file in my tests.

svn path=/trunk/; revision=52568
2013-10-12 17:32:41 +00:00
Michael Mann 9ccefb0ecd Prefix all "Wireshark application specific" display filters with a "_ws." to distinguish them from dissector filters.
This was committed now to get it into the 1.11 release so users can start getting used to the changed filter names.

svn path=/trunk/; revision=52462
2013-10-09 12:56:19 +00:00
Michael Mann ee208c8dcc Add support for RELATIVE-OID ASN.1 type. Bug 9192 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192)
From Ed Beroset.

svn path=/trunk/; revision=52393
2013-10-06 02:31:10 +00:00
Michael Mann a891f3e70b Make expert items used in "low level" proto functions filterable (and ensure they are called even with a NULL tree). I don't really like the Type Length Mismatch "protocol", but it doesn't seem that much different than the exception "protocols".
svn path=/trunk/; revision=52341
2013-10-03 01:54:02 +00:00
Evan Huus ccbb52b436 Add a dissector assert to _set_bytes like the one in _set_oid, noticed while
debugging https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9214

svn path=/trunk/; revision=52327
2013-10-01 22:50:29 +00:00
Evan Huus f1ba7e1095 The pointer into proto_tree_add_oid can be NULL if the length is 0. Exposed
because wmem_alloc(pool, 0) returns NULL (like pretty much every other
malloc-style function) where ep_ or se_ alloc did not.

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

svn path=/trunk/; revision=52187
2013-09-23 12:09:20 +00:00
Pascal Quantin 102c452bcb More emem -> wmem conversion:
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz()
- tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc()
- tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz()
- tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str()
- update docs accordingly

svn path=/trunk/; revision=52180
2013-09-22 20:04:35 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Bill Meier 3bb06ab6a5 Fix proto_registrar_dump_protocols() bug introduced by the
implementation of BASE_VAL64_STRING value_strings.

Fixes 'tshark -G values' crash.

svn path=/trunk/; revision=52121
2013-09-17 18:33:03 +00:00
Guy Harris aa8fbf09d2 The secs field of an nstime_t is a time_t, so cast to that.
svn path=/trunk/; revision=51981
2013-09-12 20:31:31 +00:00
Jörg Mayer 934cc4526d Make proto.c compile on my system (linux, 32 bit)
[-Werror,-Wshorten-64-to-32]
                                time_stamp.secs = (todsecs  / 1000000) - TOD_BASETIME;
                                                ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/home/jmayer/work/wireshark/svn/trunk/epan/proto.c:1613:44: error: implicit conversion
      loses integer precision: 'unsigned long long' to 'time_t' (aka 'long')
      [-Werror,-Wshorten-64-to-32]
                                time_stamp.secs = (todsecs  / 1000000) - TOD_BASETIME;
                                                ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

svn path=/trunk/; revision=51978
2013-09-12 20:07:48 +00:00
Evan Huus 3d5ed04f60 Add casts to fix mac buildbots.
svn path=/trunk/; revision=51975
2013-09-12 17:17:42 +00:00
Evan Huus f8693e35e0 From RobiOneKenobi via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9072
Add support for Time-of-Day timestamp format from z/OS.

svn path=/trunk/; revision=51974
2013-09-12 16:56:37 +00:00
Michael Mann 1b009df749 Couldn't quite figure out how to make the expert items in proto.c and the LUA API filterable (suggestions welcome!), but I wanted to start forcing dissectors to use the filterable expert API (nothing like compile errors to force change!). I created expert_add_info_format_internal (original expert_add_info_format) and used it as a placeholder for proto.c/LUA API until a solution is created. The "new" expert_add_info_format will be the "old" expert_add_info_format_text, and I'll slowly do the search/replace.
For those with dissectors outside the source tree, please see tools/convert_expert_add_info_format.pl for help with the conversion.  Please do not use expert_add_info_format_internal, as it's support time will be very short lived.

svn path=/trunk/; revision=51844
2013-09-08 19:32:10 +00:00
Evan Huus 304bbabbbe From Jiri Engelthaler via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9055

Add support for bitmask set for signed integer types.

svn path=/trunk/; revision=51522
2013-08-26 16:23:55 +00:00
Jakub Zawadzki 850f80fdc1 proto: simplify proto_tree_add_pi() remove out pointer to field_info *
field_info can be already get using PNODE_FINFO(return_value)

svn path=/trunk/; revision=51479
2013-08-22 21:20:50 +00:00
Jakub Zawadzki 4e870dd240 Fix few concept of new api tree:
- (for now) keep ABI, restore prototype of old proto_tree_add_item, add new proto_tree_add_item_new
- add few helpers for boolean, time, string which will do ->id
- don't use HFI_INIT directly, use it by another macro (MSVC has very small limit for section name)

svn path=/trunk/; revision=51401
2013-08-17 07:16:12 +00:00
Jakub Zawadzki 9d79b3233a Introduce new proto_tree API required for hf_ variables removal.
svn path=/trunk/; revision=51396
2013-08-16 21:21:52 +00:00
Jakub Zawadzki 97bddef1a2 Try to fix compilation under MSVC
__builtin_ctz() with bitmask == 0 is UB, so only do g_assert there.

svn path=/trunk/; revision=51176
2013-08-06 21:06:56 +00:00
Jakub Zawadzki 9cfac1227d Replace hfinfo pointer to same_name_prev, with same_name_prev_id.
svn path=/trunk/; revision=51175
2013-08-06 20:53:47 +00:00
Jakub Zawadzki 72ea2f9c9c Remove hfinfo->bitshift member, add hfinfo_bitshift() to get it.
svn path=/trunk/; revision=51174
2013-08-06 20:10:59 +00:00
Jakub Zawadzki 93f56d8a77 Optimize wrs_count_bitshift()
- Use __builtin_ctz for GCC/clang
- Do multiply and lookup on other platforms

svn path=/trunk/; revision=51173
2013-08-06 19:53:54 +00:00
Michael Mann 81f3faf1e8 Completely remove support for proto_item_set_expert_flags.
svn path=/trunk/; revision=51144
2013-08-05 02:25:45 +00:00
Jakub Zawadzki 430bd9eacc Optimize marking label as truncated in proto_tree_set_representation_*()
svn path=/trunk/; revision=51036
2013-07-30 20:02:24 +00:00
Martin Kaiser 3b92f760ed add a NULL check to report_type_length_mismatch()
this might be called via proto_tree_add_item() with tree==NULL
which results in a crash

svn path=/trunk/; revision=51020
2013-07-29 21:10:13 +00:00
Evan Huus dbabc55955 Much simpler (and possibly faster) fix for the 64-bit value string label issue.
svn path=/trunk/; revision=50983
2013-07-28 20:05:04 +00:00
Evan Huus 4e5ac2989c As caught by Stig: 64-bit value strings could print the field name twice.
Don't do that.

svn path=/trunk/; revision=50982
2013-07-28 19:56:23 +00:00
Jakub Zawadzki 5b15390b3a Store protocol fields in single linked list, saves about 1 MB of memory.
svn path=/trunk/; revision=50967
2013-07-28 10:47:31 +00:00
Michael Mann f3dac73d38 Fix compile error that resulted from whitespace cleanup.
svn path=/trunk/; revision=50963
2013-07-28 00:11:30 +00:00
Michael Mann a87f47c02c Make many items filterable for Vines dissectors.
Add support for FT_VINES type.

svn path=/trunk/; revision=50962
2013-07-28 00:07:49 +00:00
Jakub Zawadzki 0d414ac0fd make some variables static
svn path=/trunk/; revision=50952
2013-07-27 20:57:58 +00:00
Evan Huus 5ede3bcde0 Follow-up to r50935: add support for 64-bit value strings in more places that
need it, I think this is all of them.

svn path=/trunk/; revision=50941
2013-07-26 23:51:00 +00:00
Evan Huus c0cac8611e Squelch MSVC warnings. It doesn't know that DISSECTOR_ASSERT_NOT_REACHED doesn't
return.

svn path=/trunk/; revision=50939
2013-07-26 22:52:34 +00:00
Evan Huus 6e3a30794e Add 64-bit value strings and the appropriate tooling (including yet another
overloaded use of the DISPLAY field). Thanks to Jakub for pointing out I'd done
this wrong the first time (months ago in r49357).

Fixes severity display for collectd protocol, originally filed at:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8472

svn path=/trunk/; revision=50935
2013-07-26 21:51:39 +00:00
Jeff Morriss d58c13c363 As pointed out in https://www.wireshark.org/lists/wireshark-dev/201307/msg00153.html :
The fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290 needs
to allow for giving a length of -1 for FT_STRINGZ's.

This is another fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8960
(in addition to r50836).  There's no point in reverting that revision, though,
since there was no need to use a length of -1 in that case.

svn path=/trunk/; revision=50892
2013-07-25 18:37:18 +00:00
Jakub Zawadzki 696a79707b Optimize proto_item_append_string()
- When old string empty just pass new one (like: frame.protocols)
- if not, use ep_strconcat()

svn path=/trunk/; revision=50890
2013-07-25 17:19:17 +00:00
Guy Harris 8bd5a3649a Have get_uint_value() assume it's being passed an encoding value, which
isn't necessarily going to be zero if the item is big-endian.

The last argument to test_length() is an encoding, not a big-endian vs.
little-endian Boolean; name it appropriately.

This fixes bug 8953.

svn path=/trunk/; revision=50806
2013-07-22 23:11:07 +00:00
Jakub Zawadzki 547eabc949 Use label_fill also when boolean / bitfield.
svn path=/trunk/; revision=50682
2013-07-16 22:21:10 +00:00
Jakub Zawadzki 13e07be25f optimize: remove g_snprintf()'s from label_fill[_descr]
svn path=/trunk/; revision=50681
2013-07-16 22:09:29 +00:00
Alexis La Goutte 7c5b471584 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50632
2013-07-15 18:06:29 +00:00
Jakub Zawadzki e26b65f0ec proto_custom_set() cleanup
- Merge _UINT / _INT into one case
- fix possible generation of wrong expression ("some_integer") for unknown value in BASE_NONE field 

svn path=/trunk/; revision=50548
2013-07-13 09:14:25 +00:00
Jeff Morriss b53ced1e6a get_hfi_and_length() hasn't returned the hfi since r50015: rename it
to get_hfi_length().

svn path=/trunk/; revision=50509
2013-07-11 15:03:43 +00:00
Jeff Morriss 160c35c8e9 For consistency:
s/hf_index/hfindex/g
s/hf_info/hfinfo/g

svn path=/trunk/; revision=50507
2013-07-11 14:58:11 +00:00
Jeff Morriss b6ee11e928 Fix the very long loop fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8923 :
Apply the fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290
to proto_tree_add_bits_item().  That is, test that we have offset+length bytes
left in the TVB before trying to fake the item.

svn path=/trunk/; revision=50504
2013-07-11 14:46:30 +00:00
Jakub Zawadzki 87646b1126 Fixes for tmp_fld_check_value():
- FT_FRAMENUM can't have strings
- mask hfinfo->display to compare with valid BASE_ value

svn path=/trunk/; revision=50444
2013-07-08 05:59:07 +00:00
Jakub Zawadzki ed4622dc7f ups? first add + 1, then multiply.
svn path=/trunk/; revision=50438
2013-07-07 21:32:12 +00:00
Jakub Zawadzki d4f1a2c599 tree_is_expanded: make it bit array.
Right now we have about 36K of ett items, and tree_is_expanded takes: 144K of memory (36K*sizeof(gboolean))
By making tree_is_expanded bit array, it reduce size to 4.5K (36K/8)

svn path=/trunk/; revision=50434
2013-07-07 17:13:17 +00:00
Jakub Zawadzki 792f35a28c Make tree_is_expanded array static, add setter/getter function.
svn path=/trunk/; revision=50433
2013-07-07 16:33:49 +00:00
Jakub Zawadzki 5ef777c80b proto.c: add few more cases when oct/hex can show up with signed number
remove invalid comment about HEX/OCT print not supported for signed numbers.

svn path=/trunk/; revision=50427
2013-07-06 23:46:31 +00:00
Jakub Zawadzki 242e18dace PROTO_REGISTRAR_GET_NTH() not needed after TRY_TO_FAKE_THIS_ITEM
svn path=/trunk/; revision=50376
2013-07-03 22:57:53 +00:00
Jakub Zawadzki 99e03acfd8 Optimize proto_item_prepend_text: if there's no fi->rep avoid one strlcpy().
svn path=/trunk/; revision=50372
2013-07-03 17:44:46 +00:00
Jakub Zawadzki 9c58621893 - rename and optimize proto_data_add_maybe_interesting_field
- proto_tree_add_node() double checks if tree_type is valid remove second one (first one is more verbose)

svn path=/trunk/; revision=50328
2013-07-02 21:26:14 +00:00
Jakub Zawadzki 68c2c57037 Remove tree argument from TRY_TO_FAKE_THIS_REPR macro
PTREE_DATA should be the same for both *tree* and *pi*

svn path=/trunk/; revision=50326
2013-07-02 20:51:58 +00:00
Jakub Zawadzki b0e04aca73 Rewrite proto_lookup_or_create_interesting_hfids() and rename to proto_data_add_maybe_interesting_field
Now proto_data_add_maybe_interesting_field:
- it actually add field_info to interesting hash_tree
- accept only required parameters
- is called only by proto_tree_add_node

svn path=/trunk/; revision=50321
2013-07-02 19:23:10 +00:00
Jakub Zawadzki 1d2409dd69 Micro-optimize common case for proto_tree_add_pi() assume tree != NULL, pfi != NULL
Fix calles.

svn path=/trunk/; revision=50320
2013-07-02 18:56:48 +00:00
Jakub Zawadzki cce4ad3c66 tree == NULL check is already done by TRY_TO_FAKE_THIS_ITEM() macro.
svn path=/trunk/; revision=50319
2013-07-02 18:45:47 +00:00
Jakub Zawadzki 874f119225 Remove not needed TRY_TO_FAKE_THIS_ITEM() from proto_tree_*_format & proto_tree_*_format_value
Right now for proto_tree_add format & _format_value TRY_TO_FAKE_THIS_ITEM() is called twice
one from 'format' function, second time from 'no format' function.

This reduces size of .text by 10K:
   text    data     bss     dec     hex filename
  76012     112      56   76180   12994 proto-after.o
  86324     112      56   86492   151dc proto-before.o


svn path=/trunk/; revision=50318
2013-07-02 18:36:00 +00:00
Jakub Zawadzki d27f026884 cleanup, put result of decode_bitfield_value directly to fi->rep->representation
svn path=/trunk/; revision=50316
2013-07-02 17:09:38 +00:00
Jakub Zawadzki 2ab52de572 Add TRY_TO_FAKE_THIS_REPR into proto_tree_set_representation_value() call.
Remove TRY_TO_FAKE_THIS_REPR from calling functions.

svn path=/trunk/; revision=50314
2013-07-02 16:09:56 +00:00
Jakub Zawadzki d0c5a5561d snprintf -> strlcpy.
svn path=/trunk/; revision=50311
2013-07-02 14:14:52 +00:00
Jakub Zawadzki 7b5a0e4a15 Cleanup fill_label_[u]int64 to fill_label_number64
svn path=/trunk/; revision=50299
2013-07-01 15:24:42 +00:00
Jakub Zawadzki 7dc10daffe Rewrite hfinfo_numeric_value_format as a special case for _hfinfo_number_value_format
cleanup some functions.

svn path=/trunk/; revision=50290
2013-07-01 09:46:50 +00:00
Jeff Morriss 772b17a6c6 Actually use the new environment variable created in r49784--apparently I forgot to check in this file (sigh).
svn path=/trunk/; revision=50257
2013-06-30 16:16:13 +00:00
Jakub Zawadzki 33abb4e091 proto_custom_set: don't fetch values twice.
svn path=/trunk/; revision=50252
2013-06-30 13:23:31 +00:00
Guy Harris 882db1c5fb Squelch a warning.
Rename the "is_int" argument to fill_label_number() to make it clearer
what it indicates, i.e. whether the number is signed or unsigned.

svn path=/trunk/; revision=50224
2013-06-28 22:47:50 +00:00
Jakub Zawadzki d0c862bfa6 Merge fill_label_[u]int to fill_label_number, hfinfo_[u]int_value_format to hfinfo_number_value_format
svn path=/trunk/; revision=50220
2013-06-28 21:46:41 +00:00
Jakub Zawadzki 8ccfc17cf2 Merge _hfinfo_int_value_format and _hfinfo_uint_value_format to one function hfinfo_number_vals_format
In hfinfo_number_vals_format check how hf should be formatted.

svn path=/trunk/; revision=50217
2013-06-28 19:54:04 +00:00
Jakub Zawadzki eecbadecf4 #micro-optimization, remove g_snprintf()'s from _hfinfo_[u]int_value_format with some new fresh replacements.
svn path=/trunk/; revision=50216
2013-06-28 19:34:48 +00:00
Jakub Zawadzki 4504ed0bcc use hf_try_val_to_str() in two more places.
svn path=/trunk/; revision=50199
2013-06-27 22:26:34 +00:00
Jakub Zawadzki ac3f0d7483 cleanup [u]int fill proto with value_string function
Create generic int/uint fill functions from hfinfo_[u]int_value_format.

XXX: to be honest I don't get it why if dev picked up BASE_DEC_HEX and has value string we're truncating it to BASE_DEC...

svn path=/trunk/; revision=50197
2013-06-27 19:17:22 +00:00
Jakub Zawadzki c36a384b25 cleanup int/uint fill proto functions.
- hfinfo_uint_value_format(), hfinfo_int_value_format() formats value instead of returning proper format
- remove hfinfo_int_format(), hfinfo_uint_format

svn path=/trunk/; revision=50193
2013-06-27 18:40:08 +00:00
Jakub Zawadzki 3f5665a6b1 Add functions hf_try_val_to_str[_const]
svn path=/trunk/; revision=50190
2013-06-27 17:26:23 +00:00
Jakub Zawadzki f60dd85784 Pass hfinfo and not hfindex to internal proto functions.
svn path=/trunk/; revision=50015
2013-06-18 20:52:31 +00:00
Evan Huus 64a4df1963 Fix the integer overflow case Jakub caught in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290#c26

Also use indentation consistent with the rest of the file.

svn path=/trunk/; revision=49652
2013-05-31 13:08:03 +00:00
Jeff Morriss 0e61a0ec05 (Finally!) check in part of Didier's patch to fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3290
(TRY_TO_FAKE_THIS_ITEM disables bounds errors):

Before calling TRY_TO_FAKE_THIS_ITEM() check if the length given (or, in
the case of FT_UINT_{STRING,BYTES}, the length we retrieve from the TVB)
exceeds what's left in the TVB.

Do this only for proto_tree_add_item() for now (it's the most commonly used
and thus the biggest trouble maker in this area).

Similar changes for other APIs will come later (if nothing blows up).  Despite
the fuzz failures this bug has caused I'm not sure about back-porting it...

svn path=/trunk/; revision=49644
2013-05-31 01:46:28 +00:00
Jeff Morriss f89f4cda6c Fix the fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8724 :
Make proto_tree_children_foreach() NULL-tree safe.  Crash is new since r49602
took out an if(tree).

svn path=/trunk/; revision=49607
2013-05-29 03:19:31 +00:00
Michael Mann 0d1a4b2920 Add expert info configuration framework. Bug 2412 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2412).
Expert info "fields" can now be registered/addressed by name.  Right now, the basic framework allows expert info fields to become "display filters".  However more could be done, like user preferences overriding default severity level, speeding up expert info dialog load time by not needing to redissect a file, etc.

Long term goal is to have all expert_info filterable and have the functionality of expert_add_info_format() include the "registered index".  expert_add_info_format_text() is the workaround until all current calls to expert_add_info_format() have been updated with either expert_add_info() or expert_add_info_format_text().  Then the remaining expert_add_info_format_text() will be renamed to expert_add_info_format().

svn path=/trunk/; revision=49559
2013-05-24 17:59:36 +00:00
Evan Huus 0c2e3fb3a7 From Florian Forster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8472
Starting with collectd 5.0, the representation of time has changed. The new
fields "TIME_HR" and "INTERVAL_HR" contain the seconds since the epoch in steps
of 2^{-30} seconds (roughly nanosecond precision). This patch adds support for
both time formats.

From me:
Permit using 64-bit integers with value-strings, as this protocol actually 
seems to needs it. We'll misbehave for named values > 2^32 but there aren't any
of those despite the field being 64 bits.


svn path=/trunk/; revision=49357
2013-05-17 00:06:26 +00:00
Chris Maynard 4ac2441d7c Coalesce "-G fields2" and "-G fields3" into "-G fields", as discussed on -dev.
See: http://www.wireshark.org/lists/wireshark-dev/201304/msg00015.html

svn path=/trunk/; revision=48753
2013-04-05 21:58:43 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman bd61beffaa Add const casts and make local functions static.
svn path=/trunk/; revision=48521
2013-03-24 10:53:31 +00:00
Evan Huus bbb4058954 Remove slab.h and replace its last remaining usage with glib slices.
Take the opportunity to deduplicate some code that was common to both an
if block and its else block.

svn path=/trunk/; revision=48227
2013-03-10 14:52:14 +00:00
Evan Huus 122b7cb6df Remove the emem slab feature (sl_* functions) completely, replacing it with
glib memory slices.

- We weren't doing anything with the emem slab that couldn't be done with glib
  slices.
- Removes a fair bit of code as well as one debugging environment variable.
- Glib slices are much cache-friendlier and are multi-threading friendly (if
  we ever go there).
- Allows glib to actually return slices to the OS on occasion. The emem slab
  would hold onto its memory forever which resulted in a great deal of wasted
  memory after closing a large file.

svn path=/trunk/; revision=48218
2013-03-09 20:02:19 +00:00
Evan Huus 8569907b9f From Steve Magnani via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8339
This patch adds a new public API, proto_tree_add_bitmask_len(), identical to
proto_tree_add_bitmask() but using a caller-supplied length rather than an
inferred one. The underlying proto_item_add_bitmask_tree() code is modified
to display only fields for which all defined bits are available, and to
ignore bits that have no corresponding defined field ("forward compatibility"
cases).

From me: minor edits, see the bug for more details.

svn path=/trunk/; revision=48049
2013-03-04 14:18:18 +00:00
Anders Broman c5ee81098c From beroset:
remove C++ incompatibilities

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

svn path=/trunk/; revision=48006
2013-03-02 12:10:56 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +00:00
Bill Meier 3f70cb4406 Add an "Unregistered hf!" hint to DISSECTOR_ASSERT((guint)hfindex < gpa_hfinfo.len).
svn path=/trunk/; revision=47611
2013-02-10 18:38:46 +00:00
Bill Meier cfff564398 Add 'proto_registrar_get_id_byname()' accessor.
svn path=/trunk/; revision=47540
2013-02-07 22:04:02 +00:00
Pascal Quantin f78791d7d2 Revert changes committed by error in r47433
svn path=/trunk/; revision=47442
2013-02-02 09:02:11 +00:00
Pascal Quantin f26b250595 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8290 :
Allow up to 64 OPTIONAL / DEFAULT components per SEQUENCE

svn path=/trunk/; revision=47433
2013-02-01 22:44:14 +00:00
Evan Huus bff31de434 Add modelines
svn path=/trunk/; revision=47130
2013-01-17 03:37:41 +00:00
Evan Huus e49285b9e4 Null the finfo pointer after we free it. Reduces (but does not completely fix)
the errors from bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8197

svn path=/trunk/; revision=47114
2013-01-16 14:14:05 +00:00
Evan Huus e4f46ce55f Take a wild guess at what might be causing
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8197

It can't hurt, in any case.

svn path=/trunk/; revision=47084
2013-01-14 22:29:23 +00:00
Pascal Quantin ac972a58b2 From Nickolai via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8167 :
Fix an incorrect logical check for no_of_bits!=0 in proto_tree_add_split_bits_item_ret_val()

svn path=/trunk/; revision=46958
2013-01-05 23:49:24 +00:00
Gerald Combs c9d4240196 Add a context menu to the packet list and fill in the
apply/match-related actions. Have matchSelectedFilter figure out our
filter strings, which lets us remove duplicate code in the apply/match
action slots. Remove some leftover code from an experiment.

Adjust the temporary message colors in the status bar and label stack.

Add a NULL check to construct_match_selected_string.

svn path=/trunk/; revision=46449
2012-12-07 20:08:00 +00:00
Jeff Morriss da4442d638 Use g_error() to generate an explanatory message (and a core) when
ABORT_ON_DISSECTOR_BUG is set and we pass MAX_TREE_ITEMS.

If ABORT_ON_DISSECTOR_BUG is set and we get an unregistered hf, generate
an explanatory message (and a core).

svn path=/trunk/; revision=46323
2012-12-02 03:34:06 +00:00
Anders Broman 94fb28dfa1 Check if we have a filter name.
svn path=/trunk/; revision=46077
2012-11-18 18:12:50 +00:00
Jakub Zawadzki bdcdec560c Manually revert r45669
svn path=/trunk/; revision=45884
2012-11-03 20:51:19 +00:00
Jakub Zawadzki ff03289b1a Remove const specifier from argument.
svn path=/trunk/; revision=45872
2012-11-02 11:44:50 +00:00
Jeff Morriss d97b4ec325 Fix problem where NTP times with the high-bit set to 0 (which RFC 2030
chapter 3 has redefined to mean years *after* 2036) were being represented as
times prior to 1968.

This has been broken since r35840 (apparently not many people see NTP
timestamps beyond 2036 :-)): apparently I over-optimized packet-ntp's code
while copying it into proto.c: that temporary variable is necessary for the
unsigned math to happen correctly before assigning the result to the (signed)
time_t.

Leave a comment in the code indicating why the temporary variable is needed.
Copy that comment to packet-ntp.c.

Fix the same problem in ntp_to_nstime(): it also did not use the temporary variable.

svn path=/trunk/; revision=45790
2012-10-25 22:26:52 +00:00
Jakub Zawadzki 6dc977b7d2 - Allow reseting edt with new function epan_dissect_reset(),
- initialize edt once in few places, and later reset it after dissecting
  (add_packet_to_packet_list),
- revert r45667, probably no longer needed.

svn path=/trunk/; revision=45669
2012-10-20 16:44:55 +00:00
Jakub Zawadzki ef72e0eed3 - Free root node and tree data outside proto_tree_free_node,
- remove #if 0 code.

svn path=/trunk/; revision=45668
2012-10-20 16:38:55 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Martin Mathieson d729f21ad2 Revert r45005.
svn path=/trunk/; revision=45006
2012-09-19 16:56:59 +00:00
Martin Mathieson a232ae9242 Make proto_item_append_string() behave sanely, and use it in a few more
dissectors.

svn path=/trunk/; revision=45005
2012-09-19 11:58:32 +00:00
Jeff Morriss f90f3f3438 Don't fetch the value twice (unsigned integer case). Fix a cut-n-pasteo.
svn path=/trunk/; revision=44757
2012-09-03 19:33:45 +00:00
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
Evan Huus 2af3ce88bd From Martin Kupec via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7658
Don't pass string-related encoding flags to get_uint_value() when handling
FT_UINT_STRING fields. This was causing all such fields with non-ASCII
encodings to use little-endian encoding, even when OR-ed with ENC_BIG_ENDIAN.

(not actually the topic of the above bug, but discovered during LLRP protocol
 testing, which was the topic of the above bug)

svn path=/trunk/; revision=44619
2012-08-23 02:48:26 +00:00
Gerald Combs a9f5507086 Keep field_info_tmp from being prematurely freed. Better fix for bug 7621.
svn path=/trunk/; revision=44478
2012-08-13 22:43:17 +00:00
Gerald Combs 517ef559c2 Fix a copy/paste error which triggered bug
svn path=/trunk/; revision=44456
2012-08-12 15:48:36 +00:00
Gerald Combs 72ddab2c98 Instead of calling DISSECTOR_ASSERT() whenever we get an invalid length,
add an expert item. For unusable lengths throw ReportedBoundsError but
try to continue on otherwise.

Based on a patch from Mike Morrin in bug 3884.

svn path=/trunk/; revision=44439
2012-08-10 23:05:04 +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
Jeff Morriss d380312c16 Move the pi==NULL test into TRY_TO_FAKE_THIS_REPR.
Since the tree will only be NULL here if someone messed up in proto.c and
since pi will only be NULL if tree is NULL, assert out if either of them are
NULL (don't use DISSECTOR_ASSERT() since such a condition wouldn't be the
dissector writer's fault).

Use TRY_TO_FAKE_THIS_REPR in ptvcursor_add_text_with_subtree().

We've had TRY_TO_FAKE_THIS_REPR for a long time now, don't wrap it in #if 1.

new_field_info() doesn't return NULL so don't check for it returning NULL in
ptvcursor_add().

svn path=/trunk/; revision=44322
2012-08-08 03:02:27 +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 c852982ebc wrappers for label filling (with information about string truncation)
svn path=/trunk/; revision=44131
2012-07-30 10:52:20 +00:00
Jeff Morriss 3fa645481f Followup to r43176, r43177, r43178, and r43179: prohibit FT_*INT*
with BASE_NONE (or other future display values).

Don't use BASE_NONE with FT_UINT32s in the expert info fields.

svn path=/trunk/; revision=43412
2012-06-20 17:25:53 +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
Bill Meier 08807fc48d Fix "BASE_CUSTOM field is incorrectly formatted when applied as a column".
Resolves Bug #6671 - https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6671

svn path=/trunk/; revision=43186
2012-06-10 19:23:50 +00:00
Bill Meier 2968fcffa8 Fix bug wherein values in a custom column aren't displayed as a value_string (when appropriate).
Essentially: BASE_CUSTOM is "base_display_e value" (like BASE_DEC) *not* a bit-mask
 (like BASE_EXT_STRING).
Bug introduced in SVN #39902

svn path=/trunk/; revision=43184
2012-06-10 15:10:11 +00:00
Bill Meier d01cb597c9 Don't crash in 'proto_registrar_dump_values' if BASE_EXT_STRING and no extended string.
Note: this shows up when doing 'tshark -G values'.

BASE_EXT_STRING with a missing extended string does *not* cause issues
with the normal display code:

ToDo (eventually): Add some code to enforce requirement that hf[] entries with BASE_EXT_STRING
(or BASE_RANGE_STRING) set must also have a 'strings' value.



svn path=/trunk/; revision=43150
2012-06-07 21:10:02 +00:00
Chris Maynard 3e52049ff5 Fix Coverity CID's 702388 and 702422: OVERFLOW_BEFORE_WIDEN.
svn path=/trunk/; revision=42886
2012-05-28 18:37:10 +00:00
Jakub Zawadzki 5020a3f170 While iterating over string characters don't use strlen(), but check for NUL.
svn path=/trunk/; revision=42883
2012-05-28 15:59:00 +00:00
Bill Meier 12ba85a2a4 Rework proto_registrar_dump_protocols() to prevent a Clang scan-build "de-reference of a null poiunter" warning
(In practice, bug would not actually occur).

svn path=/trunk/; revision=42717
2012-05-19 16:07:50 +00:00
Jakub Zawadzki 91690d8a28 Fix string buffer overflow (bug #7029)
g_strlcpy() always return the size of strlen(src), so in case of truncation it could happen that offset_r > size or offset_e > size.
Fix it by adding new function protoo_strlcpy() which returns how many bytes was copied to dest buffer.


svn path=/trunk/; revision=42676
2012-05-17 10:18:53 +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
Jakub Zawadzki e6f2751cdd Add support for checking conflicting entries in value_string_ext.
svn path=/trunk/; revision=42262
2012-04-26 15:33:46 +00:00
Anders Broman b02b6a932f From Evan Huus: Use Add DISSECTOR_ASSERT_HINT() macro. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7142
svn path=/trunk/; revision=42148
2012-04-20 05:12:20 +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
Bill Meier ad9f8fffad Update a comment as to the number of Wireshark protocols;
Minor whitespace and formatting changes.

svn path=/trunk/; revision=41559
2012-03-15 14:15:48 +00:00
Bill Meier e0397b3811 Fix up a several REPORT_DISSECTOR_BUG messages to specify the correct function name;
Do general cleanup:
- Indentation & whitespace;
- Reformat long lines,
- & etc.

svn path=/trunk/; revision=41547
2012-03-14 17:11:39 +00:00
Stig Bjørlykke da8cd5d5bd Value can't be negative if no_of_bits == 0
svn path=/trunk/; revision=41507
2012-03-12 17:18:04 +00:00
Anders Broman 230eb02a41 From Sylvain Munaut: proto_tree_add_split_bits_item_ret_val doesn't handle signed value properly https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6920
svn path=/trunk/; revision=41419
2012-03-08 06:11:20 +00:00
Anders Broman bfcf193d2f Increase the size of the preallocated area for hf fields.
svn path=/trunk/; revision=41290
2012-03-02 09:28:30 +00:00
Jeff Morriss a146f5a2e2 (After a couple of years of warning about this), assert out if someone tries
to register an hf with an empty-string abbreviation.

svn path=/trunk/; revision=41280
2012-03-01 22:00:33 +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
Jeff Morriss 21a422463e If WIRESHARK_ABORT_ON_DISSECTOR_BUG is set (in the environment) and we put more
than MAX_TREE_ITEMS in the tree, abort() out rather than throwing an exception.

svn path=/trunk/; revision=41009
2012-02-13 03:14:46 +00:00
Jeff Morriss 2f240acc2e Fix a couple of cut-n-pasteos.
svn path=/trunk/; revision=40711
2012-01-25 01:24:25 +00:00
Jörg Mayer 71520b8759 Remove obsolete GLIB_CHECK_VERSION(2,10,0) checks
svn path=/trunk/; revision=40490
2012-01-14 03:21:28 +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
Stephen Fisher 4af334a549 Improve this error message (example output based on attachment in bug #6665):
OOPS: ',' in 'tpncp.fxs_ana,og_voltage_beading'

Now:

    Invalid character ',' in filter name 'tpncp.fxs_ana,og_voltage_beading'


svn path=/trunk/; revision=40256
2011-12-20 21:53:50 +00:00
Chris Maynard a71316964f Fix crash caused by trying to apply a field of type BASE_CUSTOM as a column. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6503.
svn path=/trunk/; revision=39902
2011-11-17 15:57:44 +00:00
Guy Harris 4e2c6d9986 Use "%g" for float as well as double.
svn path=/trunk/; revision=39709
2011-11-02 03:45:18 +00:00
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