Commit Graph

2810 Commits

Author SHA1 Message Date
Guy Harris b4219afa51 Generated Bison and Flex files test whether __STDC__ is defined
in order to check whether to use ANSI C features such as "const".

GCC defines it as 1 even if extensions that render the implementation
non-conformant are enabled; Sun's C compiler (and, I think, other
AT&T-derived C compilers) define it as 0 if extensions that render
the implementation non-conformant are enabled; Microsoft Visual C++
6.0 doesn't define it at all if extensions that render the implementation
non-conformant are enabled.

We define it as 0 in "config.h.win32", so that those generated files will use
those features (and thus not get type warnings when compiled with
MSVC++).

svn path=/trunk/; revision=2698
2000-11-22 07:20:27 +00:00
Gilbert Ramirez ff8da7fb9d Export plugin_reg_handoff via DLLEXPORT.
svn path=/trunk/; revision=2697
2000-11-22 06:22:35 +00:00
Gilbert Ramirez 90e0fb129d Change Ethereal homepage URL from etheral.zing.org to www.ethereal.com.
svn path=/trunk/; revision=2696
2000-11-22 04:07:04 +00:00
Gilbert Ramirez 038774d586 Enable the building of any combination of ethereal, tethereal, and editcap.
If GTK+ is not detected, then ethereal is not built.

svn path=/trunk/; revision=2695
2000-11-22 04:03:22 +00:00
Guy Harris 032575ea0d In the tvbuffified "dissect_rpc()", use the "pinfo" argument rather than
the global "pi".  Also set "pinfo->current_proto" to "RPC", so that we
get the right message if a tvb accessor throws an exception.

svn path=/trunk/; revision=2694
2000-11-22 01:39:10 +00:00
Guy Harris 4f766002df Get rid of declarations of no-longer-extant "init_dissect_rpc()" and
"cleanup_dissect_rpc()".

svn path=/trunk/; revision=2693
2000-11-22 00:34:15 +00:00
Guy Harris fcd119d834 Add a "color.h" file that declares a nominally-toolkit-independent
"color_t" structure to store color values (although currently it has all
the same fields that a GdkColor has; its currently advantage is that you
don't have to include any GTK/GDK stuff to declare it).

Add routines in the "gtk" directory to convert between "color_t" and
GdkColor values.

Define, in "prefs.h", all colors as "color_t" values rather than
GdkColor values.  "prefs.h" now no longer needs to include <gtk/gtk.h>,
so don't include it.

svn path=/trunk/; revision=2692
2000-11-21 23:54:10 +00:00
Guy Harris f8d8ac9df6 Tethereal includes no GUI stuff, so it doesn't need to include
"ui_util.h".

svn path=/trunk/; revision=2691
2000-11-21 23:50:56 +00:00
Guy Harris 0d178f826a Initialize "http_type" to HTTP_OTHERS before calling
"is_http_request_or_reply()", so that if "is_http_request_or_reply()"
decides the line is part of a request or a response it'll set "*type"
(which it does only if "*type" is HTTP_OTHERS).

svn path=/trunk/; revision=2690
2000-11-21 22:40:40 +00:00
Guy Harris 90eccd89b8 Some compilers, e.g. Microsoft Visual C++, don't define __STDC__ unless
extensions to ANSI C are disabled if they may cause strictly conforming
programs not to compile, or to work differently if those extensions are
enabled.  (Other compilers #define it as 0, e.g.  Sun's and, I think,
other AT&T-derived compilers; still others cheerfully define it as 1
even when those extensions are enabled, e.g. GCC.)

As such, checking whether __STDC__ is defined, or is defined as a
non-zero value, isn't the right way to check whether function prototypes
are supported; MSVC++ 6.0 supports them, but, by default, leaves
extensions of the sort described above enabled, and thus doesn't define
__STDC__.  This means that the compiler warns about arguments to
"snprintf()" when compiling it, as the declaration is an old-style
declaration.

As Ethereal uses function prototypes, there's not much point in making
it possible for its private "snprintf()" to be compiled or used when
function prototypes aren't supported; just get rid of the tests for
__STDC__, so that it's compiled with function prototypes regardless of
whether __STDC__ is defined or not.

While we're at it, have "snprintf()" give it a "__attribute__((format
(printf, 3, 4))))" when compiled by GCC 2.x or later, so that
format/argument checks can be done even on platforms lacking
"snprintf()".

