Commit Graph

435 Commits

Author SHA1 Message Date
Anders Broman 84370fffcb Add *.sbr files to the clean target.
svn path=/trunk/; revision=40762
2012-01-29 20:21:30 +00:00
Gerald Combs 3c1b8a6ca1 Add a "-G ftypes" option, which dumps our supprted FT_… names and
descriptions. Captitalize and fix up the descriptions. Use its output to
create the field type list in the wireshark-filter man page.

svn path=/trunk/; revision=40306
2011-12-27 20:35:41 +00:00
Martin Mathieson 82186b84df Make some variables volatile to avoid warnings with my gcc version.
svn path=/trunk/; revision=39753
2011-11-08 14:32:13 +00:00
Stig Bjørlykke 42376edbac Do not return from within a TRY/CATCH/ENDTRY because this will make the
except stack invalid, and will lead to a crash.

In this case it was when doing compare functions on a FT_PROTOCOL.

svn path=/trunk/; revision=39749
2011-11-07 16:09:41 +00:00
Stig Bjørlykke 8b0be9ad63 Fixed max and min in sint24_from_unparsed() again.
Note to self: don't think hex while doing something else...

svn path=/trunk/; revision=39664
2011-10-29 09:00:18 +00:00
Stig Bjørlykke 760813589c Fixed max and min in sint24_from_unparsed().
svn path=/trunk/; revision=39662
2011-10-28 20:57:46 +00:00
Stig Bjørlykke 67c6b90fd9 Fixed a typo: strtoull() -> strtoul()
svn path=/trunk/; revision=39661
2011-10-28 20:32:42 +00:00
Stig Bjørlykke a52bf4edc5 Simplified code for checking integer ranges.
svn path=/trunk/; revision=39660
2011-10-28 20:30:41 +00:00
Stig Bjørlykke 3e241efba3 Added range checking for integers and give an appropriate error
message if value is outside of range (given by field type).

svn path=/trunk/; revision=39659
2011-10-28 20:14:13 +00:00
Stig Bjørlykke 4a902dca46 Fixed compare functions for 64 bits integers:
- Do not cast unsigned values to signed
- Do cast signed values from the internal stored unsigned

svn path=/trunk/; revision=39601
2011-10-26 08:34:10 +00:00
Bill Meier 14dd4c3c8d Convert "4 space tabs" to spaces;
Fix vi edtor modeline so it works.

svn path=/trunk/; revision=39075
2011-09-21 16:41:14 +00:00
Anders Broman d785c79f88 From Jakub Zawadzki :
Add support for prefix in IPv6 address filter.
 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5538

svn path=/trunk/; revision=38916
2011-09-07 11:03:47 +00:00
Stig Bjørlykke 5603cef9f2 Remove support for libpcre, we use GRegex in GLib.
svn path=/trunk/; revision=38683
2011-08-23 09:25:06 +00:00
Anders Broman 42a4b2776e From Dirk:
support ISO style date and time for frame.time filter

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6086

svn path=/trunk/; revision=38233
2011-07-28 05:49:47 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Guy Harris 053c583fda Add some additional routine variants that handle string encodings, and
make FT_STRING and FT_UINT_STRING handle string encodings.

Get rid of FT_EBCDIC in favor of FT_STRING with ENC_EBCDIC.

Add some URLs for DRDA.

Clean up some stuff in TN3270 and TN5250, including using ENC_ values
for proto_tree_add_item().

svn path=/trunk/; revision=37909
2011-07-05 23:59:23 +00:00
Stig Bjørlykke e4d168c5dc Please don't use prohibited APIs in new code:
sprintf -> g_snprintf

Fixes coverity 1197 & 1198.

svn path=/trunk/; revision=37664
2011-06-14 20:37:53 +00:00
Guy Harris f153eb070b Cast away some warnings about alignment; ep_alloc() guarantees
sufficient alignment for all types of data.

svn path=/trunk/; revision=37190
2011-05-16 21:42:49 +00:00
Jakub Zawadzki 17f6352c2e Convert SLAB_-s, to sl_-API.
svn path=/trunk/; revision=37030
2011-05-09 12:52:55 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector 
* Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name
* Update Documentation (README.dev)
* Add new function in libwireshark.def
* Support of encoding for tvb_eui64_to_str
* Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector

svn path=/trunk/; revision=37015
2011-05-08 10:23:53 +00:00
Gerald Combs b223e99e5a get_host_ipaddr() was returning numeric addresses in host byte order
and hostnames in network byte order. Have it return everything in
network byte order.

svn path=/trunk/; revision=36873
2011-04-26 17:13:37 +00:00
Chris Maynard 7b43d9c705 Use g_snprintf instead of sprintf: (Part of) Covertiy 665.
svn path=/trunk/; revision=36600
2011-04-12 18:29:52 +00:00
Bill Meier d3efa3ed9f A bit of Windows makefiles rework and cleanup:
- Define macros for certain CFLAGS in config.nmake iso of having defs in each makefile;
  a. -DHAVE_CONFIG_H and -D_U_="" are now part of a macro named STANDARD_CFLAGS;
  b. -WX has been replaced by WARNINGS_ARE_ERRORS (defined as -WX in config.nmake)
      (This allows disabling "Warnings as Errors" by just changing config.nmake)
  c. CVARSDLL definitions (not usage) have been removed from the various makefiles.
     XXX: It appears the usage of CVARSDLL can also be removed (not yet done) since:
     -DWIN32 and -DNULL=0 do not appear to be needed (any more);
     -D_MT and _D_DLL  are not needed since /MP causes these definitions.
  d. Define a macro WARNINGS_CFLAGS with additional specific compiler (level4) warnings to be enabled.
     E.G., 4295: array is too small to include a terminating null character
- config.nmake: reformat some long lines for readability;
- plugins\Makefile.nmake: clean-deps does nothing: remove it (and usage in top-level makefile);
- dissectors/Makefile.nmake: test to enable packet-rrc.obj target needs to include MSVC2010 ...

svn path=/trunk/; revision=35747
2011-02-02 01:19:53 +00:00
Stig Bjørlykke fcc9f7a569 Protect tvb_* functions in a TRY-CATCH block.
This fixes bug 5087.

svn path=/trunk/; revision=33735
2010-08-08 19:04:35 +00:00
Jeff Morriss 47e2d75820 Move some code (including the optional objects) into libwsutil
svn path=/trunk/; revision=33012
2010-05-28 20:19:55 +00:00
Guy Harris 927b7da346 Have abs_time_to_str() and abs_time_to_str_secs() take an additional
argument indicating whether to include the time zone in the string.  If
we're constructing a display filter, don't include the time zone,
otherwise do.  Fixes bug 4756.

svn path=/trunk/; revision=32913
2010-05-21 06:33:25 +00:00
Bill Meier 8f7aa8dfd8 (Trivial) Use consistent indentation.
svn path=/trunk/; revision=32773
2010-05-12 17:34:11 +00:00
Jaap Keuter 23b4509d1b Straighten out field type names.
svn path=/trunk/; revision=32765
2010-05-11 21:46:17 +00:00
Bill Meier 7130d39b06 (Trivial) Fix a typo & some indentation
svn path=/trunk/; revision=32724
2010-05-08 16:12:29 +00:00
Guy Harris 06a24aaa7e Pick up other check from the almost-identical routine in
epan/dfilter/scanner.l.

(The common code should be in a utility routine.)

svn path=/trunk/; revision=32619
2010-04-30 21:55:42 +00:00
Guy Harris d57979b197 Fix comment.
svn path=/trunk/; revision=32618
2010-04-30 21:51:47 +00:00
Jeff Morriss 1b6b831daf Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1696 :
The change put in with rev 11382 meant that, on 64-bit systems, we could not
parse negative numbers into integers (since -1 taken as an unsigned 64-bit
number is (significantly) larger than G_MAX_UINT32).

To fix this, split the val_from_unparsed() routine for integers into two
routines: one for signed and one for unsigned; each routine can then do the
appropriate "is this bigger than what fits in a *32?" test.

