Commit Graph

482 Commits

Author SHA1 Message Date
Stig Bjørlykke 7f4d8491f3 prefs: Preserve UTF-8 characters in preferences.
When saving preferences the strings in string lists must not be
escaped with g_strescape() because this will destroy UTF-8 characters.

Because this strings only should use printable characters we manually
escape quote and backslash, and skip non-printable.

Bug: 13342
Change-Id: I57e492dff746a5ecc0aee809f946a615ad110b4d
Reviewed-on: https://code.wireshark.org/review/19738
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-27 05:06:39 +00:00
Michael Mann 21a3b8cc71 Internalize struct preference
Move "struct preference" into prefs.c, essentially creating a "private"
structure to handle preferences. The 2 motivating factors were:
1. Better memory management so that clients/users of API don't have to worry
about it.
2. Hide the ugliness of the union stuff and make it transparent to the API.

A few bugs related to preference <-> Decode As integration were fixed
while in the neighborhood.

Change-Id: I509b9a236235d066b139c98222b701475e0ed365
Reviewed-on: https://code.wireshark.org/review/19578
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-22 10:43:57 +00:00
Dario Lombardo 805ddd1add uat: add a reset callback.
This function will free the resources allocated by the caller.

Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4
Reviewed-on: https://code.wireshark.org/review/19375
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-12 12:39:15 +00:00
Michael Mann 165c8b0422 Refactor range preference.
Refactored so that all handling of ranges in struct preference
can be internal to prefs.c

Change-Id: I68577909f9c07b23a16ab3443a523355d4645314
Reviewed-on: https://code.wireshark.org/review/19577
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 15:35:18 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Roland Knall 9d47bf9939 InterfaceList: Add check for remote interface
Add a check, to allow the filtering of remote only interfaces. Also
add the necessary options to the type menu.

Change-Id: Ib82519362454094f64abf1cbe6d7bc917990d7ac
Reviewed-on: https://code.wireshark.org/review/19438
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-12-27 11:55:51 +00:00
Michael Mann 96d15102f5 Remove individual post-dissect enable preferences.
Use Analyze -> Enabled Protocol dialog interface.  Added support
for backwards compatibility of preference.

Change-Id: I32b3fce9d18083d9324197e3fd7ddc7eb888d1fb
Reviewed-on: https://code.wireshark.org/review/19422
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-25 15:04:21 +00:00
Michael Mann 78d56e5dd7 Cleanup transum post-dissector.
1. Enable/disable preference not needed - just use Enabled Protocol
dialog interface.  Added support for backwards compatibility of preference.
2. Add value_string for calculation values
3. Create an structured array of "hfs of interest" so they can more easily
be extended.
4. Convert a bunch of arrays into hash tables and lists.  For the amount
of wasted space they were taking up, we can live with the very slight
performance degrade.  Also puts less limits on number of things to process.

Change-Id: I7399789d62432b507062ed9cdc20ad974b9dde1b
Reviewed-on: https://code.wireshark.org/review/19406
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-25 08:06:53 +00:00
Michael Mann a942468e07 Make more infiniband subdissectors heuristic.
1. Convert the Mellanox encapsulation header into a heuristic dissector.
2. Convert EtherType header dissection into a heuristic dissector.
3. Convert "heuristic preferences" to use deprecated_heur_dissector_pref.

Ping-Bug: 5061
Ping-Bug: 2672
Change-Id: Iabcac1af8e07f3f6f25f825ed56b2036c3285783
Reviewed-on: https://code.wireshark.org/review/19317
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-19 14:19:48 +00:00
Gerald Combs 333832ebf7 Prefs: Use g_utf8_strlen instead of strlen.
Change-Id: I99e2906b3c31f4aebcda44f4433f0fdd457ced3b
Reviewed-on: https://code.wireshark.org/review/19008
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-02 01:09:54 +00:00
Gerald Combs cbf89c8ed8 Check preference titles and descriptions.
When registering preferences, make sure our titles and descriptions are
valid UTF-8. Make sure our titles are short and only contain printable
characters.

Fix problematic titles and descriptions.

Change-Id: I20d3f93438f2b3c30266f934297feb79897f2ee5
Reviewed-on: https://code.wireshark.org/review/18998
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-01 01:26:39 +00:00
Michael Mann fb9a356e46 Add prefs_get_uint_value and prefs_get_range_value
This allows dissectors to not need to know about the internal preference structure.

Change-Id: I1ae67248cd0b0132aefc225ea0a9befaf9afdde2
Reviewed-on: https://code.wireshark.org/review/18864
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-22 16:47:47 +00:00
Roland Knall 3fb32662a8 InterfaceList: Add button to toggle hidden interfaces
Add a button to the context menu, to allow for easy display of hidden
interfaces, and make that a storable preference

Change-Id: I8df5562b3ce8119b0ed38f9893c1879127f40c47
Reviewed-on: https://code.wireshark.org/review/18005
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-20 15:50:44 +00:00
Michael Mann 739bdfb45f Some Pref <-> Decode As bugfixes.
1. If a deprecated port preference is found, populate the new port preference with the value
2. Mark preferences as changed to trigger preference callback at startup.

Change-Id: Ic271841686617e847d2e0ed8800bbb0fa874df47
Reviewed-on: https://code.wireshark.org/review/18274
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-18 23:03:23 +00:00
Dario Lombardo 5546400b55 frame: print debug line according to new console preference.
Change-Id: I4e4b7d08e7765c43904469bbf8ba5c0581428382
Reviewed-on: https://code.wireshark.org/review/18231
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-17 09:22:18 +00:00
Stig Bjørlykke c59f7fc8fe dmp: Fix UDP ports preference conversion
The preferences change in 2eb7b05b had a typo for the old preference name.

Change-Id: Ie4d85160050f5bea01b59a1803011b49a6c4d748
Reviewed-on: https://code.wireshark.org/review/18213
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-10-16 11:29:38 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +00:00
Michael Mann 31a35aa9e6 Cleanup from adding Decode As TCP preferences.
1. Fix bug caught by scan build (module not read)
2. Remove range preference call that should have been part of original patch.

Change-Id: I24b1fb253548bffddc4c8ebfc3ede666d8fd9dcd
Reviewed-on: https://code.wireshark.org/review/18143
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-12 00:56:15 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
This patch introduces new APIs to allow dissectors to have a preference for
a (TCP) port, but the underlying data is actually part of Decode As functionality.
For now the APIs are intentionally separate from the regular APIs that register a
dissector within a dissector table.  It may be possible to eventually combine the
two so that all dissectors that register with a dissector table have an opportunity
to "automatically" have a preference to adjust the "table value" through the
preferences dialog.

The tcp.port dissector table was used as the guinea pig.  This will eventually be
expanded to other dissector tables as well (most notably UDP ports).  Some
dissectors that "shared" a TCP/UDP port preference were also converted. It also
removed the need for some preference callback functions (mostly when the callback
function was the proto_reg_handoff function) so there is cleanup around that.

Dissectors that has a port preference whose default was 0 were switched to using
the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference

Also added comments for TCP ports used that aren't IANA registered.

