Commit Graph

131 Commits

Author SHA1 Message Date
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