Commit Graph

296 Commits

Author SHA1 Message Date
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
Guy Harris 99db336999 One more "#ifdef" (well, #ifndef, actually) for _WIN32.
svn path=/trunk/; revision=6834
2002-12-31 22:42:45 +00:00
Guy Harris 3e822a8538 #ifdef out all the pipe-opening stuff on Windows.
svn path=/trunk/; revision=6833
2002-12-31 22:01:48 +00:00
Guy Harris 55246f1b9f Clean up the comments a bit.
Use _WIN32 rather than WIN32 throughout (both of them appear to work - I
don't know whether one is the "right" one to use and, if one is, which
one it is - and they're both used in Ethereal, but let's at least be
consistent within a given file).

Update the capture device open failure message on Windows not to say
Token Ring devices aren't supported - current versions of WinPcap do
support it, and the Ethereal message was updated, but the Tethereal one
wasn't.

Fix up the Tethereal code to match the Ethereal code a bit more, so that
we go to "error" on Windows if the capture device open fails, and so
that the code actually compiles on Windows.  Fix up the indentation
while we're at it.

svn path=/trunk/; revision=6829
2002-12-31 21:18:05 +00:00
Guy Harris 1e6c1a0ac0 From rmkml: support for capturing from a pipe in Tethereal.
Fix up the documentation of the "-i" flag in the Ethereal man page to
note only that "netstat -i" and "ifconfig -a" *might* work, to
specifically note that not all UNIXes support the "-a" flag to
"ifconfig", and to note that pipe data must be in *standard* libpcap
format.

Document the support for pipes in the "-i" flag in Tethereal.

svn path=/trunk/; revision=6822
2002-12-29 22:40:10 +00:00
Guy Harris 59932f2722 Don't cast away constness, and fix variable and structure member
qualifiers as necessary to ensure that we don't have to.

"strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't
test their results as if they did.

Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes.

Update Michael Tuexen's e-mail address.

svn path=/trunk/; revision=6726
2002-12-02 23:43:30 +00:00
Gerald Combs 2329ea1483 Add tethereal's tap objects to Makefile.nmake's "clean" target.
Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in
packet-snmp.c.

svn path=/trunk/; revision=6606
2002-11-10 20:53:06 +00:00
Guy Harris b9f754f891 Add support for SIGINFO on systems that have it.
svn path=/trunk/; revision=6590
2002-11-09 00:08:44 +00:00
Ronnie Sahlberg 42e0065552 Fix for small bug that crashed tethereal if a tap filter was applied and tethereal forgot to tell epan_dissect_new() to build a tree
svn path=/trunk/; revision=6529
2002-11-01 01:11:59 +00:00
Guy Harris 8442ad9a32 From Ronnie Sahlberg: have a registration interface for tap listeners,
and generate the table of stuff to register from tap source files, so
Tethereal doesn't need to know what tap listeners exist.

Get rid of "tap-xxx.h" files, as they're now empty.

Add "tethereal-tap-register.c" to the .cvsignore file, as it's a new
generated file.

Update "Makefile.nmake" to generate "tethereal-tap-register.c".

Clean up "Makefile.am" and "Makefile.nmake" a bit.

svn path=/trunk/; revision=6525
2002-10-31 22:16:01 +00:00
Guy Harris c2d40f72b9 Don't reset the packet count if we longjmp out of the capture loop, as
that causes us to report that no packets were captured if you ^C out of
a capture.

svn path=/trunk/; revision=6523
2002-10-31 20:24:41 +00:00
Guy Harris 72d59f0596 The versions of UCD SNMP that we now support all install
<ucd-snmp/version.h>, so get rid of the stuff to check for its presence
and handle its absence.

svn path=/trunk/; revision=6503
2002-10-25 03:13:11 +00:00
Guy Harris ae1ebc09da Don't include the header file to get the SNMP version unless we're
building with an SNMP library.

If we have Net-SNMP, include <net-snmp/version.h>, not
<ucd-snmp/version.h>.

Don't include any of the SNMP headers unless HAVE_SOME_SNMP is defined.

Include <net-snmp/config_api.h> if we have Net-SNMP, to declare
"read_premib_configs()" and "read_configs()".

Supply the include directories for Net-SNMP in the Makefile.nmake for
GTK 1.2 and GTK 2.

svn path=/trunk/; revision=6493
2002-10-24 07:08:26 +00:00
Guy Harris cc8a765d8e From Wes Hardaker:
Define HAVE_SOME_SNMP if either HAVE_UCD_SNMP or HAVE_NET_SNMP
	is defined, and use HAVE_SOME_SNMP, rather than HAVE_UCD_SNMP,
	in most places when testing whether we have an SNMP library or
	not.

	Be more selective when including Net-SNMP header files.

Fix up {gtk,gtk2}/main.c to do the same SNMP stuff that tethereal.c
does - including the MIB stuff that gtk/main.c was doing but gtk2/main.c
wasn't doing.

Fix the copyright date in gtk/main.c.

svn path=/trunk/; revision=6483
2002-10-23 18:24:09 +00:00
Guy Harris a71d1d910e From Ronnie Sahlberg: add a tap for statistics for DCERPC interfaces.
svn path=/trunk/; revision=6479
2002-10-23 03:49:13 +00:00
Guy Harris 79308de612 From Ronnie Sahlberg: don't have the tap code do a dissection, leave
that up to its callers, so only one dissection need be done when reading
a capture file.

svn path=/trunk/; revision=6442
2002-10-17 02:11:20 +00:00
Gerald Combs ec8fd2703a Link to libsnmp under Win32.
In gtk/main.c and tethereal.c set MIBDIRS to <get_program_path()>\snmp\mibs
so that we can drop the MIB files there, instead of the default c:\usr\...
path.

Add NET_SNMP_DIR to config.nmake and modify Makefile.nmake to adjust
CFLAGs, ethereal_LIBS and tethereal_LIBS accordingly.

Define HAVE_UCD_SNMP in config.h.win32.

I tested this by creating c:\program files\ethereal\snmp\mibs and
dropping in the MIB files that come with Net-SNMP.  Ethereal resolved
system.sysDescr.0 to "iso.3.6.1.2.1.1.1.0" under Windows.  Under Linux
it resolved to "SNMPv2-MIB::sysDescr.0".

Ethereal.nsi still needs to be updated.

A compiled version of the Net-SNMP library can be found at

    http://www.ethereal.com/distribution/win32/development/

svn path=/trunk/; revision=6385
2002-10-09 03:07:34 +00:00
Ronnie Sahlberg c0b84c028f Update tethereal to put the filter string in the statistics table for RPC_STAT.
Update gtk and gtk2 versions of RPC_STAT to allow a filter string to be specified on both the command line as well as the GUI.

Update the documentation for ethereal to reflect this.

svn path=/trunk/; revision=6343
2002-09-27 11:07:16 +00:00
Ronnie Sahlberg c7b512c343 Updated RPCSTAT for tethereal. The command now takes a filter string as an optional extra parameter.
This makes it possible to generate any types of stats based on user defined subsets of the capture.

Try -z rpc,rtt,100003,3,nfs.fh.hash==0x12345678

NFS rtt statistics for a specific file.

svn path=/trunk/; revision=6337
2002-09-26 01:13:04 +00:00
Ronnie Sahlberg 429b24827b From Vassilii Khachaturov, cleanup of redundant code.
svn path=/trunk/; revision=6202
2002-09-06 22:45:44 +00:00
Ronnie Sahlberg e20ea63dd4 New type of onc-rpc statistics.
try: -z rpc,programs

svn path=/trunk/; revision=6190
2002-09-05 09:27:56 +00:00
Ronnie Sahlberg a26f9d5107 Added a mutex to protect a critical region in Gtk2 where the list can be
modified while the draw thread is walking it.

Changed the cmdline switch to -z so the same one can be used both for
ethereal and tethereal.

Updated man pages to reflect the RPCSTAT feature.

(Try this with Tools/Statistics/ONC-RPC/RTT and load a capture containing
onc-rpc. )

svn path=/trunk/; revision=6189
2002-09-05 06:46:38 +00:00
Ronnie Sahlberg 93a649db6f Tap api. tap is a simple api that can be used for arbitrary extensions.
One example extension is rpcstat.

Try -Z rpc,rtt,100003,3 as argument to tethereal when reading a capture
containing NFSv3 packets.

tap-rpcstat.[ch] is intended to demonstrate the api and can be used to
base other extensions on.

svn path=/trunk/; revision=6175
2002-09-04 09:40:29 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 7200333d8b Add -S option to tethereal. It is the equivalent to Ethereals display
packets in real time feature.

svn path=/trunk/; revision=6034
2002-08-20 20:49:31 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Jörg Mayer 9630bf353e Fix a few more memleaks found by valgrind (all deriving
from the get_persconffile_path mess).

svn path=/trunk/; revision=5927
2002-08-01 03:15:29 +00:00
Guy Harris ca6badc579 Get rid of some "unused variable" and "unused static function" warnings,
and some compile errors in Tethereal, when compiling without libpcap.

If libpcap is missing (whether that's detected at compile time or, as on
Windows, at run time), don't call any of the "capture_prefs" routines -
the routine to create the capture preferences page wasn't called, so the
other routines can try to refer to non-existent widgets and other items
and crash.

Get rid of the stub routines in "capture_prefs()" used when compiling
without libpcap, as they're no longer called.

svn path=/trunk/; revision=5888
2002-07-17 00:22:30 +00:00
Guy Harris 44d19627ef From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the
	standard error.

	Optimize the capture loop.

Fix some of the error-message printing code in Ethereal and Tethereal.

Have Wiretap check whether it can seek on a file descriptor, and pass
the results of that test to the file-type-specific "open for output"
routine.  Have the "open for output" routines for files where we need to
seek when writing the file return an error if seeks don't work.

svn path=/trunk/; revision=5884
2002-07-16 07:15:09 +00:00
Guy Harris 192749474f From Liviu Daia <Liviu.Daia[AT]imar.ro>: move "col_init()" call after
the command-line options are processed, so that we don't crash if you've
set the "column.format" preference from the command line.

Fix a grammaro in a comment.

svn path=/trunk/; revision=5838
2002-07-07 21:52:51 +00:00
Guy Harris b10bc01cad From Graeme Hewson:
pass a non-zero count to "pcap_dispatch()" when possible;

	fix the check after "test_for_fifo()";

	if there's a maximum file size, we're definitely saving to a
	file, so don't bother checking "ld.pdh", as it won't be null;

	if writing to a FIFO, flush after "pcap_dispatch()" returns,
	rather than after every packet, so we don't do as many writes to
	the FIFO.

svn path=/trunk/; revision=5805
2002-06-30 20:26:45 +00:00
Guy Harris 95d39eb34e SIGINT is, at least as I read some Microsoft documentation, not
supported in Win32 applications; use the native Win32 mechanism for
catching ^C (and other events that would terminate a program running in
a console window).

That mechanism (and the signal mechanism in the MSVC++ C run-time) cause
the handler to be run in a separate thread, so it can't just do a
longjmp.  Fortunately, WinPcap's packet-dispatch loop, unlike the
libpcap loop on some UNIX platforms, can be interrupted by ^C, so we
don't have to do the longjmp there - we can just set "ld.go" to FALSE to
terminate the capture loop.

svn path=/trunk/; revision=5776
2002-06-28 09:47:36 +00:00
Gerald Combs 83dc23831a Update tethereal to handle the "<description> : <device ID>" interface
names that are generated under Windows.  Note in pcap-util.c that we
may want to separate interface device names and descriptions in the
future.

svn path=/trunk/; revision=5770
2002-06-27 22:39:16 +00:00
Guy Harris cd6fe13358 Count packets that pass the read filter, if we have a read filter, not
packets that we get from libpcap; if there's a read filter in effect,
only packets that pass the read filter get saved or printed, so that's
the number of packets that should be compared against the argument to
any "-c" flag, and the number that should be printed when we print
packet counts.

svn path=/trunk/; revision=5747
2002-06-23 21:58:02 +00:00
Guy Harris 38b530a8b8 Add a routine to "epan/filesystem.c" to test whether a file is a FIFO.
Use that in Tethereal rather than duplicating a pile of macros.

Get rid of the remaining uses of "stat()" in Tethereal - none of them
are necessary (they were just cut-and-pasted from Ethereal).

svn path=/trunk/; revision=5746
2002-06-23 21:33:09 +00:00
Guy Harris 7ad0ca82b1 From Graeme Hewson: flush the output after every frame if Tethereal is
writing a capture to a FIFO, and improve the error checking for ring
buffers.

svn path=/trunk/; revision=5745
2002-06-23 20:30:01 +00:00
Guy Harris c2b438ddfa Add a Wiretap routine to process packets captured via libpcap, possibly
extracting a pseudo-header, for the use of SunATM captures.

Add support for SunATM capture.

svn path=/trunk/; revision=5652
2002-06-07 21:11:24 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris e2630eed79 Command-line interface cleanups, from Graeme Hewson:
- Exit if an error is found in the options or arguments.

	- In print_usage(), improve the visibility of any getopt() error
	  message by suppressing the version information when -h is not
	  specified, and by adding an empty line.

	Ethereal:

	- If the -k option is specified, use the interface in the preferences
	  file, if present.

	- Prevent the user from specifying any hidden options which are used
	  internally in -S mode.

	Tethereal:

	- Fix a memory leak in the processing of the -f option.

	- In print_usage(), change "capture file type" to "output file type",
	  which I think is clearer; move the -q flag from the non-libpcap case
	  to the libpcap case.

svn path=/trunk/; revision=5525
2002-05-22 23:22:56 +00:00
Guy Harris 976a82b06a Use "-G fields" rather than "-G" in Makefiles.
Print an error and exit if an invalid option is given for the "-G" flag.

svn path=/trunk/; revision=5466
2002-05-14 18:27:28 +00:00
Guy Harris e390d7e0cc Make the "-G" flag take an argument. If no arugment is specified, or if
the argument is "fields", dump out a table of the fields, as we
currently do; if the argument is "protocols", dump out a table of the
protocols.

svn path=/trunk/; revision=5462
2002-05-14 10:15:12 +00:00
Guy Harris 63e8447614 From Joerg Mayer: get rid of unused arguments, and mark those that can't
be eliminated (because the function is called through a pointer, and
other functions called through the same pointer *do* use the argument)
as unused.

svn path=/trunk/; revision=5050
2002-03-31 20:57:02 +00:00
Guy Harris 2ee730c79e Update from Diana Eichert to remove the comments with her login name.
svn path=/trunk/; revision=5006
2002-03-23 00:20:17 +00:00
Guy Harris 5a01067dff From Diana Eichert: add a "-q" flag to Tethereal to suppress packet
count display.

Update the Tethereal man page to reflect the new option.

Update both the Ethereal and Tethereal man pages to use the same style
to describe options, e.g.

	-Z	Cause Ethereal to draw the mark of Zorro on the display.

rather than

	-Z	Causes Ethereal to draw the mark of Zorro on the display.

(some were using the first and some were using the second).

Update the Ethereal man page to do the same for menu items.

Update both the Ethereal and Tethereal man pages to better describe the
"-N" flag (by noting that any form of name resolution *not* specified in
the flag is turned *off*).

svn path=/trunk/; revision=5005
2002-03-22 23:42:27 +00:00
Guy Harris 6327b456db Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".
Make the directory option to "--with-ucdsnmp" optional.  Handle
"--with-ucdsnmp" similar to the way "--with-pcap" is handled.

Get rid of unnecessary #defines in "packet-cops.c".

Get rid of no-longer-necessary include of "dlfcn.h" in "packet-snmp.c".

svn path=/trunk/; revision=4930
2002-03-12 10:37:04 +00:00
Guy Harris 37dd5f340c Remove code to show the presence, and version number, of the CMU SNMP
library, as we no longer support linking with that library.

svn path=/trunk/; revision=4917
2002-03-10 23:19:44 +00:00
Guy Harris 43ca2567dc Don't say "without SNMP"; that can confuse people into thinking it means
Ethereal doesn't dissect SNMP if not linked with an SNMP library (and
*did* confuse at least one person into thinking that).  Say "without
SNMP MIB support", instead, as you only lose the ability to read SNMP
MIBs and interpret OIDs and variable bindings according to those MIBs.

