Commit Graph

113 Commits

Author SHA1 Message Date
Stig Bjørlykke 3b5c88ea4b wsutil: Back out profile_write_info_file
Change-Id: I89a9aaeeba1689cce04f239dafdc9003492aba16
Reviewed-on: https://code.wireshark.org/review/22346
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-22 14:59:45 +00:00
Stig Bjørlykke 7af770dfa7 wsutil: Return error from profile_write_info_file
Change-Id: I1d91cef01ced6cceaa75d1618ffcb59eae5b8e6f
Reviewed-on: https://code.wireshark.org/review/22325
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-22 02:41:59 +00:00
Stig Bjørlykke 6117ff496b wsutil: Check return from ws_write
Change-Id: I73f65222dc23ebcb484f2598a12f43b284654420
Reviewed-on: https://code.wireshark.org/review/22321
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-21 20:09:52 +00:00
Stig Bjørlykke 6e0bc30a95 wsutil: Ignore return from ws_write
Change-Id: Idad4dd84538e3ccb7b258775704db8b6bd6c301e
Reviewed-on: https://code.wireshark.org/review/22319
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-06-21 20:04:43 +00:00
Anders 48a6487116 [filesystem.c] Add a cast to aviod a warning with VisualStudio 2017.
Change-Id: I95186bd54ae487e112fcb533c62bb8f9b210dc24
Reviewed-on: https://code.wireshark.org/review/22309
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21 16:13:05 +00:00
Stig Bjørlykke 99c3c6d908 wsutil: Free files in reset_default_profile
This plugs a memory leak.

Change-Id: Ic989a89353d10de6f8f07df6a734d2b912facb7e
Reviewed-on: https://code.wireshark.org/review/22305
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21 15:46:22 +00:00
Stig Bjørlykke a14ef98540 Qt: Write a list of profile files at startup
This file will contain all personal config files which will be
fetched from a profile.

Change-Id: I430ca84ccefc17f0e21c8efb93a92602ab8d5661
Reviewed-on: https://code.wireshark.org/review/22303
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-21 15:23:58 +00:00
Stig Bjørlykke 4f1053c546 Qt: Create the user profiles dir at startup
Ensure the user profiles directory is created at startup so that
users can put downloaded profiles without creating the directory.

Change-Id: Ib06bb3055daef8fd9e78d7887ce56f8fe50e48bf
Reviewed-on: https://code.wireshark.org/review/22275
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-20 19:45:03 +00:00
Max Dmitrichenko d1c0f2b95a Fix memory leak in create_persconffile_profile
found by valgrind

Change-Id: I15aef9d78dffac44e36849349dc57b4b36f23de1
Reviewed-on: https://code.wireshark.org/review/21228
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-19 22:27:27 +00:00
Guy Harris 2c44a7f930 Clean up handling of enabled/disabled protocols/heuristic dissectors.
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-04-08 20:40:08 +00:00
Guy Harris 357cfd3b03 A bunch of "{Mac} OS X" -> "macOS" changes.
Avoid anachronisms, however; there was no "macOS 10.0" or even "OS X
10.0", for example.  It was "Mac OS X" until 10.8 (although 10.7 was
sometimes called "OS X" and sometimes called "Mac OS X"), and it was "OS
X" from 10.8 to 10.11.

Change-Id: Ie4a848997dcc6c45c2245c1fb84ec526032375c3
Reviewed-on: https://code.wireshark.org/review/20933
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-05 19:16:22 +00:00
Jakub Zawadzki dfc26accc0 Fix compilation without plugins:
filesystem.c: In function ‘free_progdirs’:
filesystem.c:2209:12: error: ‘plugin_dir’ undeclared (first use in this function)
     g_free(plugin_dir);

Change-Id: Ib52b86d41be79b8ed7e42f5fdfaddcae6b0ca5c8
Reviewed-on: https://code.wireshark.org/review/20270
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-25 13:36:40 +00:00
Guy Harris 0327078837 Only do save_errno = errno and errno = save_errno around g_free();
There is *no* need to do it around an assignment statement.  (We
*probably* don't need to do it around g_free(), but better safe than
sorry - maybe some memory allocator makes system calls to hand regions
of the address space back.)

