Commit Graph

536 Commits

Author SHA1 Message Date
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
Guy Harris 117cd421e4 From Lars Roland: don't use ADNS_DIR if it's not defined.
svn path=/trunk/; revision=7881
2003-06-13 22:45:15 +00:00
Guy Harris b18f9bad07 Handle the case of a comparison between two ranges (or, at least, don't
dump core if the user tries it).

svn path=/trunk/; revision=7875
2003-06-13 10:03:25 +00:00
Guy Harris 47895f5e55 Oops, a range of N-N is valid and means "the byte at offset N".
svn path=/trunk/; revision=7874
2003-06-13 07:39:26 +00:00
Guy Harris 669e203f4b Add some sanity checking for ranges, so that you can't say "foo[M-N]"
where N is less than or equal to M.

svn path=/trunk/; revision=7873
2003-06-13 07:27:46 +00:00
Guy Harris feadec85eb Export "tvb_get_string()" and "tvb_get_stringz()" to plugins.
svn path=/trunk/; revision=7862
2003-06-12 10:10:39 +00:00
Guy Harris ec5499613d Don't wire into "config.h.win32" files an indication of whether we have
GNU ADNS or not - set it based on whether ADNS_DIR is defined by
"config.nmake", and make "config.h.win32" files that specify whether we
have GNU ADNS dependent on "config.nmake".

Note in "config.nmake" that:

	if you have GNU ADNS, ADNS_DIR should be defined as the
	directory in which the ADNS .lib file resides;

	if you don't have GNU ADNS, ADNS_DIR shouldn't be defined.

svn path=/trunk/; revision=7860
2003-06-12 09:45:42 +00:00
Guy Harris ee97ce3196 Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
	arguments, allocates a buffer big enough to hold a string with
	the specified number of bytes plus an added null terminator
	(i.e., length+1), copies the specified number of bytes from the
	tvbuff, at the specified offset, to that buffer and puts in a
	null terminator, and returns a pointer to that buffer (or throws
	an exception before allocating the buffer if that many bytes
	aren't available in the tvbuff);

	tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
	a "gint" as arguments, gets the size of the null-terminated
	string starting at the specified offset in the tvbuff (throwing
	an exception if the null terminator isn't found), allocates a
	buffer big enough to hold that string, copies the string to that
	buffer, and returns a pointer to that buffer and stores the
	length of the string (including the terminating null) in the
	variable pointed to by the "gint" pointer.

Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).

Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string).  Use "tvb_get_stringz()", instead.

In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.

svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
Guy Harris 6fc868b2c9 Put in a missing "break" statement.
svn path=/trunk/; revision=7850
2003-06-11 21:48:39 +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
Guy Harris 9472b08c4e Get rid of an unused variable.
svn path=/trunk/; revision=7832
2003-06-10 18:03:23 +00:00
Gerald Combs bc8ef81903 Bump the version to 0.9.13 and otherwise prep for the next release. ETA is
Wednesday.

svn path=/trunk/; revision=7820
2003-06-10 01:47:34 +00:00
Guy Harris 6b36f382ad Fix "tvb_strneql()", "tvb_strncaseeql()", and "tvb_memeql()" not to
throw an exception if there aren't enough bytes in the tvbuff to
compare.

svn path=/trunk/; revision=7813
2003-06-09 07:27:42 +00:00
Gerald Combs 37521e54a5 Use "=" instead of "==" in an assignment.
svn path=/trunk/; revision=7792
2003-06-05 21:54:54 +00:00
Guy Harris f2233623ea From Lionel Ains: "-d" flag for decode-as support in Tethereal.
Add a new routine to iterate through all dissector tables, calling a
routine for each table, to support having the "-d" code list all
dissector tables.

Get rid of "dissector_handle_get_dissector_name()"; it was put in there
for "-d", but turns out not to be necessary for that.

Clean up the usage message a bit (using the convention, adhered to by at
least some UNIX utilities, of listing all the flags with no arguments in
a single lump, and then listing the ones with arguments individually,
and also putting "-v" and "-h" in a separate lump, as Ethereal does).

