Commit Graph

296 Commits

Author SHA1 Message Date
Ulf Lamping 66acca7018 update usage output and manual pages for both Ethereal and Tethereal to reflect the latest changes in the command line.
clarifications of some command line parameter descriptions in the manual pages

this also fixes #221

svn path=/trunk/; revision=14545
2005-06-04 01:29:14 +00:00
Guy Harris 33db7e6fcb Don't include <pcap.h> twice.
svn path=/trunk/; revision=14357
2005-05-12 03:29:59 +00:00
Ronnie Sahlberg 1a647a2c6a make tethereal compile when plugins are disabled
svn path=/trunk/; revision=14319
2005-05-05 13:48:34 +00:00
Guy Harris 80c1907a36 Rename "register_ethereal_tap()" to "register_tap_listener_cmd_arg()" as
it's used to register a callback for a tap listener invoked if the
specified command line argument is specified to the "-z" flag.

Move it, along with routines to:

	look up a "-z" argument in the table constructed by
	"register_tap_listener_cmd_arg()" and either save the full
	argument to "-z" and the corresponding listener if it's found or
	return a failure indication if it isn't;

	list the available tap listeners;

	call the "init" routines for the tap listeners saved in the
	table above;

and have Ethereal and Tethereal use those routines.

svn path=/trunk/; revision=13993
2005-04-01 09:08:27 +00:00
Guy Harris 910ad32b3b Don't assume only one "-z" argument will be given on the command line;
add information for each tap to a list, and set up all the taps in the
list.

svn path=/trunk/; revision=13991
2005-04-01 05:45:08 +00:00
Guy Harris 46e1907f13 If we have "pcap_freecode()", use it to free the instructions for a BPF
filter after installing the filter.

Set HAVE_PCAP_LIB_VERSION if we're building with WinPcap 3.1; it's not
present in earlier versions, but is present in current 3.1 betas.

Check HAVE_PCAP_LIB_VERSION when building capture-wpcap.c.

svn path=/trunk/; revision=13872
2005-03-23 01:25:01 +00:00
Jörg Mayer 58d8f2f652 - pcap.h needs to be included before capture.h
- As capture.h is empty without libpcap defined, only include it in that
  case and don't protect the file internally against libpcap any more.

svn path=/trunk/; revision=13648
2005-03-07 10:19:33 +00:00
Luis Ontanon 779a8f5d80 If -z was not given as the very last argument the tap listener initialization might have crashed.
Copy the optarg so that when the tap initialization is called it gets the right argument.

svn path=/trunk/; revision=13570
2005-03-01 23:46:05 +00:00
Luis Ontanon 5319cabe88 Make sure that plugin tap listeners get registered before the non-plugin tap listeners
that's because stat trees are registered as tap listeners by either
gtk/stats_tree_stat.c or tap-stats_tree.c


svn path=/trunk/; revision=13545
2005-02-28 00:55:49 +00:00
Guy Harris dd4b0b718b The stats tree stuff should ultimately allow us to have plugin taps, so
add infrastructure for them, and display the plugin type (which could be
both dissector *and* tap) in the list of plugins.

svn path=/trunk/; revision=13543
2005-02-27 22:04:48 +00:00
Luis Ontanon 707c3c52d0 in tethereal
list_link_layer_types was not being initialized causing the "-r" option to fail


svn path=/trunk/; revision=13480
2005-02-23 17:05:32 +00:00
Ulf Lamping 72547c8d02 use the applications name (currently "ethereal" or "tethereal") in capture_opts, instead of hardcoded "ethereal" for both.
svn path=/trunk/; revision=13476
2005-02-23 08:34:12 +00:00
Ulf Lamping d643a55488 move capture_opts related things (init, command line, ...) from capture.c to a new file capture_opts.c and let both ethereal and tethereal use it.
svn path=/trunk/; revision=13474
2005-02-23 01:01:19 +00:00
Luis Ontanon 7dccea9b20 Do not call the tap's initialization as soon as the -z option is read,
postpone it after the preferences callback has being called.

That way mate's fields, which are registered by the preferences callback
can be used as part of the tap's filter.