svn path=/trunk/; revision=2689
2000-11-21 21:24:52 +00:00
Gilbert Ramirez de9a50d3e7 Fix infinite loop in reallocation of memory for decryption buffer.
svn path=/trunk/; revision=2688
2000-11-21 16:17:58 +00:00
Uwe Girlich 3faeb8e0e7 Start of a tvbuff_t version of the dissect_rpc() function.
All ONC/RPC dissectors remain old dissectors for now but this will
change too.

svn path=/trunk/; revision=2687
2000-11-21 14:58:07 +00:00
Uwe Girlich 65d9f034eb Senseless old prototype for rpc init removed.
svn path=/trunk/; revision=2686
2000-11-21 14:15:21 +00:00
Guy Harris 2a33d09c72 Updates from Ed Warnicke.
svn path=/trunk/; revision=2685
2000-11-21 05:38:51 +00:00
Guy Harris 94c731a108 Tvbuffication, and introduction of a number of named fields, from Heikki
Vatiainen.

svn path=/trunk/; revision=2684
2000-11-21 05:36:36 +00:00
Gilbert Ramirez 5a0e2a658a Move to version 0.8.14
svn path=/trunk/; revision=2682
2000-11-20 17:10:26 +00:00
Gilbert Ramirez b054fb1cb6 Changes in 0.8.14
svn path=/trunk/; revision=2681
2000-11-20 17:08:50 +00:00
Gilbert Ramirez ed396d1c03 Initialize winsock as we do in Ethereal.
svn path=/trunk/; revision=2680
2000-11-20 17:08:20 +00:00
Gilbert Ramirez 95efc598a0 Move tvbtest.c to EXTRA_DIST
svn path=/trunk/; revision=2679
2000-11-20 16:18:08 +00:00
Gilbert Ramirez eab4d35141 next_pd and next_offset are used only if HAVE_PLUGINS is #defined.
Therefore, declare these 2 variables only if HAVE_PLUGINS is #defined.

svn path=/trunk/; revision=2678
2000-11-20 16:17:43 +00:00
Gerald Combs c24e26da42 In dissect_ntp(), add an ellipsis (...) to the end of a reference clock ID
if its name gets truncated.

svn path=/trunk/; revision=2677
2000-11-19 21:18:10 +00:00
Guy Harris 8fa7f53b1f Fixes, from Heikki Vatiainen, to bugs introduced by the tvbuffification
of the SAP and SDP dissectors.

svn path=/trunk/; revision=2676
2000-11-19 21:01:06 +00:00
Gerald Combs 6cbf7512cb Add an overflow check to process_data().
svn path=/trunk/; revision=2675
2000-11-19 20:56:17 +00:00
Guy Harris cf109dd91a Updates from Heikki Vatiainen to tvbuffify the Auto-RP dissector and
improve the named fields.

Add Auto-RP to the list, in the AUTHORS file, of stuff he's done.

svn path=/trunk/; revision=2674
2000-11-19 20:01:22 +00:00
Gerald Combs 0c887fd488 Check to make sure the h_addr entry returned by gethostbyname() can fit
into an in_addr struct.

svn path=/trunk/; revision=2673
2000-11-19 19:45:54 +00:00
Gerald Combs db1285dce6 Dynamically resize decr_pd in dissect_icqv5Client() in order to avoid
a possible buffer overflow on media with frame sizes greater than
1600 bytes.