svn path=/trunk/; revision=7788
2003-06-05 04:47:58 +00:00
Guy Harris 85ada1dec6 When "proto_tree_add_item()" is used with FT_STRINGZ with a length
value, just copy the specified number of bytes and stick a '\0' at the
end, don't use "tvb_get_nstringz0()" - yes, you end up copying more
bytes, but you don't have to bother looking for a '\0' that might not
even be present (if the string is null-padded rather than
null-terminated).

Also, set the length of the item to the specified length, rather than to
the length up to the terminating '\0' - if the string is null-padded,
the field should include all the padding bytes.

svn path=/trunk/; revision=7785
2003-06-05 03:57:38 +00:00
Guy Harris aa1c605ba3 When "proto_tree_add_item()" is used with an FT_STRINGZ and given a
length (rather than being given -1), the length is, in most cases, the
maximum length of a null-*padded* string, rather than the actual length
of a null-*terminated* string.  Treat it as such - allocate a buffer one
larger than the length (to leave room for a terminating '\0'), and pass
the size of that buffer to "tvb_get_nstringz0()".  (Otherwise, in those
cases, the last character of the string is chopped off.)

Allow "proto_tree_add_string()" to add FT_STRINGZ items to the protocol
tree, as well as FT_STRING items.

In "alloc_field_info()", if we're passed a length of -1 and the field is
an FT_STRINGZ, don't make the length be the length remaining in the
tvbuff; that way, you *can* use a length of -1 in
"proto_tree_add_item()" for an FT_STRINGZ item, and have it get the
actual length by looking for the terminating '\0'.

(We might want to distinguish between null-terminated and null-padded
strings, e.g. with an FT_STRINGZPAD type.  Null-terminated strings
rarely, if ever, have a specified length; the length is found by
scanning for the terminating '\0'.  Null-padded strings presumably
always have a specified length, which is the length to which the string
is padded.)

svn path=/trunk/; revision=7784
2003-06-04 21:51:54 +00:00
Guy Harris dd6f38957b Use "tvb_ensure_bytes_exist()" to check, in "tvb_fake_unicode()", to
make sure we have the entire string, rather than fetching the last
character.

svn path=/trunk/; revision=7783
2003-06-04 21:45:49 +00:00
Guy Harris 4875604484 Fix up some comments, and move some common GLib 1.2[.x]/2.x code outside
#ifdefs.

svn path=/trunk/; revision=7775
2003-06-04 00:11:02 +00:00
Gerald Combs bdec82ce59 From Lars Roland: Update the plugin API for Glib/GTK+ 2.2 and have NSIS
remove the Start menu entries and desktop icon.

svn path=/trunk/; revision=7772
2003-06-03 02:32:56 +00:00
Gerald Combs f755cf5034 Add GNU ADNS to the Windows build environment. A precompiled DLL can be
found at

	http://adns.jgaa.com/

and

	http://www.ethereal.com/distribution/win32/development/

The modifications to the root-level config.h.win32 and Makefile.nmake
may not be neccessary.

svn path=/trunk/; revision=7769
2003-06-02 18:40:02 +00:00
Guy Harris f94c7971a5 Add an API to get the dissector name from a dissector handle.
svn path=/trunk/; revision=7726
2003-05-23 22:09:36 +00:00
Gerald Combs 7a132e5b48 More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that Bad
Things can happen if we pass a zero buffer length to tvb_get_nstringz0().
Throw an exception if this happens.

In various dissectors make sure the tvb_get_nstringz0()'s buffer length
is greater than zero.

svn path=/trunk/; revision=7688
2003-05-19 03:23:12 +00:00
Guy Harris e1647e4504 From Richard Urwin:
add support for a system-wide color filter file;

	fix a bug where "read_filters()" didn't close the file handle.

Use the "get_datafile_path()" routine he added to construct the pathname
of the Diameter directory, the global preferences file, and the manuf
file.

svn path=/trunk/; revision=7677
2003-05-15 07:44:54 +00:00
Guy Harris 48de87a3cd Declare "host_name_lookup_process()" regardless of whether HAVE_GNU_ADNS
is defined (as it's defined, and called, regardless of whether
HAVE_GNU_ADNS is defined), and get rid of the extra declarations of the
ADNS support routines.

svn path=/trunk/; revision=7644
2003-05-05 08:20:01 +00:00
Guy Harris 6d6a37b5d2 Provide stub versions of "host_name_lookup_init()",
"host_name_lookup_process()", and "host_name_lookup_cleanup()" if we
don't have GNU ADNS, so that Ethereal compiles without GNU ADNS.

