Commit Graph

225 Commits

Author SHA1 Message Date
Guy Harris 7502ac216a There's no need to keep a "FILE *" for the file being printed to in a
"capture_file" structure.  Keep it locally, instead.

Check for errors when printing packets.

Report failure to open a print destination and failure to write to a
print destination differently.

Don't have the "print preamble" and "print final" routines return
success/failure indications - revert to the old scheme where they
didn't, and have the callers use "ferror()" to check for errors.

Report write errors when printing dissections in Tethereal.

Report print errors as errors, not warnings.

svn path=/trunk/; revision=9828
2004-01-25 00:58:13 +00:00
Guy Harris 46848f0a9e Add a new "file_open_error_message()" routine in "epan/filesystem.c", to
translate UNIX errno values to a somewhat friendly message format
string.

Rename "file_open_error_message()" in "file.c" to
"cf_open_error_message()", make "cf_open_error_message()" use the new
"file_open_error_message()" for UNIX errno values, have "do_capture()"
in "capture.c" use "file_open_error_message()" to report errors from
"open()", and make "cf_open_error_message()" static as nothing outside
"file.c" uses it.

Do similar stuff in "tethereal.c".

svn path=/trunk/; revision=9821
2004-01-24 01:44:29 +00:00
Jörg Mayer da5f6f9472 The current year is 2004
svn path=/trunk/; revision=9731
2004-01-19 18:21:18 +00:00
Ulf Lamping 0353c5823f move timestamp format options from "View->Options" dialog into
menuitems under "View->Time Display Format".
renamed timestamp enum items e.g. from ABSOLUTE to TS_ABSOLUTE,
to prevent conflicting definitions with MSVC

svn path=/trunk/; revision=9729
2004-01-19 03:46:43 +00:00
Guy Harris 6033a79387 Update the Win32 information given when we fail to open a capture device
to note that the 3.0 and later versions of WinPcap don't support PPP/WAN
captures even on Windows OT.

svn path=/trunk/; revision=9709
2004-01-18 04:13:44 +00:00
Jörg Mayer 82cf1b015d Output the result of -h to stdout, not stderr
svn path=/trunk/; revision=9702
2004-01-18 02:12:59 +00:00
Olivier Biot 8db6fb47cd Nice rendering of the CVS version as "(cvs 200401181200003000)".
The make-version.pl script only defines CVSVERSION if this was a build
from CVS.

svn path=/trunk/; revision=9701
2004-01-18 01:41:14 +00:00
Jörg Mayer 0ac74ed036 In case of CVS sources, add the date of the last change to the version
number.

2do: Add support to Makefile.nmake
     Enforce the generation of cvsversion.h on each run of make

svn path=/trunk/; revision=9679
2004-01-16 20:04:21 +00:00
Guy Harris b97626862e Rename DISSECTOR_HELPER_{SRC,OBJECTS} to
DISSECTOR_SUPPORT_{SRC,OBJECTS}.

Add some additional files, required by dissectors, to those lists.

Extract the stuff to get version information strings for libraries and
the OS, which is *not* needed by dissectors, from "util.c", which
contains routines that *are* needed by dissectors, and put it into a
separate file.

Make "dftest" link only with the dissector support stuff, not with all
of the Ethereal common files.

svn path=/trunk/; revision=9645
2004-01-11 22:17:43 +00:00
Guy Harris 84dcd53b03 We don't need to keep the progress bar quantum or next step in the
capture_file structure - just make it local to the routine scanning
through the packets.

svn path=/trunk/; revision=9616
2004-01-09 21:38:21 +00:00
Ulf Lamping ba776f0e0f use the same packet range things for "Print" dialog, as already implemented
in the "Save As" dialog and some other minor changes

svn path=/trunk/; revision=9612
2004-01-09 19:02:18 +00:00
Ulf Lamping 0d9679de8d removed some MSVC warnings (level 3)
svn path=/trunk/; revision=9561
2004-01-05 19:31:44 +00:00
Richard Sharpe fa9874ef73 Apply the patches from Tadaaki Nagao for a global version of disabled
protocols ...

svn path=/trunk/; revision=9538
2004-01-03 18:40:08 +00:00
Guy Harris 7725f5e92d "pcap_compile_nopcap()" has a different signature in recent NetBSD
libpcap than in tcpdump.org libpcap; it's been deprecated for that
reason.  "pcap_open_dead()" has been in libpcap since 0.6, so only for
0.5[.x] will you have "pcap_compile_nopcap()" but not "pcap_open_dead()"
- for now, we use "pcap_open_dead()" rather than
"pcap_compile_nopcap()", and don't do the check for capture filters in
systems with libpcaps that lack "pcap_open_dead()".