svn path=/trunk/; revision=4894
2002-03-06 23:37:12 +00:00
Gilbert Ramirez d96747f550 In follow.c, initialize data_out_file to NULL, as it used to
be initialized in gtk/follow_dlg.c

In gtk/follow_dlg.c, declare data_out_file as 'extern'.

In tethereal.c, no longer define 'data_out_file', as the storage
for it is now in follow.c.

svn path=/trunk/; revision=4830
2002-02-28 19:35:09 +00:00
Guy Harris cbf5c537c4 From Joerg Mayer: remove unused variables and declarations of
non-existent functions.

Remove the "filetype" argument from the "can_write_encap" functions for
particular capture file types - the argument value is implicit, in that
the routine being called is the routine for that particular file type.

svn path=/trunk/; revision=4823
2002-02-27 08:57:25 +00:00
Guy Harris 541c654ff0 Put all the capture options into a structure.
Move the ringbuffer capture options from the "capture_file" structure to
the structure for capture options, as they're a property of an
in-progress capture, not a property of a particular capture file.

svn path=/trunk/; revision=4799
2002-02-24 09:25:36 +00:00
Guy Harris ca8f79df3d Get rid of "init_all_protocols()"; instead, have a routine
"init_dissection()" which calls "epan_conversation_init()", does the
work that "init_all_protocols()" did, and then calls
"reassemble_init()", so that the standard sequence of dissection
initialization is done in one place, rather than having multiple places
call the same sequence of routines.