Declare the argument lists of "host_name_lookup_init()" and
"host_name_lookup_cleanup()" as empty, C89-style, rather than as
unknown.

svn path=/trunk/; revision=7641
2003-05-05 00:53:06 +00:00
Gerald Combs 1d9b54fc07 Add support for asynchronous DNS updates using the GNU ADNS library.
Support can be enabled at configure time by using "--with-adns=DIR".
If support is enabled, async queries happen whenever host name resolution
is enabled.  Do we need a separate preference for async queries?

Currently, only IPv4 reverse queries are supported.  I can add IPv4 forward
lookup support, but I don't have any way to test IPv6 queries.

svn path=/trunk/; revision=7640
2003-05-04 18:50:56 +00:00
Guy Harris 5105311cb1 Add a note about the "val_to_string_repr" and "string_repr_len" for
ftypes, and how to add them to more types and use them in more places.

svn path=/trunk/; revision=7636
2003-05-03 01:11:29 +00:00
Guy Harris ca318813a4 Rename "proto_alloc_dfilter_string()" to
"proto_construct_dfilter_string()", to more accurately reflect what it
does.

Give it, and "proto_can_match_selected()", an "epan_dissect_t *"
argument, which replaces the raw data pointer argument to
"proto_construct_dfilter_string()".