svn path=/trunk/; revision=9341
2003-12-18 02:46:45 +00:00
Guy Harris 4e67fd6bf6 Set "print_args" regardless of whether we're printing the packet detail
or not - it's used if we're printing the hex data.

svn path=/trunk/; revision=9324
2003-12-17 21:11:25 +00:00
Guy Harris 0e3e6e534e Fix a typo.
svn path=/trunk/; revision=9240
2003-12-11 01:13:32 +00:00
Ulf Lamping 892700e893 print system enhanced, more print ranges and expanded states
svn path=/trunk/; revision=9222
2003-12-09 22:27:28 +00:00
Gilbert Ramirez c7cee4331f -Tpdml and -Tps force -V. Thus, -V is no longer required when using -Tpdml.
Eventually, -Tps will not force -V, and will print summaries when -V is
not selected. However, work still has to be done there.

svn path=/trunk/; revision=9218
2003-12-09 05:56:31 +00:00
Gilbert Ramirez 058ef64db8 Add the ability to print packet dissections in PDML (an XML-based format)
to tethereal. It could be added to Ethereal, but the GUI changes to
allow the user to select PDML as a print format have not been added.

Provide a python module (EtherealXML.py) to help parse PDML.

Provide a sample app (msnchat) which uses tethereal and EtherealXML.py
to reconstruct MSN Chat sessions from packet capture files. It produces
a nice HTML report of the chat sessions.

Document tethereal's PDML and EtherealXML.py usage in doc/README.xml-output

Update tethereal's manpage to reflect the new [-T pdml|ps|text] option

svn path=/trunk/; revision=9180
2003-12-06 06:09:13 +00:00
Guy Harris 0c84e1c329 From Didier Gautheron: for each column format type, save the first and
last columns, if any, with that format, and use that to speed up
processing of columns with a particular format and checking whether
we're displaying a column with a particular format.

svn path=/trunk/; revision=9147
2003-12-02 23:14:32 +00:00
Guy Harris 5e33fbf97b From Michael Lum: fix the usage message to say "-z", not "-Z".
svn path=/trunk/; revision=9104
2003-11-27 22:04:02 +00:00
Guy Harris 219b6cefa2 Based on a patch from Brian Fundakowski Feldman, add support for setting
link-layer type when capturing, using the "pcap_set_datalink()" and
related APIs.

svn path=/trunk/; revision=8848
2003-11-01 02:30:18 +00:00
Guy Harris b350eb28d3 On UNIX, give up set-UID and set-GID privileges before opening capture
files and immediately after opening capture devices, so we run without
privileges as much as possible.

svn path=/trunk/; revision=8837
2003-10-30 19:56:47 +00:00
Guy Harris a3d8b3481f Not all versions of libpcap have "pcap_compile_nopcap()"; use it only if
we have it.

Not all versions of libpcap have DLT_LINUX_SLL, either; use DLT_EN10MB
instead.

svn path=/trunk/; revision=8670
2003-10-10 21:13:21 +00:00
Jörg Mayer 2699b77d84 Part two of different-filter-syntax-hackaround: Warn in case of capture
filter usage where display filter syntax is required.

svn path=/trunk/; revision=8669
2003-10-10 13:33:49 +00:00
Jörg Mayer 4466a80cb3 In case of a parse error in the capture syntax, check whether it is
valid display filter syntax. In case it is, warn about a possbile
confusion of the two filter types.

svn path=/trunk/; revision=8652
2003-10-09 22:29:52 +00:00
Guy Harris 14a047afe9 From Matthijs Melchior: check whether the ring buffer timeout has
expired *before* writing a packet, rather than *after* writing a packet,
so that if you get no packets for a sufficiently long period that the
timeout expires before you get a new packet, the new packet is in the
beginning of a new file (as you might get more packets right after that,
and want them to be in the new file, rather than have the first packet
at the end of one file and the rest of the packets in another file).

svn path=/trunk/; revision=8536
2003-09-25 00:08:58 +00:00
Guy Harris 6aed321bb5 From Lars Roland: initialize the flags.ref_time field of a frame_data
structure.