Change-Id: I99604f95d426ad345f4b494598d94178b886eb67
Reviewed-on: https://code.wireshark.org/review/17724
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08 02:44:53 +00:00
Roland Knall 99097dd3c6 Interface List: Change display to view/model
This changes the underlying model of the main interface tree.
Because of that, we can resort to a view/model approach, enlisting
the global interfaces list as only data source.

The interface list works identical to the old list, but allows
for filtering of the displayed interfaces by type. Only types, which
are present and whose interfaces are not hidden, are being displayed
for selection.

Change-Id: If8475b227daa026dc0ad3d25bc7fe050d5bf2ac3
Reviewed-on: https://code.wireshark.org/review/17940
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-01 13:18:51 +00:00
Michael Mann 3120536012 Have TPKT support a TCP port range preference instead of having "subdissectors?" register their own.
There are a number of dissectors who are subdissectors of TPKT (and OSITP) that are
not called by TCP dissector directly, yet can possibly register a TCP port "on the
behalf" of TPKT.  Just allow TPKT to support a range of ports to possibly include
these protocols.
Remove the preferences from these dissectors, but add backwards compatibility for
the preferences by hooking into set_prefs and have the preferences just hook into
Decode As functionality directly.

Change-Id: Ic1b4959d39607f2b6b20fa6508da8d87d04cf098
Reviewed-on: https://code.wireshark.org/review/17476
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-16 14:58:24 +00:00
Peter Wu 1ea6b4fe2e prefs: fix crash with -o column.foo:x
The gui.column module is somehow special, it has no name since it is
part of the gui module. This causes a crash when trying to invoke
`strcmp(module->name /* NULL */, "mgcp")`.

Always look up prefs inside gui_column_module when the given prefs
module is "column" instead of matching two specific names.

Change-Id: I47e354d11b6fd01818b0627a249b506a8f9510cc
Reviewed-on: https://code.wireshark.org/review/16937
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-07 12:32:48 +00:00
Michael Mann 907d49483d Fix some of the checkAPIs.pl warnings for g_warning.
1. Create ws_g_warning for legitimate uses of g_warning
2. Use proto_tree_add_debug_text
3. Comment some out

Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5
Reviewed-on: https://code.wireshark.org/review/16678
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-26 04:08:50 +00:00
Gerald Combs e5a1afc6f9 Qt: Preferences dialog performance improvements.
Fill in advanced and module tree item text when requested.

Create ModulePreferencesScrollAreas only when we need to show them.

Change-Id: I5aa7d5dba8f5d20de088de3a9d1ee9d58e779269
Reviewed-on: https://code.wireshark.org/review/16181
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-28 06:53:35 +00:00
Gerald Combs e2e84563ee Use getc_unlocked in a few places.
Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This
reduces startup time by about 100ms here.

Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af
Reviewed-on: https://code.wireshark.org/review/14518
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-13 16:18:25 +00:00
Michael Mann 57ef06e242 *_stdup_printf -> strdup for "single string only" formatting.
Done for performance improvements.

This could probably be done in checkAPIs.pl, but this was just
a quick manual check with grepping.

Change-Id: I91ff102cb528bb00fa2f65489de53890e7e46f2d
Reviewed-on: https://code.wireshark.org/review/15751
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-06 06:03:58 +00:00
João Valverde ed6eecd79e [GTK] Check for xdg-open at run time
Remove HTML_VIEWER compile-time setting.

If xdg-open doesn't exist use user web browser preference as fallback.

Change-Id: I3b4a4a1a36b0192d75f2c97595f37d0d88a0941e
Reviewed-on: https://code.wireshark.org/review/14805
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2016-04-09 23:40:51 +00:00
João Valverde e005bc819c Remove synchronous DNS name resolution
Change-Id: Ie5e670b769eb0674950f3679ef511047641c2873
Reviewed-on: https://code.wireshark.org/review/14751
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-04 06:49:55 +00:00
Uli Heilmeier e1d54cfc3e IEEE 802.1Q/VLAN: Resolve ID to a describing name
A vlans file in the personal preference directory add an option to resolve
VLAN IDs to a describing name.

Format of vlan file is
123\tName of VLAN

To enable the resolving the preference nameres.vlan_name must be set
to TRUE.

Bug: 11209
Change-Id: I3f00b4897aace89c03c57b68b6c4b6c8b7d4685a
Reviewed-on: https://code.wireshark.org/review/14471
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-18 05:41:36 +00:00
Peter Wu e6f59d04aa prefs: set correct context for a preference
When a pref is renamed (e.g. from eth.qinq_ethertype to
vlan.qinq_ethertype), the latter module must be marked as changed.
Otherwise the pref has no effect as the vlan handoff routine is not
called.

For consistency, set the module for preferences migrated from smpp (the
gsm-sms-ud dissector does not have a handoff routine for these prefs,
so it has no functional effect for that dissector).

Undoes I89f4a2d125e18d113edec4bf35599f128249e913, fixes
I2a49dce93fdc7fab4ab3dc52dad90288c2d17434.

Change-Id: I255b49db23c7958f9fb2214c54f3f35386fa5e9a
Reviewed-on: https://code.wireshark.org/review/13851
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-10 05:11:40 +00:00
Alexis La Goutte 6d88e9e116 prefs.c: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I89f4a2d125e18d113edec4bf35599f128249e913
Reviewed-on: https://code.wireshark.org/review/13726
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08 06:08:12 +00:00
Dario Lombardo 9f28bce07d prefs: fix a leak.
This change fix a leak in the prefs subsystem when setting a preference as obsolete.
Found by valgrind.

==5779== 1 bytes in 1 blocks are definitely lost in loss record 7 of 3,421
==5779==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5779==    by 0xA7FE610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==5779==    by 0xA815B0E: g_strdup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==5779==    by 0x65E01DF: register_string_like_preference (prefs.c:1052)
==5779==    by 0x65E054E: prefs_register_string_preference (prefs.c:1096)
==5779==    by 0x688D010: proto_register_dtls (packet-dtls.c:1828)
==5779==    by 0x71C4C34: register_all_protocols (register.c:350)
==5779==    by 0x65EEFA7: proto_init (proto.c:521)
==5779==    by 0x65CD621: epan_init (epan.c:126)
==5779==    by 0x115330: main (tshark.c:1220)

Bug: 12096
Change-Id: I8f36114e2098b0255b4e774c6e0f35b64da6d366
Reviewed-on: https://code.wireshark.org/review/13798
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08 06:04:13 +00:00
Stig Bjørlykke 07ef89691c prefs: Add missing newline for filter expressions heading
Change-Id: I005904ffddf4542248c1994a0786340383b62192
Reviewed-on: https://code.wireshark.org/review/13660
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-02 11:20:03 +00:00
Roland Knall 927ffaa794 extcap: Add Save functionality to options dialog
This patch creates the functionality of saving all parameters
for extcap devices in the general preference section.

For now, multiselect and fileselect do not save their values
but patches for this will be provided in the future

Also, all preferences are stored as strings to make handling
easier. This might change in the future, but for the first version
it will stick.