Change-Id: Ib57540cc36b505aadf4a5e8885b9a744a35b1f75
Reviewed-on: https://code.wireshark.org/review/20236
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-22 01:42:35 +00:00
Gerald Combs 012a179785 Fix a double free.
In create_persconffile_profile, pf_dir_path_copy needs to be allocated
separately since the subsequent call to get_dirname is destructive. Add
back a call to g_strdup. This should hopefully fix a crash in the Win32
buildbot.

Change-Id: I591b5845032c9b8a5324bf6ac60fc43d1e92ac2e
Reviewed-on: https://code.wireshark.org/review/20231
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-21 19:03:43 +00:00
Michael Mann 897c750127 Clean up some memory leaks in wsutil/filesystem.c
The fixes involve functions always returning a string that needs to be
freed by the caller.  That way the static string pointers within the functions
don't end up leaking at program end.

Change-Id: I35a8dc37536c2927d88f33217887f62efafcc8ca
Reviewed-on: https://code.wireshark.org/review/20175
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-02-19 01:27:14 +00:00
Dario Lombardo f792625b1d epan/wsutil: free memory on exit.
Change-Id: I1cf3a4ce3b21b2e10887cbef5576e5e028e55bab
Reviewed-on: https://code.wireshark.org/review/20052
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18 14:11:45 +00:00
Dario Lombardo 6d79055ba6 wsutil: remove leaks from filesystem and plugins code.
Change-Id: Iac2805c0130bd2ba6cdb3c9dd997050274d58d99
Reviewed-on: https://code.wireshark.org/review/20020
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18 13:45:14 +00:00
Stig Bjørlykke c01cdd4e47 Qt: Reset Default profile support
Add support for resetting the Default profile by deleting it in
the Profile Dialog.  All profile files will be deleted and all
other files will be kept.

Change-Id: I795a6db3ee7b2c29e7aba461183e6cc411798b75
Reviewed-on: https://code.wireshark.org/review/20097
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-02-14 18:15:12 +00:00
Peter Wu d5fdbef7f4 cmake,wslua,wsutil: load files from run/ instead of source tree
Fixes Lua on macOS, tested with an out-of-tree build:

    WS_BIN_PATH=$PWD/run ../wireshark/test/test.sh -s wslua

Previously programs that were ran from the build directory would load
data files (radius/, diameter/, init.lua) from the source directory.
Then in the case of Lua, files were loaded from the program directory
($BUILDDIR/run/init.lua on Linux) or source directory
(sSOURCEDIR/epan/wslua/console.lua).

On macOS, this does not work for Lua since files are installed into
$BUILDDIR/run/Wireshark.app/Contents/Resources/share/wireshark/init.lua
instead. Since CMake always copies data files (radius, console.lua,
etc.) into the build directory, make get_datafile_dir() return this
"run" directory instead.

Change-Id: If97d2f5686271caf9ad4d4e4fc58e902dc592a98
Reviewed-on: https://code.wireshark.org/review/19330
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-12-20 13:16:57 +00:00
Dario Lombardo 43000acd74 ui: move filesystem code to wsutil/filesystem.c
This function can be used by code outside ui (eg. extcap).

Ping-Bug: 13218
Change-Id: Ic11f7acebefeaf777692df044ebff9b1bc387aa3
Reviewed-on: https://code.wireshark.org/review/19178
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-09 15:50:04 +00:00
Guy Harris faf70602a8 Update a comment to reflect current reality.
Change-Id: Ied84e0363161ebc42c8cf24e7ade4b1b4e536448
Reviewed-on: https://code.wireshark.org/review/19074
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-05 03:21:59 +00:00
João Valverde a02e90da41 filesystem.c: Don't constify mallocated pointer
Change-Id: I8991682bda256c5e1c09a303b0243e240b276101
Reviewed-on: https://code.wireshark.org/review/16602
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-23 12:44:34 +00:00
Gerald Combs d9fb7f9a5e Handle ENAMETOOLONG.
g_strerror doesn't appear to handle ENAMETOOLONG. Check for it ourselves.

Change-Id: Icd113a81e8d95bb3c84c91bb420a1a6a19bf5d40
Reviewed-on: https://code.wireshark.org/review/16041
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-22 23:53:00 +00:00
Peter Wu dabbaaf418 filesystem: Fix build dir detection when using cmake
Fixes loading of plugins by detecting the build output directory of
cmake. This requires a "CMakeCache.txt" file to be present in the parent
directory (above run/).