svn path=/trunk/; revision=13469
2005-02-22 19:17:28 +00:00
Lars Roland f3294ee49a change nmake makefiles in /trunk and /trunk/epan so that
object code for libethereal.dll isn't generated by the
makefile in /trunk.

Having no code in /trunk linked into libethereal.dll
anymore, the definition of the macro _NEED_VAR_IMPORT_
can be moved from various source files in /trunk to /trunk/Makefile.nmake .
So do that, too.

svn path=/trunk/; revision=13389
2005-02-13 00:10:15 +00:00
Guy Harris 01b33c922d Fix up the suppression of packet printing and packet count printing so
that:

	packets are printed iff we're not saving packets to a file and
	"-q" wasn't specified;

	packet counts are printed iff we're capturing (i.e., not reading
	from a file) and "-q" wasn't specified.

svn path=/trunk/; revision=13348
2005-02-07 21:40:53 +00:00
Guy Harris 802a3977bf Make Ethereal and Tethereal compile if we're building without libpcap.
svn path=/trunk/; revision=13346
2005-02-07 20:52:59 +00:00
Guy Harris d01ae28b6f Suppress the packet counts when we're reading from a file.
svn path=/trunk/; revision=13342
2005-02-07 19:42:32 +00:00
Guy Harris da36197902 Tethereal can write to a file in binary even if not built with libpcap.
svn path=/trunk/; revision=13341
2005-02-07 19:33:49 +00:00
Guy Harris 6e58e3984b Clean up indentation.
The default for "capture_options.save_file" is a null pointer, meaning
we're not writing to a save file, we're writing out the dissection as
text.

svn path=/trunk/; revision=13340
2005-02-07 19:11:45 +00:00
Guy Harris 2b7b39bb6f "iface" is now a member of "capture_opts", not "cfile".
svn path=/trunk/; revision=13326
2005-02-06 22:21:51 +00:00
Ulf Lamping 3a63719e38 another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts

also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. 
It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this.

svn path=/trunk/; revision=13320
2005-02-06 21:20:35 +00:00
Guy Harris fa3e5609ab Put "cf_status_t" back.
svn path=/trunk/; revision=13303
2005-02-05 12:50:47 +00:00
Guy Harris 3e07757e58 Make "cf_open()" match the prototype in "file.h".
svn path=/trunk/; revision=13302
2005-02-05 12:08:01 +00:00
Guy Harris 2c89242aac Instead of having a single enumerated type for status return values from
cf_ functions, have separate ones for different classes of routines, and
use gboolean when the return value is just "success" or "failure" - that
way you don't get compiler warnings if a case statement isn't handling a
particular status value if the routine in question won't return it.

svn path=/trunk/; revision=13293
2005-02-04 20:54:12 +00:00
Ulf Lamping 0861927ce3 huge cleanup of capture file API (functions in file.c/file.h).
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions.

Hopefully, I didn't introduced any new bugs, as I had to change a lot of files...

svn path=/trunk/; revision=13289
2005-02-04 18:44:44 +00:00
Ulf Lamping dd71ad695f (some) redesign of capture data structures.
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c
move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it