Restore to Defaults is not implemented as of yet, and will be
in a future version, once the preference storing is finalized

Bug: 11666
Change-Id: I178346405146d2e43f4f3481c05c92c0b3595af5
Reviewed-on: https://code.wireshark.org/review/13451
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-01 12:12:41 +00:00
Michael Mann 850f5d3be0 Remove the deprecated column types so users don't think they still exist.
Bug: 11559
Change-Id: I51836dc9a4fa399835c7bdabcba577ebd40327ad
Reviewed-on: https://code.wireshark.org/review/13538
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-27 07:54:24 +00:00
Peter Wu a7c025fd14 Fix missing validation (crash) for certain prefs
The gui.layout_type preference is part of the Layout submodule (which is
part of the gui module. The Layout submodule has a special apply
callback that validates its prefs. These validations were never called
though because the prefix is "gui" and as a result that module would be
marked as changed.

Fix this crash by calling the validation function on the submodules
instead holding the pref, not its parent.

Change-Id: I2a49dce93fdc7fab4ab3dc52dad90288c2d17434
Reviewed-on: https://code.wireshark.org/review/13154
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-01-25 18:16:14 +00:00
Stig Bjørlykke 77046c0c2d Qt: Add some window title variables
Add some variables to be used in custom window title.

%P = profile name
%V = version info

Change-Id: I049717432a4d3523b541bb4f6f882c75abc38ddb
Reviewed-on: https://code.wireshark.org/review/13419
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-01-21 18:22:05 +00:00
João Valverde d3e480ac76 Fix warnings for epan/prefs.c [-Wcast-qual]
Change-Id: I86032d624ee37edc86a868eb2aaaffce81a8807b
Reviewed-on: https://code.wireshark.org/review/12719
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-08 15:28:45 +00:00
Guy Harris ee9f102aa9 No need for toolkit-dependent color initialization.
We're not allocating colors ourselves in GTK+ (and haven't been doing so
since at least 1.12), and all color_t values are valid colors, so
we don't need any toolkit-specific processing to fill in a color_t.

While we're at it, catch read errors when reading color filter files.

Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b
Reviewed-on: https://code.wireshark.org/review/12985
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 04:15:29 +00:00
Guy Harris 93f9416c36 Get rid of the "pixel" member of a color_t.
Now that we're letting GTK+/GDK allocate colors behind the scenes, if it
allocates them at all, there's no reason to save the allocated color in
the toolkit-independent color value.

Change-Id: I99df32bd6b07924f41f3d855d2ddecb3dc8d5201
Reviewed-on: https://code.wireshark.org/review/12983
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 02:05:07 +00:00
Alexis La Goutte 936359053a Qt: Add gui.prepend_window_title option
Bug: 11102
Change-Id: I659b6be4652a65542c217370e01340e4696c0e31
Reviewed-on: https://code.wireshark.org/review/12653
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-12-29 18:01:27 +00:00
Michal Labedzki 9bb3f6be4c Qt: Add missing multi-field column validation
GTK already has it, but Qt forgot about it, so multi-field custom column
works ok if previously saved in GTK-shark. Invalid validation prevent from
modifying and saving multi-field custom column in Qt version.

While at it, rename "custom field" to "custom fields" to ensure
we think about multi-field custom column.

Change-Id: I99588150ccb38be11b75f5dd5b0f6443e7055ebb
Reviewed-on: https://code.wireshark.org/review/12685
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-20 08:21:02 +00:00
Guy Harris 85e3750b06 Get rid of the argument to filter_expression_init().
It's always TRUE.

Clean up indentation while we're at it.

Change-Id: I11f5b849274b68bbda4fa32a8d909d6d5e71cbb1
Reviewed-on: https://code.wireshark.org/review/12732
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-19 19:21:08 +00:00
Guy Harris 3efb965493 Get rid of a couple of extra blank lines.
Change-Id: I57fd59a065e987e0e188b0898a874116e7cc56e8
Reviewed-on: https://code.wireshark.org/review/12722
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-19 03:39:08 +00:00
Guy Harris 146fd0fa84 Remove a comment that didn't need to be copied and pasted.
Change-Id: Id05c3fbf0c667ae2b2e349b73eba62a23d9e9e9e
Reviewed-on: https://code.wireshark.org/review/12721
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 20:51:49 +00:00
Guy Harris 4d3d6af643 prefs_register_modules() is used only in epan/prefs.c; make it static.
Change-Id: If2a5ad5c836c5dfddb4f6c4ffa41c52e52f2b671
Reviewed-on: https://code.wireshark.org/review/12717
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 09:28:01 +00:00
Guy Harris 487dfe1e28 More common code for string-like preferences.
Change-Id: I0143c40cabc0e60265aad2004884cb24cd41a8ac
Reviewed-on: https://code.wireshark.org/review/12714
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 03:50:44 +00:00
Guy Harris d222dd3989 Provide routines to set string-like and range preferences from a string.
That gets rid of some duplicate code.

Change-Id: I4b65c6c73929d18602f6b0425e4f3dbbabbf0127
Reviewed-on: https://code.wireshark.org/review/12713
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-18 03:19:03 +00:00
Gerald Combs 76dd8a27b7 Start deprecating the capture info API.
The GTK+ UI has a capture info dialog which shows a summary of captured
protocols, including IPX (!), NetBIOS (!!) and VINES (!!OMG!!). It's
been disabled by default since 2006 (g59aa9e40).

Remove the preference in the Qt UI capture pane. It's still available
via the advanced prefs. Add comments in various parts of the code noting
that the capture_info routines and structs are GTK+ only. Also note that
if we *do* want to add a Qt capture info dialog we'll probably want to
modernize the information we show.

Change-Id: I3c63f6f01b60f0767fb33602a7f0c3b537dbde51
Reviewed-on: https://code.wireshark.org/review/10991
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-13 04:25:13 +00:00
Balint Reczey 9a9b1c9bba Spelling fixes for errors found by lintian
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20
Reviewed-on: https://code.wireshark.org/review/11945
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:11:54 +00:00
Mikael Kanstrup 9a2d16bac7 Fix memory leak in write_prefs
Valgrind reports leaks like these:
384 bytes in 8 blocks are definitely lost in loss record 43,909 of 46,703
  at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  by 0xD6A055F: __vasprintf_chk (vasprintf_chk.c:80)
  by 0xA5FD0FB: g_vasprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D8C7F: g_strdup_vprintf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0xA5D8D1B: g_strdup_printf (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
  by 0x6854FA6: write_prefs (prefs.c:4941)
  by 0x733A9A: prefs_main_write (preference_utils.c:266)
  by 0x5F8A5C: CaptureInterfacesDialog::saveOptionsToPreferences() (capture_interfaces_dialog.cpp:851)
  by 0x5F93CD: CaptureInterfacesDialog::on_manage_clicked() (capture_interfaces_dialog.cpp:858)
  by 0x7182AC: CaptureInterfacesDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (capture_interfaces_dialog.moc.cpp:316)
  by 0x718822: CaptureInterfacesDialog::qt_metacall(QMetaObject::Call, int, void**) (capture_interfaces_dialog.moc.cpp:413)
  by 0xBEBE36C: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)

