Commit Graph

41 Commits

Author SHA1 Message Date
Guy Harris 6b762c78a5 Rename a variable to avoid collisions with a global variable, as noted
by John Smith.

svn path=/trunk/; revision=25548
2008-06-23 20:32:50 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 4d8d477018 Move create_tempfile() to tempfile.c out of util.c. This means dumpcap
no longer needs util.c, so it no longer includes routines that use
host_ip_af(), so it no longer needs to define its own host_ip_af().

That also means dumpcap.c no longer needs to include <sys/socket.h>.

svn path=/trunk/; revision=17278
2006-02-12 21:52:18 +00:00
Ulf Lamping a7dc7c2922 enhance the comments
svn path=/trunk/; revision=16686
2005-12-05 22:28:42 +00:00
Jörg Mayer 62b7cc3043 Last set of char -> const char trivial warning fixes.
svn path=/trunk/; revision=15244
2005-08-06 14:03:14 +00:00
Jörg Mayer b972fd4658 Get rid of warnings about shadowed variables (code was ok)
svn path=/trunk/; revision=12172
2004-10-01 12:32:46 +00:00
Guy Harris fe3b7d73ed Move the base-64 routines to "epan/base64.c".
svn path=/trunk/; revision=11960
2004-09-10 23:16:00 +00:00
Guy Harris ac982aa7a5 Move the stuff to handle ASCII <-> EBCDIC conversions to
"epan/charsets.c"; other character set translation code should perhaps
go there as well.

svn path=/trunk/; revision=11958
2004-09-10 22:59:37 +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
Olivier Biot 4ee7c7faf6 As noted by Thomas Anders, the Heimdal libroken library has a base64_decode()
function with a different signature than the one defined in util.c/util.h.
For this reason, we need to rename our base64_decode() routine.

The routine is now called epan_base64_decode().

svn path=/trunk/; revision=10840
2004-05-10 22:20:24 +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
Gerald Combs fee0d98c18 Check the environment variables SSH_CONNECTION, SSH_CLIENT, REMOTEHOST,
DISPLAY, and CLIENTNAME (in that order).  If any of them are set, create
a capture filter that excludes their traffic and set it as the default.
The longer filters should be efficient without being overly long; they
may need some tweaking.

svn path=/trunk/; revision=8994
2003-11-18 04:16:28 +00:00
Tim Potter d3913cfdb1 Move the base64_decode() function somewhere where other dissectors can
use it.

svn path=/trunk/; revision=7723
2003-05-23 05:25:19 +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
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
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 9d601c6799 On Windows, use the directory in which the binary resides as the
directory in which global data files are stored.  If an installed binary
is being run, that's the correct directory for them; if a build-tree
binary is being run, the "manuf" file will be there, and you can put
other data files there as well, if necessary.

