Commit Graph

111 Commits

Author SHA1 Message Date
Guy Harris e1b6881286 Squelch some compiler warnings.
svn path=/trunk/; revision=32165
2010-03-11 00:36:45 +00:00
Gerald Combs e648060f0f Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
2009-04-16 04:05:39 +00:00
Stig Bjørlykke 83cb48cc63 Fix a typo in a comment.
svn path=/trunk/; revision=25970
2008-08-09 16:16:52 +00:00
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
Anders Broman 3d39efc2c3 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25248
2008-05-07 05:26:40 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Michael Tüxen 3340a9f9b7 Fix get_conn_cfilter() such that not an invalid capture filter
is used on FreeBSD 7.0 systems. Now REMOTEHOST can be an
empty string. 

svn path=/trunk/; revision=24834
2008-04-07 13:22:47 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Stig Bjørlykke f6026eb978 Rewrote to use g_strlcpy and g_strlcat.
svn path=/trunk/; revision=24531
2008-03-02 21:12:24 +00:00
Stig Bjørlykke 47d744b59d More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
2008-02-03 15:38:20 +00:00
Ronnie Sahlberg e6ed260aca some more path fixes for g_ascii_strcasecmp.h
svn path=/trunk/; revision=23638
2007-11-28 01:31:23 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +00:00
Stephen Fisher 0ebc01dc03 From Sebastien Tandel:
Create two new files (ws_strsplit.[ch]) that use GTK2 code to override
the buggy g_strsplit() function when compiling for GTK1.  Include this
work-around function (ws_strsplit) in libwireshark.def.  Add notes on usage
to README.developer.  Include epan/ws_strsplit.h in all files that use
g_strsplit().


svn path=/trunk/; revision=20804
2007-02-13 20:57:22 +00:00
Guy Harris 3696f686b1 When parsing DISPLAY, mirror what __X11TransConnectDisplay() does - and
handle the case where the "host name" begins with "/", as some platforms
might allow the pathname of a UNIX domain socket to be given in DISPLAY.

Fix indentation of a comment.

svn path=/trunk/; revision=20548
2007-01-24 23:30:23 +00:00
Gerald Combs 7d95399a0d Use SESSIONNAME instead of CLIENTNAME to try to detect RDP sessions.
Look for a string that starts with "rdp".  This should take care of
cases where a default capture filter is set needlessly.

Update the docs accordingly.