When storing user preferences the constructed pathname of user's
preferences file is not freed properly.

Change-Id: I5cdc53ca836503af048e1d06e4614d83ef8921ac
Reviewed-on: https://code.wireshark.org/review/12114
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-25 14:18:47 +00:00
Stig Bjørlykke 0ae19656e1 Qt: Fixed column issues when changing profile.
Always initialize prefs.col_list in pre_init_prefs.
When switching to a profile without a saved 'preferences' file we
have to initialize prefs.col_list to default values to avoid reusing
settings from the profile we leave.
This was introduced in 5012cf84e6

Emit columnsChanged() before preferencesChanged().
This because columnsChanged() rebuilds cap_file_->cinfo which is used
in preferencesChanged() to align columns (and possible other actions).
Doing this in the wrong order will give an inconsistency and a
heap-buffer-overflow if having different number of columns.

Bug: 11493
Change-Id: I5792dfc0ede11b9457b96f092af8da00453787b1
Reviewed-on: https://code.wireshark.org/review/11971
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-20 07:57:25 +00:00
Balint Reczey c297df134b More spelling fixes found by lintian
Change-Id: Id218dec9e5a721d6c63fd34962ffe50b6ab8dd56
Reviewed-on: https://code.wireshark.org/review/11946
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Diederik de Groot <dkgroot@talon.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-20 05:47:29 +00:00
Matthieu Coudron c2afc9edec Change prototype of callbacks passed to wmem_tree_foreach so that they
accept the node key as a first parameter.

wmem_tree accepts all sort of keys (strings, integers, soon ranges),
thus it is of interest for various purposes (testing, greedy search) to
know the key of the node.

Change-Id: Ie748b917bef91f0b1ba8cce15bd1b471922641dc
Reviewed-on: https://code.wireshark.org/review/11683
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-11 00:22:37 +00:00
Guy Harris 0b05086754 Apple calls it just "OS X" these days.
Change-Id: I98905988ceb394d27307d1cbe883d8fe95ac23e4
Reviewed-on: https://code.wireshark.org/review/11703
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-10 21:08:45 +00:00
Guy Harris 0162e54075 Clean up includes of unistd.h, fcntl.h, and sys/stat.h.
Have wsutil/file_util.h include them on UN*X, just as it includes io.h
on Windows, so we can have a rule of "if you do file operations, include
<wsutil/file_util.h> and use the routines in it".

Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't
necessary (whether because of the addition of them to wsutil/file_util.h
or because they weren't needed in the first place).

Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f
Reviewed-on: https://code.wireshark.org/review/11619
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07 21:52:23 +00:00
Gerald Combs 9f8d00c174 Add preferences for related packets and the scroll bar minimap.
Add gui.packet_list_show_related and gui.packet_list_show_minimap.
Show_related enables and disables the related packet delegate.
Show_minimap enables and disables the minimap. Start calling it the
"intelligent scroll bar" since that's the best suggestion for a name
I've seen so far.

Leave them out of the Appearance preference pane for now.

Change-Id: I5869c446fda5c8e62d6b1e49a74d63ba3b117b0f
Reviewed-on: https://code.wireshark.org/review/11332
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-27 23:28:56 +00:00
Peter Wu c647faa8a9 Fix various memleaks
Found by starting Wireshark within an empty profile, opening
Preferences, search for Protocol "IEEE 802.11" (because it has radio
buttons), then close everything again.

Many fixes are trivial, but the various recent_read_* functions in
recent.c were changed to return a boolean such that the result can
always be checked even if errno==0.

QButtonGroup leak was hinted by Clang Static Analyzer, all other
memleaks were found using ASAN/LSan.

Change-Id: Ia73f5d4c09d92f22e72377be59e23342f8ad7211
Reviewed-on: https://code.wireshark.org/review/10776
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-04 15:45:02 +00:00
Guy Harris 32e785f813 The official #define for 32-bit and 64-bit Windows is _WIN32.
It's _WIN32, with a leading underscore, not WIN32.  See, for example:

    https://sourceforge.net/p/predef/wiki/OperatingSystems/

and

    https://msdn.microsoft.com/en-us/library/b0084kay.aspx

*Some* environments may also define WIN32, but we shouldn't depend on
that.

Replace all-caps "WIN32" referring to Windows in comments and other text
with "Windows" or "Win32".  (The two are pretty much equivalent, these
days; nobody much cares about Win16, not that we ever ran on it, and
64-bit Windows is just a 64-bitified Win32.)

Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70
Reviewed-on: https://code.wireshark.org/review/10367
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-02 22:59:10 +00:00
Stig Bjørlykke ecc4f756bd Added Reload Lua plugins.
This is initial support for reloading Lua plugins without
restarting the application.

Still todo:
- Deregister FileHandlers
- Support deregister ProtoField with existing abbrev (same_name_hfinfo)
- Add a progress dialog when reloading many plugins
- Search for memory leakages in wslua functions

Change-Id: I48870d8741251705ca15ffe1068613fcb0cb18c1
Reviewed-on: https://code.wireshark.org/review/5028
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-11 12:09:07 +00:00
Gerald Combs 9fd3bcc25e Add an elide mode preference for the Qt packet list.
Change-Id: I081cc1e9b2a0eea7f0a3ef1157561c50beb4c4db
Reviewed-on: https://code.wireshark.org/review/9902
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-06 21:06:34 +00:00
Hadriel Kaplan 190e313e9d DNS: move DNS name resolution pref to Name Resolution prefs
Move the boolean flag for using captured DNS packet info for name resolution
to the Name Resolution preferences settings, as it was rather surprising to
disable Name Resolution preferences and still have names being resolved. Also
disble them all if the '-n' command line switch is used, and re-enable it for
a 'd' character in the '-N' option.

Bug: 10337
Change-Id: Ie4d47bab0100db3360cc447cd3e446b2e39aa917
Reviewed-on: https://code.wireshark.org/review/9786
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-07-25 17:05:01 +00:00
Michal Labedzki 1e487664bc Qt: Add option to back white line separator for packet list items
This uses one line (on bottom) of items and makes it white.
Seen in Wireshark on some configurations of GTK 2 on Linux,
so backports it to Qt for people who like it.

In my opinion it helps if you use packet list background colors
for frames and you have a lot of following frames with
the same background color.

Bug: 10954
Change-Id: Id8f58520d7224db4eb8181bcc04febd7416a8578
Reviewed-on: https://code.wireshark.org/review/7293
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-07-20 21:21:28 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Evan Huus 35399887f4 prefs: fix memory leak reading capture columns
Change-Id: I925ec3329cc099a5f3d2ae66e43b06fc52309dc8
Reviewed-on: https://code.wireshark.org/review/9504
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-07-06 00:26:03 +00:00
Evan Huus e4f88dd6cb Fix a memory leak registering prefs
Built-in string prefs have to be dynamic, but get overwritten by the
registration routine, so we have to save and then free them after-the-fact.

Change-Id: Ib418b14296391dd198a8b49b0c99c5f697d8050f
Reviewed-on: https://code.wireshark.org/review/9132
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-25 17:39:02 +00:00
Evan Huus ec094b5cc1 Initialize default stats before using them
Quick hack fix for bug 11275.

The longer fix I am still thinking about, but it goes something like this: we
have a terribly confusing dependency graph in ordering our various preferences,
so it's fragile and needs refactoring.

1. We must call epan_init before we read the preferences files, since dissectors
register many preferences.
2. We must call pre_init_prefs before we call prefs_register_modules, since that
inits the default values of the "global" preferences structure. `init_prefs()`
handles this normally.
3. We must call epan_init before we call init_prefs since init_prefs depends on
UATs being initialized (which is something epan_init does).
4. We must call prefs_register_modules before we call epan_init since that
generates the `protocols` subtree which is needed for registering
dissector-specific preferences.

The above graph has a cycle, which I *think* can be solved by splitting
prefs_register_modules?

Bug: 11275
Change-Id: I08dae6a7ade178896e0de5e5091f7eeaca95846f
Reviewed-on: https://code.wireshark.org/review/9098
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 19:48:09 +00:00
Peter Wu 0c71b13b3e prefs: fix memleak
Calling g_list_remove_link(link, llink) does not free the removed
last link llink. g_list_next or g_list_foreach+g_free followed by
g_list_free should be used instead such that the data is freed before
and then dropped from the list.

This fixes a memleak in tshark -r dns.pcap detected by ASAN (single
packet).

Set pref->default_val.list = NULL just in case, and with symmetry with
capture_columns handling.

Change-Id: I3cc52e275784037ab40c0b42c68d0dd83b73cd98
Reviewed-on: https://code.wireshark.org/review/9026
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-23 05:46:18 +00:00
Guy Harris 083f6b6e6d Have a #define for whether the capture buffer size can be set.
It can be set if either 1) this is Windows (where we're assumed to be
using WinPcap, which includes calls to set the buffer size) or 2) we
have pcap_create() (in which case we also have pcap_set_buffer_size(),
at least in a normal libpcap release).