Do the same with plugins, except that, if there's no
"plugins\\{version}" subdirectory of that directory, fall back on the
default installation directory, so you at least have a place where you
can put plugins for use by build-tree binaries.  (Should we, instead,
have the Windows build procedure create a subdirectory of the "plugins"
source directory, with the plugin version number as its name, and copy
the plugins there, so you'd use the build-tree plugin binaries?)

Move "test_for_directory()" out of "util.c" and into
"epan/filesystem.c", with the other file system access portability
wrappers and convenience routines.  Fix "util.h" not to declare it - or
other routines moved to "epan/filesystem.c" a while ago.

svn path=/trunk/; revision=3858
2001-08-21 06:39:18 +00:00
Guy Harris 65dc469326 "get_home_dir()", in "epan/filesystem.c", uses
"find_last_pathname_separator()" on Win32; move the other pathname
manipulation routines from "util.c" into "epan/filesystem.c".

Remove from "util.h" the declarations of routines not defined in
"util.c", and put them into "epan/filesystem.h" if they're not already
there.

Adjust #includes to make the above work.

svn path=/trunk/; revision=3241
2001-04-02 09:53:46 +00:00
Guy Harris faf70584f2 Fix it to build on Windows.
svn path=/trunk/; revision=2488
2000-10-11 07:35:02 +00:00
Guy Harris 332d5715e8 Compute and display negative relative and delta time stamps correctly,
just in case time goes backwards (yes, it sometimes does happen in
captures).

svn path=/trunk/; revision=2407
2000-09-10 06:44:39 +00:00
Guy Harris 3d20d56999 Add a routine to check whether a file is a directory or not.
To test whether a file the user selected to be opened from the file
selection box is really a directory (so that we can point the file
selection box at it, rather than trying to open the directory as a
capture file, which wouldn't work), use the routine in question.

To make the GTK+ file selection box start out in the last directory from
which we opened a file, use "gtk_file_selection_complete()", rather than
"chdir()"ing to that directory.

Those changes keep us from "chdir()"ing all over the place; that way, if
Ethereal dumps core, the core dump shows up in the directory from which
it was run, rather than in the directory from which you last opened or
into which you last saved a file.

svn path=/trunk/; revision=2190
2000-07-31 04:53:40 +00:00
Guy Harris ca9d89b2ba In Tethereal, allow capture filters and read filters either to be
specifies with "-f" and "-R" flags, respectively, or specified with
non-flag command-line arguments, as tcpdump and snoop allow.

svn path=/trunk/; revision=1663
2000-02-22 07:07:55 +00:00
Gilbert Ramirez ea8136cd8e Remove instances of getenv("HOME") and provide a get_home_dir() function
which provides a default value if "HOME" is not set.

svn path=/trunk/; revision=1579
2000-01-29 16:41:28 +00:00
Guy Harris d1aac3e35f Provide a "get_dirname()" routine, that takes a pathname and returns
either a pointer to the directory part of the pathname (after stomping
on the pathname separator with a '\0', so don't use this on pathnames
you plan to use afterwards), or NULL if the pathname contains no
directory part, and make it handle Win32 pathnames on Win32 systems.

Use it to get the containing directory of the currently open file, so
that the "chdir()" stuff we do to cause the "File:Open" dialog box to
show you files in the directory in which you last looked works on Win32
systems.

svn path=/trunk/; revision=1555
2000-01-25 05:48:47 +00:00
Guy Harris 8e68faf22f Encapsulate the code to take a pointer to a pathname and return a
pointer to the name of the file to which it refers (i.e., to the last
component of the pathname) in a "get_basename()" routine, and have the
code in "file.c" call it.

svn path=/trunk/; revision=1552
2000-01-25 04:31:17 +00:00
Guy Harris 7f30e566a0 Move the routine to get a list of the network interfaces on the system
to "util.c", and provide a routine to free that list as well.

When picking an interface on which to do a capture (if no "-i" flag was
specified), use that routine, and pick the first interface on the list.

svn path=/trunk/; revision=1495
2000-01-16 02:48:12 +00:00
Guy Harris 80618858d6 Move the GTK+ implementations of various UI utilities out of "util.c"
into "gtk/ui_util.c", and move the declarations of those UI utilities
out of "util.h" into "ui_util.h".  (The header file is in the top-level
directory, rather than the "gtk" directory, because it declares
window-system-independent interfaces to routines with
window-system-dependent implementations.)

Add to "gtk/ui_util.c" a routine to set the window and icon title.

Use that routine to make the title of an Ethereal top-level window be

	{filename} - Ethereal

if there's a capture open, and have "{filename}" be "<capture>" if it's
a temporary capture file.

svn path=/trunk/; revision=1255
1999-12-09 07:19:20 +00:00
Gilbert Ramirez 942b69ce9a A "character encoding" variable is now set per packet. The existence
of SNA in a packet changes the character encoding from the default ASCII
to EBCDIC.

The hex-printing routines in the GUI code and in the printing code convert
to EBCDIC if appropriate.

svn path=/trunk/; revision=1089
1999-11-22 06:24:56 +00:00
Gilbert Ramirez 2dd24ea353 Add ASCII/EBCDIC conversion to TCP Follow window. Also add Close button
for ease-of-use with window managers w/o "destroy" buttons (twm).

svn path=/trunk/; revision=884
1999-10-19 04:11:23 +00:00
Guy Harris fca713e47f Make a "create_tempfile()" routine that constructs the template to be
used by "mkstemp()" into a buffer supplied as an argument, trying
several directories for the tempfile, in the same fashion that the BSD
(and probably other) "tempnam()" routines do.

Have that routine cope with temporary-file directory names that don't
end with "/", as "P_tmpdir" doesn't necessarily end with "/" (and
doesn't, in GNU "libc" 2.x, at least on Linux); thanks to Gilbert
Ramirez for catching this one, and supplying the code to cope with that.

Have the code that creates the temporary file for the "Follow TCP
Stream" text use it.

svn path=/trunk/; revision=507
1999-08-18 02:59:05 +00:00
Guy Harris 18f922b46e Improve the alert boxes put up for file open/read/write errors. (Some
influence came from

http://developer.apple.com/techpubs/mac/HIGuidelines/HIGuidelines-232.html

which has a section on dialog box and alert box messages.  However,
we're largely dealing with technoids, not with The Rest Of Us, so I
didn't go as far as one perhaps should.)

Unfortunately, it looks like it's a bit more work to arrange that, if
you give a bad file name to the "-r" flag, the dialog box pop up only
*after* the main window pops up - it has the annoying habit of popping
up *before* the main window pops up, and sometimes getting *obscured* by
it, when I do that.  The removal of the dialog box stuff from
"load_cap_file()" was intended to facilitate that work.  (It might also
be nice if, when an open from the "File/Open" menu item fails, we keep
the file selection box open, and give the user a chance to correct
typos, choose another file name, etc.)

svn path=/trunk/; revision=310
1999-06-12 09:10:20 +00:00
Gilbert Ramirez 2870ce29ce Capturing packets from ethereal now saves the capture in an "anonymous" buffer. That is, it's
a random name chosen by tempnam(), unknown to the user. If the user decides to save that
trace, he then uses File | Save to save it to a file. File | Save As lets him make a copy
of his named trace file as well. I also updated my e-mail address in the various credit
locations.

svn path=/trunk/; revision=242
1999-04-06 16:24:50 +00:00
Guy Harris f1e024b605 Move the bitfield-decoding routines to "packet.h", along with other
helper routines for packet dissecting, and away from "util.c", which is
now all GUI-related.  (Among other things, this makes life more pleasant
for Gilbert Ramirez's "tethereal" stuff, although a lot more separation
of GUI from other stuff needs to be done to make that - or a
"curses"-based variant of Ethereal, or a variant using some other GUI
toolkit - work smoothly.)

svn path=/trunk/; revision=235
1999-03-31 08:20:28 +00:00
Gilbert Ramirez ef3dfe2077 Removed all references to gtk objects from packet*.[ch] files. They now
reference the protocol tree with struct proto_tree and struct proto_item
objects. That way, the packet decoding source code file can be used with
non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged
some of the information in packet.h to more appropriate places (like other
packet-*.[ch] files).

svn path=/trunk/; revision=223
1999-03-23 03:14:46 +00:00
Gerald Combs cb1f8e34c5 * Added Joerg Mayer's Vines patch
* Added Joerg to the AUTHORS file
* Added Guy's bitfield decode patch
* Fixed time output

svn path=/trunk/; revision=142
1998-12-29 04:05:38 +00:00
Gerald Combs 349f96bb49 * Copied in the correct GNU license (I'm such a goober)
* Hacks to the filter interface (Gerald)
* About box (Laurent)
* AppleTalk support (Simon)
* Mods to the match_strval routine (Gerald)

svn path=/trunk/; revision=61
1998-10-16 01:18:35 +00:00
Gerald Combs 0758da1146 - Added match_strval function to packet.c
- Separated display and capture filters; rearranged some of the look and feel
- Lots of other miscellaneous fixes and updates

svn path=/trunk/; revision=38
1998-10-12 01:40:57 +00:00
Gerald Combs 2e7e493198 Merged in a _huge_ patch from Guy Harris. It adds a time stap column,
generalizes the column printing code, adds a "frame" tree item to
   the tree view, and fixes a bunch of miscellaneous coding bugs.

svn path=/trunk/; revision=31
1998-09-27 22:12:47 +00:00
Gerald Combs 576024f903 Added ID tags to the beginning of each source file.
svn path=/trunk/; revision=7
1998-09-16 03:22:19 +00:00
Gerald Combs 86534f46e1 Initial revision
svn path=/trunk/; revision=2
1998-09-16 02:39:15 +00:00