svn path=/trunk/; revision=19236
2006-09-15 21:35:01 +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
Gerald Combs 18abcfc988 If "CLIENTNAME" is set (which indicates that we're using RDP) use
"not tcp port 3389" instead of "not ip host $CLIENTNAME", since it
seems to be more reliable.

Make sure we remove dumpcap.obj when we clean.

This also tests the content-type "text/plain; charset=utf-8" for commit
messages.  Maybe Stig B's name will show up correctly now.

svn path=/trunk/; revision=16826
2005-12-16 17:53:44 +00:00
Guy Harris 283fce7500 Clear up const vs. non-const warnings.
svn path=/trunk/; revision=16717
2005-12-07 09:38:57 +00:00
Ulf Lamping 937a50243c as mkstemp makes trouble and is only used once in util.c, move definition from file_util.h to util.c for now
this hopefully fixes the mkstemp problem

svn path=/trunk/; revision=16406
2005-11-07 00:20:20 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Ulf Lamping 0dc9fb3d4a various code cleanup:
-use g_snprintf instead of sprintf and snprintf
-use g_strdup_printf where appropriate
-remove #include "snprintf.h" (as only g_snprintf should be used)
-replace some more alloc/realloc/calloc/free with their glib pendants

svn path=/trunk/; revision=15264
2005-08-08 18:50:39 +00:00
Guy Harris d473807893 "setup_tmpdir()" either returns the const string passed to it, or it
returns a malloced string that's supposed to persist as long as Ethereal
is running.  Make it return "const char *", and return either the former
pointer or the result of mallocation, so we don't end up using the same
variable for a const pointer and a non-const pointer.

Make the variables to which its result is assigned const pointers as
well.

"strlen()" returns size_t; make a argument to which its result is
assigned a size_t.

Just out of paranoia, check for a zero-length string passed to
"setup_tmpdir()".

svn path=/trunk/; revision=15247
2005-08-06 18:38:35 +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
Guy Harris 0ccf418724 Add a "get_addr_name()" routine that takes an "address *" and attempts
to resolve it to a name.

Fix up some const-pointer-to-non-const-pointer, and
function-pointer-to-void-*, conversions.

Fix some comments.

svn path=/trunk/; revision=12863
2004-12-30 02:10:24 +00:00
Guy Harris f23f4ecf04 Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;
according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is.

svn path=/trunk/; revision=11972
2004-09-11 23:03:36 +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 3a583aeb59 From Albert Chin: rename resolv.{ch} to addr_resolv.{ch}, so that an
include of <resolv.h> in any system header file gets the system
<resolv.h> (needed for builds on Tru64 with GTK+ 1.2[.x]).

svn path=/trunk/; revision=11615
2004-08-06 19:57:49 +00:00
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
Jörg Mayer 021f72021e Fix automagically generated filters in case of remote login via IPv6.
This fix was picked from the source rpm of Suse 9.1.

svn path=/trunk/; revision=11234
2004-06-25 07:00:54 +00:00
Guy Harris 4934457275 Fix the other place where we construct temporary path names to use
G_DIR_SEPARATOR and G_DIR_SEPARATOR_S, to get rid of one more
horse-frightening pathname.

svn path=/trunk/; revision=10955
2004-05-22 07:50:15 +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
Gerald Combs 6687b152f1 Don't automatically set a capture filter if DISPLAY or REMOTEHOST are
"localhost" or "127.0.0.1".

svn path=/trunk/; revision=10365
2004-03-12 17:23:56 +00:00
Guy Harris 6d2f9e38dd Use G_DIR_SEPARATOR_S rather than "/" as the pathname separator when
constructing the pathname of a temporary file, so as not to frighten the
horses when they see an error message for a temporary capture file.

svn path=/trunk/; revision=10002
2004-02-07 04:25:16 +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
Ulf Lamping 3b77bfee59 removed some MSVC warnings (moved pcap.h before glib.h)
svn path=/trunk/; revision=9393
2003-12-21 12:19:39 +00:00
Gilbert Ramirez 55a6251e7c From Olivier Biot
New "matches" operater in display filter language. Uses PCRE.

If a "matches" operator is found in a dfilter
while libpcre has not been used to build the binary, then an
exception is thrown after using dfilter_fail() to set an apporporiate
error message.

svn path=/trunk/; revision=9182
2003-12-06 16:35:20 +00:00
Gerald Combs 4306925479 Don't automatically fill in a capture filter if CLIENTNAME is set to
"Console".

svn path=/trunk/; revision=9130
2003-12-01 20:27:09 +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
Gerald Combs 031db8b9c8 From Gisle Vanem:
* Added a new function get_file_in_temp() to
  epan/filesystem.c. This because of asn1.dll plugin which
  had code to write to a log-file "c:\temp\ethereal.log". I feel
  this patch makes this safer; I don't even have a c:\temp dir.

* Patched packet-asn1.c to use get_file_in_temp().

* Added some #undef to packet-snmp.c to silence gcc.

* Changed "%u" -> "%lu" formats in util.c

Rename get_file_in_temp() to get_tempfile_path() to match other function
names.

svn path=/trunk/; revision=8859
2003-11-02 23:12:35 +00:00
Guy Harris 4c858d1ae7 Include <windows.h> so that OSVERSIONINFO and the like are defined on
Windows.

svn path=/trunk/; revision=8841
2003-10-31 07:57:22 +00:00
Guy Harris 8e51328bc2 Get the version number of the libpcap/WinPcap with which we're running
with "pcap_lib_version()", if available.

svn path=/trunk/; revision=8656
2003-10-10 06:05:48 +00:00
Guy Harris 8649fcf232 From Gisle Vanem: MingW declares "rint()" in <math.h> and defines it in
a library, and declares "mode_t" in <sys/types.h>.

svn path=/trunk/; revision=8185
2003-08-18 18:41:25 +00:00
Guy Harris 48b1ab757e From smhuang [AT] pcs.csie.nctu.edu.tw: fix a "g_string_append()" call.
svn path=/trunk/; revision=8014
2003-07-11 06:46:00 +00:00
Guy Harris 7ca62c9ece Fixes to get it to compile on Win32.
svn path=/trunk/; revision=7878
2003-06-13 22:22:48 +00:00
Guy Harris 626b7e21ea On Win32, say "without WinPcap" rather than "without libpcap" (although
it's unlikely that somebody would build without WinPcap - they'd
currently have to manually tweak config.h.win32; we can do the same
trick there that we do with ADNS).

svn path=/trunk/; revision=7877
2003-06-13 20:40:31 +00:00
Guy Harris 31d4df4a8f Do run-time word-wrapping on the "Compiled with" message, rather than
wiring the line boundaries in.

On Win32, say "with WinPcap" rather than "with libpcap", and report both
on whether we were compiled with WinPcap and whether we were able to
load WinPcap.

svn path=/trunk/; revision=7876
2003-06-13 20:03:50 +00:00
Guy Harris 896eee275d Put in a missing comma.
svn path=/trunk/; revision=7869
2003-06-13 03:43:44 +00:00
Gerald Combs 34f3a83862 Add ADNS to the "Compiled with" list. Wrap at the SNMP library part since
the line was getting long.

svn path=/trunk/; revision=7747
2003-05-26 22:55:43 +00:00