For fields that don't have a type we can directly filter on, we don't
support filtering on the field as raw data if:

	the "epan_dissect_t *" argument is null;

	the data source tvbuff for the field isn't the tvbuff for the
	"epan_dissect_t" in question (i.e., it's in the result of a
	reassembly, and "frame[N:M]" can't get at it).

Trim the length the raw data in the case of such a field to the length
of the tvbuff for the "epan_dissect_t" in question, so we don't go past
it.  Fetch the raw data bytes to match from that tvbuff.

Have "proto_construct_dfilter_string()" return a null pointer if it
can't construct the filter string, and have "protocolinfo_packet()" in
the tap-protocolinfo tap ignore a field if
"proto_construct_dfilter_string()" can't construct a filter string for
it - and have it pass NULL as the "epan_dissect_t *", for now.  If
somebody decides it makes sense to dump out a "frame[N:M] =" value for
non-registered fields, it can be changed to pass "edt".

svn path=/trunk/; revision=7635
2003-05-03 00:48:37 +00:00
Guy Harris f9037afd44 From Matthijs Melchior: don't export functions also implemented as
macros, and do export "except_pop()" and "except_setup_try()".

svn path=/trunk/; revision=7628
2003-05-01 21:10:43 +00:00
Guy Harris 933fd3b12c From Lars Roland: set "patable.p_asn1_string_decode" to point to
"asn1_string_decode()", not to "asn1_octet_string_decode()".

svn path=/trunk/; revision=7624
2003-05-01 18:05:27 +00:00
Gerald Combs c5f6451d30 Bump the version number to 0.9.12. Make NEWS and ChangeLog current.
The next release will likely be tomorrow (May 1).

svn path=/trunk/; revision=7622
2003-05-01 03:09:54 +00:00
Guy Harris 0242a26c59 The typedefs in plugins/plugin_table.h must have "addr_" in front of the
function name; make it so.

Eliminate the duplicate entry for "except_throw" and the duplicate code
for it.

svn path=/trunk/; revision=7618
2003-04-30 23:40:43 +00:00
Guy Harris dcae08c20b From Matthijs Melchior: export the exception mechanism routines to
plugins on platforms on which plugins need to use the table of functions
exported to plugins.

svn path=/trunk/; revision=7611
2003-04-30 19:19:15 +00:00
Gerald Combs 0b9bbbbdb6 Modify tvb_get_nstringz*() to behave more like snprintf(). Make changes
where necessary to reflect the new behavior.

svn path=/trunk/; revision=7607
2003-04-30 02:35:28 +00:00
Guy Harris 1025817e84 Add a "proto_item_set_end()" routine that sets the length of an item
given a tvbuff/offset pair referring to the byte past the end of the
item.  Use it in one place in the SMB dissector (there are plenty of
other places where it could be used as well).

svn path=/trunk/; revision=7603
2003-04-29 21:27:19 +00:00
Gerald Combs b2f936ff24 Fix several buffer and integer overflow issues discovered by Timo Sirainen.
tvbuff.c:

  Lots of existing code assumes that you can safely do the following:

    #define MAX_BUF 64
    guint8 *buf[MAX_BUF];
    ...

    tvb_get_nstringz0 (tvb, offset, MAX_BUF, buf, &bytes_copied);

  In reality, tvb_get_nstringz*() can potentially write one byte past
  "buf".  Modify _tvb_get_nstringz() not to do that.

packet-ppp.c:

  Check for a valid BAP suboption length.

packet-mount.c:

  Fix a possible integer overflow in dissect_group().

svn path=/trunk/; revision=7590
2003-04-28 04:03:26 +00:00
Guy Harris 090a5aa24b From Matthijs Melchior: add the ASN.1 routines to the table of routines
exported to dissectors.

svn path=/trunk/; revision=7552
2003-04-24 21:15:13 +00:00
Ronnie Sahlberg cb5e97d49a Update to TCP to handle hints from dissectors where the next PDU may start.
ONCRPC dissector updated to provide hint to TCP where the next RPCoverTCP
PDU starts as example.
Trivial updates to the other TCP based protocols required to amke them handle
this as well.  See the updates to packet-rpc.c as an example.

This is enabled by activating tcp analysis and provides hints to TCP to know where PDUs starts when not aligned to the start of the segment.

svn path=/trunk/; revision=7543
2003-04-23 10:20:29 +00:00
Guy Harris 2678786425 Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".

svn path=/trunk/; revision=7467
2003-04-16 05:55:41 +00:00
Guy Harris 24ec2110d1 Add the notion of a "fence" to columns. A dissector can set the fence
to "protect" what's currently in the column, so that attempts to clear
the column will only clear stuff after the fence and attempts to
overwrite the column will append stuff after the fence.  This, for
example, allows a dissector to arrange that the Info column contain
information for its protocol and for protocols running atop it.

svn path=/trunk/; revision=7466
2003-04-16 04:52:55 +00:00
Guy Harris d3daad1bec Add "proto_tree_add_none_format()" to the set of functions exported to
plugins.

svn path=/trunk/; revision=7423
2003-04-08 17:20:05 +00:00
Guy Harris 9f3902270e Put in a comment about the "to what code does the configuration file
directory belong" issue.

svn path=/trunk/; revision=7370
2003-03-26 00:34:27 +00:00
Guy Harris 4fb9c1866b Fix up a comment.
svn path=/trunk/; revision=7369
2003-03-25 23:46:04 +00:00
Guy Harris 97f273f044 Use "datafiledir" rather than "DATAFILE_DIR" as the name of the variable
in the configure script for the all-variables-expanded version of the
data file directory.

Don't AC_SUBST "DATAFILE_DIR", as it's not used.

Define DATAFILE_DIR in config.h as the all-variables-expanded version of
$datadir/ethereal, as that's where the global configuration files such
as manuf and the Diameter files are actually installed.

svn path=/trunk/; revision=7368
2003-03-25 23:37:54 +00:00
Gerald Combs 656eb2b35c Bump the version to 0.9.11. Let's hope the goat's blood and hastily carved
idol is enough for the CVS gods.

svn path=/trunk/; revision=7337
2003-03-11 00:12:39 +00:00
Ronnie Sahlberg e00fb8c413 From Lars Ronald :
MGCP request/response matching and
MGCPSTAT RTT calculation.

For those with MGCP captures, try
-z mgcp,rtd[,filter]

svn path=/trunk/; revision=7294
2003-03-06 09:01:47 +00:00
Gerald Combs fbd2efeccc Bump the version to 0.9.10.
svn path=/trunk/; revision=7271
2003-03-04 03:56:33 +00:00
Guy Harris 14b5b9e3a9 Completely initialize all the address fields in a packet_info structure,
setting the length to 0 and the data pointer to a null pointer.

svn path=/trunk/; revision=7239
2003-03-01 09:38:41 +00:00
Guy Harris 5e665db815 Assume all AT_NONE addresses are the same, as they have no address data
to compare; based on a change from Laurent Meyer.

svn path=/trunk/; revision=7222
2003-02-28 20:30:06 +00:00