Use that rather than testing "defined(_WIN32) ||
defined(HAVE_PCAP_CREATE)"; that makes it a bit more obvious what's
being tested.

Change-Id: Id9f8455019d19206b04dd6820a748cb97ae5ad12
Reviewed-on: https://code.wireshark.org/review/7816
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-25 03:22:33 +00:00
Michal Labedzki 2d4817966e Qt: Automatically scroll the packet list.
Add an "Auto Scroll in Live Capture" action to the Go menu. It's in the
View menu in the GTK+ UI but it seems to make more sense as a navigation
item.

Use a timeout interval for automatic scrolling. I haven't run any tests
to see if this makes a difference but it would seem that the less
drawing we do during a high speed capture the better, particularly for
remote displays.

Update the x-stay-last icons.

Note that we might want to make prefs.capture_auto_scroll a "recent"
setting.

Mark auto_scroll_live and packet_list_check_end GTK+ only.

Bug: 10601
Co-authored-by: Gerald Combs <gerald@wireshark.org>
Change-Id: I645d27c0814f0e4a0d5b01ae68be366847e2522d
Reviewed-on: https://code.wireshark.org/review/7292
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-27 20:27:14 +00:00
Michal Labedzki c093797b12 Fix GTK-shark
Looks like a copy/paste issue.
ERROR: wireshark/color_filters.c💯color_filters_add_tmp: assertion failed: (strlen(prefs.gui_colorized_fg)==69)

Change-Id: I7b8309cfc178fd834951078a098bbce986639ed2
Reviewed-on: https://code.wireshark.org/review/7286
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-21 17:19:05 +00:00
Gerald Combs 5012cf84e6 Call pre_init_prefs each time our profile changes.
Manually back out gafa96c3 so that we can set our preferences to their
default values each time we switch profiles.

Zero the prefs struct at startup.

Change-Id: Ic28db44cd0c4cdf640e977d7277f7357db10ebe8
Reviewed-on: https://code.wireshark.org/review/7282
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-21 02:57:46 +00:00
Gerald Combs ead79e6aa1 Clear the filter expression list in prefs.c.
Move filter_expression_nuke from ui/gtk to epan and rename it to
filter_expression_free. Call it in prefs_reset along with the other
preference reset routines.

This keeps the Qt filter toolbar from filling up with duplicate
expressions when the profile changes.

Change-Id: I9fae9a7b48944079ea342a126979d9e79af0d22b
Reviewed-on: https://code.wireshark.org/review/7281
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-20 23:16:54 +00:00
Dario Lombardo 60cc8b4fd8 Support for looking for incomplete dissectors.
Change-Id: I03e592dd3d54fc0e1c4af09d5d5336dda93f950e
Reviewed-on: https://code.wireshark.org/review/6978
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-12 11:14:24 +00:00
Michael Mann 7967ef9510 Remove emem APIs from UAT functionality.
Change-Id: I009c09f25d170e5c9aaaef713eaacb3252817856
Reviewed-on: https://code.wireshark.org/review/6460
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-12 14:25:12 +00:00
Michael Mann effc8266ce Add preference to display spaces between bytes for FT_BYTES fields.
I think this can make fields more readable (for a small amount of bytes).

Converted DeviceNet dissector to use proto_tree_add_item for some FT_BYTES field as tvb_bytes_to_str_punct was used to create this effect "manually".

Change-Id: I59e2acf9b00a4eb1279e6c2b2b7bd8ecef20db9b
Reviewed-on: https://code.wireshark.org/review/6304
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10 19:57:27 +00:00
Alexis La Goutte 60d7413efe prefs: fix typo
Change-Id: Ic4dbbab5e53b5745cb703e6e30b2dc6251c3918e
Reviewed-on: https://code.wireshark.org/review/6161
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-31 14:58:38 +00:00
Michal Labedzki 5025bc258c Qt: Dynamic languages
- get language as soon as possible (before creating any Qt objects) to make all
  translations working
- dynamic list of supported languages
- runtime change of GUI language (no need to restart application)
- add flags icons support
- search for *.qm languages in buildin resources, then
  data dir called "languages" (main directory in sources or
  /usr/share/wireshark/languages), then user directory
  (UNIX: ~/.wireshark/languages); "languages" directory should contains
  files wireshark_xx.qm where xx is language code (en, en_GB, etc.),
  and optional xx.svg for flag icon
- try to fix some untranslated manually-created UI items
  (need manual reset text of those components)

Change-Id: I62ca8a8cddce47cec9dbcad6b0bd68b6cfd92229
Reviewed-on: https://code.wireshark.org/review/5041
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-04 08:21:55 +00:00
Alexis La Goutte e8d2ba9349 Pref: Remove unsued function
Fix also warning: no previous prototype for 'prefs_get_uint_preference' [-Wmissing-prototypes]