Change-Id: I297432cdcd0981646058410f3eadf5f73b5248c8
Reviewed-on: https://code.wireshark.org/review/7453
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-16 04:40:55 +00:00
João Valverde ecb4dc396e Include ws_diag_control.h in config.h
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-04 23:05:31 +00:00
João Valverde 80a80edd5e wsutil: Remove getenv_utf8(), replaced with g_getenv()
Replace getenv() calls in filesystem.c too for consistency.

Change-Id: I31425179290e556e6696953531989d93777adf92
Reviewed-on: https://code.wireshark.org/review/14752
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: João Valverde <j@v6e.pt>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-03 16:30:33 +00:00
Gerald Combs 6ed543dbe6 Remove the last remnants of U3 support.
Change-Id: Ide4c177e67a77c5f9495b3b4c0f817f40e6dde30
Reviewed-on: https://code.wireshark.org/review/14425
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-03-11 19:55:57 +00:00
Guy Harris ccdb8be0e9 Clean up indentation.
Change-Id: Ica6615ef80867e911a1244a8a54411519033b275
Reviewed-on: https://code.wireshark.org/review/13105
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-07 09:41:14 +00:00
Guy Harris 97378a5bad Don't assume a stat() fails only if the target file doesn't exist.
If the error is something other than ENOENT, return that error
indication.

Change-Id: If866cab5f0de0e4fa8b1ed1cead1290feb88a3cb
Reviewed-on: https://code.wireshark.org/review/13091
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-07 03:02:08 +00:00
João Valverde fbf2e3cf8f Make init_progfile_dir() take a function pointer [-Wpedantic]
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-14 23:52:28 +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
Guy Harris 6ada7d5389 Just use g_mkdir_with_parents() to make the .config directory on UN*X.
It will create all the relevant directories (if it can), using
g_mkdir(), which is a wrapper for mkdir() on UN*X - just as ws_mkdir()
is, so we don't need to make our own copy that uses ws_mkdir.

Bug: 11645
Change-Id: I68affc6fabccf58dace75af078d9bfd67a1b47b2
Reviewed-on: https://code.wireshark.org/review/11373
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-28 23:07:07 +00:00
Guy Harris 0f8e32c515 Do the "create parent of config file directory" stuff on UN*X as well.
~ obviously exists, but ~/.config might not, making it impossible to
create ~/.config/wireshark.

Bug: 11645
Change-Id: Ia267b168eb7b1438d4c35a6bb89df9d7bfcbd3f3
Reviewed-on: https://code.wireshark.org/review/11368
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-28 19:46:05 +00:00
Guy Harris b0b53fa593 On UN*X, use XDG_CONFIG_HOME/wireshark for configuration files.
If it doesn't exist, but ~/.wireshark does, continue to use that, for
backwards compatibility.

Derived from change I7fa64d6e8bd43c6a5dec93e30a4f69a747c34256.

Bug: 6353
Change-Id: I937f94b19a371486b7ea2228e51994cc4c72b501
Reviewed-on: https://code.wireshark.org/review/11137
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-19 20:49:10 +00:00
Tobias Stoeckmann a68518f499 terminate readlink result
The readlink function does not guarantee to nul-terminate its result string.
Therefore, it should be done in wsutil/filesystem.c.

Change-Id: Id96533e825a302a1922ce9ac7ee47d5525ac9c39
Reviewed-on: https://code.wireshark.org/review/9597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-11 18:18:35 +00:00
Guy Harris 63a78d45bc Use ws_fstat64() to determine the size of an open file.
fseek() to the end, followed by ftell(), is a bit of an odd way to get
the file size.  Use ws_fstat64() instead.

Check that the file is a regular file, while we're at it.  This means we
don't have to check before opening.

Bug: 11268
Change-Id: I31ee20dd5568d10541375cf97b286abfc1384d1c
Reviewed-on: https://code.wireshark.org/review/9230
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-30 02:34:54 +00:00
Evan Huus 5dcd207cc6 Check _MSC_VER is defined before we use it
Otherwise it breaks a bunch of stuff on Linux machines because of the way gcc's
preprocessor works (buildbot decryption tests, extcap, etc).

Originally added in Ic5360089f96be620fbe99ba4e819e0caa5ca0215

Change-Id: Iad43fa1415aa331ae375771adac0818ea1b99060
Reviewed-on: https://code.wireshark.org/review/9091
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-24 15:34:18 +00:00
AndersBroman 89fbf02ab5 [MSVC 2015] file_exists() fails on MSVC2105 as file_stat.st_ino gets reset
to zero in the function call if the file does not exist. The general code
seems to work with MSVC2015 so use that.