svn path=/trunk/; revision=4797
2002-02-24 06:45:14 +00:00
Guy Harris b767826991 Have "get_positive_int()" really check for positive integers, not just
non-negative integers.

Get rid of unused "get_positive_int()" routine in "gtk/capture_dlg.c".

svn path=/trunk/; revision=4796
2002-02-24 06:01:03 +00:00
Guy Harris 8bd63530ed "autostop_filesize" and "autostop_duration" don't need to be in the
"capture_file" structure - they're a property of an in-progress capture,
not a property of an open capture file.  Make them just variables.

The maximum number of packets to be captured should be a variable
separate from the "count" field in the "capture_file" structure - the
latter is a count of the packets in the capture file in question.

Have Boolean variables indicating whether a maximum packet count,
maximum capture file size, and maximum capture duration were specified.
If an option isn't set, and we're doing an "update list of packets in
real time" capture, don't pass the option to the child process with a
command-line argument.

Don't create "stop when the capture file reaches this size" or "stop
when the capture's run for this long" conditions if a maximum capture
file size or a maximum capture duration, respectively, haven't been
specified.  Don't test or free a condition if it wasn't created.

Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag
is the way you specify "no limit on the number of packets".

Initialize the check boxes and spin buttons for the "maximum packets to
capture", "maximum capture size", and "maximum capture duration" options
to the values they had in the last capture.  If an option wasn't
specified, don't read its value from the dialog box and set the
variable.