svn path=/trunk/; revision=32616
2010-04-30 21:40:39 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Anders Broman 4e66c899d1 From Jakub Zawadzki:
Optimizations.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4303

svn path=/trunk/; revision=31967
2010-02-23 19:28:38 +00:00
Bill Meier e0064797fb Use more unique names for certain enum constants.
(enum constant names are part of the global name space).
(Fixes at least one gcc -Wshadow warning).

svn path=/trunk/; revision=31572
2010-01-19 19:37:03 +00:00
Gerald Combs b33e11a0e9 Fix our match flags.
svn path=/trunk/; revision=31303
2009-12-18 01:25:46 +00:00
Gerald Combs 7c0dc5d7e7 If we don't have PCRE and we do have GLib >= 2.14, use GRegexes for the
"matches" operator.

svn path=/trunk/; revision=31302
2009-12-18 01:15:08 +00:00
Guy Harris 4fde145bd2 Add an argument to abs_time_to_str() and abs_time_secs_to_str()
indicating whether the time should be shown as local time or UTC.  For
now, always pass FALSE, meaning "show as local time".

Clean up some stuff in the SNMP dissector, use abs_time_secs_to_str()
for times with one-second resolution, and update a comment in various
macros in the WSP dissector, while we're at it.

svn path=/trunk/; revision=31227
2009-12-10 22:19:29 +00:00
Jörg Mayer ec7380a6b1 Creatig static sublibs was not a good idea:
=========================================================================
 "du -s build" with sublibs:
 396868  build
 -----------------------------------
 "du -s build" without sublibs:
 197588  build/
 =========================================================================
 tshark with sublibs:
 -rwxr-xr-x 1 jmayer users 27399706 2009-10-11 08:39 tshark*
 -----------------------------------
 tshark without sublibs:
 -rwxr-xr-x 1 jmayer users  226748 2009-10-11 09:05 tshark*
 =========================================================================

So undo the following patches:

 ------------------------------------------------------------------------
 r30459 | krj | 2009-10-10 07:08:48 +0200 (Sa, 10 Okt 2009) | 1 line
 
 Sort subdirectories alphabetically
 ------------------------------------------------------------------------
 r30458 | krj | 2009-10-10 07:03:36 +0200 (Sa, 10 Okt 2009) | 1 line
 
 Add epan/dissectors/CMakeLists.txt which creates a static dissectors library
 ------------------------------------------------------------------------
 --> readd!! *** r30443 | krj | 2009-10-09 21:43:42 +0200 (Fr, 09 Okt 2009) | 1 line
 
 Rename DISSECTOR_ASM_UTILS to LIBWIRESHARK_ASM_FILES since these files belongs to ep
 an not dissectors
 ------------------------------------------------------------------------
 r30442 | krj | 2009-10-09 21:17:26 +0200 (Fr, 09 Okt 2009) | 1 line
 
 Add epan/ftypes/CMakeLists.txt which creates a static ftypes library
 ------------------------------------------------------------------------
 r30441 | krj | 2009-10-09 21:13:01 +0200 (Fr, 09 Okt 2009) | 1 line
 
 Add epan/dfilter/CMakeLists.txt which creates a static dfilter library
 ------------------------------------------------------------------------
 r30440 | krj | 2009-10-09 21:05:29 +0200 (Fr, 09 Okt 2009) | 1 line
 
 Add epan/crypt/CMakeLists.txt which creates a static crypt library
 ------------------------------------------------------------------------
 r30439 | krj | 2009-10-09 20:22:22 +0200 (Fr, 09 Okt 2009) | 1 line
 
 Add epan/crc/CMakeLists.txt which creates a static crc library
 ------------------------------------------------------------------------

To avoid merge problems, I needed to revert r30443 as well, will readd this
one in my next patch.

svn path=/trunk/; revision=30494
2009-10-11 07:28:26 +00:00
Kovarththanan Rajaratnam b04e327795 Add epan/ftypes/CMakeLists.txt which creates a static ftypes library
svn path=/trunk/; revision=30442
2009-10-09 19:17:26 +00:00
Kovarththanan Rajaratnam 56b8d36e03 Introduce a few FT_XXX lengths defines and use those instead of hard coding constants
svn path=/trunk/; revision=29846
2009-09-10 18:22:33 +00:00
Kovarththanan Rajaratnam 48069c2b01 Use the correct type, that is GByteArray instead of GString. The reason why this 'worked' before (on non-64bit platforms that is):
struct _GString
{
  gchar  *str;
  gsize len;    
  gsize allocated_len;
};

And:

struct _GArray
{
  gchar *data;
  guint len;
};

We only accessed the first two fields of the GString struct.

svn path=/trunk/; revision=29841
2009-09-10 14:37:09 +00:00
Kovarththanan Rajaratnam aaa6d87cf0 Remove unused field
svn path=/trunk/; revision=29840
2009-09-10 13:52:36 +00:00
Kovarththanan Rajaratnam cd49063473 Revert r29614 until I figure out why buildbot doesn't like it
svn path=/trunk/; revision=29615
2009-08-29 07:53:48 +00:00
Kovarththanan Rajaratnam cc948586bf Use G_STRINGIFY/G_PASTE
svn path=/trunk/; revision=29614
2009-08-29 06:42:23 +00:00
Bill Meier 94f28dd8f9 (FWIW) One step towards including stdio.h & stdlib.h only when req'd.
svn path=/trunk/; revision=29568
2009-08-26 19:27:49 +00:00
Anders Broman 67d6f5976e Move th /MP flag setting to LOCAL_CFLAGS set in configure.nmake
for MSVC variant 2008 only. As suggested by Bill Meier.

svn path=/trunk/; revision=29114
2009-07-16 08:27:18 +00:00
Anders Broman 91caa01090 Add /MP flag to make use of multi cores.
svn path=/trunk/; revision=29104
2009-07-15 20:55:31 +00:00
Guy Harris ad33ca6c2f Clean up some 64-bit issues.
svn path=/trunk/; revision=28117
2009-04-22 03:07:37 +00:00
Guy Harris 02c7132ea4 Some more P64 fixes - they all assume we don't have truly gigantic
strings.

svn path=/trunk/; revision=27720
2009-03-15 02:57:16 +00:00
Stig Bjørlykke 62f60df6b4 From Jakub Zawadzki (bug 3331):
g_free() is NULL safe, so we don't need check against it.

svn path=/trunk/; revision=27718
2009-03-13 22:06:48 +00:00
Bill Meier 42d8daee19 #include <epan/emem.h> not req'd ...
svn path=/trunk/; revision=27391
2009-02-07 15:17:54 +00:00
Balint Reczey 41723a5ef2 Signal error on field values that cannot be safely represented as strings instead of crashing.
This fixes bug 2845.

svn path=/trunk/; revision=26749
2008-11-11 13:32:51 +00:00
Guy Harris 35ce35ebf5 Include the new Makefile.common file.
svn path=/trunk/; revision=25659
2008-07-02 02:18:53 +00:00
Guy Harris a04774395f Add Makefile.common files for epan/dfilter and epan/ftypes.
Add checkapi rules to Makefile.am files.

svn path=/trunk/; revision=25656
2008-07-02 01:44:30 +00:00
Guy Harris b6e20d89be Put printf into a separate "termoutput" API group. For most files,
check for it - but not for TShark plugins, as they are expected to
print to the standard output.

svn path=/trunk/; revision=25653
2008-07-01 21:13:32 +00:00
Anders Broman 09a741cb17 Add FT_INT64 to IS_FT_INT and FT_UINT_64 to IS_FT_UINT.
svn path=/trunk/; revision=25623
2008-06-28 17:23:07 +00:00
Stig Bjørlykke dd6c6af3e4 Rename some variables to avoid shadowing warnings.
svn path=/trunk/; revision=25543
2008-06-23 20:23:29 +00:00
Guy Harris 160a305efa g_ascii_strtoull() is in GLib 2.2 and later, and we require GLib 2.4 or
later, so there's no longer any need to have our own g_ascii_strtoull.