According to http://www.student.nada.kth.se/~d95-mih/icq/ there isn't
an upper bound to the size of a v5 packet, so we grow dynamically to
fit what we've been handed.

svn path=/trunk/; revision=2672
2000-11-19 19:23:54 +00:00
Gerald Combs 2c456a433a Fix buffer overruns:
- packet-afs.c: dissect_acl() didn't restrict the size of a string read
    with sscanf().  An exploit has been released.

  - packet-nbns.c: When passed an illegal name, get_nbns_name() would
    overrun nbname with an error message.  This isn't exploitable AFAIK,
    but it could result in a crash.

  - packet-ntp.c: dissect_ntp() wasn't checking the length of the
    reference clock's host name.  This is most likely exploitable.
    This fix simply lops off the end of the host name if it's too long.
    We should probably add an ellipsis (...) as we have done in other
    places in the code.

svn path=/trunk/; revision=2671
2000-11-19 16:58:57 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

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

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

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

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

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

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris e88bd04f9a The source operand of "SET_ADDRESS()" has to be static, as a pointer to
it is saved.

svn path=/trunk/; revision=2669
2000-11-19 08:20:34 +00:00
Guy Harris 6ed0c8ac68 Register the OSI transport dissector by name, and make it static.
"packet-clnp.h" no longer exports anything, so remove it.

Have the X.25 dissector call subdissectors through dissector handles
(now that all the dissectors it uses are registered by name).

svn path=/trunk/; revision=2668
2000-11-19 04:14:26 +00:00
Guy Harris 4933cc340f "wtap_read()" must *always* set "*err" when it returns FALSE - if it's
just an EOF, it should set "*err" to 0.  Fix up a bunch of read routines
for various capture file types to set "*err" appropriately.

svn path=/trunk/; revision=2667
2000-11-19 03:47:36 +00:00
Guy Harris ea9409cb04 Finish tvbuffifying the X11 dissector - instead of having it be an
old-style dissector that does a "tvb_create_from_top()" and then calls
new-style-dissector subroutines, just use tvbuffs throughout.

Turn "tvb" from a global variable into an argument (as we no longer
create that tvbuff).

svn path=/trunk/; revision=2666
2000-11-19 02:48:24 +00:00
Guy Harris 8b769702d0 Get rid of a now-unused variable.
svn path=/trunk/; revision=2665
2000-11-19 02:03:00 +00:00
Guy Harris dd90e7e327 Have the Etherenet and PPP dissectors register themselves, and have
other dissectors call them through handles.  Do the same for the "PPP
payload" dissector, after tvbuffifying it.

Tvbuffify the PPPoE dissector.

Do the last little bit of tvbuffifying the L2TP dissector (it takes
old-style arguments and immediately generates a tvbuff out of them; make
it take new-style arguments).

svn path=/trunk/; revision=2664
2000-11-19 02:00:03 +00:00
Guy Harris 5c1549b944 Set the tvbuff length for ARP packets, so the Ethernet dissector knows
how much of the packet is padding.

svn path=/trunk/; revision=2663
2000-11-19 01:00:20 +00:00
Guy Harris 74777083d3 Fix a number of problems that caused compiles to fail if
PLUGINS_NEED_ADDRESS_TABLE was defined.

svn path=/trunk/; revision=2662
2000-11-18 21:41:40 +00:00
Gilbert Ramirez 567ee3e083 dissect_sip() was incorrectly always calling the next level
dissector when tree was NULL.
From Heikki Vatiainen <hessu@cs.tut.fi>

svn path=/trunk/; revision=2661
2000-11-18 16:56:31 +00:00
Guy Harris ea00ad9f58 Nobody calls "old_try_conversation_dissector()" or
"old_dissector_try_heuristic()" any more, as their users have all been
tvbuffified - get rid of them.