Change-Id: Ic5360089f96be620fbe99ba4e819e0caa5ca0215
Reviewed-on: https://code.wireshark.org/review/9070
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-23 20:12:39 +00:00
Gerald Combs 3d7b728173 Make androiddump loadable on OS X.
Make sure the target location for extcap executables and extcap_dir
match on OS X.

Set the extcap directory to Contents/MacOS/extcap. The Mac Developer
Library documentation doesn't explicitly define "Resources", but
examples include data files and not executables. It does state that
executables shouldn't go into PlugIns.

Make sure we rpathify androiddump.

Change-Id: If36c762e2a1991c26e5c01a870deaf191bcf9f94
Reviewed-on: https://code.wireshark.org/review/8093
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-04-17 18:08:36 +00:00
Gerald Combs cec99abac9 Win32: Restore the versioned plugin installation path.
Revert parts of g2ef72cb and g7710da4 so that the NSIS installer once
again places plugins in $INSTDIR\plugins\$VERSION. This matches the
behavior of Autotools and previous Windows installers, and reduces the
chances of a version mismatch if the user happens to install a custom
plugin.

Leave the development plugin path unversioned. Leave the extcap path
unversioned for now.

Change-Id: I861d4ee12975fba4b642e391871c5e852d92a2fe
Reviewed-on: https://code.wireshark.org/review/7976
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-04-07 23:01:40 +00:00
Pascal Quantin 786a7ea42c Add support for WIRESHARK_EXTCAP_DIR environment variable on Windows
This can be useful when a user cannot modify the Wireshark installation folder (due to UAC restriction for example)
This is already supported on Linux / OSX

Change-Id: Icfcb43908de1fd8cd415cd31a98219eab1c757c8
Reviewed-on: https://code.wireshark.org/review/7809
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-25 05:08:02 +00:00
Pascal Quantin 7710da4d77 Since g2ef72cb, plugins are no more stored in plugins/$VERSION folder
Also update the custom samples to reflect the latest changes done

Change-Id: I2ac865fad1acdef5a5c4d68a155cbdf970c306f5
Reviewed-on: https://code.wireshark.org/review/7805
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>
2015-03-24 20:54:01 +00:00
Guy Harris 9423a13b2d Just have init_progfile_dir() take a void pointer.
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-02-20 00:24:08 +00:00
Gerald Combs 630f54fbbc Fix various warnings in wireshark-qt.cpp.
Squelch warnings due to (char *) casts.

Use "include_directories(SYSTEM..." in CMakeLists.txt so that we
don't get pedantic warnings about things we can't easily fix such
as QList loop optimizations. Not sure if there's an easy way to do
this in Autotools.

Pass get_gui_compiled_info to init_progfile_dir. C++ don't have to
show you any stinkin' ::main.

    warning: ISO C++ forbids taking address of function ‘::main’ [-Wpedantic]

Change-Id: If1c77284ab0d1b4786bce4e926a4109dd9b1ae34
Reviewed-on: https://code.wireshark.org/review/7207
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-18 05:01:00 +00:00
Guy Harris f62353755b We use GLib's directory-reading routines, so we don't need <dire[cn]t.h>.
Change-Id: Id86e5d6d0ab24adb1bfff0688f33a40f2fdaed8d
Reviewed-on: https://code.wireshark.org/review/7108
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-02-14 07:23:20 +00:00
Guy Harris e304f6d9f8 Get rid of unnecessary includes of ctype.h.
Change-Id: Ic23203f13fd6627b664e8ed1438d328c46328b9f
Reviewed-on: https://code.wireshark.org/review/4790
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-17 21:22:58 +00:00
Bill Meier 07698d536b Adjust some whitespace to match editor modelines.
Change-Id: Ia22cac3ebd7a454c156f98d967e6fd61f708a2b3
Reviewed-on: https://code.wireshark.org/review/4489
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 02:55:49 +00:00
Roland Knall bed29af46d Extcap Capture Interface
Extcap is a plugin interface, which allows for the usage
 of external capture interfaces via pipes using a predefined
 configuration language which results in a graphical gui.

 This implementation seeks for a generic implementation,
 which results in a seamless integration with the current
 system, and does add all external interfaces as simple
 interfaces.

 Windows Note: Due to limitations with GTK and Windows,
 a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe
 is needed, which is part of any GTK windows installation.

 The default installation directory from the build is an extcap
 subdirectory underneath the run directory. The folder used by
 extcap may be viewed in the folders tab of the about dialog.

 The default installation directory for extcap plugins with
 a pre-build or installer version of wireshark is the extcap
 subdirectory underneath the main wireshark directory.

 For more information see:

  http://youtu.be/Nn84T506SwU
  bug #9009

 Also take a look in doc/extcap_example.py for a Python-example
 and in extcap.pod for the arguments grammer.

 Todo:
   - Integrate with Qt - currently no GUI is generated, but
     the interfaces are still usable

Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f
Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net>
Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net>
Signed-off-by: Roland Knall <rknall@gmail.com>
Reviewed-on: https://code.wireshark.org/review/359
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-21 03:34:02 +00:00
Jeff Morriss edb7a91105 Make the nameres test suite work out of tree by looking for the global hosts
file in the build directory (rather than the source directory).