svn path=/trunk/; revision=25423
2008-06-04 01:30:40 +00:00
Guy Harris caa183b45b We require GLib 2.4 or later, and they define G_MININT32, G_MAXIN32,
G_MAXUINT32, and G_MAXUINT64; don't check whether we need to define them
ourselves.

svn path=/trunk/; revision=25420
2008-06-03 23:57:47 +00:00
Anders Broman 2640b786f4 Fix run checkapi for more targets.
svn path=/trunk/; revision=25414
2008-06-03 05:35:19 +00:00
Jeff Morriss 73c7570102 Undo rev 24518 and (re)fix http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2291 .
svn path=/trunk/; revision=25327
2008-05-20 14:30:01 +00:00
Stig Bjørlykke 5ccc52fbb6 From Alex deVries (bug 2486):
This adds fpSyncFork and fpSyncDir functionality to the AFP dissector.

svn path=/trunk/; revision=25142
2008-04-21 21:36:11 +00:00
Stig Bjørlykke 6f89fd00d0 Corrected ne operator for FT_BYTES.
svn path=/trunk/; revision=25126
2008-04-20 22:34:47 +00:00
Jeff Morriss bc580e1aa0 All our programs link against glib so don't there's no need to link our libraries against it too. This should allow us to build Wireshark (with dynamic libs) with static glib (read: it should fix the OS X buildbot building with glib-1.2).
svn path=/trunk/; revision=24518
2008-03-01 12:14:38 +00:00
Stephen Fisher a97304bd26 Fix typo in comment
svn path=/trunk/; revision=24288
2008-02-08 05:45:46 +00:00
Stig Bjørlykke 28ae535b00 Removed even more "statement not reached" warnings.
svn path=/trunk/; revision=24286
2008-02-07 15:44:45 +00:00
Stig Bjørlykke c6af1bfdd4 Removed some "statement not reached" warnings.
svn path=/trunk/; revision=24282
2008-02-07 12:14:40 +00:00
Stig Bjørlykke 6d4a2e7ebf Changed email address for Gerald from zing.org to wireshark.org
in a lot of files, which I suppose is correct.

svn path=/trunk/; revision=24034
2008-01-08 22:54:51 +00:00
Guy Harris 9aa28e3176 At least on some LP64 platforms (such as OpenBSD 4.2 on x86-64),
PRI[dux]64 use "ll", but gint64 and guint64 are "long" and "unsigned
long", not "long long" or "unsigned long long", and the compiler warns
about using "%ll[doux]" with "long" or "unsigned long".  Use
G_GINT64_MODIFIER instead.

svn path=/trunk/; revision=23760
2007-12-05 09:05:52 +00:00
Stephen Fisher 849e628334 Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.


svn path=/trunk/; revision=23503
2007-11-19 21:27:01 +00:00
Guy Harris d913f45ef1 Fix bug 1956 - make the bitwise-AND routine treat its arguments as being
IPv4 addresses.  Also, rename that routine to cmp_bitwise_and(), as it's
not working on bit strings.

svn path=/trunk/; revision=23375
2007-11-06 09:19:59 +00:00
Guy Harris 69ba6c7762 The "bitwise AND" display filter operator is supposed to evaluate to
TRUE if the result of the operation has any bit set; that means that the
test should stop and return TRUE as soon as it finds two bytes that when
ANDed together are non-zero, and return FALSE if no such byte was found.

The other test functions don't have "_bytes" in the routine name; don't
put it into this one.

svn path=/trunk/; revision=23374
2007-11-06 08:46:57 +00:00
Luis Ontanon bcd55f4c8e replace oid_to_str_buf() and oid_to_str()
fix a potential buffer overflow due to a very liberal estimate by oid_repr_len()


svn path=/trunk/; revision=22659
2007-08-25 17:29:55 +00:00
Jörg Mayer b16106f89f Only #deinfe __USE_XOPEN if not already defined. On my Suse 10.2 it was
already #defined to 1, so this would create a warning/error.


svn path=/trunk/; revision=21508
2007-04-22 20:04:34 +00:00
Stephen Fisher 62f88a4a04 From Sebastien Tandel:
(Temporarily disable the warnings as errors default on Unix to get
to get the buildbots and people with gcc40 going again until those
additional warnings gcc40 generates can be fixed-I'm working on it
ASAP)

   Patch for configure.in which disables by default the treatment of
warnings as errors.
It can be enabled with './configure --with-warnings-as-errors'.
The macro will test first if GCC is present. If it's the case,
HAVE_WARNINGS_AS_ERRORS is defined. All the USING_GCC have been replaced
by HAVE_WARNINGS_AS_ERRORS.
With this switch, people won't suffer from unexpected warnings when
downloading svn sources during the transition time ;)