svn path=/trunk/; revision=13276
2005-02-04 01:29:29 +00:00
Ulf Lamping 9ff19a4c94 move capture_file_fd field from capture_file to capture_opts type, as this is the place where it should be
svn path=/trunk/; revision=13268
2005-02-03 22:48:20 +00:00
Ulf Lamping be0e6a0631 prevent ringbuffer from having to know about capture_file type at all (decoupling dependencies)
svn path=/trunk/; revision=13266
2005-02-03 21:58:33 +00:00
Guy Harris 5485b96a9a Report a friendlier name, if possible, when capturing in Tethereal.
svn path=/trunk/; revision=13062
2005-01-16 03:09:05 +00:00
Guy Harris f1deabed56 Make the tone of the error messages a bit less formal, by using
contractions.  (Safari does, at least when you're trying to open a file
to which you don't have read access.)

svn path=/trunk/; revision=12852
2004-12-29 01:08:20 +00:00
Guy Harris cab22a15bd Move the #ifdef/#endif a bit so that the entire chunk of
live-capture-related-code is inside it.

svn path=/trunk/; revision=12651
2004-12-01 23:55:43 +00:00
Ronnie Sahlberg 5102dbe323 minor fix to tethereal to allow it to compile with --without-pcap
svn path=/trunk/; revision=12650
2004-12-01 23:47:14 +00:00
Guy Harris 196e04bf74 As per Sebastian Felis, don't assume that doubling the size of the line
buffer will necessarily be sufficient to make it big enough to handle
what's being added to the buffer - continue doubling the size until it
is.

Put the code to maintain the line buffer into a routine.

As that buffer is maintained as being large enough to handle what's
being put into it, there's no need to use "snprintf()" to print into it.

svn path=/trunk/; revision=12508
2004-11-11 11:50:26 +00:00
Guy Harris 6aaf948795 If we're not printing packet information, don't print the preamble or
finale for that information, either.

svn path=/trunk/; revision=12352
2004-10-19 22:43:52 +00:00
Jörg Mayer 54e0e363a9 Get rid of warnings about shadowed variables (code was ok)
svn path=/trunk/; revision=12171
2004-10-01 12:31:52 +00:00
Guy Harris 7f5b234c5c Move the column preferences stuff to epan (the rest of the preferences
stuff is already there).

Update Gerald's e-mail address in column.h.

svn path=/trunk/; revision=12131
2004-09-29 02:54:22 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Guy Harris 8e90f07c71 Hoist the code for handling "-G" into a common module.
svn path=/trunk/; revision=11956
2004-09-10 22:47:02 +00:00
Gilbert Ramirez f676f7107b Add a "-G fields2" option which is like "-G fields", but extends the field
records by tw fields: base (for integers), and blurb

Add a "-G values" option which shows value strings and true_false strings for
the fields that have them.

svn path=/trunk/; revision=11954
2004-09-10 15:21:20 +00:00
Guy Harris 10d4e3873a When opening an output file, use "file_snaplen" as the snapshot length,
rather than "pcap_snapshot(ld.pch)" - we've set "file_snaplen" to
"pcap_snapshot(ld.pch)" if we're capturing from a device, but if we're
reading from a pipe, "ld.pch" is null (so we'll crash if we use it), and
we've set "file_snaplen" from the header we've read from a pipe.

svn path=/trunk/; revision=11734
2004-08-13 08:27:58 +00:00
Guy Harris 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
Gilbert Ramirez e8c27ad10c Mention psml as a valid option to -T in the usage statements.
svn path=/trunk/; revision=11607
2004-08-06 03:36:28 +00:00
Guy Harris 07658bc75c Disallow "-f" when not doing a live capture, rather than just ignoring
the specified filter.

Note in the manual that you can't use capture filters when reading a
capture file, and that read filters might require too much CPU when
doing a live capture.

svn path=/trunk/; revision=11594
2004-08-03 02:52:48 +00:00
Guy Harris 5a3ab160c1 Make some generic print routines that take, as an argument, a pointer to
a structure containing a pointer to print operations for that object and
a pointer to the private subclass-dependent data for that object, with
subclasses for text and PostScript, and use those rather than the old
scheme where a print format was passed as an argument - or where (as in
the case of printing summary information in Tethereal) we just printed
as text even if "-T ps" was selected.

Check whether those routines succeed or get an I/O error writing output.

Clean up indentation.

svn path=/trunk/; revision=11514
2004-07-25 08:53:38 +00:00
Guy Harris a6b4a098ff "-T ps" should not imply "-V"; one should be able to get a list of
packet summaries in PostScript.

svn path=/trunk/; revision=11512
2004-07-25 08:32:32 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Gerald Combs 8106dc0862 Convert make-version.pl and the associated cvsversion.h and CVSVERSION
definition to Subversion.  "svn info" prints out the last changed date
of the repository, so we don't have to go hunting through "CVS/Entries"
files anymore.


svn path=/trunk/; revision=11379
2004-07-15 21:09:33 +00:00
Guy Harris 49283faa17 Don't complain about "-T pdml" or "-T psml" being combined with "-x"
only if "-x" was specified.

svn path=/trunk/; revision=11349
2004-07-09 09:21:07 +00:00