Commit Graph

72 Commits

Author SHA1 Message Date
Guy Harris 07263e1a17 Free up the err_info string returned by wtap_read().
svn path=/trunk/; revision=25399
2008-05-30 02:37:36 +00:00
Jeff Morriss a5cee04fad Move the file utility functions from wiretap to libwsutil so that
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.

While doing that, rename the eth_* functions to ws_*.

svn path=/trunk/; revision=25354
2008-05-22 15:46:27 +00:00
Stig Bjørlykke 38f233cd99 Removed an unused break.
svn path=/trunk/; revision=25247
2008-05-06 15:12:45 +00:00
Guy Harris 7a0981e513 Get rid of extra blank lines at the end of the file.
svn path=/trunk/; revision=25202
2008-04-30 07:59:26 +00:00
Guy Harris a12bdc612a Use report_failure() to report failures in capture_sync.c; that will do
the right thing in Wireshark and TShark, as both of them call
epan_init() to set the appropriate "report an error" function.

That obviates the need to have TShark have its own private version of
simple_dialog().

Have cmdarg_err() just call failure_message() instead of duplicating the
code in failure_message().

svn path=/trunk/; revision=25201
2008-04-30 07:58:57 +00:00
Luis Ontanon 906d2f3cbb http://www.wireshark.org/lists/wireshark-dev/200803/msg00308.html
proto.[hc]
    define new APIs to allow delayed registration of protocol fields,
	so that dissectors with "flexible" fields  like xml, radius, diameter,
	snmp do not have to load their files at startup but can do so as late as possible.

gtk/dfilter_expr_dlg.c :
	have the expression dialog registering all prefixes so that all fileds appear in the dialog

tshark.c
	register all prefixes when called with -G

epan/radius_dict.l
epan/dissectors/packet-radius.c
epan/dissectors/packet-radius.h
	refactor registration to delay dictionary loading as long as possible



svn path=/trunk/; revision=24762
2008-04-03 22:13:52 +00:00
Sake Blok f17067c174 Make tshark and rawshark behave similar to wireshark when "frame.time_delta_displayed" is
used within a display filter.

(the usefullness of "frame.time_delta_displayed" in a display filter is very limited
 since it bites it's own tail. Still, wireshark and tshark should at least show the
 same behaviour)


svn path=/trunk/; revision=24708
2008-03-21 06:11:45 +00:00
Stig Bjørlykke 3c3c2224f9 Allow tshark to print custom columns.
svn path=/trunk/; revision=24678
2008-03-17 23:30:37 +00:00
Stephen Fisher 56226b49b8 Custom column updates:
- Change apply / prepare / ... as filter to use the field's value, which
   is now stored in fdata as well as cinfo.  Now we don't have to reprocess
   the entire packet list when using these features.  This also prevents
   the use of these features from overwriting custom column information.
   (custom columns can now be used in apply / prepare ... as filter)
 - Break col_expr and col_expr_val out into a struct that is included not only
   in cinfo, but now also fdata.
 - Have col_custom_set_fstr() quote FT_STRING & FT_STRINGZ when storing the
   col_expr_val value (for filter creation).


svn path=/trunk/; revision=24511
2008-03-01 05:16:45 +00:00
Sake Blok b38b10b516 Make -c work properly in tshark when a read filter is used.
svn path=/trunk/; revision=24335
2008-02-15 13:02:43 +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
Sake Blok c8276a5c91 From Balint Reczey (bug 2233):
The attached patch makes the Statistics -> RTP -> Show All Streams feature of
wireshark accessible via tshark.

I found it helpful in dealing with tons of RTP captures.


svn path=/trunk/; revision=24252
2008-02-03 10:31:55 +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
Stig Bjørlykke 8b4e80384a Fixed a few "statement not reached" warnings and a "assignment type mismatch" warning.
svn path=/trunk/; revision=24085
2008-01-14 09:39:55 +00:00
Jörg Mayer 0c797861ba Warning fixes: function declaration isn’t a prototype
svn path=/trunk/; revision=23862
2007-12-14 15:14:40 +00:00
Guy Harris 33c1bf50bf If we only captured 1 packet, print "1 packet", not "1 packets".
svn path=/trunk/; revision=23543
2007-11-22 01:51:51 +00:00
Stephen Fisher 849e628334 Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.


svn path=/trunk/; revision=23503
2007-11-19 21:27:01 +00:00
Guy Harris a421b8f96f "sa_mask" in a "struct sigaction" is a sigset_t, which is not
necessarily an integral data type.  Use sigemptyset() to clear it.

svn path=/trunk/; revision=23257
2007-10-24 04:13:30 +00:00
Guy Harris 2ef0350a47 Use sigaction(), not signal(), so we know what its semantics are (and so
that we can find out what the signal action for SIGHUP is without
changing it).