svn path=/trunk/; revision=4795
2002-02-24 03:33:05 +00:00
Guy Harris 309e86246e From Peter Valchev: fix editcap to assign the result of "getopt()" to an
"int" and to check "getopt()"s return value with -1 rather than EOF.

Fix other "getopt()" loops to check against -1 as well (EOF is -1 on
most if not all platforms, but the Single UNIX Specification says
"getopt()" returns -1, so we should check against -1, not EOF).

svn path=/trunk/; revision=4793
2002-02-24 01:26:45 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris 89a4acb438 Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file.  Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).

If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.

Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").

Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping.  Also add units to the capture count option.

Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.

Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.

svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
Guy Harris d76a4172a6 The ring buffer code only supports libpcap format captures; print an
error message and quit if the user tries to use ring buffering with
another capture file format, and put a note about that in the Tethereal
man page.

svn path=/trunk/; revision=4615
2002-01-29 05:38:56 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Gilbert Ramirez 06348ee4e0 Tethereal needs to allocate space for col_expr[] and col_expr_val[] too.
Capturing with non-verbose output being printed segfaulted w/o this.

svn path=/trunk/; revision=4551
2002-01-15 23:11:02 +00:00
Guy Harris 0a03b0f73e Add a preferences page for the name resolution flags.
Separate the preferences value for those flags and the name resolution
code's value into separate variables; this means that the resolution
code no longer depends on the preferences code, and may let us
eventually have the current setting and the preference setting differ
(so that a user can temporarily override the preference setting without
causing subsequent saves of the preferences to save the temporary
value).

Add routines to create various types of widgets for preferences, and to
fetch the values for "enumerated" preferences, and use them both in the
code to handle hardwired preference pages and table-driven preference
pages.

svn path=/trunk/; revision=4536
2002-01-13 20:35:12 +00:00
Guy Harris e8297af92b Declare "capture()" appropriately.
svn path=/trunk/; revision=4527
2002-01-11 11:04:03 +00:00
Guy Harris d663cdb4a1 Fix some problems with building Ethereal/Tethereal without libpcap.
Get rid of a #include I'd #if 0'ed out.

svn path=/trunk/; revision=4513
2002-01-10 09:51:23 +00:00
Guy Harris 9357047df5 Add a preferences page for capture preferences, so that the user can
directly edit the capture preferences, rather than only being able to
set them implicitly from the values for the most recent capture.

Add a preferences item for the interface on which to capture.

Get rid of some unused variables.

svn path=/trunk/; revision=4510
2002-01-10 07:43:39 +00:00
Guy Harris b1f4093d1a Make the "go" member of the "loop_data" structure in Ethereal a
"gboolean", as it's a Boolean value, and move it to the beginning of the
structure in Tethereal, as it is in Ethereal.

From Graeme Hewson:

	Check for "pcap_dispatch()" returning -1, meaning an error
	occurred; if it does, stop capturing, and report the error.

	If we get a signal in tethereal, stop the capture with a
	"longjmp()", rather than by clearning the "go" flag;
	"pcap_dispatch()", on many platforms, keeps reading rather than
	returning a captured packet count of 0 if the system call to
	read packets returns -1 with an errno of EINTR, so the
	"pcap_dispatch()" won't be broken out of if the signal handler
	returns.

	Fix a typo in an error message.