Change-Id: I365e573ee84e9a41aa76f4aa9a4a6efaf42fb60e
Reviewed-on: https://code.wireshark.org/review/3334
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-02 01:00:08 +00:00
Jeff Morriss f113306e0e More Python-bindings removal.
Change-Id: I4d82175781e65c73179f4c8e737a7900cb050bce
Reviewed-on: https://code.wireshark.org/review/2283
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-16 23:14:05 +00:00
Balint Reczey 7bf49b31ac Set PLUGIN_INSTALL_DIR properly for wireshark.pc
Change-Id: I64c04095ce780ce2cc44a54a68695506d27e5747
Reviewed-on: https://code.wireshark.org/review/1861
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-30 12:48:08 +00:00
Alexis La Goutte 0f51f78608 The 1.11.x installer puts the global plugins in the wrong place [Mac OS X]
Issue found by rols

Fix comment and use the correct plugin_dir path (missing wireshark folder)

Change-Id: I298bc5e9872d8c20c5baeaaf056262b9668f15bf
Closed-bug: 9854
Reviewed-on: https://code.wireshark.org/review/745
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 18:42:31 +00:00
Alexis La Goutte eb2fb39ff7 The 1.11.x installer puts the global plugins in the wrong place [Mac OS X]
Issue found by rols

The installer puts the normal included plugins (e.g. mate, wimax) in
/Applications/Wireshark.app/Contents/Frameworks/wireshark/plugins,
however the global plugins directory is set to
/Applications/Wireshark.app/Contents/Resources/lib/wireshark/plugins
(as it was in previous versions) so no plugins load at startup.
In order to make them load you have to create this directory and
copy the plugins there, or put them in your personal directory.

From remark of Gerald, use recommandation of Bundle Programming Guide (use Contents/PlugIns for plugin)

https://developer.apple.com/library/mac/documentation/corefoundation/conceptual/cfbundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW19

Change-Id: Ib1ae7da48a8fa94f7037912cd44c05532a238b71
Closed-bug: 9854
Reviewed-on: https://code.wireshark.org/review/602
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 11:19:37 +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
Anders Broman 05f7044bc7 Make internal functions static
svn path=/trunk/; revision=54686
2014-01-10 07:01:15 +00:00
Michael Mann ea278d3bf8 Remove a few (now unused) variables.
svn path=/trunk/; revision=53442
2013-11-20 01:44:06 +00:00
Guy Harris 30620ff1be Fix missing semicolon.
svn path=/trunk/; revision=53437
2013-11-19 20:06:47 +00:00
Guy Harris 06098fce7b Add routines to set the personal file directory paths (personal
configuration file directory and directory in which to save captures),
have the routine to parse -P options use them, and move that routine to
libui.

Have that routine just return a gboolean.

svn path=/trunk/; revision=53435
2013-11-19 19:45:38 +00:00
Guy Harris 67d4aaaa10 Get rid of unused trivial wrapper routine.
svn path=/trunk/; revision=53403
2013-11-18 00:51:22 +00:00
Guy Harris ed80b06a78 strncat() bad, g_strlcat() good.
svn path=/trunk/; revision=53381
2013-11-17 08:49:51 +00:00
Guy Harris d0cd9624d9 Clean up indentation.
svn path=/trunk/; revision=53380
2013-11-17 04:43:28 +00:00
Guy Harris eee9b9ddd3 Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].
svn path=/trunk/; revision=53379
2013-11-17 04:39:44 +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