Change-Id: I4626372a9c131584c515a43e73aa019e2f696d29
Reviewed-on: https://code.wireshark.org/review/4960
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-28 15:21:00 +00:00
Guy Harris 033f096ee9 Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).

Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 23:11:18 +00:00
Dario Lombardo 7f74471229 Added italian translation to qt.
Change-Id: If58ed29e78a9994fc488a4d01cf665f7e8d82830
Reviewed-on: https://code.wireshark.org/review/4707
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-16 18:55:33 +00:00
Gerald Combs 8fc2327766 Qt: Fix preference bugs.
Make sure we set the "resolved" member of the column fmt_data struct.

Emitting WiresharkApplication::AppSignals from a modal dialog can cause
event loop problems on OS X. Queue them up in PreferencesDialog and emit
them after closing.

Change-Id: I2de77778a0448db3b87d402e431b8e5f325cbbda
Reviewed-on: https://code.wireshark.org/review/4274
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-24 16:25:40 +00:00
Bill Meier f3dd7fe1eb Fix whitespace/indentation to match editor modelines.
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca
Reviewed-on: https://code.wireshark.org/review/3452
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-05 20:42:21 +00:00
Gerald Combs 59ef97dd65 [WIP] Add a conversation dialog.
Items are sorted by value.

Move common conversation code to ui/conversation_hash.[ch]. Add a
conversation_type_e enum along with convenience functions for fetching
titles, tap names, etc.

We have a single main dialog instead of a main dialog + individual
protocol dialogs. It de-clutters the statistics menu and results in
simpler code. Conversation type tabs can be added and removed within the
dialog itself. The tab list is sticky and saved with the current profile
when the dialog closes. Data can be copied as CSV or YAML.

Add a FilterAction class and a corresponding filterAction slot to
MainWindow. Use it for the Conversations context menu.

Add an addressResolutionChanged signal and related plumbing.

Get rid of the iterator members in the conversation item struct. Update
the GTK+ code accordingly.

Excercise for the reader:
- Update TShark to use the common hash code.

Ping-Bug: 9231
Ping-Bug: 8703
Ping-Bug: 6727
Change-Id: I8728d771fc5b1a85937bed9d898e53c3ecc3a544
Reviewed-on: https://code.wireshark.org/review/2987
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-21 23:19:09 +00:00
Martin Kaiser b1532b21be start support for the Japanese language in the Qt version
just the framework and some simple translations

Change-Id: I7653a9c6ab26b391bfe2942d088d233996030576
Reviewed-on: https://code.wireshark.org/review/3134
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-07-20 18:02:33 +00:00
Guy Harris 9d436346c3 Make the state variable an enum, and add a case for the IN_SKIP value.
Also indicate what the states mean.

Change-Id: Ie1701bb2fb33334bcd66d325d1368c2a15cbb7e8
Reviewed-on: https://code.wireshark.org/review/3061
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15 21:06:16 +00:00
Guy Harris 338369ec2f Treat CR-LF at the end of a line like LF.
That way, if we're reading a Windows-format file on UN*X, we handle it
the same way we'd handle a UN*X-format file.

This handles bug 10272 for the preference file and the "recent" files;
there are other configuration files that may need code changes as well.

Change-Id: Iec15a8fac276929ce8b53ae16070e9f2855f574c
Reviewed-on: https://code.wireshark.org/review/3042
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-14 18:27:06 +00:00
Guy Harris d96ff60566 As opposed to *loudly* silently?
Change-Id: I5c6843ac2c665a4c8c8822084377fee661405d34
Reviewed-on: https://code.wireshark.org/review/2992
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-11 00:44:51 +00:00
Guy Harris 2585e6cb09 Change comments to reflect current reality.
Change-Id: If4e220457d2040eaa35dd5e55a0f43fc9da5e347
Reviewed-on: https://code.wireshark.org/review/2991
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-11 00:43:15 +00:00
Michal Labedzki 59e860cf2f [WIP] qt: Add support for Polish language
Change-Id: Ib63937e741b737f171a9b383a9cbabb55dfdd8ef
Reviewed-on: https://code.wireshark.org/review/2553
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-23 19:10:21 +00:00
Irene Ruengeler df8c4bf264 Capture Interfaces Dialog:
- allow to change the interface options in the table
- save the options to preferences when the dialog is left
- add a field for setting a capture filter for all selected interfaces
- add a "Compile BPF" button and a window to show the compiled filter output
- try to address Alexis' and Evan's comments

Change-Id: Ic1272e29183ec80e2d2f4b3e494c79dabe2c3b6f
Reviewed-on: https://code.wireshark.org/review/1946
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-12 05:54:59 +00:00
Bill Meier 3d23cbd11f (Trivial) Fix a typo.
Change-Id: I111d3af8d9f1a96ebbe3f4b19ab1597a93348058
Reviewed-on: https://code.wireshark.org/review/1952
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-04 19:29:38 +00:00
Peter Wu 8dc7d164dc prefs: prevent double-free on changing prefs
Prevent double-free when changing profiles. After switching from the
default profile to a profile without a preferences file,
saved_at_version will be freed, but a new version will not be inserted
(because the prefs file is empty). On a subsequent switch to another
profile, the saved_at_version field is freed again leading to a crash.

Bug: 9463
Change-Id: Ia9e0936e32603b4676a37dc428bda40c264a6eaa
Reviewed-on: https://code.wireshark.org/review/1425
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 04:17:54 +00:00
Peter Wu e8cb623166 prefs: spelling fix, simplify code
Found spelling error "a another". All those dynamic allocations and
magic numbers are horrible and unnecessary. Simplify the gtk code
rewording the message and merging strings.

Simplify the version code by using fscanf to take care of matching
the first line of a preference file.

Change-Id: I1e75803aacaa494ba5005791bcbd023e0807aaaa
Reviewed-on: https://code.wireshark.org/review/1424
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 04:16:23 +00:00
Peter Wu 878f341ffa prefs: fix ASAN error due to invalid indirection
For pref_current, indirection of pref->varp.string will cause a read of
size 8. This will cause a global buffer overflow error for all smaller
types, for example lbmc_use_heuristic_subdissectors (size 4).

Reproduce: compile Wireshark with -fsanitize=address, open Preferences
and select OK or Apply. Result: ASAN crash.

To fix this, only indirect a pointer if the storage size is known, a
void pointer stores the address of the constant value (pref_default,
pref_stashed) or the address to the value (pref_current). Note that
pointers of different types are of equal size, I could take
valp.pref_(anything).

While at it, remove superfluous 'break' keywords where a 'return'
keyword is present.

Change-Id: I05a69e8f14a1ecb4e5d2a0c0f0b71ed3f0a41d70
Reviewed-on: https://code.wireshark.org/review/1286
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-27 18:56:03 +00:00
Michal Labedzki 15b95bab42 Do not try to use unknown/non-existent webbrowser
Some systems do not have webbrowser or have strange browser.
Do not try to use it and dislayed URL for user information.