svn path=/trunk/; revision=4471
2002-01-03 22:03:24 +00:00
Guy Harris b1abeeb5f0 Clean up the comments for the ring buffer checks.
svn path=/trunk/; revision=4438
2001-12-21 20:32:53 +00:00
Guy Harris b89a117a61 There is no such thing as an optional parameter to a command-line flag
if you're using "getopt" - if a flag requires a parameter, not
specifying the parameter is an error.

svn path=/trunk/; revision=4437
2001-12-21 20:18:40 +00:00
Guy Harris 393fba6ff2 If the user requested a ring buffer but didn't specify a capture file or
maximum capture file size, treat that as an error.

svn path=/trunk/; revision=4436
2001-12-21 20:06:43 +00:00
Guy Harris 095d803437 Don't let the user specify a maximum capture file size if they're not
saving the capture to a file.

svn path=/trunk/; revision=4435
2001-12-21 19:58:30 +00:00
Guy Harris 7ff0e8e3ce It's not possible to check whether the capture file has reached its
maximum size if there is no capture file; in fact, if you do, you get a
core dump.  Skip the capture file size test if not capturing to a file.

svn path=/trunk/; revision=4434
2001-12-21 19:51:03 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Guy Harris 794f0c04f4 Add an extra argument to "epan_dissect_new()" that indicates whether the
display representation should be put into protocol tree items if a
protocol tree is to be constructed; have it set "proto_tree_is_visible"
from that argument.

svn path=/trunk/; revision=4408
2001-12-16 22:16:14 +00:00
Guy Harris dca6cf394f Don't fill in the columns if we're writing to a capture file.
Don't fill in the columns if we're in verbose mode.

svn path=/trunk/; revision=4372
2001-12-10 02:12:53 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Gilbert Ramirez 6542c18172 Remove proto_tree from capture_file and PacketWinData, since they
already contain a pointer to an epan_dissect_t, which contains
the proto_tree.

Routines calling epan_dissect_new() do not create their own
proto_tree via proto_tree_create_root(); instead, they pass a boolean
to epan_dissect_new() telling it whether it should create the root
proto_tree.

svn path=/trunk/; revision=4343
2001-12-06 04:25:09 +00:00
Guy Harris 2174f26cdc In the NetMon capture file reading code, if we get a short read when
trying to read the frame table, return -1 with "*err" set to
WTAP_ERR_SHORT_READ, don't return 0 - we've already decided that the
file is a NetMon file, so we shouldn't return a "this isn't a NetMon
file" indication, we should return a "this file is too short" error, as
that's what the problem is.

Fix up the error messages for WTAP_ERR_SHORT_READ to indicate that the
read might have gotten cut short in the middle of data other than a
packet.

svn path=/trunk/; revision=4331
2001-12-04 23:38:55 +00:00
Guy Harris 8032fa8a1b Make the bytes-written information from Wiretap a long, as we allow
files to get that big.

From Thomas Wittwer and Matthias Nyffenegger:

Support for "ring buffer mode", wherein there's a ring buffer of N
capture files; as each capture file reaches its maximum size (the ring
buffer works only with a maximum capture file size specified), Ethereal
rolls over to the next capture file in the ring buffer, replacing
whatever packets might be in it with new packets.

svn path=/trunk/; revision=4323
2001-12-04 08:26:00 +00:00
Guy Harris a1660d6d3a Support for stopping capture at specified capture file size or capture
duration, from Thomas Wittwer and Matthias Nyffenegger.

svn path=/trunk/; revision=4322
2001-12-04 07:32:05 +00:00
Gilbert Ramirez 8743a4a8a7 Remove the global packet_info called "pi". Dissectors now only
access their own "pinfo". A packet_info is stored in epan_dissect_t,
which is created for the dissection of a single packet.

GUI functions which need to access the packet_info of the currently
selected packet used to use "pi"; now they use cfile.edt->pi. cfile's
"edt" member is the epan_dissect_t of the currently-selected packet.

The functionality of blank_packetinfo() was moved into
dissect_packet(), as that's the only place that called blank_packetinfo(),
after a spurious call to blank_packetinfo() was removed from
packet_list_select_cb().

svn path=/trunk/; revision=4246
2001-11-21 23:16:26 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris 40b22f317b Wrap calls to "pcap_datalink()" in a routine that attempts to compensate
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't
return DLT_ values, it returns RFC 1573 ifType values.

Put that wrapper, and the routine to get the interface list, in a
separate file, for packet-capture utility routines, so not everybody who
includes "util.h" needs to include <pcap.h>.

Fix up the Wiretap hack for dealing with said incompatibility to use the
correct ifType value for Token Ring.

svn path=/trunk/; revision=4184
2001-11-09 07:44:51 +00:00
Guy Harris cc7347ebf6 Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences
file, so that we don't spam the user with error messages caused by them
having saved preferences in an earlier release that contained those
preferences.

Make the Diameter and iSCSI dissectors register obsolete preferences.

