aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-05Allow bigger snapshot lengths for D-Bus captures.Guy Harris1-4/+3
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except for D-Bus captures. Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for them, because that's the largest possible D-Bus message size. See https://bugs.freedesktop.org/show_bug.cgi?id=100220 for an example of the problems caused by limiting the snapshot length to 256KB for D-Bus. Have a snapshot length of 0 in a capture_file structure mean "there is no snapshot length for the file"; we don't need the has_snap field in that case, a value of 0 mean "no, we don't have a snapshot length". In dumpcap, start out with a pipe buffer size of 2KB, and grow it as necessary. When checking for a too-big packet from a pipe, check against the appropriate maximum - 128MB for DLT_DBUS, 256KB for everything else. Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20 Reviewed-on: https://code.wireshark.org/review/21952 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>
2017-05-26Report syntax errors in UAT prefs parsingPeter Wu1-3/+11
Add the cause for a syntax error while parsing UATs. Example output: $ tshark -ouat:ssl_keys:, tshark: Invalid -o flag "uat:ssl_keys:,": ssl_keys:1: No IP address given. $ tshark -ouat:unknown:, tshark: Invalid -o flag "uat:unknown:,": Unknown preference Change-Id: I549406c4e31a81d29f487ef47bdb3c22da084947 Reviewed-on: https://code.wireshark.org/review/21748 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-20Add common routines for command-line libwiretap error reporting.Guy Harris1-33/+2
These are similar to the routines added to ui/alert_box.c for dialog-box libwiretap error reporting. This centralizes the knowledge about what to say for various libwiretap errors, removing some duplicate code, and giving more details in some programs. Change-Id: I737405c4edaa0e6c27840f78a8c587a8b3ee120b Reviewed-on: https://code.wireshark.org/review/21234 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-15Squelch some compiler warnings.Guy Harris1-3/+3
Cast an ssize_t value to unsigned int before subtracting it from an unsigned int. The value is already known to be >= 0 and <= the value from which we're subtracting it, and that latter value is an unsigned int, so it's guaranteed to fit into an unsigned int. (ssize_t can be bigger than unsigned int.) Change-Id: I5c4d3c7fa4bf241c9ea72661beca89bc30495a3b Reviewed-on: https://code.wireshark.org/review/21114 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-14Remove some unused code.Guy Harris1-11/+3
It's copied-and-pasted from {somethingelse}shark.c, such as tshark.c; it's not needed here. Fixes CID 1405103. Clean up indentation while we're at it. Change-Id: Ia3ab41f64f055fcebeac6e49ebf5f5581125b960 Reviewed-on: https://code.wireshark.org/review/21082 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09Pull all the "load settings" calls into a epan_load_settings() routine.Guy Harris1-7/+2
That way, nothing using libwireshark needs to know what settings need to be loaded, they just call epan_load_settings(). Change-Id: I9390e259e286fc4f5acaeaac2767e4c3c4b656af Reviewed-on: https://code.wireshark.org/review/20983 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09Pull the error-reporting code for preference files into read_prefs().Guy Harris1-27/+1
No need to duplicate it in N different programs. Update comments while we're at it. Change-Id: I3096cbe5448a19363eff6303bdd54e522dae9336 Reviewed-on: https://code.wireshark.org/review/20973 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-09Pull the code to save enabled/disabled lists into libwireshark.Guy Harris1-1/+1
It's identical in the GTK+ and Qt UIs, and it should just be done in libwireshark. Rename some routines to just speak of enabled_and_disabled_lists, so we don't have to say enabled_and_disabled_protos_and_heuristic_dissectors or something such as that. Clean up indentation. Change-Id: Ief2e612d9e1b60d8d0123b6bd3409dce5faf6495 Reviewed-on: https://code.wireshark.org/review/20970 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-56/+28
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-28rawshark: Move large data (WTAP_MAX_PACKET_SIZE) to the heap.Michael Mann1-2/+3
Change-Id: Ib525d35b6a0fa58602d30fda701b0cce5f05b322 Reviewed-on: https://code.wireshark.org/review/20756 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-03-27Check for return value of WSAStartup on all executables.Michael Mann1-1/+7
Windows vscodeanalysis complains even though the event is probably very unlikely. Change-Id: Iafe158eea5586908209d6bfe1e45540117558673 Reviewed-on: https://code.wireshark.org/review/20727 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-17Rawshark: Try to avoid a VC runtime crash.Gerald Combs1-5/+22
The MSDN documentation for _read says "If fd is invalid, the file is not open for reading, or the file is locked, the invalid parameter handler is invoked, as described in Parameter Validation." This means that on Windows, if our parent has closed stdin when we call _read we'll crash. Add a check to bail out early if that's happened. Fix a sign cast while we're here. Change-Id: I8afb75f6e56c6a6c2b62103ba7e2fb635dc85702 Reviewed-on: https://code.wireshark.org/review/20153 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-02-14rawshark: add initializer.Dario Lombardo1-1/+1
Change-Id: I696b1cfd7cf226d07918cca708a3463db3114333 Reviewed-on: https://code.wireshark.org/review/20100 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-14wiretap: add cleanup routine.Dario Lombardo1-39/+51
The cleanup routine has been added to exit section of the applications. Those which required a exit restyle have been patched as well. Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1 Reviewed-on: https://code.wireshark.org/review/19949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-09Make the capture file's interface description filterableJim Young1-0/+1
This patch introduces the frame.interface_description field. While testing this new functionality it became obvious that we have a non-optimal interaction between the existing cfile.c's cap_file_get_interface_name(), the recently added frame.interface_name field and this new frame.interface_description field. The string returned from cap_file_get_interface_name() may in fact come from one of three different sources: the idb's interface name (if it exists) or the idb's interface description (if that exists) or a default text of "unknown". The string ultimately becomes the rame.interface_name whether or not the idb had an interface name option to begin with. This behavior does not allow one to test for the simple presence of frame.interface_name. The new peer function cap_file_get_interface_description() added by this patch returns NULL instead of "unknown" if the idb does not have an interface description. Should cap_file_get_interface_name() be similarly modified to return NULL if the idb does not have an interface name? Bug: 9781 Change-Id: Ie479f373c5080c004dd22bd88919838feca71e95 Reviewed-on: https://code.wireshark.org/review/19861 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-06rawshark: fix err code.Dario Lombardo1-0/+2
Change-Id: I5aec3ad14eb0f0d591691f2aa7eb8ce09341e020 Reviewed-on: https://code.wireshark.org/review/19963 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02Rawshark: Add a memory limit (-m) option.Gianluca Borello1-1/+23
Add an option to rawshark that lets the user set a maximum memory limit. Change-Id: Ie102ee5f6ba5aec90a35bd63297184c7dc37662c Reviewed-on: https://code.wireshark.org/review/19911 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-12-24Add enabled protocol list for dissectors who are disabled by defaultMichael Mann1-0/+3
We save a list of dissectors that are disabled through the Enabled Protocols dialog. This is because we assume dissectors are enabled by default. For dissectors that are disabled by default, we have no way to keep them enabled through the Enabled Protocols dialog. A dissector that defaults to being disabled has to be reset to enabled each time Wireshark is launched. Add a list similar to the disabled list for enabling dissectors that are disabled by default. This mostly applies to post-dissectors. Change-Id: I31a8d97a9fdbc472fe2a8666384e0f8786bb8e9f Reviewed-on: https://code.wireshark.org/review/19405 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-05Clean up initialization code for programs.Guy Harris1-1/+2
Make the init_progfile_dir() call unconditionally, even if plugins aren't supported, as that doesn't necessarily mean nobody uses the directory containing the executable. Report the error the same way in all programs, and free the error string after we're finished with it. Make the error - and the comment before the code - reflect what init_progfile_dir() is actually doing (the goal is to get the full pathname of the directory *containing* the executable; that's generally done by getting the pathname of the executable and stripping off the name of the executable, but that's won't necessarily always be the case). Also note for TShark that we won't be able to capture traffic, just as we do for Wireshark (if we don't have the pathname of the program file, we don't have a pathname to use to find dumpcap). Have the plugin scanner just fail silently if we weren't able to get the plugin directory path, so we don't have to worry about calling it if init_progfile_dir() fails. Clean up white space while we're at it. Change-Id: I8e580c719aab6fbf74a764bf6629962394fff7c8 Reviewed-on: https://code.wireshark.org/review/19076 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-04Rawshark uses libwiretap, so it has to call wtap_init().Guy Harris1-0/+2
Change-Id: I4b87227e4828ebad98b22e5e5d1f3896e636582a Reviewed-on: https://code.wireshark.org/review/19070 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-12fix some compilation issues without extcap.Dario Lombardo1-1/+8
Change-Id: I18c855e13281013a6277c1f38eeac92e74d52b34 Reviewed-on: https://code.wireshark.org/review/17665 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-09-11extcap: fix use-after-free for preferencesPeter Wu1-12/+4
In commit v2.3.0rc0-117-g485bc45 (backported to v2.2.0rc0-44-g66721ca), extcap_prefs_dynamic_vals and extcap_cleanup were added in an attempt to address dangling pointers. Unfortunately it is not sufficient: - A pointer to the preference value is stored in extcap_arg and passed to the prefs API, but this extcap_arg structure can become invalid which result in use-after-free whenever the preference is accessed. - On exit, a use-after-free occurs in prefs_cleanup when the preference value is being checked. As the preference subsystem actually manages the memory for the string value and consumers should only provide a pointer where the value can be stored, convert the char* field in extcap to char**. This has as additional benefit that values are not limited to 256 bytes anymore. extcap_cleanup is moved after epan_cleanup to ensure that prefs_cleanup does not operate on dangling pointers. Crash is reproducible under ASAN with: tshark -i randpkt Ping-Bug: 12183 Change-Id: Ibf1ba1102a5633aa085dc278a12ffc05a4f4a34b Reviewed-on: https://code.wireshark.org/review/17631 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-29extcap: Restore functionality for optionsRoland Knall1-0/+16
Allow stored options to be restored to their default values. This adds a global cleanup method for extcap and globally defined preference values, which fixes the parameter problem with windows Change-Id: I48e0cf846ef81f4732d652c6a2ad0020db5df08e Reviewed-on: https://code.wireshark.org/review/13741 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-07-17Fix printf style parameters complaints from VS Code AnalysisMichael Mann1-1/+1
Change-Id: I5669e2442582f899643fae4a9f86ab6d505dde07 Reviewed-on: https://code.wireshark.org/review/16505 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-06-21pcap: Add support to "new" Npcap native mode without setting PATHYang Luo1-0/+1
Npcap decided not to add "C:\Windows\System32\Npcap" to system PATH in the installation any more (starting from Npcap 0.07 r14). So this patch needs to be applied, otherwise Wireshark will not find Packet.dll (the error message will only say wpcap.dll is missing, but actually is Packet.dll missing). Change-Id: Ifd8b6e6d8ecf9866cd37c3368b604de210ff8c7b Reviewed-on: https://code.wireshark.org/review/15959 Reviewed-by: Yang Luo <hsluoyz@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-19Revert "tap: change glib functions to wmem."Pascal Quantin1-3/+3
This reverts commit 2e9f3c5d366eaa7139fc877b5301392166b3f985. It breaks the registration of codec, dissector and libwiretap plugins. Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de Reviewed-on: https://code.wireshark.org/review/16012 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-17tap: change glib functions to wmem.Dario Lombardo1-3/+3
Change-Id: I878ae6b121a669f9b7f4e1e57bc079f0cb44c0bf Reviewed-on: https://code.wireshark.org/review/15270 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-10Have fvalue_to_string_repr always return an (wmem) allocated buffer.Michael Mann1-5/+4
Previous patches converted all fvalue_to_string_repr calls to expect an allocated buffer (and not a passed in one). Now changing signature to force an allocated buffer. Added wmem in case that can be taken advantage of within epan (and since the function signature was changing anyway). Change-Id: Ica1ac4a9a182ce0e73303856329e198d9d525b7b Reviewed-on: https://code.wireshark.org/review/15343 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-10rawshark: Have fvalue_to_string_repr just return allocated string ↵Michael Mann1-15/+8
representation. Simplify use of fvalue_to_string_repr in rawshark by just having it return an allocated string representation of a field value instead of trying to find the right allocated buffer size to pass in. This will also allow fvalue_to_string_repr to be converted to exclusively return allocated strings and not accept a provided buffer. Change-Id: I9996411dca4656d599b30ed415453d0207131824 Reviewed-on: https://code.wireshark.org/review/15342 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-10rawshark: Get "field string values" from existing functionality.Michael Mann1-115/+20
rawshark shouldn't be converting FT_ and BASE_ values into strings on its own, there's a function for that. Change-Id: Ib4ce1651ee130a03644b5de3ab471333444e19a9 Reviewed-on: https://code.wireshark.org/review/15341 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-21Link version code statically againJoão Valverde1-1/+1
This allows keeping the code-sharing with the static linking. This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more external dependencies to wsutil than strictly necessary. A nice side-effect is that libwsutil no longer depends on version.h. Follow up to f95976eefcbeb5d24df383c29d29ef888b503945. Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23 Reviewed-on: https://code.wireshark.org/review/15002 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-04-04Include ws_diag_control.h in config.hJoão Valverde1-1/+0
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317 Reviewed-on: https://code.wireshark.org/review/14749 Petri-Dish: João Valverde <j@v6e.pt> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04Remove synchronous DNS name resolutionJoão Valverde1-2/+2
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-03-15More "FT_BOOLEAN is 64-bit" fixes.Guy Harris1-2/+2
Change-Id: Iaacd492858ca2fb98c4947d587fbbd26fc102a7d Reviewed-on: https://code.wireshark.org/review/14486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-14Make init_progfile_dir() take a function pointer [-Wpedantic]João Valverde1-1/+1
Change-Id: I45f8ea5ee6ccc5a484c60ad6e686aaf30f6b0c98 Reviewed-on: https://code.wireshark.org/review/12557 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-12Remove -Wwrite-strings compiler flagJoão Valverde1-4/+2
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-11Update user guide for development releasePascal Quantin1-1/+1
Change-Id: I9b4c5ab2e98ad6daa618bcda20b53a23467e16e0 Reviewed-on: https://code.wireshark.org/review/11734 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-08Use ws_{read,write,fdopen,close}.Guy Harris1-3/+3
Be more consistent about using the ws_ routines, as we suggest in README.developer. In C++ on UN*X, define ws_close as ::close rather than close, so that it works even in classes with methods or members named "close". Change-Id: Ide2652229e6b6b4624cbddae0e909a4ea1efa591 Reviewed-on: https://code.wireshark.org/review/11637 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-12/+0
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-10-28Catch REPORT_DISSECTOR_BUG() calls in dissector registration routines.Guy Harris1-1/+3
Have epan_init() return a success/failure Boolean indication. Catch exceptions when calling the dissector registration routines and, if we get one, report the error and return a failure indication. If epan_init() fails, quit, but first make sure the reported error is displayed. Change-Id: I0300cbb1f66a5644f857a205235124909d684c50 Reviewed-on: https://code.wireshark.org/review/11340 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-25DNS: move DNS name resolution pref to Name Resolution prefsHadriel Kaplan1-6/+3
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-14Add a "heuristic dissectors" tab to the Enable Protocols dialog.Michael Mann1-0/+3
This allows for a global place to enable/disable all heuristic dissectors. This removes the need for individual dissector preferences, but those will be removed at a later date. The more important part is the epan code to save/restore the enabled state of the heuristic dissector. The GTK dialog was more for quickly testing the feature (there was already some GTK code in place that started the heuristic dialog tab) Change-Id: Ie10687505c27a4456c49d5c4c69a5fc5f6394275 Ping-Bug:11152 Reviewed-on: https://code.wireshark.org/review/9508 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-06Rawshark calls init_process_policies() twiceHadriel Kaplan1-5/+0
Calling it twice won't make it work any better. Change-Id: I30fea0ba2ccf6ebfb6caf6a58333cee9b192e4cb Reviewed-on: https://code.wireshark.org/review/9513 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-06-27Avoid some Visual Studio Code Anaylzer warningsMartin Mathieson1-7/+7
Change-Id: I320386b02bea09658636a9281ee3cbba34a5e4cd Reviewed-on: https://code.wireshark.org/review/9188 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-10[MSVC 2015] Use intptr_t to make MSVC happy.AndersBroman1-1/+1
Change-Id: I1a39495bc2a752070db8c62136b17d9567bc33ab Reviewed-on: https://code.wireshark.org/review/8856 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-21Make FT_{U}INT64 behave more like FT_{U}INT32, add support for ↵JC Wren1-2/+9
FT_{U}INT{40,48,56} Change-Id: I57354c309ecf3a0c8f0c7cff485638027f30bb19 Reviewed-on: https://code.wireshark.org/review/5813 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-20Suppress a bunch of cast-qual warnings.Gerald Combs1-2/+5
Squelch warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] similar to g630f54f. Change strtod to g_ascii_strtod to squelch a checkAPIs error. Change-Id: Ib2d26ef89f08827a5adc07e35eaf876cd7b8d14e Reviewed-on: https://code.wireshark.org/review/7269 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-20Just have init_progfile_dir() take a void pointer.Guy Harris1-1/+1
dladdr() takes a void * as a code pointer; have init_progfile_dir() do so, and do the casting in the calls. We don't care about the signature of the function whose address we're passing, we just want to pass a pointer to *something* in the main program. Change-Id: I9372620a97b0eb53c2bb3c0c41a238b4408f3709 Reviewed-on: https://code.wireshark.org/review/7270 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Clean up ftype-conversion and dfilter error message string handling.Guy Harris1-2/+5
Have dfilter_compile() take an additional gchar ** argument, pointing to a gchar * item that, on error, gets set to point to a g_malloc()ed error string. That removes one bit of global state from the display filter parser, and doesn't impose a fixed limit on the error message strings. Have fvalue_from_string() and fvalue_from_unparsed() take a gchar ** argument, pointer to a gchar * item, rather than an error-reporting function, and set the gchar * item to point to a g_malloc()ed error string on an error. Allow either gchar ** argument to be null; if the argument is null, no error message is allocated or provided. Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c Reviewed-on: https://code.wireshark.org/review/6608 Reviewed-by: Guy Harris <guy@alum.mit.edu>