Commit Graph

82 Commits

Author SHA1 Message Date
Jeff Morriss 9fdc3e961d get_datafile_path() and get_persconffile_path() return malloc'd memory. Note that in the comments.
svn path=/trunk/; revision=24476
2008-02-26 18:58:12 +00:00
Stig Bjørlykke b715bd28d2 Ups, fix a typo from last checkin.
svn path=/trunk/; revision=24259
2008-02-03 15:49:22 +00:00
Stig Bjørlykke 47d744b59d More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
2008-02-03 15:38:20 +00:00
Stig Bjørlykke 45572b611c Do not change profile if directory creation failed, and change to default
profile if existing profile was deleted.

svn path=/trunk/; revision=24208
2008-01-27 14:45:31 +00:00
Stig Bjørlykke 6a31f43f8b Always return a valid profile name from get_profile_name().
svn path=/trunk/; revision=24175
2008-01-24 17:06:22 +00:00
Jeff Morriss fdfaebccd1 Include dirent.h if we have it (to fix glib-1 compile: it needed DIR).
svn path=/trunk/; revision=24100
2008-01-15 19:39:31 +00:00
Stig Bjørlykke a2d1e9005d This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files.

This can be found in the "Configuration Profiles..." menu item from the Edit
menu, or by pressing Shift-Ctrl-A.  It's also possible to start wireshark
and tshark with a named profile by using the "-C ProfileName" option.
A new status pane in the main window will show the current profile.

The configuration files currently stored in the Profiles are:
- Preferences
- Capture Filters
- Display Filters
- Coloring Rules
- Disabled Protocols
- User Accessible Tables

The recent data are by design not added to the profile.

Planned future enhancements:
- make a more convenient function to switch between profiles
- add a "clone profile" button to copy an existing profile
- make the profiles list active and accept return as OK
- save users "Decode as" in the profile
- make new, clone and deletion of profiles more secure
- make some of the recent values available in the profile

This patch also fixes:
- setting default status pane sizes
- a bug setting status pane for packets when not having main lower pane.

svn path=/trunk/; revision=24089
2008-01-14 16:40:23 +00:00
Richard van der Hoff 58b39bde74 Don't build in init_plugin_dir if HAVE_PLUGINS is not defined, which
means that we aren't reliant on PLUGIN_DIR having a sensible value.

svn path=/trunk/; revision=22616
2007-08-24 00:03:02 +00:00
Bill Meier a6dab6d644 (Minor) Use _WIN32 (instead of WIN32) like the rest of Wireshark
svn path=/trunk/; revision=22030
2007-06-03 16:07:07 +00:00
Guy Harris ab5a09f4de No need to call init_plugin_dir() - it gets called, if necessary, by
get_plugin_dir().

Add checks for the success or failure of init_progfile_dir() in dftest.

svn path=/trunk/; revision=21942
2007-05-25 20:03:26 +00:00
Luis Ontanon 11f06217ce Have editcap and capinfos loading the wiretap plugins.
epan/filesystem.c
   have get_plugin_dir() calling init_plugin_dir() if necessary

epan/epan.c and epan/report_err.c
   move the report_failure family into the new report_err.c file, have epan_init() calling the initializer

epan/plugins.h and epan/proto.c
   do not have init_plugins() calling the proto_reg functions instead do it in init_proto()

gtk/main.c and tshark.c
   init_plugin_dir() has become suprefluous

capinfos.c and editcap.c
   load the wiretap plugins

Makefiles
   do what's needed to build withe the above changes.




svn path=/trunk/; revision=21935
2007-05-25 17:22:32 +00:00
Guy Harris a3d3282e64 Have init_progfile_dir() also check whether
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set and, if so and we weren't run
with special privileges, set the running_in_build_directory_flag.  Have
it do the same if it finds ".libs" in the pathname of the program and we
weren't run with special privileges, as that means it was probably run
from the libtool wrapper script and presumably thus isn't an installed
binary.

This means that get_credential_info() has to be called before
init_progfile_dir().

Clean up some indentation.

svn path=/trunk/; revision=21866
2007-05-21 20:31:45 +00:00
Stephen Fisher 46b8669566 Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errors
under gcc to tools/lemon, plugins/mate and epan/


svn path=/trunk/; revision=21204
2007-03-26 06:10:52 +00:00
Guy Harris 2e8fa7557e Include <ctype.h> to define "isspace()".
Clean up indentation.

svn path=/trunk/; revision=21028
2007-03-14 18:22:28 +00:00
Ulf Lamping 7366ae37a0 as requested by "John T. Haller" for PortableApps.com:
add new WS command line option -P to be able to change some of the path settings

this is experimental, please report bugs

svn path=/trunk/; revision=21022
2007-03-14 02:55:54 +00:00
Stephen Fisher a68006f995 Add a description for errno EINVAL (Invalid Argument) to
file_open_error_message().  In this context, the error means
that an invalid filename was specified.