Crash if some code tries to register a preferences module with a name
that contains something other than lower-case ASCII letters, numbers, or
underscores, or that has already been registered, or if some code tries
to register a preference with a name that contains something other than
lower-case ASCII letters, numbers, underscores, or periods, or that has
already been registered, so that we don't put code like that in a
release and have to shovel code into "prefs.c" to fix it up later.  (The
problem with multiple modules or preferences with the same name should
be obvious; the problem with names with blanks, or upper-case letters,
or punctuation, is that they're a pain to type on the command line.)

svn path=/trunk/; revision=4148
2001-11-04 02:50:21 +00:00
Gilbert Ramirez 6de396c4a8 Fix the rest of the signed/unsigned comparison warnings.
svn path=/trunk/; revision=4088
2001-10-26 18:28:17 +00:00
Guy Harris 8a96e8c675 Handle "pcap_open_live()" succeeding but returning a warning; print the
warning before the capture starts.

svn path=/trunk/; revision=4074
2001-10-25 06:41:48 +00:00
Guy Harris e4db9c4b64 Add a routine to get the directory in which personal configuration files
reside.  Use it, rather than concatenating the user's home directory and
".ethereal" in a number of files.

Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname
separator.

svn path=/trunk/; revision=4061
2001-10-22 22:59:26 +00:00
Guy Harris 3c9efdf478 Use longs as file offsets, so that on platforms with 64-bit "long" we
can handle capture files bigger than 2GB.

svn path=/trunk/; revision=3993
2001-10-04 08:30:36 +00:00
Guy Harris 23140475d7 Close the file to which we're writing before exiting, so that:
buffered data is written out to the file;

	headers are written if the capture file header depends on the
	number or sizes of the packets;

etc..

svn path=/trunk/; revision=3909
2001-09-05 05:03:47 +00:00
Guy Harris 5bb08b0970 Fix AC_ETHEREAL_PCAP_CHECK so that, if a directory was specified with
"--with-pcap", it adds the "include" subdirectory of that directory to
the list of directories to search for include files, rather than adding
the directory itself.

Check whether libpcap defines "pcap_version", and define
HAVE_PCAP_VERSION if it does.  Use "pcap_version" iff HAVE_PCAP_VERSION
is defined, rather than special-casing MacOS X.

Don't #define a string for the WinPcap version; just leave
HAVE_PCAP_VERSION undefined on Windows, as WinPcap 2.2beta is out, so we
can no longer assume that the Windows version of Ethereal is using
WinPcap 2.1.

svn path=/trunk/; revision=3792
2001-07-27 07:10:13 +00:00
Guy Harris ae251f8426 MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
	plugin directory optional - this allows plugins to be disabled;

	add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
	requires it, for some annoying reason, even though it is, as far
	as I know, GCC-based, and other GCC's don't require it);

	on MacOS X, don't use "pcap_version[]", as, for some annoying
	reason, libpcap on MacOS X doesn't define it.

Clean up some whitespace in the help messages for the configure script.

Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".

svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
Ed Warnicke add908fabd Added a "Suppress Unmarked" option to the print dialog to
allow you to suppress the printing of unmarked packets.
This allows a user to mark the packets they wish to print and
print ONLY those packets by suppressing all other unmarked packets.

This may seem like a bit of a convoluted way of expressing things,
as usually the desired behavior would be to print the marked packets.
However, we do NOT print marked packets that are not displayed under
the current filter.  To be maximally explicite I've expressed this
as suppressing unmarked frames.

svn path=/trunk/; revision=3736
2001-07-17 05:32:44 +00:00
Guy Harris 537d308abe "open_cap_file()" in Ethereal and Tethereal don't use the FILE_T they
get from calling "wtap_file()", so get rid of the call and the
(otherwise unused) variable to which its result gets assigned.

That lets us get rid of "wtap_file()" in Wiretap.

It also lets us get rid of the include of "zlib.h" in "file.h"; the
#defines of "file_open()", "filed_open()", and "file_close()" are also
unnecessary, so we get rid of those as well.

However, that means we need to include <zlib.h> in "gtk/main.c" and
"tethereal.c", so that the version number of libz is defined and can
show up in the version string.

svn path=/trunk/; revision=3652
2001-07-05 00:34:42 +00:00
Guy Harris 2da9bb2696 When printing the contents of a raw-data field, don't use the raw data
of the current frame as the source, use the raw data of the tvbuff
that's the data source of that field.

svn path=/trunk/; revision=3531
2001-06-08 08:50:51 +00:00
Guy Harris c9da803a08 Move the fragment reassembly code into "reassemble.c" and
"reassemble.h", and remove IPv4 dependencies from it.

Use it for OSI CLNP segment reassembly as well.

svn path=/trunk/; revision=3525
2001-06-08 06:27:16 +00:00
Guy Harris 2851b7ef76 Enable "Match Selected" only if there's a field selected *and* we can do
a "Match Selected" on it - we can't do a "Match Selected" if the field
has no value (e.g., FT_NULL) and has a length of 0.

If we unselect the current packet, we don't have a protocol tree, so we
don't have a currently selected field - clear the "Match Selected" menu
item and the display in the status line of information about the
currently selected field.

Move the low-level statusbar manipulation into "gtk/main.c", in routines
whose API doesn't expose anything GTK+-ish.

"close_cap_file()" calls one of those routines to clear out the status
bar, so it doesn't need to take a pointer to the statusbar widget as an
argument.

"clear_tree_and_hex_views()" is purely a display-manipulating routine;
move it to "gtk/proto_draw.c".

Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine
to do all the work that needs to be done if the currently selected
protocol tree row is unselected, and call it if the currently selected
packet list row is unselected (if it's unselected, there *is* no
protocol tree, so no row can be selected), as well as from
"tree_view_unselect_row_cb()".

Before pushing a new field-description message onto the statusbar, pop
the old one off.

Get rid of an unused variable (set, but not used).

svn path=/trunk/; revision=3513
2001-06-05 07:39:31 +00:00
Guy Harris 6ee04dad33 Support for "-N" flag enabling selected forms of name resolution, from
Joerg Meyer.

Support for saving to the preferences file the settings for all types of
name resolution.

Do a case-insensitive check for "true" and "false" in Boolean preference
settings.

svn path=/trunk/; revision=3489
2001-05-31 08:36:46 +00:00
Guy Harris 39710cd582 In ANSI C (and in pre-ANSI UNIX implementations), if you return from
"main()", the program exits, and exits with an exit status equal to the
return value of "main()", so "return 0;" is sufficient at the end of
"main()".