That renders report_counts() safe to use at the end of a capture; do so.

Clean up indentation.

svn path=/trunk/; revision=23256
2007-10-24 03:33:35 +00:00
Bill Meier adce7d882d Add 'C' as a valid -N option in error message.
svn path=/trunk/; revision=23040
2007-10-01 00:22:39 +00:00
Guy Harris 53e74d7931 Get rid of a forward declaration of a routine that no longer exists.
svn path=/trunk/; revision=23030
2007-09-29 02:27:04 +00:00
Guy Harris 81db68f38f Clean up indentation a bit.
Count packets even if we're not dissecting them.

svn path=/trunk/; revision=23026
2007-09-29 02:05:09 +00:00
Jeff Morriss e55168c53d Specify that -l causes tshark to flush the *standard* output (from bug 1875). The man page already states this
svn path=/trunk/; revision=23014
2007-09-28 16:34:59 +00:00
Gerald Combs 69ddd8a773 Load wpcap.dll, since we still use it for some things. This should hopefully
fix Buildbot.

svn path=/trunk/; revision=23003
2007-09-27 23:49:05 +00:00
Jeff Morriss f563945bf8 (Try to) get tshark capturing working on *NIX (it works for me anyway):
We can simply block waiting for input from the child process because we are
in a CLI that does not need to worry about updating a GUI while we're waiting
for packets and so forth.

Before I realized that I wrote a working (for me) method using select() that
I've left in for now (#ifdef'd out).

svn path=/trunk/; revision=22999
2007-09-27 15:58:54 +00:00
Ulf Lamping c703e7e18c the Ubuntu / OS X buildbots don't seem to like G_STATIC_MUTEX_INIT (for whatever reason), try to use g_static_mutex_init() instead
svn path=/trunk/; revision=22977
2007-09-26 00:44:47 +00:00
Ulf Lamping a0adcc7e2c solve some more of the unix specific buildbot problems
svn path=/trunk/; revision=22975
2007-09-26 00:03:30 +00:00
Ulf Lamping 9194ddf399 add a dummy function, so unix/linux version should at least compile
svn path=/trunk/; revision=22974
2007-09-25 23:23:56 +00:00
Ulf Lamping 879d656537 as "advertised" some days ago:
rewrite the tshark capture code almost completely, to use dumpcap instead of it's own pcap functionality.