svn path=/trunk/; revision=20958
2007-03-02 21:17:44 +00:00
Graeme Lunt 4ea1d12df8 Update to get_persdatafile_dir() to choose a default directory on the U3 device that Wireshark is being run from.
The U3 Deployment Guide recommends a sub-directory of U3_DEVICE_DOCUMENT_PATH, so the u3util creates a "My Captures" sub-directory to use as the personal data file directory.


svn path=/trunk/; revision=20441
2007-01-15 19:11:29 +00:00
Ulf Lamping e31d777279 fix a warning
svn path=/trunk/; revision=20436
2007-01-15 04:22:10 +00:00
Ulf Lamping d131445196 SHGetFolderPath is not available on MSVC 6 without a Platform SDK, use SHGetSpecialFolderPath instead
svn path=/trunk/; revision=20435
2007-01-15 03:53:20 +00:00
Ulf Lamping 47aaf7d9b7 on my way to fix #301:
add a function get_persdatafile_dir() that will return the users personal default data dir Win32:"My Documents" UNIX:"" (for the current dir)

svn path=/trunk/; revision=20431
2007-01-14 22:25:22 +00:00
Ulf Lamping 2cbce84d41 Win32: MSVC > 6 doesn't work well with Unicode filenames!
fix this, by providing required functions in the new file file_util.c - it's mostly copied from GLib (g_open alike - that take UTF8 as filename format but don't use msvcrt.dll V6 for this as the glib files do) 

"link" to these functions in file_util.h: #define eth_open eth_stdio_open

revert changes (from SVN 20282) throughout the code related to these file functions which were introduced with the first tries of MSVC 2005 ...

Hopefully I've done everything right with the new file_util.c ...

svn path=/trunk/; revision=20402
2007-01-12 03:05:28 +00:00
Ulf Lamping 894f6cd603 from Laurent Rabret:
I posted a patch about 1.5 years ago for the formerly Ethereal to successfully compiled with Visual > 6. I have always successfully used this patched Ethereal/Wireshark compiled with VS 2003 and have just checked when compiled with Visual C++ 2005 Express

svn path=/trunk/; revision=20282
2007-01-03 02:50:22 +00:00
Guy Harris 44c0624bd9 Add a WIRESHARK_RUN_FROM_BUILD_DIRECTORY environment variable on UN*X;
if set, and if the program isn't running with additional privileges,
it'll treat the directory in which the program is found as the data
directory.

If, on Windows, the version-number subdirectory of {data
directory}\plugins doesn't exist (which is assumed to mean that the
program is being run from the build directory), or if, on UN*X,
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set, the plugin directory is the
"plugins" subdirectory of the data directory, and all subdirectories of
that directory are scanned for plugins, as the "plugins" subdirectory of
the build directory contains subdirectories for the plugins; this means
that if we're running from the build directory, we'll find the plugins
we built in the build tree.

When generating the wireshark-filter man page, run tshark with
WIRESHARK_RUN_FROM_BUILD_DIRECTORY set, so it uses the plugins from the
build to generate the list of filters.

svn path=/trunk/; revision=20261
2007-01-02 06:49:40 +00:00
Gerald Combs 30619416b9 Add missing files from last commit. Fix an #include.
svn path=/trunk/; revision=19293
2006-09-22 22:34:54 +00:00
Guy Harris e7135c63bb Clean up indentation, etc.
svn path=/trunk/; revision=19116
2006-09-02 06:39:09 +00:00
Graeme Lunt 14be5e2bcc U3 packaging, utility and Wireshark modifications that allows Wireshark to be run from a U3 USB device.
For more details see packaging/u3/win32/README.txt


svn path=/trunk/; revision=19046
2006-08-26 17:55:21 +00:00
Gerald Combs 8958bab6de Tethereal/tethereal -> TShark/tshark.
svn path=/trunk/; revision=18268
2006-05-31 17:38:42 +00:00
Gerald Combs b15974d094 libethereal -> libwireshark. idl2eth -> idl2wrs. There are a _lot_ of
changes here.  It compiles OK on OS X, but hasn't been tested anywhere else.

svn path=/trunk/; revision=18260
2006-05-31 00:23:01 +00:00
Anders Broman 996d4db495 Ethereal->Wireshark
svn path=/trunk/; revision=18234
2006-05-28 19:49:07 +00:00
Ronnie Sahlberg 6075ec39fb ethereal->wireshark
svn path=/trunk/; revision=18207
2006-05-22 08:21:22 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 635ae7e19a As suggested by Jim Prince, pass the right argument to "getcwd()" - the
buffer argument is a mallocated buffer, so sizeof doesn't return its
size, it returns the size of the pointer to the buffer.  Fixes bug 907.

svn path=/trunk/; revision=18186
2006-05-18 12:01:33 +00:00
Guy Harris 098facb0f7 It's g_strdup_printf(), not g_sprintf_alloc().
Declare "error", and properly terminate a string.