svn path=/trunk/; revision=3350
2001-04-20 21:50:06 +00:00
Gilbert Ramirez 950d194eb9 Add a "return 0;" at the end of main() to pacify MSVC 5 (and probably
other compilers, too.)

svn path=/trunk/; revision=3347
2001-04-20 19:41:42 +00:00
Guy Harris d2d999fb74 Check the validity of numbers specified in command-line options.
svn path=/trunk/; revision=3326
2001-04-18 05:45:58 +00:00
Guy Harris f8c9764894 There's no "enable name resolution in captures" preference in Ethereal,
and never was - there's only an Ethereal-wide "enable name resolution"
preference.  Name it just "name_resolve".

Replace all tests of "g_resolving_actif" with tests of
"prefs.name_resolv", and replace all code that sets "g_resolving_actif"
with code that sets "prefs.name_resolv", so that the setting of
"prefs.name_resolv" actually affects whether names are resolved or not.

svn path=/trunk/; revision=3300
2001-04-15 03:37:16 +00:00
Guy Harris 094dc29f19 The Software Porting And Archive Centre for HP-UX now has libpcap 0.6.2
binaries, so users only need to make sure they have that version
installed in order to have Ethereal (and tcpdump, and snort, and so on)
accept "lanN"-style names (i.e., names of the sort reported by lanscan
and handled by ifconfig), rather than "dlpiN".

Get rid of the patches to update libpcap, get rid of the discussion in
"README.hpux" of patching libpcap and just say "get 0.6.2", and make the
notes on HP-UX kernel patches to fix problems with capturing outgoing
packets a separate item in the list of items in "README.hpux".

Also update the error messages Ethereal and Tethereal display if they
can't open a device and the error is "can't find PPA for XXX" to say
"get 0.6.2" rather than "patch libpcap and recompile.

svn path=/trunk/; revision=3288
2001-04-11 05:24:08 +00:00
Guy Harris 7da2edcb2e Don't hand "fdata" to "clear_fdata()" if you haven't filled it in.
svn path=/trunk/; revision=3266
2001-04-07 06:58:17 +00:00
Gilbert Ramirez 9fc1e0261b Win32 build fix, show "0.5.2 (WinPcap 2.1)" as the libpcap version
for Win32, and show a slightly more informative (i.e., geared to the
user) help message when trying to capture without having WinPcap installed.

svn path=/trunk/; revision=3261
2001-04-05 05:58:05 +00:00
Guy Harris b966192f5e Try to load WinPcap only on Windows.
svn path=/trunk/; revision=3251
2001-04-03 05:55:44 +00:00
Gilbert Ramirez a817e97015 Now that WinPcap is a DLL, I can load it at run-time rather than load-time.
That means that I no longer need to distribute capture and non-capture
versions of Ethereal for Win32; one version (compiled with WinPcap headers)
can run on systems with or without WinPcap.

For systems that don't have WinPcap, instead of disabling the Capture
menu, Capture|Start brings up a dialogue informing the user that wpcap.dll
was not loadable, and gives a URL to the WinPcap home page.

svn path=/trunk/; revision=3249
2001-04-03 05:26:27 +00:00
Ed Warnicke f5cf9c8dca Added two new arguments to epan_init() and proto_init() to
allow the passing of register_all_protocols() and
register_all_protocol_handoffs() through epan_init() to proto_init().
This allows the removal of the compile time dependence of proto.c
on register.h.  Modified dftest.c, tethereal.c, and gtk/main.c to
use the new style epan_init() and depend on register.h.

svn path=/trunk/; revision=3237
2001-04-02 00:38:36 +00:00
Guy Harris c58b7b49b5 Make "comp_info_str" static in Ethereal - there's no need for it outside
"gtk/main.c" in Ethereal.

Add the GLib version to it in Ethereal, and put in the GLib version
rather than the GTK+ version in Tethereal (which isn't linked with
GTK+...).

Make it a GString; this makes the code to construct it slightly less
ugly, especially now that we're putting the GLib version in.

