aboutsummaryrefslogtreecommitdiffstats
path: root/util.h
AgeCommit message (Collapse)AuthorFilesLines
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-02-12Move create_tempfile() to tempfile.c out of util.c. This means dumpcapGuy Harris1-8/+0
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
2005-12-05enhance the commentsUlf Lamping1-7/+25
svn path=/trunk/; revision=16686
2005-08-06Last set of char -> const char trivial warning fixes.Jörg Mayer1-1/+1
svn path=/trunk/; revision=15244
2004-10-01Get rid of warnings about shadowed variables (code was ok)Jörg Mayer1-1/+1
svn path=/trunk/; revision=12172
2004-09-10Move the base-64 routines to "epan/base64.c".Guy Harris1-2/+0
svn path=/trunk/; revision=11960
2004-09-10Move the stuff to handle ASCII <-> EBCDIC conversions toGuy Harris1-5/+0
"epan/charsets.c"; other character set translation code should perhaps go there as well. svn path=/trunk/; revision=11958
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
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-05-10As noted by Thomas Anders, the Heimdal libroken library has a base64_decode()Olivier Biot1-2/+2
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-01-11Rename DISSECTOR_HELPER_{SRC,OBJECTS} toGuy Harris1-13/+1
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
2003-11-18Check the environment variables SSH_CONNECTION, SSH_CLIENT, REMOTEHOST,Gerald Combs1-1/+4
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-05-23Move the base64_decode() function somewhere where other dissectors canTim Potter1-1/+3
use it. svn path=/trunk/; revision=7723
2003-03-12Change the version messages to put the "compiled with" stuff on aGuy Harris1-3/+9
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-08Put the code to get version numbers of various libraries with whichGuy Harris1-1/+7
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
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-4/+4
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2001-11-09Wrap calls to "pcap_datalink()" in a routine that attempts to compensateGuy Harris1-13/+1
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-08-21On Windows, use the directory in which the binary resides as theGuy Harris1-35/+2
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-04-02"get_home_dir()", in "epan/filesystem.c", usesGuy Harris1-5/+1
"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
2000-10-11Fix it to build on Windows.Guy Harris1-1/+8
svn path=/trunk/; revision=2488
2000-09-10Compute and display negative relative and delta time stamps correctly,Guy Harris1-1/+4
just in case time goes backwards (yes, it sometimes does happen in captures). svn path=/trunk/; revision=2407
2000-07-31Add a routine to check whether a file is a directory or not.Guy Harris1-1/+14
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-02-22In Tethereal, allow capture filters and read filters either to beGuy Harris1-1/+7
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-01-29Remove instances of getenv("HOME") and provide a get_home_dir() functionGilbert Ramirez1-1/+5
which provides a default value if "HOME" is not set. svn path=/trunk/; revision=1579
2000-01-25Provide a "get_dirname()" routine, that takes a pathname and returnsGuy Harris1-1/+11
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-25Encapsulate the code to take a pointer to a pathname and return aGuy Harris1-1/+3
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-16Move the routine to get a list of the network interfaces on the systemGuy Harris1-1/+13
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
1999-12-09Move the GTK+ implementations of various UI utilities out of "util.c"Guy Harris1-17/+1
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-11-22A "character encoding" variable is now set per packet. The existenceGilbert Ramirez1-1/+3
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-10-19Add ASCII/EBCDIC conversion to TCP Follow window. Also add Close buttonGilbert Ramirez1-1/+4
for ease-of-use with window managers w/o "destroy" buttons (twm). svn path=/trunk/; revision=884
1999-08-18Make a "create_tempfile()" routine that constructs the template to beGuy Harris1-1/+3
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-06-12Improve the alert boxes put up for file open/read/write errors. (SomeGuy Harris1-7/+1
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-04-06Capturing packets from ethereal now saves the capture in an "anonymous" ↵Gilbert Ramirez1-1/+7
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-03-31Move the bitfield-decoding routines to "packet.h", along with otherGuy Harris1-11/+1
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-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-2/+1
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
1998-12-29* Added Joerg Mayer's Vines patchGerald Combs1-1/+10
* Added Joerg to the AUTHORS file * Added Guy's bitfield decode patch * Fixed time output svn path=/trunk/; revision=142
1998-10-16* Copied in the correct GNU license (I'm such a goober)Gerald Combs1-2/+2
* 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-12- Added match_strval function to packet.cGerald Combs1-2/+8
- 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-09-27Merged in a _huge_ patch from Guy Harris. It adds a time stap column,Gerald Combs1-3/+1
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-16Added ID tags to the beginning of each source file.Gerald Combs1-0/+2
svn path=/trunk/; revision=7
1998-09-16Initial revisionGerald Combs1-0/+49
svn path=/trunk/; revision=2