This works on Win32 and should work on unix/linux (but I'm not sure here). Some stuff needs to be cleaned up, some more may need to be rewritten to specifically work with unix/win32. Futher work needs to be done at:

1. read filters (simply document current behaviour?)
2. event loop polling
3. privileges
4. code cleanup (e.g. in capture_loop.c)

Be prepared that tshark might not work as before / expected at least in the next days!

svn path=/trunk/; revision=22969
2007-09-25 21:55:06 +00:00
Gerald Combs d2d4fcd903 Add routines under Windows to check if npf.sys is running, and to
fetch the major OS version.  If we're running Windows >= 6 (Vista)
_and_ npf.sys isn't running, warn the user in Wireshark and TShark.
Add a recent prefs item to disable the warning in Wireshark.

svn path=/trunk/; revision=22877
2007-09-15 00:18:17 +00:00
Gerald Combs 92802883a6 Change the "--enable-setuid-install" option to install dumpcap and TShark
setuid instead of Wireshark.  Remove the "DANGEROUS" notices, but leave it
disabled by default.  Whine if the user runs Wireshark or TShark as root.
Add a preference to disable the whining.  Add a "setuid-root" script that
can be used to switch dumpcap and TShark's setuid-ness on and off for
development and testing.  Update the release notes and README.packaging.

svn path=/trunk/; revision=22733
2007-08-30 00:24:40 +00:00
Jeff Morriss 2f77efce7d Fix bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1757 :
Try to call get_interface_descriptive_name() as little as possible (storing
the result in capture_opts) to avoid a performance hit during live capture
(especially if you have lots of interfaces) and to avoid leaking memory.

One issue with this is that capture_opts.c cannot (without adding significant
dependencies) set the iface_descr so readers of that field (only gtk/main.c
and tshark.c) use a macro to (set if not already set and) get the value of
that field.

svn path=/trunk/; revision=22587
2007-08-22 16:30:16 +00:00
Luis Ontanon d8e818e9da Make sure that wiretap plugins are loaded before dissectors are (if a new encap type is registered the plugin probably needs it before reg_handoff)
svn path=/trunk/; revision=22461
2007-08-07 20:07:43 +00:00
Gerald Combs c02e0c7b4a Remove the "-I" flag from dumpcap, and add a "-M" flag used to specify
that "-D" and "-L" should produce machine-readable output.  Use this to
move an indirect get_pcap_linktype() call from the GUI to dumpcap.

svn path=/trunk/; revision=22367
2007-07-20 21:43:07 +00:00
Gerald Combs e9f1a0b692 One more step in privilege separation.
Add a capture_interface_list(), which works similar to
get_interface_list() except that it forks dumpcap instead of calling
the pcap routines directly.  Use it in the GUI.

Add a "-I" flag to dumpcap, which prints out verbose interface
information.

Tested under Windows and Linux.

svn path=/trunk/; revision=22071
2007-06-11 03:58:58 +00:00
Guy Harris 4e008159c8 The libpcap callback "user" argument *should* have been a "void *", as
it's a pointer to an arbitrary object, assumed to be correctly aligned,
not a pointer to a not-necessarily-properly-aligned array of bytes. 
Cast it, so we won't get alignment warnings.

svn path=/trunk/; revision=21940
2007-05-25 19:31:13 +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
Jaap Keuter 7ecc588029 Fix for bug 1614:
Output preamble and finale on live capture.

svn path=/trunk/; revision=21930
2007-05-25 06:46:47 +00:00
Luis Ontanon 869732d121 Prepare wireshark and tshark for wiretap plugins
svn path=/trunk/; revision=21928
2007-05-24 22:26:51 +00:00
Stephen Fisher 0fc9e207d2 From Sake Blok:
Fix for bug #1056


svn path=/trunk/; revision=21867
2007-05-21 20:41:05 +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
Graeme Lunt cf56e76be9 Updated splash screen for Wireshark that shows the initialisation progress.
The splash screen shows a progress bar and a percentage complete - like the progress dialog.
As dissectors are initialised and handed off the name is shown. However, the names of plugin dissectors are not shown.
The update to the make-dissector-reg shell script has been tested, though I think generally the python version is used.


svn path=/trunk/; revision=21716
2007-05-07 17:55:42 +00:00
Guy Harris 1bc049906a Add some GCC warnings to the standard set, and add some others to the
--enable-extra-gcc-checks set.

If we turn on -pedantic, try turning on -Wno-long-long as well, so that
it's not *so* pedantic that it rejects the 64-bit integral data types
that we explicitly require.

Constify a bunch of stuff, and make some other changes, to get rid of
warnings.

Clean up some indentation.

svn path=/trunk/; revision=21526
2007-04-23 10:59:26 +00:00
Stephen Fisher 6625e7503f Fix warnings on Linux/gcc 4.1.1
svn path=/trunk/; revision=21330
2007-04-03 21:17:13 +00:00
Ronnie Sahlberg 910299acb1 The signature for load_cap_file changed in 21211
Update also the code path for when not compiling with pcap  so that code path also
uses the new signature.


svn path=/trunk/; revision=21219
2007-03-26 23:16:53 +00:00
Stephen Fisher 509883e3e9 From Doug Pratley:
The purpose of the patch is to provide a new output format (so it is
independent of -V): single line record per-packet with the fields chosen by the
user, with configuration options to control separator, quoting and whether a
header line is printed. It also extends some existing options behaviour (-c and
-a:filesize) so that they affect reading a file as well as writing one, so that
only the first <n> packets or bytes are read).


svn path=/trunk/; revision=21211
2007-03-26 20:17:05 +00:00
Stephen Fisher 6d8d2854c8 From Sake Blok:
Fix for bug #491: Unexpected frame.time_delta behavior

This patch ... fixes bug 491. It does this by changing the
behaviour of the frame.time_delta field so it reflects the delta
time between captured packets (tshark already did this).  To keep
the delta time between displayed packets, the field 
frame.time_delta_displayed is created.


svn path=/trunk/; revision=21154
2007-03-23 18:08:17 +00:00
Stephen Fisher 793e70956e Fix problem where specifying -b duration:xx on tshark wasn't working by
testing for the "duration specified" variable along with the "maximum
file size" variable.
 

svn path=/trunk/; revision=20950
2007-02-28 22:45:18 +00:00
Jeff Morriss 0787b688cc Squelch a few unused parameter warnings.
svn path=/trunk/; revision=20863
2007-02-19 15:30:06 +00:00
Jeff Morriss 0c17bfd3a8 From Eric Hall to fix bug 1289:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1289

Rename 'svnversion' to 'wireshark_svnversion' to resolve a symbol conflict with
GTK 2.10.6 (hmm, shouldn't GTK not be exporting that symbol or at least naming
it so as to prevent such collisions? Well, so should we, so...)

From Andreas Fink: change #ifdef for size_t in airdcap_interop.h to fix
compile on MacOS X.


svn path=/trunk/; revision=20726
2007-02-06 02:27:59 +00:00