Fix the code for the "-D" flag in Tethereal to compile in a no-libpcap
version (in a no-libpcap version, it just says that this version of
Tethereal wasn't compiled with capture support).

svn path=/trunk/; revision=3196
2001-03-27 06:48:12 +00:00
Guy Harris 40ba2e9e61 Give Tethereal a "-D" flag, inspired by WinPcap's "-D" flag, which
prints a list of all network interfaces it found on which it can capture
(the same list as the one that shows up in the "Interface" combo box in
Ethereal's "Capture Preferences" dialog).

svn path=/trunk/; revision=3194
2001-03-27 06:16:11 +00:00
Guy Harris d055130ad2 Clear "fdata->data_src" when initializing a "frame_data" structure.
When we're done with a "frame_data" structure, free all data attached to
it.

svn path=/trunk/; revision=3182
2001-03-24 09:24:41 +00:00
Jeff Foster 45cde0fc88 Added named data sources printing support, written by Guy Harris
svn path=/trunk/; revision=3167
2001-03-23 18:44:20 +00:00
Guy Harris fd6cd6f9bc In the MSVC++ 6.0 C library, "line-buffered" doesn't mean what one might
expect - it means "same as fully-buffered".  This means that the "-l"
flag is a no-op on Windows.

Instead of setting line-buffered mode with "setvbuf()", set a flag and,
if that flag is set, flush the standard output after the information for
ever packet is printed; this isn't "line-buffered", either, but, as the
reason for doing line-buffering is to allow the output of Tethereal to
be piped to a program and to have that program see the output for a
packet as soon as the packet is seen and dissected, it should be just as
good as line-buffered.

svn path=/trunk/; revision=3047
2001-02-18 03:38:44 +00:00
Guy Harris 35a14714c0 Report failures of "pcap_stats()", as tcpdump does.
Print the "Capturing on <interface>" message, the running count of
packets captured, and error messages to the standard error in Tethereal,
so that you can pipe the output of a live capture that's printing
packets to a program or script without that script having to worry about
parsing stuff other than dissected packet summaries or details (tcpdump
does the same).

svn path=/trunk/; revision=3017
2001-02-11 21:29:03 +00:00
Guy Harris bf0a3a32d1 In Ethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, display the packet drops count as the "Drops"
value in the status line and as the "Dropped packets" statistics in the
summary dialog box, otherwise don't display it at all.

In Tethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, and if there were any dropped packets, print
out the count of dropped packets when the capture finishes.

svn path=/trunk/; revision=3016
2001-02-11 09:28:17 +00:00
Guy Harris 261f3f1a6c Check for errors when writing a capture file.
Report errors when writing or closing a capture file.

Clean up some I/O error messages.

svn path=/trunk/; revision=3011
2001-02-10 09:08:14 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Guy Harris defc02babb There's no need for a member of a "capture_file" structure holding a
compiled capture filter program, so remove it, and remove the include of
<pcap.h> from "file.h"; instead, have local "struct bpf_program"
structures where needed, and have those files that need stuff from
<pcap.h> include it.

This cleans stuff up a bit, and should eliminate a pile of compile
warnings with Visual C++ due to <pcap.h> and some GTK+/GLib header file
(or files they include) both defining "inline".

svn path=/trunk/; revision=2955
2001-01-29 00:09:38 +00:00
Guy Harris 00fcdc0900 There's no need for a member of a "capture_file" structure holding a
compiled capture filter program, so remove it, and remove the include of
<pcap.h> from "file.h"; instead, have local "struct bpf_program"
structures where needed, and have those files that need stuff from
<pcap.h> include it.

This cleans stuff up a bit, and should eliminate a pile of compile
warnings with Visual C++ due to <pcap.h> and some GTK+/GLib header file
(or files they include) both defining "inline".

svn path=/trunk/; revision=2954
2001-01-28 23:56:29 +00:00
Guy Harris b443a9295a Don't define "promisc_mode" if we weren't built with libpcap support.
svn path=/trunk/; revision=2821
2001-01-04 00:16:43 +00:00
Guy Harris 35b1907af8 Pull the code to set the fields in the "cfile.cinfo" structure into a
common routine to initialize a "column_info()" structure, shared by
Ethereal and Tethereal.

svn path=/trunk/; revision=2739
2000-12-03 22:12:21 +00:00
Guy Harris f8d8ac9df6 Tethereal includes no GUI stuff, so it doesn't need to include
"ui_util.h".

svn path=/trunk/; revision=2691
2000-11-21 23:50:56 +00:00
Gilbert Ramirez ed396d1c03 Initialize winsock as we do in Ethereal.
svn path=/trunk/; revision=2680
2000-11-20 17:08:20 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 718fe2b549 Move a "putchar('\n')" that caused an extra newline to be printed after
the protocol tree was printed.

svn path=/trunk/; revision=2586
2000-11-09 07:29:59 +00:00
Guy Harris 13a92d5410 In Tethereal, when printing summary lines, print the fields specified in
the preferences file, don't just print a wired-in list of fields.
Always print the time stamp.

svn path=/trunk/; revision=2573
2000-11-06 09:28:43 +00:00
Guy Harris 7d663fe7b0 Add a fourth choice of time format in the packet list display, which
shows the date (in YYYY-MM-DD format) as well as the time of day when
the packet arrived.

svn path=/trunk/; revision=2547
2000-11-01 08:31:36 +00:00
Guy Harris e023b751c0 Instead of failing if we can't find a netmask for the interface on which
we're capturing, just use a netmask of 0, and warn the user in Tethereal
(doing it in Ethereal would be more disruptive, and doing so only once
per interface in a session is a bit of work, as, in an "Update list of
packets in real time" capture the child process would have to tell the
parent that it couldn't get the netmask).

svn path=/trunk/; revision=2546
2000-11-01 07:38:54 +00:00
Guy Harris 7d67803a8e Get rid of a statement that should've been deleted when we started using
"compute_timestamp_diff()" to compute the difference betwen time stamps
but that wasn't deleted, causing the time difference between a frame and
the previous frame to be computed incorrectly in Tethereal.

svn path=/trunk/; revision=2543
2000-10-31 08:15:26 +00:00
Guy Harris cba377df3c Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()".  Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.

That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files.  Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).

Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.

Remove from the top-level configure script checks for things used only
in libethereal.

svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +00:00
Gerald Combs e61373a7c1 Change addresses from ethereal.zing.org to www.ethereal.com.
svn path=/trunk/; revision=2481
2000-10-08 17:16:29 +00:00
Gilbert Ramirez e69b5278aa Implement epan_dissect_new() and epan_dissect_free(). These are the
"top-level" dissectors that libepan-users call, instead of dissect_packet().
The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's
memory is not cleared until after the proto_tree is freed. (I might stuff
the proto_tree into the epan_dissect_t, too).

What remains of dissect_packet() in packet.c handles the tvbuff initialiation.
The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c
This means that "packet.c" is no longer a dissector, os it is no longer
passed to make-reg-dotc.

Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped()
and dissect_fddi_nonswapped()), the a dissector handoff routine could
be used instead of the switch statement in dissect_frame(). I'd register
a field like "wtap.encap"

svn path=/trunk/; revision=2478
2000-10-06 10:11:40 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00
Guy Harris 2ef47f9ccb Give Tethereal a "-l" flag, as tcpdump has, to make the standard output
line-buffered.

svn path=/trunk/; revision=2451
2000-09-20 08:28:54 +00:00