svn path=/trunk/; revision=18054
2006-05-01 08:09:39 +00:00
Guy Harris 0dfbc73cbe Handle the case where we *can't* determine the pathname in which to find
programs, by reporting it with a dialog box that at least attempts to
indicate what the problem is, and by giving up early on running dumpcap.

svn path=/trunk/; revision=18051
2006-05-01 06:51:14 +00:00
Gerald Combs f31a402f6b Include tchar.h only if we're running Windows. Fixup whitespace.
svn path=/trunk/; revision=17537
2006-03-08 22:13:21 +00:00
Gerald Combs 9406c5db24 Use Unicode for all native Win32 calls. Unicode Windows applications
use UTF-16 internally and GTK+ 2.x uses UTF-8, which means we have to
do a lots of conversions.

Add utf_8to16() and utf_16to8 convenience functions to strutil.c.

svn path=/trunk/; revision=17534
2006-03-08 20:55:32 +00:00
Guy Harris 94c71f063d Fix the loop that checks $PATH for the binary to actually step from one
element of the path to the next element.

svn path=/trunk/; revision=17298
2006-02-14 09:08:12 +00:00
Guy Harris b8136fbfa9 Add a routine to attempt to get the absolute pathname of the executable
file, strip off the last component to get the pathname of the directory
containing the executable file, and save it for future use.  On Windows,
you can get that from the OS, but, on UN*X, you have to look at argv[0]
and derive the absolute path from that (argv[0] is not guaranteed to be
an absolute path, or even a path at all).  (In addition, if you're
running from the build directory, you might have to strip off a ".libs/"
added to argv[0] as an artifact of the libtoolizing script.)

Use that in the About dialog, and use it to construct the path of
dumpcap.

Don't put quotes into the path of dumpcap; you don't have to quote
strings with spaces in them when handing them to execvp and, in fact,
you *mustn't* quote them, as the quotes will be treated as part of the
pathname.

svn path=/trunk/; revision=17267
2006-02-12 03:15:29 +00:00
Guy Harris 6382f1d4bb Fix up some comments.
svn path=/trunk/; revision=17214
2006-02-08 03:25:22 +00:00
Guy Harris 4d86160203 Clean up the comments for files_identical(), and fix up the UNIX
implementation to check whether the stat calls succeed and to check not
only that the files have the same inumber but that they also are on the
same file system.

svn path=/trunk/; revision=17213
2006-02-08 02:06:09 +00:00
Luis Ontanon 007796b156 Make file_exists() work on macosx (and other unices)
svn path=/trunk/; revision=17211
2006-02-08 00:06:38 +00:00
Ulf Lamping a9f4ae4f99 fix #648:
Win32 only: reading a pathname from an environment var requires us to read it in as unicode somehow and convert it to utf8. Using _wgetenv should work under all circumstances on NT, using getenv and g_locale_to_utf8 on Windows OT is the best we can do in this case.


svn path=/trunk/; revision=17024
2006-01-12 22:32:29 +00:00
Guy Harris db9fba20b4 Use <wiretap/file_util.h> to include "file_util.h"; otherwise, the
include fails as we don't do -Iwiretap.

If we have it, include <sys/stat.h> in epan/filesystem.c - we need it
for stat() and the macros and structures it uses.

svn path=/trunk/; revision=16410
2005-11-07 02:47:09 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Jörg Mayer 30a8557868 More 'char*' -> 'const char*' changes to fix warnings.
svn path=/trunk/; revision=15015
2005-07-23 11:41:25 +00:00
Ulf Lamping dc223932b8 another try to fix the unix build
svn path=/trunk/; revision=14063
2005-04-12 23:48:47 +00:00
Ulf Lamping 6cacb84377 bugfix for unix builds, remove leftover things from function move
svn path=/trunk/; revision=14062
2005-04-12 23:12:37 +00:00
Ulf Lamping 6e38159c25 add functions file_exists and file_identical to filesystem.c (coming from file.c)
svn path=/trunk/; revision=14057
2005-04-12 21:12:19 +00:00
Guy Harris 6e622fd24e "gtk_entry_get_text()" returns a "const char *" - assign the result to
one.

"get_basename()" doesn't modify its argument, and its callers don't
modify the substring pointed to by the result, so make it take a "const
char *" as an argument and return a "const char *". 

"find_last_pathname_separator()" doesn't modify its argument, so make it
a "const char *" - but some of its callers pass a non-"const" "char *"
and modify the result, so don't make its return value a "const char *".
And, as none of its callers are outside "filesystem.c", make it static.

In "about_folders_page_new()", have separate variables for pathnames
returned as "const char *" (which are cached by the routine that returns
them, so you can't modify them - and can't free them, so get rid of the
commented-out "g_free()" calls for them) and pathnames returned as "char
*" (which are allocated anew for each call, and can be modified, but
have to be freed).

Clean up white space.

svn path=/trunk/; revision=12881
2004-12-31 00:26:36 +00:00