Change-Id: I3f5bcca6701b20cafa942629cbee78aa1fc689b1
Reviewed-on: https://code.wireshark.org/review/516
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-08 06:30:17 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 616ed71918 Fix bug which (somewhat) randomly caused UAT pref to not display on a proto pref page.
Introduced in ga2b2dd4b (SVN #53880)

Change-Id: I3dd24ab5e1b45367b03b8096a5892f346782217f
Reviewed-on: https://code.wireshark.org/review/433
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-28 19:03:09 +00:00
Hadriel Kaplan 655f2e4dd4 Fix prefs.c: Argument with 'nonnull' attribute passed null (redux)
Change-Id: I795df36039278283008132d647aaf51e76dbe218
Reviewed-on: https://code.wireshark.org/review/424
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-02-27 21:23:32 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Guy Harris 32da185ed5 Don't cast away constness.
svn path=/trunk/; revision=54802
2014-01-14 18:42:54 +00:00
Gerald Combs 17a67c3b5c Get the "Decode As" dialog working, albeit with a few warts. It differs
from the GTK flavor in two major ways:

- The "Decode As" and "User Specified Decodes" dialog have been unified.
- You can modify the decode as behavior at any time, not just when you
  have a packet selected.

Revert part of 53498 so that we can move items marked

/*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/

from epan/decode_as.h to ui/decode_as_utils.h. 

Move "save" code from decode_as_dlg.c to decode_as_utils.c as well.

In packet-dcerpc.c don't register a table named "ethertype". We might
want to add checks for duplicate table names.

To do:
- Add support for ranges?
- Either add support for DCERPC or make DCERPC use a regular dissector
  table.
- Fix string selectors (i.e. BER).


svn path=/trunk/; revision=53910
2013-12-10 19:23:26 +00:00
Irene Rüngeler a2b2dd4b28 Add a function and an enum to register an uat preference for QT only.
svn path=/trunk/; revision=53880
2013-12-09 10:07:33 +00:00
Michael Mann 60d6b05e23 Stats_tree enhancements for sorting, averages and burst rate. Bug 9452 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9452)
From Deon van der Westhuysen

- Bug fix: object leak in stats_tree after a tap reset (for example apply statistics preferences with a stats_tree window open)
- Bug fix: correct sample code in README.stats_tree
- Add: slash in plug-in name now creates submenu as docs describe (was a bug?)
- Add: menu separator before the stat_tree registered plug-ins
- Add: stats_tree can now calculate averages for nodes; automatically calculated for range nodes. Add section in README.stats_tree describing averages.
- Add: stats_tree can now calculate burst rate of each node (like rate but with a shorter, sliding time window)
- Add: sorting for stats_tree plug-ins. Can sort on node name, count, average, min, max values and burst rate.
- Add: preferences for stats_tree system (default sort column, burst calc params)
- Add: stats_tree window copy to clipboard and export and plain text, csv and XML.
- Added sample of new functionality in $srcdir/plugins/stats_tree/pinfo_stats_tree.c
- Moved all stats_tree sample plug-ins to "IP Statistics" submenu.

svn path=/trunk/; revision=53657
2013-11-29 22:47:59 +00:00
Gerald Combs 70709e1b35 Move common "decode as" preference code to epan.
We presumably want "decode as" behavior to be consistent across UIs so
call load_decode_as_entries() from read_prefs().

svn path=/trunk/; revision=53498
2013-11-22 00:20:23 +00:00
Guy Harris db25270df8 Move the epan/filesystem.c routines to wsutil; they're not specific to
packet dissection, they're specific to the entire Wireshark suite of
programs.

svn path=/trunk/; revision=53377
2013-11-17 02:55:14 +00:00
Alexis La Goutte 49485528d8 Add Packet Editor Preference
svn path=/trunk/; revision=53134
2013-11-07 07:43:11 +00:00
Jeff Morriss 274596eaab Fix up some formatting and white space.
svn path=/trunk/; revision=52848
2013-10-25 15:25:46 +00:00
Jeff Morriss ce23d50028 Fix CID 715143: assert that the preference we were looking for was found. It
should be which is why this is an assertion not a NULL check.

svn path=/trunk/; revision=52847
2013-10-25 15:00:00 +00:00
Jeff Morriss 81b0681c12 Fix CID 715144: assert that the preference we were looking for was found. It
should be which is why this is an assertion not a NULL check.

svn path=/trunk/; revision=52846
2013-10-25 14:57:55 +00:00
Alexis La Goutte f99f7bf17e From Dean Lee via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8597 Qtshark: Chinese Simp translation
From me :
Add to the (new) Qtshark Language selector

svn path=/trunk/; revision=51871
2013-09-09 17:49:15 +00:00
Alexis La Goutte fe4407ebc7 Add Preference to change Language (in QtShark)
Need restart application to change language

svn path=/trunk/; revision=51869
2013-09-09 16:20:45 +00:00
Evan Huus 14b098baf7 When freeing the preferences of a module, also free the preferences of its
submodule.

svn path=/trunk/; revision=51328
2013-08-13 02:56:55 +00:00
Evan Huus 615687f4c0 Fix the most egregious of the newly exposed leaks, about 28KB.
svn path=/trunk/; revision=51047
2013-07-31 01:55:20 +00:00
Evan Huus 999c603027 Convert preferences to wmem. Exposes some more memory leaks that didn't show up
before.

svn path=/trunk/; revision=51046
2013-07-31 01:49:57 +00:00
Guy Harris afe77c5a4e Clean up white space a bit, make the description of the capture column
type depend on what values are supported, add some comments.

Regularize the curly bracket style a bit.

svn path=/trunk/; revision=50998
2013-07-29 00:27:20 +00:00
Gerald Combs a05f55bffc Add a UAT dialog. Make UAT preferences uat_t * instead of void *.
C++-ize the UAT headers.

Add an ElidedLabel widget. Use it in the File Set, Profile, and UAT
dialogs.

Update the Qt README.

svn path=/trunk/; revision=50896
2013-07-25 23:49:47 +00:00
Guy Harris 21609c54bb Don't report a syntax error if a preference name without a "." is
specified, report it as "no such preference" instead.  That should be
less confusing; see

   http://stackoverflow.com/questions/17757659/how-to-apply-and-override-preferences-with-tshark

for an example of confusion.

#BACKPORT 1.10, 1.8

svn path=/trunk/; revision=50745
2013-07-21 00:56:42 +00:00
Pascal Quantin 57aebcf776 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 :
Fix segmentation fault when reading pref file

svn path=/trunk/; revision=50737
2013-07-19 08:04:58 +00:00
Pascal Quantin fdc867a4fc Temporarily disable offending code triggering a segmentation fault on Linux (see bug 8942)
svn path=/trunk/; revision=50725
2013-07-18 09:12:59 +00:00
Anders Broman 09c5152fa7 From Cal Turney:
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved.

If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved.  A "Continue without Saving" button is provided so that the user can save the profile under a different name.

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

svn path=/trunk/; revision=50716
2013-07-18 04:28:36 +00:00
Anders Broman e9d236ec0b Backing out r50690 (exept simple_dialog)
struct FILE is different on windows vs *nix


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

svn path=/trunk/; revision=50691
2013-07-17 05:52:51 +00:00
Anders Broman e0341f776c From Cal Turney:
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved.

If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved.  A "Continue without Saving" button is provided so that the user can save the profile under a different name.

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

svn path=/trunk/; revision=50690
2013-07-17 04:52:19 +00:00
Guy Harris 86147047f5 Fix one that got missed.
svn path=/trunk/; revision=50660
2013-07-16 03:16:26 +00:00
Chris Maynard 9d3cda266b Revert r50655 for this file.
svn path=/trunk/; revision=50659
2013-07-16 03:04:47 +00:00
Chris Maynard d331c33b4f This should fix warning: to be safe all intermediate pointers in cast from 'gchar **' to 'const char **' must be 'const' qualified.
svn path=/trunk/; revision=50655
2013-07-16 02:34:44 +00:00
Evan Huus afa96c3f33 Fix some of the preferences leaks. Don't strdup the defaults, as they will be
strduped again immediately when they are registered. To make this safe, tweak
the flow a bit so that they are guaranteed to be registered immediately after
being set here.

svn path=/trunk/; revision=50563
2013-07-14 00:45:19 +00:00
Anders Broman 06f748c0b5 prefs.c: In function 'capture_column_set_cb':
prefs.c:1745: warning: unused variable 'syntax_error'

svn path=/trunk/; revision=50457
2013-07-09 05:14:33 +00:00
Anders Broman bbf7636e61 From Cal Turney:
Wireshark crashes when switching from a v1.11.0 profile to a v1.4.6 prof and then to a v1.5.1 profile.

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

#BACKPORT 1.10

svn path=/trunk/; revision=50455
2013-07-09 04:22:43 +00:00
Jeff Morriss 20674d8877 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8876 :
Errors in preferences preceding "gui.console_open" are not immediately
displayed in the console:  If a gui.console_open is set to "AUTOMATIC" or
"ALWAYS" and an error or warning occurs in a preference previous to it, the
warning is not displayed in the console window because the window is not yet
open. However, if the user switches to another profile and returns, the
messages will be displayed.

Fix: Move the gui.console_open to the top of the list in
prefs_register_modules() of prefs.c. Existing preferences files can be
corrected by saving them.

svn path=/trunk/; revision=50269
2013-06-30 21:58:25 +00:00
Michael Mann 277aed869e Make colors used by colorize_filter_te_as_* as preferences. Bug 5413 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5413)
svn path=/trunk/; revision=50203
2013-06-28 03:03:36 +00:00
Jeff Morriss 838e3767ce From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8707 :
As suggested by Jakub, don't use strlen() when g_string->len will do.

From me:

Don't assume that just because we "got_val" that the value has a length.
Checking it first eliminates this warning from Valgrind:

==11954== Invalid read of size 1
==11954==    at 0x61D1466: read_prefs_file (prefs.c:3012)
==11954==    by 0x61D1841: read_prefs (prefs.c:2955)
==11954==    by 0x409901: main (tshark.c:1137)
==11954==  Address 0xc05244f is 1 bytes before a block of size 16 alloc'd
==11954==    at 0x4A08A6E: realloc (vg_replace_malloc.c:662)
==11954==    by 0x3CF8C4D736: g_realloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x3CF8C66226: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x3CF8C66ACE: g_string_insert_c (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x61D1566: read_prefs_file (gstring.h:139)
==11954==    by 0x61D1841: read_prefs (prefs.c:2955)
==11954==    by 0x409901: main (tshark.c:1137)

svn path=/trunk/; revision=49731
2013-06-03 22:07:21 +00:00
Anders Broman aff9b07fd3 From Cal Turney:
Preferences with trailing commas are ignored.

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

svn path=/trunk/; revision=49629
2013-05-30 05:30:08 +00:00
Guy Harris 7f97cc813e From Cal Tunney:
contify some arrays;

	don't complain about "print.command" on Windows, just ignore it,
	as it's valid on non-Windows platforms;

	fix some comparisons for preferences moved elsewhere;

	clean up some comments.

svn path=/trunk/; revision=49485
2013-05-21 21:28:41 +00:00
Guy Harris dc8af1b552 Clean up white space.
svn path=/trunk/; revision=49484
2013-05-21 20:38:51 +00:00
Anders Broman 1569217448 From Cal Turney:
When another profile is selected, its column.hidden preference is ignored.

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

svn path=/trunk/; revision=49434
2013-05-20 05:33:18 +00:00
Gerald Combs a5037603ce Tell the user tha gui.update.channel probably shouldn't be changed.
svn path=/trunk/; revision=48970
2013-04-22 17:58:28 +00:00
Jeff Morriss c2ced4a2ab Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written to
that directory since 2001 and reading from that directory was only left in for
backwards compatibility with versions prior to r4702.  I think it's now safe
to remove that backwards compatibility.

This eliminates the last argument of get_persconffile_path().

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

svn path=/trunk/; revision=48797
2013-04-09 02:48:03 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Irene Rüngeler 44e6a88b13 Add interface options preferences.
svn path=/trunk/; revision=48275
2013-03-13 12:38:08 +00:00
Michael Tüxen 15501fad2a Try to fix the buildbots.
The patch for capture_dlg.c is from Anders...

svn path=/trunk/; revision=48164
2013-03-07 12:06:55 +00:00
Irene Rüngeler cb42bc9fec Add buffersize and snap length to the preferences.
svn path=/trunk/; revision=48163
2013-03-07 09:16:55 +00:00
Anders Broman d4e23d8daa Use explicit casts.
svn path=/trunk/; revision=48162
2013-03-07 07:48:33 +00:00
Bill Meier 24eff41b08 it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47896
2013-02-26 02:19:57 +00:00
Gerald Combs 5a5d872639 Register the gui.update.interval preference.
svn path=/trunk/; revision=47750
2013-02-19 23:05:27 +00:00
Gerald Combs 81a5be5813 Enable automatic updates for Win64. Fix a copy/paste error.
svn path=/trunk/; revision=47749
2013-02-19 22:57:40 +00:00
Gerald Combs e48236a436 Add automatic software update checks for Win32 using WinSparkle. Add
preferences (currently hidden) to disable updates, set the update
frequency, and set the update "channel" (stable vs development). Add a
"Help" menu item to manually check for updates.

svn path=/trunk/; revision=47748
2013-02-19 22:21:17 +00:00
Gerald Combs d21f62b73b Add a directory name preference type (PREF_DIRNAME) and registration
routine (prefs_register_directory_preference). Add PREF_FILENAME and
PREF_DIRNAME support to the Qt module preferences. Change a couple of
preferences to directory names.

Clean up some names and default settings.

svn path=/trunk/; revision=47573
2013-02-08 18:07:34 +00:00
Gerald Combs d1f6e2e3ec Use a not-quite-black background for marked packets.
http://ianstormtaylor.com/design-tip-never-use-black/

svn path=/trunk/; revision=47392
2013-01-31 18:46:40 +00:00
Gerald Combs 2dff8d7605 Add font and color preferences. Unfortunately Qt doesn't have a color
picker widget so we're back to popping up dialogs. Move the contents of
monospace_font.{cpp,h} to wireshark_application.{cpp,h}.

Pango and Qt use completely different string representations for fonts.
Add a separate gui.qt.font_name preference so that they don't clobber
each other.

svn path=/trunk/; revision=47240
2013-01-24 01:10:12 +00:00