svn path=/trunk/; revision=8496
2003-09-19 04:52:16 +00:00
Guy Harris 14509164fc Rename various capture file routines to have names starting with "cf_".
svn path=/trunk/; revision=8479
2003-09-15 22:48:42 +00:00
Guy Harris 3e1a532413 When saving packets, we have a "Save only marked packets" option; label
the option to print only marked packets similarly, rather than as
"Suppress unmarked packets" (for consistency, and because the latter
isn't unlike a double negative).

svn path=/trunk/; revision=8451
2003-09-10 22:23:58 +00:00
Guy Harris 27ea7816ee Have "get_interface_list()" return a list of "if_info_t" structures
containing a pointer to an interface name and possibly a pointer to an
interface description (although that pointer might be null if no
description is available), rather than having the Windows version glue
together the name and description into a single string.

Supply for the Linux "any" device the same description that libpcap's
"pcap_findalldevs()" returns.

svn path=/trunk/; revision=8440
2003-09-10 05:35:26 +00:00
Guy Harris f6c0519c0a Support string dissector tables in the Tethereal "decode as" stuff.
Make the Ethereal "decode as" stuff not blow up with string dissector
tables.

Selectors for uint dissector tables are unsigned, not signed.

svn path=/trunk/; revision=8408
2003-09-07 00:47:57 +00:00
Guy Harris 01bf043654 From Graham Bloice, with changes from me: list the interface index in
"-D" output, and support interface indices as arguments to "-i",
tcpdump-style.

svn path=/trunk/; revision=8402
2003-09-06 02:22:24 +00:00
Ronnie Sahlberg b9ce30cd35 And for Cal,
Ethereal presents   a column to display culmulative bytes into the capture.

A new column type is added : Culmulative Bytes.
While PacketLength column type specifies the number of bytes in the current packet,
Culmulative Bytes specifies the culmulative number of bytes from the start of the capture.

svn path=/trunk/; revision=8359
2003-09-03 10:49:03 +00:00
Guy Harris ddf6a8acf2 From Michael Lum: add the ability to have a preferences file containing
a list of disabled protocols, and to save that list from the Edit >
Protocols dialog box.

Add checks for read errors in "read_prefs()".

Clean up white space.

svn path=/trunk/; revision=8144
2003-08-07 00:41:28 +00:00
Gilbert Ramirez c91b8e713f Fix signed/unsigned comparison warnings.
svn path=/trunk/; revision=8084
2003-07-25 04:11:51 +00:00
Guy Harris 4cdfa9c59e From Lionel Ains:
don't assume that a dissector handle has a protocol associated
	with it (there's none for the "OSI network layer" dissector, for
	example, as that dissector hands off to one of several protocols
	based on the NLPID);

	rename a few functions to have names that better explain what
	they do;

	have separate functions to show all the layer types (dissector
	tables) and to show all the protocols supported for a layer
	type, and have both of them take, as an argument, the standard
	I/O stream to which they should write;

	improve the parser for the "-d" option to give more information
	on errors;

	fix up some comments.

svn path=/trunk/; revision=7949
2003-06-30 00:58:18 +00:00
Laurent Deniel 0afce7ca81 Ringbuffer rework.
Almost completely rewritten in order to:

- be able to use a unlimited number of ringbuffer files

  0 specified with -b argument or in the GUI, means that the number of file
  is unlimited.

  else the maximum number of ring buffer files is arbitrarily set to 1024.

- close the current file and open (truncating it) the next file at switch

- set the final file name once open (or reopen)

- avoid the deletion of files that could not be truncated (can't arise now)
  and do not erase empty files

The idea behind that is to remove the limitation of the maximum # of
ringbuffer files being less than the maximum # of open fd per process
and to be able to reduce the amount of virtual memory usage (having only
one file open at most) or the amount of file system usage (by truncating
the files at switch and not the capture stop, and by closing them which
makes possible their move or deletion after a switch).

svn path=/trunk/; revision=7912
2003-06-22 16:09:04 +00:00
Guy Harris 60f7a4d75d Make it compile without libpcap.
svn path=/trunk/; revision=7870
2003-06-13 03:44:36 +00:00
Guy Harris f2233623ea From Lionel Ains: "-d" flag for decode-as support in Tethereal.
Add a new routine to iterate through all dissector tables, calling a
routine for each table, to support having the "-d" code list all
dissector tables.

Get rid of "dissector_handle_get_dissector_name()"; it was put in there
for "-d", but turns out not to be necessary for that.

Clean up the usage message a bit (using the convention, adhered to by at
least some UNIX utilities, of listing all the flags with no arguments in
a single lump, and then listing the ones with arguments individually,
and also putting "-v" and "-h" in a separate lump, as Ethereal does).

svn path=/trunk/; revision=7788
2003-06-05 04:47:58 +00:00
Guy Harris 2689d287d4 Squelch some compiler complaints.
svn path=/trunk/; revision=7682
2003-05-16 00:48:26 +00:00
Laurent Deniel 3070b797d5 Implement a ring buffer switch duration:
when the new "Rotate capture file every n second(s)" checkbox or the
-b <# of file>[:<duration>] argument are used, [t]ethereal will skip to the
next ring buffer file if the specified duration has elapsed (even if the
specified capture size is not reached). This is useful when you want to have
separate capture files per hour or day for instance.

I let the autostop filesize parameter mandatory (i.e. the "rotate capture
file after n kilobytes") but this could be no longer strictly necessary when
that new feature is used ...

Another point: it might be interesting to really truncate the file at the
switch and not the closure ... According to user comments and my own real
case tests, I might plan to enhance this point and others (still ring buffer
related) in the future.

svn path=/trunk/; revision=7678
2003-05-15 13:40:20 +00:00
Laurent Deniel ea052d7d23 A correct programming practice is to save errno and restore its value
in all signal handlers that could modify it (i.e. by calling system
calls or worst standard C library functions).

Else the following code for instance is buggy if a signal arises between
the tests:

if (system_call() == -1) {
  if (errno == Exxx) {
   ...
  } else {
   ...
  }
}

And MANY (open source or not) programs are broken that way ...

svn path=/trunk/; revision=7664
2003-05-14 10:31:15 +00:00
Gerald Combs 1d9b54fc07 Add support for asynchronous DNS updates using the GNU ADNS library.
Support can be enabled at configure time by using "--with-adns=DIR".
If support is enabled, async queries happen whenever host name resolution
is enabled.  Do we need a separate preference for async queries?

Currently, only IPv4 reverse queries are supported.  I can add IPv4 forward
lookup support, but I don't have any way to test IPv6 queries.

svn path=/trunk/; revision=7640
2003-05-04 18:50:56 +00:00
Guy Harris 4cfd8b0f36 Allow taps to have menu item registration routines; the menu item
registration routines, for taps with menu items (taps that can be run
from the "Tools->Statistics" menu), create the menu item for the tap.
"make-tapreg-dotc" constructs a "register_all_tap_menus()" function that
calls all the tap menu item registration routines it finds, and Ethereal
calls that routine after the main window has been constructed (so that
the main menu exists, as the menu items are added to it).  (Tethereal
doesn't call it.)

Get rid of the "menu" and "menu_init" arguments to
"register_ethereal_tap"; the menu item is registered in the tap's menu
item registration routine, not in its main registration routine.

Have the RTP GUI tap register its menu item that way, rather than by
having it compiled into "gtk/menu.c".  (We're not ready yet to have taps
whose menu items are under a submenu register themselves in that
fashion, as "register_tap_menu_item()" can't yet create submenus.)

svn path=/trunk/; revision=7540
2003-04-23 03:51:03 +00:00
Guy Harris 2678786425 Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".

svn path=/trunk/; revision=7467
2003-04-16 05:55:41 +00:00
Guy Harris 24ec2110d1 Add the notion of a "fence" to columns. A dissector can set the fence
to "protect" what's currently in the column, so that attempts to clear
the column will only clear stuff after the fence and attempts to
overwrite the column will append stuff after the fence.  This, for
example, allows a dissector to arrange that the Info column contain
information for its protocol and for protocols running atop it.

svn path=/trunk/; revision=7466
2003-04-16 04:52:55 +00:00
Guy Harris ab84d8be6e Change the version messages to put the "compiled with" stuff on a
separate line, and to put the "running with" info on a separate line
from that, to make the output narrower.

svn path=/trunk/; revision=7344
2003-03-12 00:07:46 +00:00
Guy Harris 170b5028e9 Put the code to get version numbers of various libraries with which
Ethereal/Tethereal was linked into a common routine, and use that in
both Ethereal and Tethereal.

Add to that routine code to get OS version information.

svn path=/trunk/; revision=7320
2003-03-08 07:00:48 +00:00
Guy Harris 06803d2919 Re-word-wrap the "you can't capture on PPP/WAN interfaces on NT"
message, to make the margins more even and to bring the second line
under 80 characters.  (It's amazing how long Herman Hollerith's legacy
has lasted....)

svn path=/trunk/; revision=6835
2003-01-01 03:51:02 +00:00