svn path=/trunk/; revision=21153
2007-03-23 17:49:59 +00:00
Stephen Fisher 84c5becd89 Add -Werror for gcc to a few more directories and fix a few warnings
svn path=/trunk/; revision=21129
2007-03-22 23:24:13 +00:00
Ulf Lamping dcb1e1bdfd add "treat warnings as errors" flag(s)
svn path=/trunk/; revision=21125
2007-03-22 22:54:00 +00:00
Bill Meier 04d29de81d Fix Windows Makefiles so clean removes all pdb files (PDB_FILE no longer defined)
svn path=/trunk/; revision=21052
2007-03-18 15:36:22 +00:00
Bill Meier 09f508b57b A few more ethereal --> wireshark
svn path=/trunk/; revision=20559
2007-01-26 01:34:29 +00:00
Martin Mathieson 806cf80659 Remove extra element.
svn path=/trunk/; revision=20477
2007-01-18 13:13:55 +00:00
Martin Mathieson 5d32fd280e Missed this one (I don't build with pcre)
svn path=/trunk/; revision=20474
2007-01-18 11:44:24 +00:00
Martin Mathieson 997e5415f9 Add separate union entries to fvalue.value for signed and unsigned
32-bit numbers.  Separate signed and unsigned accessors have been
added and used where appropriate.

Definitely not for 0.99.5.

svn path=/trunk/; revision=20472
2007-01-18 11:02:26 +00:00
Ronnie Sahlberg 95e50279ab since all callers to fvalue_set for FT_STRING[Z] use already_copied==FALSE we now assert that this is the case in ftype-string.c and no longer have a conditional whetehr to create a local copy or not.
svn path=/trunk/; revision=20246
2006-12-30 00:57:46 +00:00
Jaap Keuter 4a780726ce Reverse commit 20209, breaking the build across the board.
svn path=/trunk/; revision=20210
2006-12-24 16:12:04 +00:00
Ronnie Sahlberg 017fdab8a1 make the PCRE ftype use ep allocated memory instead of g_malloced memory
svn path=/trunk/; revision=20209
2006-12-23 21:17:32 +00:00
Ronnie Sahlberg 44535d37b2 make ipv4 ftype use cheap ep_ memory isntead of slightly less cheap g_ memory
for the temporary storage while parsing


svn path=/trunk/; revision=20205
2006-12-23 00:10:49 +00:00
Ronnie Sahlberg 8fc740a53e hmm
best to revert this for a while.



revert all changes from previous patch.



svn path=/trunk/; revision=20195
2006-12-22 09:01:12 +00:00
Ronnie Sahlberg 8433f6d589 change some slab allocated memory into ep/emem allocated structures instead.
this primarily removes code and simplifies (==eliminates) the need to track the data that is allocated and should potentially be slightly faster than a slab allocator.
however these functions are called A LOT so there might be a performance hit when using emem with full debugging canary values and all the bells and whistles activated.


this change also makes any future attempt to parallellize dissection of frames easier if we just make the ep allocator allocate from a threads specific ep pool.
(something we would have to do anyway to make ep allocations multithreaded)



this works in all my tests so far but needs more test coverage.



svn path=/trunk/; revision=20194
2006-12-22 08:35:43 +00:00
Guy Harris 5123a82b3c Fix bytes_repr_len() to correctly handle a zero-length FT_BYTES field
svn path=/trunk/; revision=19863
2006-11-07 20:30:34 +00:00
Tomas Kukosa d89ef87534 Bug 1053: New SNMP filtering is broken
Do not try to parse OID as hexbytes string

svn path=/trunk/; revision=19772
2006-11-02 08:48:58 +00:00
Gerald Combs f7e38bd5e6 Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variable
definition in the Catapult DCT2000 code.

svn path=/trunk/; revision=18524
2006-06-20 18:30:54 +00:00
Gerald Combs b15974d094 libethereal -> libwireshark. idl2eth -> idl2wrs. There are a _lot_ of
changes here.  It compiles OK on OS X, but hasn't been tested anywhere else.

svn path=/trunk/; revision=18260
2006-05-31 00:23:01 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Gilbert Ramirez e3899ed4a4 Add infrastructure for display filter functions.
Add upper() and lower() display filter functions for string fields.

svn path=/trunk/; revision=18071
2006-05-02 14:26:17 +00:00
Guy Harris 7db8eea5c6 Make the GUIDs in various data structures e_guid_t's rather than arrays
of 16 bytes.  Use "sizeof" for the size of e_guid_t's, and use structure
assignment to copy GUID values.

Make functions such as append_h225ras_call() and new_h225ras_call() take
pointers to e_guid_t's as arguments.

Define GUID_LEN in epan/guid-utils.h and use it as the length of a GUID
in a packet.  (Note that "sizeof e_guid_t" is not guaranteed to be 16,
although it is guaranteed to be the size of an e_guid_t.)

When constructing a display filter that matches a GUID, use
guid_to_str() to construct the string for the GUID.

svn path=/trunk/; revision=17676
2006-03-19 20:45:45 +00:00
Jörg Mayer 7e40853dbb propset...
svn path=/trunk/; revision=17574
2006-03-11 01:45:42 +00:00
Tomas Kukosa 082627bdb5 few warnings from GUID handling avoided
svn path=/trunk/; revision=17568
2006-03-10 14:14:39 +00:00
Tomas Kukosa 923855bb20 new FT_GUID handling - big/little endian supported
svn path=/trunk/; revision=17566
2006-03-10 11:58:22 +00:00
Jaap Keuter 7f2b94c59b Fix bug 764. Always initialize the members of the tuple on creation.
svn path=/trunk/; revision=17390
2006-02-23 21:22:54 +00:00
Tomas Kukosa c41cac4285 mark unused parameter
svn path=/trunk/; revision=16700
2005-12-06 12:50:11 +00:00
Tomas Kukosa dcae7d303f new field type FT_OID for OBJECT IDENTIFIERs
svn path=/trunk/; revision=16652
2005-12-02 13:16:58 +00:00
Guy Harris 30b5f0f493 Fix usage of PRI[du]64 - they just replace the "letter" part of the
format, they don't include the "%".

svn path=/trunk/; revision=16384
2005-11-03 04:30:35 +00:00
Guy Harris cbce856e9e When printing the code for a display filter:
print register numbers as unsigned (they're guint32);

	when printing a PUT_FVALUE instruction, show the value as well
	as the type of the value.

That requires that a bunch of types get to_repr methods; add them for
PCRE (FTREPR_DFILTER-only - show the regular expression as text),
tvbuffs (FTREPR_DFILTER_only - show the data as a hex string), integral
types, string types other than FT_STRING, and FT_IPv6.

That means we can use fvalue_to_string_repr() for FT_IPXNET and FT_IPv6
in proto_construct_dfilter_string(), and that we don't need to handle
integer and floating types specially in MATE.

Fix some problems with the PCRE execution code for tvbuff types.

svn path=/trunk/; revision=16369
2005-10-31 02:42:22 +00:00
Guy Harris 0be296b711 "XXX.XXX.XXX.XXX" is 15 characters, not 14 characters.
svn path=/trunk/; revision=16366
2005-10-30 22:55:30 +00:00
Guy Harris f6ef22c553 Have show_exception() take a "const char *" as its exception message,
and not free the string to which it points.  Pass to
REPORT_DISSECTOR_BUG() strings allocated with ep_strdup_printf(), so
that they're freed automatically.

svn path=/trunk/; revision=16039
2005-09-28 16:16:37 +00:00
Guy Harris aeb8645a56 "strlen()" returns a "size_t"; use that for its return value.
Cast the argument to <ctype.h> macros to "guchar", so that if the 8th
bit is set in the byte, it doesn't get sign-extended.

svn path=/trunk/; revision=15691
2005-09-05 21:18:06 +00:00
Tomas Kukosa 55d8c5cb79 filter expression can contain GUID in XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX form now
svn path=/trunk/; revision=15656
2005-09-01 10:52:33 +00:00
Jörg Mayer 96adc5f4a1 - Include the .h files in their .c files.
- Remove epan/dissectors/packet-sna.h, it isn't used anywhere.

svn path=/trunk/; revision=15475
2005-08-20 16:19:22 +00:00
Anders Broman 6fdb974570 From Richard van der Hoff
negative relative time fixes.

svn path=/trunk/; revision=15407
2005-08-18 12:55:01 +00:00
Jörg Mayer 8433afe23b Albert Chin:
Don't include epan/gdebug.h

Now that epan/gdebug.h is unused: remove it

svn path=/trunk/; revision=15209
2005-08-04 21:09:08 +00:00
Jörg Mayer fc4a2ddfe0 Move declaration of void ftype_register_* to ftypes-int.h.
This fixes some warnings like
ftype-bytes.c:52: warning: no previous declaration for 'bytes_fvalue_free'


svn path=/trunk/; revision=15010
2005-07-23 06:21:17 +00:00
Jörg Mayer 23486b484e Fix lots of warnings of type:
ftypes.c:257: warning: passing argument 1 of 'logfunc' discards
                        qualifiers from pointer target type
by changing 'char*' -> 'const char*'

svn path=/trunk/; revision=15009
2005-07-23 06:19:08 +00:00
Jörg Mayer 5b442f2279 After doing "make maintainer-clean", "svn status --no-ignore | grep ^I"
returned quite a list of files. Add them to MAINTAINERCLEANFILES.

Whitespace changes (replace multiple spaces by TABs, in a few cases this
needed to be done at the beginning of Makefile lines.


svn path=/trunk/; revision=14891
2005-07-10 08:04:27 +00:00
Tomas Kukosa bab34b522b new field type FT_GUID
svn path=/trunk/; revision=14845
2005-07-04 13:04:53 +00:00
Ulf Lamping cf7dee822b replace another g_assert by DISSECTOR_ASSERT, so Ethereal won't crash if a dissector triggers that assert
svn path=/trunk/; revision=13867
2005-03-22 21:39:37 +00:00
Guy Harris 6616a3770c Make the "maintainer-clean" rules get rid of some additional generated
files.  Do this with GENERATED_HEADER_FILES, GENERATED_C_FILES, and
GENERATED_FILES macros in Makefile.common files, along the lines of what
wiretap/Makefile.common has.

Clean up "*~" files with "make clean" rather than only "make distclean"
in some additional places.

Add "maintainer-clean" rules to the Makefile.nmake files, paralelling
the ones in the automake-generated Makefile.in files, using the
GENERATED_FILES macros from Makefile.common files.  In some cases, move
the cleanup of files from "make distclean" to "make maintainer-clean",
and in other cases, put in a comment indicating why we're not doing that
(because some files that are distributed in the source tarballs, namely
Flex output, were built with a UN*X Flex and won't compile on Windows,
so we get rid of them with "make distclean" so you can clean up stuff
that *has* to be re-generated for Windows).

Clean up some *CLEANFILES definitions - get rid of ones that no longer
apply as files were moved or that add to the definition a name that's
already there.

svn path=/trunk/; revision=13402
2005-02-14 20:33:57 +00:00
Gilbert Ramirez 7e9f4b7eb7 From Pekka Pietikainen <pp@ee.oulu.fi>, add a byte to the hex[]
array so that there is room for the terminating NUL from sprintf().

svn path=/trunk/; revision=13256
2005-02-03 15:03:29 +00:00
Lars Roland ea67e4cfab Add functions to the old and the new plugin api for the MATE Plugin.
svn path=/trunk/; revision=12715
2004-12-11 00:13:27 +00:00
Jörg Mayer 54e0e363a9 Get rid of warnings about shadowed variables (code was ok)
svn path=/trunk/; revision=12171
2004-10-01 12:31:52 +00:00
Guy Harris dfad2b94f5 Some UN*Xes don't have any "strtou*" routine to convert a string to a
64-bit integer; use "g_ascii_strtoull()", and, in the configure script,
check whether it's available in GLib (it's not in GLib 1.2[.x]) and, if
not, supply the GLib 2.4.5 version of the routine.

For G_MAXUINT32 and G_MAXUINT64, put a "U" at the end of the constant to
explicitly flag it as unsigned.

svn path=/trunk/; revision=11889
2004-09-03 18:14:00 +00:00
Guy Harris d15724fc9e Make a bunch of source files non-executable.
svn path=/trunk/; revision=11869
2004-09-01 07:07:23 +00:00
Guy Harris 750812d739 guint64 & guint64 is another guint64, but a gboolean is just 32 bits on
most if not all platforms; the "bitwise and" operator in display filters
is Boolean and evaluates to "true" if the result is non-zero and "false"
otherwise, so explicitly do the comparison with 0 to make sure we don't
just throw away the upper 32 bits.

Do the same for the 32-bit bitwise AND as well, although it's not
strictly necessary.

svn path=/trunk/; revision=11828
2004-08-25 03:44:04 +00:00
Guy Harris 39313e5553 GLib 1.2[.x] doesn't define G_MAXUINT64, just as it doesn't define
G_MAXUINT32, so we have to define it if it's not defined.

svn path=/trunk/; revision=11797
2004-08-22 01:40:21 +00:00
Guy Harris c68f62210f Add "tvb_get_ntoh64()" and "tvb_get_letoh64()" routines to fetch 64-bit
integers.

Make FT_INT64 and FT_UINT64 add numerical values, rather than byte-array
values, to the protocol tree, and add routines to add specified 64-bit
integer values to the protocol tree.

Use those routines in the RSVP dissector.

svn path=/trunk/; revision=11796
2004-08-22 00:31:58 +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
Jörg Mayer fd24ad7d92 .cvsignore is dead
it has been replaced by
svn proplist -v <dir/file>
and
svn propedit <dir/file>

svn path=/trunk/; revision=11422
2004-07-18 23:44:34 +00:00
Jörg Mayer 56c759212f Add epan/dissectors/.cvsignore
Add tags and TAGS to all .cvsignore files

svn path=/trunk/; revision=11419
2004-07-18 22:51:50 +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
Guy Harris 12fddb1280 G_MAXINT32, G_MININT32, and G_MAXUINT32 aren't defined by GLib 1.2[.x],
so we have to define them ourselves if they're not defined.

svn path=/trunk/; revision=11384
2004-07-17 08:45:10 +00:00
Guy Harris c27d80c9ad I'm not sure "strtol()" and "strtoul()" are guaranteed to clear "errno"
on success, so we clear it before calling them.

Assign the value of "strtol()" to a "long" and assign the value of
"strtoul()" to an "unsigned long", as those are the return types for
those functions - "gint32" and "guint32" might not be large enough for
the return value on an LP64 platform.

Check for errno being EINVAL, as that can happen if the number isn't
valid.

Before assigning the value returned by "strtol()" or "strtoul()" to the
final destination, check whether it's in the right range for that
destination.

svn path=/trunk/; revision=11382
2004-07-16 23:35:46 +00:00
Guy Harris 003ecf68bb Instead of using pointer casts in the slab allocator stuff, add a
"SLAB_ITEM_TYPE_DEFINE()" macro to define a union of the type of object
for the slab and a pointer to an object of that union type, and use that
type for items on the slab allocator free lists; that *should* avoid
having the compiler think two pointers to an item being added to or
removed from the free list don't point to the same object just because
they have different types.

svn path=/trunk/; revision=11306
2004-07-04 02:29:43 +00:00
Guy Harris 456c6cab66 Make the "SLAB_ALLOC()" and "SLAB_FREE()" macros take the type of the
object being allocated, rather than the name of the free list, as an
argument (with the name of the free list constructed from the name of
the type), and add macros to define and declare the free list, also
taking the type of the object being allocated.

svn path=/trunk/; revision=11305
2004-07-04 00:28:11 +00:00
Guy Harris 7c097187c9 From Graeme Hewson: prevent an assertion failure if a display filter
specifies [i:] and i is >= the length of the frame.

svn path=/trunk/; revision=11258
2004-06-28 06:01:33 +00:00
Guy Harris 7737b1382d From Laurent Rabret: replace "lib" with "link /lib"; "lib" is just a
wrapper around "link /lib", and not all Microsoft C compiler
distributions provide "lib".

svn path=/trunk/; revision=11242
2004-06-26 02:16:16 +00:00
Ronnie Sahlberg 9c880121eb from tomas k
updates to the asn2eth compiler and a new regenerated h235 dissector

svn path=/trunk/; revision=11231
2004-06-24 21:50:05 +00:00
Gerald Combs 4a0a8b7e72 Add a "force_separators" parameter to hex_str_to_bytes so that it's
possible to paste in WEP keys without any separators.

Add doxygen comments to strutil.h.

svn path=/trunk/; revision=11123
2004-06-06 14:29:07 +00:00
Guy Harris e6e3ff60f5 From Graeme Hewson:
Fix assertion failure when absolute value of negative slice
     offset > field length.

     Remove code for handling negative slice lengths.

svn path=/trunk/; revision=11084
2004-06-03 07:34:49 +00:00
Guy Harris 15af0f656f From Lars Roland: add support for building a libethereal.dll with MSVC:
add a config.nmake option to control whether to build
	libethereal.dll or not;

	remove "./wiretap" from PATH to prevent problems due to
	wrongly-loaded files;

	build dissector.lib with MSVC;

	move "print.c" and "ps.c" to the dissector helpers, as "print.c"
	imports variables from packet-frame.c and packet-data.c, which
	are in libethereal;

	move "g711.c" out of the dissector helpers, as they're used only
	by Ethereal in a tap, not in Tethereal or in any dissector;

	add a .def file for libethereal;

	arrange to declare global variables exported from libethereal
	with "__declspec(dllimport)" when building programs that import
	those variables;

	update the NSIS installer.

Make the "configure" script define ETH_VAR_IMPORT as "extern".

svn path=/trunk/; revision=10834
2004-05-09 10:03:41 +00:00
Guy Harris 62f5077dc3 From Graeme Hewson:
Fix off-by-one errors in slice_func

svn path=/trunk/; revision=10831
2004-05-09 08:29:48 +00:00
Guy Harris 35cf424c08 From Graeme Hewson:
"aim.fnac.ssi.buddyname==ab" caused segmentation fault.  Fix
     handling of unparsed value as byte string.

svn path=/trunk/; revision=10830
2004-05-09 08:25:52 +00:00
Guy Harris fa0624b1be Make sure the character values we pass to "isprint()" aren't
sign-extended.

svn path=/trunk/; revision=10767
2004-05-02 07:31:59 +00:00
Gilbert Ramirez fb571671d2 When producing a display-filter representation of an FT_STRING*, represent
any non-printable character in hex, as "\xNN". We rely on isprint(), which
may not be the best solution because it is locale-specific.

svn path=/trunk/; revision=10707
2004-04-26 02:09:37 +00:00
Olivier Biot af4a73a523 At last compiling on CygWin works again! Added the missing PCRE and GLIB
libraries to libftypes.

Provide caching of computed configure tests.

svn path=/trunk/; revision=10600
2004-04-14 18:42:19 +00:00
Olivier Biot eee9dc26ac Fix the CLEANFILES target so both static and shared libraries are cleaned.
svn path=/trunk/; revision=10475
2004-03-24 21:27:44 +00:00
Jörg Mayer b7803c8fc6 Make libethereal and libwiretap shared libs.
svn path=/trunk/; revision=10368
2004-03-13 10:15:36 +00:00
Olivier Biot 1791f84919 First attempt at "bitwise AND" display filter operator.
Document how a display operator can be added.

svn path=/trunk/; revision=10250
2004-02-27 12:00:32 +00:00
Gilbert Ramirez 5cfc41fd88 If the LHS is a STRING or UNPARSED string, and the RHS is a FIELD,
then make sure that the FIELD can participate in the relation that
is expressed in the display filter.

Note that tvbuff's *should* be able to participate in == comparisons, etc.,
but those functions need to be added to ftype-tvbuff.c first.

svn path=/trunk/; revision=10175
2004-02-22 03:04:41 +00:00
Jörg Mayer a02d03c089 Forgot *.la
svn path=/trunk/; revision=10012
2004-02-09 17:23:59 +00:00
Jörg Mayer 96ad35f100 Ignore shared dll stuff
svn path=/trunk/; revision=10011
2004-02-09 16:49:00 +00:00
Guy Harris 75ef17775d Cast the result of "tvb_get_ptr()" to squelch a compiler warning.
svn path=/trunk/; revision=9954
2004-02-01 22:42:24 +00:00
Jörg Mayer 4023150e25 signed/unsigend warning fixes
svn path=/trunk/; revision=9931
2004-02-01 02:35:30 +00:00
Jörg Mayer 4189858920 Fix 'warning: cast discards qualifiers from pointer target type' by removing cast
svn path=/trunk/; revision=9845
2004-01-25 17:33:20 +00:00
Jörg Mayer 111f977cfa Remove the cast again and do the proper fix (add right type to union)
svn path=/trunk/; revision=9844
2004-01-25 17:22:57 +00:00
Jörg Mayer 21c1c34c02 Add a cast to avoid a signedness warning
svn path=/trunk/; revision=9843
2004-01-25 17:07:57 +00:00
Ulf Lamping cd85423556 epan don't need GTK_CFLAGS as GTK isn't used,
GLIB_CFLAGS are just enough

svn path=/trunk/; revision=9779
2004-01-22 19:27:59 +00:00
Olivier Biot 8775850e3b Add support of contains operator in slices.
svn path=/trunk/; revision=9512
2004-01-01 17:02:56 +00:00
Gerald Combs d72750578b Pull most of bytes_from_unparsed() into a new routine,
hex_str_to_bytes().  Use the new routine to initialize any WEP keys we
have defined.  This has the side effect of fixing an overflow if the user
entered a long WEP key.

svn path=/trunk/; revision=9471
2003-12-29 04:07:06 +00:00
Olivier Biot 7b1c1a9497 Add support of the "matches" operator to FT_BYTES and FT_ETHER. I don't think
it would make sense to add PCRE support for byte arrays containing an integer
or an IP address.

Avoid lengthy pointer constructs in cmp_matches().

svn path=/trunk/; revision=9343
2003-12-18 13:02:19 +00:00
Olivier Biot d9d5a1e44d Add protocols to the header fields for which the "matches" operator can be
appliedi (PCRE). In fact, all FT_TVBUFF fields.

svn path=/trunk/; revision=9329
2003-12-17 22:42:02 +00:00
Gerald Combs 45c2823020 Make the _pcre_tuple_t struct internal.
svn path=/trunk/; revision=9233
2003-12-10 21:12:02 +00:00
Olivier Biot ec776da55a Internal PCRE field type for efficient RE parsing in dfilters.
svn path=/trunk/; revision=9225
2003-12-09 23:15:35 +00:00
Olivier Biot 0f18533b75 Internal PCRE field type for efficient RE parsing in dfilters.
svn path=/trunk/; revision=9224
2003-12-09 23:02:40 +00:00
Gerald Combs 409948eced Add PCRE support to the Windows build.
svn path=/trunk/; revision=9185
2003-12-07 00:04:32 +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
Guy Harris dcd98ae8d3 The "ptr_u" unions no longer have a "next" pointer - they now just have
one member - or have one that's not used, so get rid of those unions.

svn path=/trunk/; revision=9151
2003-12-03 09:28:26 +00:00
Guy Harris ed2ae2d8d3 Instead of requiring slab-allocated structures to have a "next" pointer,
when adding them to the free list, cast the pointer to the structure to
a pointer to a "freed_item_t" which contains the "next" pointer.

This reduces the memory requirement for some of those structures, and
leaves us free to slab-allocate structures that have a "next" pointer
for other reasons.

svn path=/trunk/; revision=9150
2003-12-03 08:53:37 +00:00
Guy Harris bd9f96738c From Didier Gautheron: put an "fvalue_t" structure into a "field_info"
structure, rather than separately allocating "fvalue_t"s and having the
"field_info" structure point to them - this appears to speed up protocol
tree construction a bit.

svn path=/trunk/; revision=9146
2003-12-02 21:15:49 +00:00
Ronnie Sahlberg 266b5a4b2e Use the LSAB_ALLOC and SLAB_FREE macros to allocate/free fvalue_t data
svn path=/trunk/; revision=9140
2003-12-02 09:47:23 +00:00
Guy Harris 06f204843e Individual fvalue_t's aren't individually allocated with "g_malloc()",
so they can't be freed with "g_free()"; keep a list of the chunks of
"fvalue_t"s, which are whare are allocated with "g_malloc()", so we can
free them all.

svn path=/trunk/; revision=9090
2003-11-25 19:25:31 +00:00
Ronnie Sahlberg 4f84e65c50 fvalue_free() is one of the most called functions.
This function is also very small, so small that teh overhead for the actual function call and return is likely to be a significant part
of its execution time.

change it into a macro and make it thus slightly faster by eliminating the function call overhead.

svn path=/trunk/; revision=9083
2003-11-25 13:20:36 +00:00
Ronnie Sahlberg 0bf28e51af Change the handling of temporary allocation of fvalue_t structures to be faster.
Use a similar technique as was used in epan/proto.c to speed up the field_info
allocation/deallocation routines

svn path=/trunk/; revision=9082
2003-11-25 08:50:38 +00:00
Guy Harris 0c0ef44095 Make the "fvalue_set" methods for types whose value is allocated free
any previously-allocated version first, so that they don't leak memory.

From Olivier Biot: add a "proto_item_append_string()" routine, to append
to the string value a protocol tree item has.

svn path=/trunk/; revision=8821
2003-10-29 23:48:14 +00:00
Guy Harris 02e1d2680a Give every Makefile.nmake file a "distclean" rule, and have "distclean"
recurse into subdirectories doing "nmake -f Makefile.nmake distclean".

Have "nmake -f Makefile.nmake clean" not remove stuff that "make clean"
doesn't remove (such as Flex/Bison output and config.h files) - and have
"nmake -f Makefile.nmake distclean" remove stuff that "make distclean"
removes, including "tethereal-tap-register.c" and
"ethereal-tap-register.c".

svn path=/trunk/; revision=8672
2003-10-10 21:31:53 +00:00
Guy Harris 92c530aced Include <string.h> to get "strlen()" declared.
svn path=/trunk/; revision=8281
2003-08-27 21:11:39 +00:00
Gilbert Ramirez 52338a3baf Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).
The search uses a naive approach; more work is required to add a
Boyer-Moore Search algorithm.

svn path=/trunk/; revision=8280
2003-08-27 15:23:11 +00:00
Guy Harris 5b04b9a4ff Give FT_IPv4 val_repr_len and val_to_repr methods, and use them for
generating display filters from FT_IPv4 fields.

svn path=/trunk/; revision=8110
2003-07-31 04:18:01 +00:00
Guy Harris adf711d5fb Add val_repr_len and val_to_repr methods for FT_FLOAT and FT_DOUBLE, and
use them when generating display filters to match field values.  Use
"%{FLT_DIG}g" rather than "%{FLT_DIG}f" for FT_FLOAT.

svn path=/trunk/; revision=8109
2003-07-31 03:52:43 +00:00
Guy Harris b37514b435 Give FT_ABSOLUTE_TIME and FT_RELATIVE_TIME val_repr_len and val_to_repr
methods, and use them when constructing display filters.

svn path=/trunk/; revision=8107
2003-07-30 22:50:39 +00:00
Guy Harris 325203fb17 Escape double-quotes, while you're at it.
svn path=/trunk/; revision=8106
2003-07-30 22:25:35 +00:00
Guy Harris bf3727b099 Escape backslashes in strings when generating the dfilter representation
of the string.

svn path=/trunk/; revision=8105
2003-07-30 22:20:04 +00:00
Gilbert Ramirez 086774b71f Add to the fundamental types passed between the scanner and the parser.
Besides "STRING", there is now "UNPARSED_STRING", where the distinction
is that "STRING" was a double-quoted string and "UNPARSED_STRING" is just
a sequence of characters that the scanner didn't know how to scan/parse,
so it's up to the Ftype to parse it.

This gives us more flexibility and prepares the dfilter parsing engine
for the upcoming addition of the "contains" operator.

In the process of doing this, I also re-did the double-quoted string
support in the scanner, so that instead of the naively-simple support we
used to have, double-quoted strings now can have embedded dobule-quotes,
embedded octal sequences, and embedded hexadecimal sequences:
    "\""    embedded double-quote
    "\110"  embedded octal
    "\x48"  embedded hex

Enhance the dfilter unit test script to be able to run a single collection
of tests instead of having to run all of them all the time.

svn path=/trunk/; revision=8083
2003-07-25 03:44:05 +00:00
Guy Harris 71424053cd Define GLIB_CFLAGS and GTK_CFLAGS variables in config.nmake (based on
variables the user configures - the user isn't expected to change
GLIB_CFLAGS or GTK_CFLAGS, and there's a comment nothing that users
shouldn't have to do so), which contain the appropriate "/I" flags for
building stuff that requires only GLib, and stuff that required GTK+ and
GLib, respectively, and use those macros in the Makefile.nmake files.

svn path=/trunk/; revision=7884
2003-06-14 20:36:04 +00:00
Gilbert Ramirez 6823d063ee Expand the ability of fvalue_to_string_repr, and modify more FT_* types
to provide that method.

svn path=/trunk/; revision=7849
2003-06-11 21:24:54 +00:00
Gilbert Ramirez 9615c4ef25 Provide a way for ftype modules to provide a string representation
of their value. Provide such a method for FT_BYTES, FT_UINT_BYTES,
and FT_ETHER. Have proto_alloc_dfilter_string() use the new methods.

This is part of a movement of ftype-related code out of proto.c and
into the ftype code. The immediate effect is that generated display
filters for long byte sequences don't incorrectly have trailing periods
("...") to indicate continuation.

svn path=/trunk/; revision=7100
2003-02-08 04:22:37 +00:00
Guy Harris a97b83a7f4 Add a new field type FT_FRAMENUM; an FT_FRAMENUM is a 32-bit unsigned
frame number, which is always decimal.  If you select an FT_FRAMENUM
field, there are menu items that let you go to the frame whose frame
number appears in that field.

Add FT_FRAMENUM fields for the ONC RPC "matching request is in this
frame" and "matching reply is in this frame" protocol tree items.

svn path=/trunk/; revision=6802
2002-12-19 02:58:53 +00:00
Jörg Mayer 48be4e530d 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=6116
2002-08-28 20:41:00 +00:00
Guy Harris 6e56c25c9d From Ulf Lamping: add a new FT_FLOAT type, for single-precision
floating-point numbers, and display all the significant digits for both
single-precision and double-precision floating-point numbers in the
protocol tree, not just what "%g" does (6 digits).

Put in comments explaining how the length of filter strings is computed,
and fix some of the computations.

svn path=/trunk/; revision=6081
2002-08-24 19:45:28 +00:00
Jörg Mayer 3105ee542f Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928
2002-08-02 21:29:45 +00:00
Guy Harris 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +00:00
Guy Harris 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Gilbert Ramirez 38dafc2bfa Register FT_UINT_BYTES with correct structure.
svn path=/trunk/; revision=5436
2002-05-10 02:44:08 +00:00
Gilbert Ramirez 41cc7f0707 Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make
some of the COL_INFO texts more useful, handle a Unicode issue, and
modify some of the cases that use "request conditions".
But the NCP dissector as it stands is very usable now.

Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted
to think about the various possible macros and review an email conversation
I had with Guy on the subject.

svn path=/trunk/; revision=5432
2002-05-09 23:50:34 +00:00
Guy Harris 52fb615708 From Joerg Mayer: get rid of "-Wno-unused" flag in some configure
scripts, and check in changes to add _U_ to some unused arguments (some
other should perhaps be used, so we leave the _U_ out so that the
warnings serve as a reminder to check those).

svn path=/trunk/; revision=4848
2002-03-02 20:51:46 +00:00
Guy Harris b4971b39bf From Joerg Mayer:
In the "configure.in" files, add

		-D_U_="__attribute__((unused))"

	to CFLAGS if we're using GCC, and add

		-D_U_=""

	otherwise, so _U_ can be used to mark arguments as unused.

Add -D_U_="" arguments to the Makefile.nmake files as well, so _U_ works
with Microsoft Visual C++ as well.

Add comments and RCS IDs to the Makefile.nmake files that don't already
have them.

svn path=/trunk/; revision=4824
2002-02-27 09:42:52 +00:00
Gilbert Ramirez e36aa9657d Comment-out FT_UCS2_LE, and remove the already commented-out FT_TEXT_ONLY.
svn path=/trunk/; revision=4738
2002-02-15 09:01:21 +00:00
Guy Harris 2d3a60e9a9 "log" is a name that belongs to the ANSI C89 standard; it refers to a
function that computes the natural logarithm of a double.  Using it as
the name of a pointer to a routine to do logging can cause namespace
collisions; in fact, it *does* cause them on AIX.  Rename the function
argument to "logfunc".

svn path=/trunk/; revision=4700
2002-02-05 22:50:17 +00:00
Guy Harris 7b4403d361 Try defining just _USE_XOPEN and see if that gets "strptime()" declared
on most platforms; it works on Solaris, at least.

svn path=/trunk/; revision=4630
2002-01-30 10:19:44 +00:00
Guy Harris e6f24ee951 Alas, on Solaris, defining _XOPEN_SOURCE causes some things not in the
X/Open specs *not* to be defined, so we also have to define
__EXTENSIONS__.

XXX - can we just define __USE_XOPEN, and not define _XOPEN_SOURCE? Is
that sufficient to get "strptime()" declared on all platforms?

svn path=/trunk/; revision=4629
2002-01-30 10:10:03 +00:00
Gilbert Ramirez 147b9e8d52 Use:
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
#define __USE_XOPEN
#include <time.h>

to get strptime() declared in time.h on various systems. I hope
this helps more than it hurts.

svn path=/trunk/; revision=4624
2002-01-29 22:57:31 +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
Guy Harris 378bcd4198 Correctly handle the nanoseconds fields in strings representing absolute
and relative times - "0.4" is 400,000,000 nanoseconds, not 4
nanoseconds.

svn path=/trunk/; revision=4458
2001-12-28 21:30:34 +00:00
Guy Harris 8bae6e2e3d From Motonori Shindo: add "*.pdb" to the ".cvsignore" files in
directories in which PDB files are generated and in which it wasn't
already present.

svn path=/trunk/; revision=4386
2001-12-12 01:39:44 +00:00
Guy Harris 39362af814 From Motonori Shindo:
fix a bogus batch mode inference rule of make, so that
	"vc60.pdb" files are created in the proper directory;

	delete ".pdb" files in a "nmake -f Makefile.nmake clean";

	include the text2pcap and mergecap ".pdb" files in the Windows
	binary distribution.

svn path=/trunk/; revision=4385
2001-12-12 01:29:13 +00:00
Ed Warnicke b7420272e7 Moved int-64bit.{c,h} into epan/
svn path=/trunk/; revision=4248
2001-11-22 03:07:07 +00:00
Guy Harris 5511e79593 Add support for 64-bit signed integers in "int-64bit.[ch]", add an
FT_INT64 type, and make the Diameter dissector use it.

Handle the 64-bit integer types in the display filter semantics checks.

svn path=/trunk/; revision=4125
2001-11-02 10:09:51 +00:00
Guy Harris d82c74d757 From Ronnie Sahlberg: FT_UINT64 support, code to handle 64-bit integers
without requiring compiler support for them, and updates to the
Diameter, L2TP, NFS, and NLM dissectors to use it and to the ONC RPC
dissector to allow ONC RPC subdissectors to use it.

svn path=/trunk/; revision=4099
2001-10-29 21:13:13 +00:00
Gilbert Ramirez 038da8730a Fix some signed/unsigned comparison warnings. In the case of tvbuff.h,
there were 2 functions which accepted 'maxlength' == -1, but the function
prototypes had maxlength as a guint --- fixed.

svn path=/trunk/; revision=4087
2001-10-26 17:29:12 +00:00
Guy Harris 07c2ce1bad Get rid of no-longer-necessary includes of <sys/time.h>.
svn path=/trunk/; revision=3936
2001-09-14 07:23:34 +00:00
Guy Harris 1d42c94b05 Make the resolution for time values be nanoseconds rather than
microseconds.

Fix some "signed vs. unsigned" comparison warnings.

svn path=/trunk/; revision=3934
2001-09-14 07:10:13 +00:00
Richard Sharpe 8e23078d1b Add FT_UCS2_LE as a field type in prep for adding unicode handling proto_tree
routines.

svn path=/trunk/; revision=3843
2001-08-12 11:46:23 +00:00
Guy Harris 5fa3b1dd5c Before setting the value of an string field, make sure it's not null.
svn path=/trunk/; revision=3723
2001-07-15 20:31:02 +00:00
Guy Harris f7b50ca754 From Joerg Mayer:
* gcc 3.0 warning fixes:
  - text2pcap.c: The number of characters to scan should probably not be 0
  - wiretap/csids.c: using preincrement on a variable used on both
    sides of an assignment might be undefined by the C99(?) standard
 * turn on additional warnings for epan and wiretap too
  - epan/configure.in
  - wiretap/configure.in
 * Fix some warnings (missing includes, signed/unsigned, missing
    initializers) found by turning on the warnings
  - all other files :-)

svn path=/trunk/; revision=3709
2001-07-13 00:55:58 +00:00
Guy Harris 92d546499e "index()" is non-standard, and MSVC++ 6.0 complained about it; the ANSI
C standard has "strchr()" instead, so use it.

svn path=/trunk/; revision=3602
2001-06-23 19:10:27 +00:00
Gilbert Ramirez 39b0e82f63 Support CIDR notation in IPv4 address filtering.
svn path=/trunk/; revision=3601
2001-06-22 16:29:15 +00:00
Guy Harris 8c52d3db75 More signed vs. unsigned cleanups, and initialization cleanups, from
Joerg Mayer.

svn path=/trunk/; revision=3578
2001-06-19 23:08:57 +00:00
Guy Harris c8554ff99a Define __USE_XOPEN in files that use "strptime()", from Joerg Mayer.
svn path=/trunk/; revision=3559
2001-06-18 01:42:24 +00:00
Guy Harris 14ab278788 Windows and the MSVC++ 6.0 library don't have "strptime()", so pull in
the glibc "strptime()" (modified so it doesn't require the rest of
glibc), set up the configure script to check for it, and set up
Makefile.am and Makefile.nmake to use it.

Get rid of NEED_MKSTEMP - nothing uses it.

svn path=/trunk/; revision=3500
2001-06-02 06:21:14 +00:00
Guy Harris 52025d6956 Display all the digits of the microsecond field of an absolute time
value.

Check that the microseconds field of an absolute time is valid, if it's
present.

Set "tm_isdst" in the "struct tm" handed to "mktime()" to -1, so that
"mktime()" will attempt to figure out whether the time is daylight
savings time or not.

Check that "mktime()" was able to convert the time.

svn path=/trunk/; revision=3487
2001-05-31 06:48:00 +00:00
Guy Harris 15336e821c Don't require both the seconds and microseconds parts of a relative time
to be present - "1" is just as good as "1.0", and ".1" is just as good
as "1.1".

svn path=/trunk/; revision=3486
2001-05-31 06:20:10 +00:00
Guy Harris 7b4fbe10b5 Support for filtering on absolute and relative time fields, from Ronnie
Sahlberg.

svn path=/trunk/; revision=3484
2001-05-31 05:01:06 +00:00
Gilbert Ramirez e108afe2bb The Win32 build builds wiretap as a DLL and requires WinPcap 2.1.
svn path=/trunk/; revision=3163
2001-03-23 02:05:29 +00:00
Gilbert Ramirez 5664e5887f Make tvb_get_ptr() return 'const guint8*', and clean up all the
usages of tvb_get_ptr(). packet-ieee80211.c still has one bad usage,
in which it *does* modify the tvbuff's data.

svn path=/trunk/; revision=3128
2001-03-13 21:34:28 +00:00
Gilbert Ramirez 4b6b3da4e7 Add some win32-specific targets in .cvsignore's.
Replace 'nmake' with $(MAKE) /$(MAKEFLAGS), from Mike Frisch.

svn path=/trunk/; revision=3108
2001-03-06 13:08:13 +00:00
Gilbert Ramirez d21e83b98b Move version to 0.8.16.
Fix build for splitting build dir from src dir.
Note the use of updated GTK+ release for Win32 binaries.

svn path=/trunk/; revision=3107
2001-03-05 22:53:41 +00:00
Guy Harris 1773080631 Fix some places where value-to-string routines were returning FALSE,
indicating an invalid string, but not reporting the error to the user.

svn path=/trunk/; revision=3098
2001-03-03 00:33:24 +00:00
Gilbert Ramirez cf75b3f6a8 Get rid of unused method from ftypes structure.
svn path=/trunk/; revision=3093
2001-03-02 17:17:56 +00:00
Gilbert Ramirez b24dff17bd Enable slices of [i-j], where i is start offset and j is end offset,
inclusive. That is, [0-1] is a slice of 2 bytes.

svn path=/trunk/; revision=3092
2001-03-02 17:04:25 +00:00
Gilbert Ramirez 2a50f8af4f Add Ed Warnicke's drange code to the new dfilter system.
Not supported yet: [i-j] (offset-offset)
Supported:
	[i]	index
	[i:j]	offset:length
	[:j]	0:offset
	[i:]	offset:end
	[x,y]	concatenation of slices

svn path=/trunk/; revision=3080
2001-02-27 19:23:30 +00:00
Gilbert Ramirez 8cd8391b9a Make boolean equality/inequality tests smarter; they don't test
for exact value matches, but just that the two values are either zero
or non-zero.

svn path=/trunk/; revision=3015
2001-02-11 03:29:53 +00:00
Gilbert Ramirez 95e09f5ac3 Add Makefile.nmake files for new subdirs.
Add them to EXTRA_DIST in corresponding Makefile.am's so that they
get packaged with the distribution.

svn path=/trunk/; revision=2979
2001-02-02 04:03:43 +00:00
Gilbert Ramirez 9627904c2a Catch any exception thrown by accessing the tvbuff.
svn path=/trunk/; revision=2978
2001-02-01 23:39:18 +00:00
Guy Harris ebf6ae7cf6 Make some pointers "guchar" pointers, so that characters extracted from
strings are unsigned, so that we can hand them to "isXXX()" macros
without GCC warning us that an array subscript is "char" (as in "if this
is a character with the 8th bit set, you may not get the answer you
think you should from 'isXXX()'").

svn path=/trunk/; revision=2972
2001-02-01 21:52:16 +00:00
Gilbert Ramirez 96e0398fc6 Grumble, grumble. I forgot to add the license comment at the top
of these files.

svn path=/trunk/; revision=2968
2001-02-01 20:31:21 +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