svn path=/trunk/; revision=2660
2000-11-18 11:47:21 +00:00
Guy Harris 6bab5c02f0 Put in an empty declaration of "struct dissector_handle" before
typedeffing "dissector_handle_t" to be a pointer to it.

svn path=/trunk/; revision=2659
2000-11-18 10:51:07 +00:00
Guy Harris c8196a1d1c Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.

Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.

Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate).  Then use it in IP.

Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.

svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
Graham Bloice 56a0c40c18 Corrected wrong function call in plugins_enable_cb
svn path=/trunk/; revision=2657
2000-11-18 09:59:04 +00:00
Guy Harris 67f0e0b41b Do the checks for the presence of a conversation dissector the same way
in "try_conversation_dissector()" that they're done in
"old_try_conversation_dissector()".

svn path=/trunk/; revision=2656
2000-11-18 07:00:31 +00:00
Guy Harris 69ebb146e8 Don't attempt to call the dissector for a conversation if the
conversation doesn't have a dissector.

svn path=/trunk/; revision=2655
2000-11-18 06:51:42 +00:00
Gilbert Ramirez abb6702fc2 Add #include <string.h>, to get prototypes for mem* and str* functions.
svn path=/trunk/; revision=2654
2000-11-17 21:00:40 +00:00
Guy Harris d50abaf3f4 Give the "null" link-layer header dissector a dissector table, and put
the BSD AF_ type values it uses into an "aftypes.h" header file for
dissectors that register themselves in that dissector table include.

svn path=/trunk/; revision=2653
2000-11-17 06:02:21 +00:00
Guy Harris d939763545 Reference clock identifiers a DATUM TymServe 2100 NTP network timeserver
can return, from Phil Techau.

svn path=/trunk/; revision=2652
2000-11-17 05:25:59 +00:00
Guy Harris ee1b884ee9 Tvbuffify the STP dissector, have it register itself and have the LLC
dissector call it through a handle, and make it static.

Give "dissect_data()" an "offset" argument, so dissectors can use it to
dissect part of the packet without having to cook up a new tvbuff.

Go back to using "dissect_data()" to dissect the data in an IPP request.

svn path=/trunk/; revision=2651
2000-11-16 07:35:43 +00:00
Guy Harris f19c2e2def "get_CDR_short()", from Frank Singleton.
Fix a comment.

svn path=/trunk/; revision=2650
2000-11-15 20:10:22 +00:00
Guy Harris 2fa39ce7d3 Move the table of bit-swapped byte values to "epan/bitswap.c", and
declare it, and define a "BIT_SWAP" macro that uses it, in
"epan/bitswap.h".

Use that macro to bit-swap bytes in the IEEE 802.11 dissector, rather
than the macro that was used (said macro used GCCisms and didn't compile
on Windows).

Make an "init_plugin()" routine to enable a plugin and call its init
routine, and call it from "check_plugin_status()" and
"plugins_enable_cb()", rather than having very similar code in two
places; "patable" is now part of libethereal, and, at least on Windows,
attempts to refer to it from "libui" failed.  Make "patable" static to
"epan/plugins.c".  (This may still not work, as now "libui" is calling a
routine in "libethereal"; if that fails, perhaps it's time to get rid of
the "enable/disable plugins" stuff completely, as new-style plugins, at
least, register themselves as protocols and should be controllable from
the "Edit->Protocols" window just as built-in dissectors are.)

svn path=/trunk/; revision=2649
2000-11-15 09:37:53 +00:00
Guy Harris b606de7ea3 Tvbuffify the IPP dissector, and have it register itself rather than
being a global function.

The HTTP dissector should set "pinfo->current_proto" to HTTP even if we
consider the packet to be IPP, so that if we run past the end of a
tvbuff while dissecting HTTP stuff it's reported as a problem with HTTP,
not IPP.

svn path=/trunk/; revision=2648
2000-11-15 08:27:14 +00:00