Commit Graph

422 Commits

Author SHA1 Message Date
Guy Harris 5474a467a2 From Chris Maynard: free up the z_stream we've allocated before failure
returns.  (The error returns shouldn't happen in practice, as the GLib
memory allocators never return a null pointer, they just abort the
program, but if we're going to be checking for failure and returning, we
should do the right thing anyway.)

svn path=/trunk/; revision=12957
2005-01-05 10:19:36 +00:00
Guy Harris a0de9d34c7 Add a "tvb_bytes_to_str_punct()" routine, which wraps
"bytes_to_str_punct()", and use it instead of extracting the bytes and
formatting them by hand.

svn path=/trunk/; revision=12876
2004-12-30 23:47:52 +00:00
Guy Harris a3f3ea6dbe From Charles Levert: in "tvb_fake_unicode()", convert non-ASCII
characters to '.'.

svn path=/trunk/; revision=12515
2004-11-12 10:26:56 +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 cb0506f41b Most developers have only 10 fingers, not 16. :-)
svn path=/trunk/; revision=11581
2004-08-02 18:58:19 +00:00
Olivier Biot c3ccccf2b6 From Kelly Byrd: fix tvb_uncompress() for GZIP encoded content.
svn path=/trunk/; revision=11579
2004-08-02 09:15:58 +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
Olivier Biot 687f3af0f2 From Jerry Talkington: speed up tvb_uncompress() by increasing the minimal
and default uncompression buffer.

svn path=/trunk/; revision=10839
2004-05-10 22:14:07 +00:00
Olivier Biot 463597f54a Memory management of tvb_uncompress() needs tvb_set_free_cb().
svn path=/trunk/; revision=10817
2004-05-07 18:15:24 +00:00
Olivier Biot 77449b1085 From Kendy Kutzner: a char should be compared with '\0', not NULL.
svn path=/trunk/; revision=10806
2004-05-06 17:40:52 +00:00
Olivier Biot 659ac78357 From Jerry Talkington:
- Helper functions for uncompressing compressed tvbuffers.

	- Compressed content coding dissection in HTTP.

svn path=/trunk/; revision=10799
2004-05-05 06:55:09 +00:00
Guy Harris 834543d7c7 Use "tvb_format_text()" to display strings, so we handle non-printable
characters.

Some strings appear to be null-padded; add a "tvb_format_stringzpad()"
routine to handle them, so that we don't show the padding characters as
"\000".

svn path=/trunk/; revision=10461
2004-03-23 18:06:29 +00:00
Guy Harris d09c4c4eab Constify a bunch of stuff.
svn path=/trunk/; revision=10106
2004-02-19 05:19:10 +00:00
Guy Harris 87b219554e Make "tvb_strneql()" take a "gchar *" rather than a "guint8 *" as the
string argument.

Add some casts to squelch compiler warnings.

svn path=/trunk/; revision=9951
2004-02-01 21:30:17 +00:00
Jörg Mayer 38faa0f27b packet-dcerpc-afs4int.c
svn path=/trunk/; revision=9938
2004-02-01 06:49:25 +00:00
Jörg Mayer 11e10e61fd Change return type of tvb_format_text from guint8* to gchar*.
Remove now unnecessary casts in two files.

svn path=/trunk/; revision=9801
2004-01-23 09:40:38 +00:00
Guy Harris 129de02c79 In "tvb_ensure_bytes_remaining()", throw ReportedBoundsError, not
BoundsError, if the offset is just past the end of the reported data
(because we're ensuring that there actually *is* a byte there, and,
even according to the reported length, it isn't).

svn path=/trunk/; revision=9444
2003-12-24 23:28:17 +00:00
Guy Harris 821baa3d48 Have "tvb_ensure_length_remaining()" throw the appropriate exception if
there's no data remaining - its callers largely depend on it doing so.

That means that the BEEP dissector doesn't have to check for it
returning 0.

svn path=/trunk/; revision=9433
2003-12-23 21:22:00 +00:00
Ronnie Sahlberg 9c14c51834 Replace two expensive macros with a much simpler mechanism
to prevent memory leaks due to exceptions.

makes my tethereal testcase ~1% faster.

svn path=/trunk/; revision=9153
2003-12-03 10:14:34 +00:00
Ronnie Sahlberg 5ff0237060 performance update
replace tvb_raw_offset() which is essentially a simple assignment and which
is called a lot with a macro.

this makes my tethereal testcase 2-3% faster.

svn path=/trunk/; revision=9152
2003-12-03 09:50:40 +00:00
Ronnie Sahlberg bfaca0cab6 Move the definition of the tvbuff_t structure and friends to tvbuff.h
so that we can change tvb_get_ds_tvb() into a macro.

This function was a single line assignment and was called a lot.

This made tethereal ~2.5% faster in one testcase I use.

svn path=/trunk/; revision=9141
2003-12-02 10:23:18 +00:00
Guy Harris b530c88a3b "compute_offset_length()" must, if it returns FALSE, and "exception" is
non-null, set "*exception" to the appropriate exception - its callers
rely on it.

Now that it does that, there's no need for "check_offset_length()" to
check for a length of -1, as "compute_offset_length()" does so, and
therefore "check_offset_length_no_exception()" does so.

svn path=/trunk/; revision=8562
2003-09-28 21:39:53 +00:00
Gerald Combs 7704cdd149 Make tvb_find_tvb() return -1 if either tvb length is 0. Otherwise, an
assertion happens 'xxxx contains ""'.

svn path=/trunk/; revision=8450
2003-09-10 21:19:47 +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 663a127b5d A bufsize of 0 makes no sense in either "tvb_get_nstringz()" or
"tvb_get_nstringz0()", as it means there's no room even for the
terminating NUL; abort if "_tvb_get_nstringz()" is passed a bufsize of
0.

Don't throw an exception in "tvb_get_nstringz0()" if
"_tvb_get_nstringz()" returns 0 - that just means we have an empty
string.

svn path=/trunk/; revision=8150
2003-08-08 08:19:50 +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 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
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
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
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
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 e345e5640e Rename "fake_unicode()" to "tvb_fake_unicode()" as it works on a tvbuff,
give it a byte-order argument, and move it to "epan/tvbuff.c".

Use it to handle UCS-2 strings in version 1 of the Service Location
Protocol.  In SRVLOC V1, use registered fields that are already there
for SRVLOC V2, and add some as needed.  Fix some field names.

svn path=/trunk/; revision=7186
2003-02-24 01:22:30 +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
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 47b147ffd1 Add an extra argument to "tvb_find_line_end()", which specifies what it
should do if it doesn't find an EOL; if FALSE, it behaves as before,
returning values that treat the line as ending at the end of the tvbuff,
and if TRUE, it returns -1, so its caller can do segment reassembly
until it gets the EOL.

Add an option to the SMTP dissector to do segment reassembly, and do
segment reassembly of the first line.

svn path=/trunk/; revision=5891
2002-07-17 06:55:29 +00:00
Guy Harris b6e941027f Add a "tvb_ensure_bytes_exist()", which is like "tvb_bytes_exist()" only
it throws the appropriate exception if the bytes don't exist.  Use it in
the GIOP and ASN.1 code to check whether the bytes to be copied to a
buffer exist before allocating the buffer.

Make "check_offset_length_no_exception()" check for an overflow, so that
it can be used in "tvb_ensure_bytes_exist()" and do all the checking
that the code "tvb_ensure_bytes_exist()" replaces did.

Make "get_CDR_wchar()" return a "gint", so that if the length octet it
fetched has a value between 128 and 255, the length can be returned
correctly.

Fix some comments not to specify the exception thrown by various
routines that can throw various exceptions.

svn path=/trunk/; revision=5453
2002-05-13 01:24:47 +00:00
Guy Harris 33e80cec64 Have "tvb_ensure_length_remaining()" directly call
"compute_offset_length()", and throw the exception it returns, rather
than calling "tvb_length_remaining()" and throw BoundsError if it
returns -1; this allows us to add additional exceptions without having
to change "tvb_ensure_length_remaining()".

Make "_tvb_get_nstringz()" static, as it's not used outside "tvbuff.c".

svn path=/trunk/; revision=5397
2002-05-05 21:07:52 +00:00
Guy Harris d612dab6df Make "tvb_ensure_length_remaining()" return a "guint" - it can't return
a negative value.

Use "tvb_ensure_length_remaining()" in "tcp_dissect_pdus()", rather than
checking the return value of "tvb_length_remaining()" ourselves, and
make various variables and parameters in it "guint" as appropriate.

svn path=/trunk/; revision=5396
2002-05-05 00:57:59 +00:00
Guy Harris ed02576048 Use "gfloat" and "gdouble", rather than "float" and "double", as the
return types of the tvbuff accessors for floating-point types, to more
closely match the tvbuff accessors for integral types.

Fix an error in the code for fetching doubles on VAXes, and get rid of
unused union members on VAXes.

svn path=/trunk/; revision=5245
2002-04-24 21:53:05 +00:00
Guy Harris 7d96eec76b Use Ashok's IEEE-float-to-long code as the basis for
IEEE-float-to-native-float code, and use that as the basis for
IEEE-double-to-native-double code.  Use that code on VAXes.

Eliminate "ieee-float.h", as we no longer use it; instead, we use the
tvbuff routines for extracting IEEE floating-point numbers.

svn path=/trunk/; revision=5243
2002-04-24 21:19:38 +00:00
Guy Harris 661056aac4 Add (untested) routines to fetch IEEE single-precision and
double-precision floating-point numbers, in big-endian and little-endian
format (hopefully there aren't any middle-endian formats; if there are,
we'll have to add them), from a tvbuff, and to return floats (for
single-precision) and doubles (for double-precision).

svn path=/trunk/; revision=5147
2002-04-12 23:25:24 +00:00
Gilbert Ramirez 6aad6e40b8 tvb_get_nstringz() needs to terminate a string with a NUL if the
end of the tvbuff is reached before the maximum_length passed by the
caller is reached and before a terminating NUL is found. In this case,
tvb_get_nstringz() returns a -1, but if the string is not artificially
terminated with a NUL by tvb_get_nstringz(), the
caller has no idea where the string should end because 1) the
return value "-1" gives the impression that the string ends
at the end of the buffer but 2) the string does
not end at the end of the buffer, but somewhere in the middle, due
to the packet being shorter than expected.

tvb_get_nstringz() and tvb_get_nstringz0() were both modified.

The FT_STRINGZ case in proto_tree_add_item() is made simpler.

During regression testing, when investigating a regression that I later
corrected, I discovered that strings added through proto_tree_add_item
(FT_STRING, FT_STRINGZ, and FT_UINT_STRING) leaked memory due to double
allocation of the string. The proto_tree_add_string*() functions do
not leak memory, since they only copy the string once. The memory
leak was fixed by adding another argument to the static function
proto_tree_set_string() to let the string ftype code know to g_strdup()
the string or not.

svn path=/trunk/; revision=4891
2002-03-06 19:17:06 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris 6f1b47d6c5 Squelch a GCC warning.
svn path=/trunk/; revision=4658
2002-02-01 07:03:32 +00:00
Gilbert Ramirez bd4a9c13eb Provide tvb_ensure_length_remaining(), which is like
tvb_length_remaining() except that it throws BoundsError if 'offset'
is out-of-bounds.

Allow a length argument of -1 for FT_STRING and FT_BYTES fields
in proto_tree_add_item().

Change some dissectors to either use -1 for the length argument in
calls to proto_tree_add_item(), or call tvb_ensure_length_remaining()
instead of tvb_length_remaining(), or to check the return-value
of tvb_length_remaining(). Changes to more dissectors are necessary,
but will follow later.

svn path=/trunk/; revision=4656
2002-02-01 04:34:17 +00:00
Gilbert Ramirez a2251afaff Throw a BoundsError if a length parameter in a tvbuff-accessor is < -1.
svn path=/trunk/; revision=4474
2002-01-04 06:45:14 +00:00
Guy Harris 0d7f3e614f Get rid of "tvb_compat()"; it's no longer needed (the one remaining call
to it returns data that's no longer used).

svn path=/trunk/; revision=4237
2001-11-20 22:46:12 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris f62a97cf2d TVBUFF_SUBSET tvbuffs share a "ds_name" with the parent tvbuff, so their
"ds_name"s shouldn't be freed when the tvbuff is freed.  (Thanks and a
tip of the Hatlo hat to the FreeBSD memory allocator for complaining
about multiple frees of the same string.)

svn path=/trunk/; revision=4136
2001-11-03 03:49:34 +00:00
Guy Harris ba06fa6490 More indentation fixes.
svn path=/trunk/; revision=4135
2001-11-03 03:41:35 +00:00
Guy Harris 6d24afcb1f Fix the indentation.
svn path=/trunk/; revision=4129
2001-11-03 00:19:26 +00:00
Gilbert Ramirez 920b294065 Fix leak of ds_name. Thanks to Sirop Erable <matrix_ottawa@yahoo.ca>
svn path=/trunk/; revision=4128
2001-11-02 21:39:34 +00:00
Guy Harris 62d224011d Stop using "tvb_get_ntohll()" and "%llX" in the BOOTP dissector, as the
former depends on having "guint64" and the latter depends on
"%ll[douxX]" being what's used to print 64-bit integers, and there are
platforms on which Etheeal runs that don't have "guint64" or that don't
use "%ll[douxX]" to print 64-bit integers.

Get rid of the routines to extract 64-bit integers into "gint64"s and
"guint64"s, as per Ronnie Sahlberg's suggestion, to discourage people
from writing code that won't work on all platforms; they should be using
FT_UINT64, or the routines in "int-64bit.c", instead.

svn path=/trunk/; revision=4102
2001-10-29 21:56:50 +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 db5e1b8c85 Tvbuffify the DNS, NBNS, NBDS, and NBSS dissectors.
Add a "tvb_memeql()" routine, for doing "memcmp()"-style equality
comparisons.

svn path=/trunk/; revision=3631
2001-07-02 07:11:40 +00:00
Guy Harris cce642c0f7 Fix a comment, and update Gerald's e-mail address.
svn path=/trunk/; revision=3471
2001-05-27 21:34:05 +00:00
Jeff Foster 395b68ea19 Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name,
GUI and printing code changed to support these changes
and display the multiple hex views.

svn path=/trunk/; revision=3165
2001-03-23 14:44:04 +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
Guy Harris 11b24c6094 Tvbuffify the RIP and OSPF dissectors.
Change them to use facilities in Ethereal that were probably not present
when they were originally written, e.g. routines to fetch 24-bit
integers and to dump a bunch of raw bytes in hex.

Redo them to extract data from the packet as they dissect it, rather
than extracting an entire data structure at once; that way, it may be
able to dissect a structure not all of which is in the packet.

Dissect a bit more of the type-of-service metrics etc. in OSPF packets.

Make "tvb_length_remaining()" return a "gint", not a "guint"; it returns
-1 if the offset is past the end of the tvbuff.

Add a "tvb_reported_length_remaining()" routine, similar to
"tvb_length_remaining()".  Use it instead of just subtracting an offset
from "tvb_reported_length()".

svn path=/trunk/; revision=2787
2000-12-27 12:48:27 +00:00
Guy Harris d46aa3d576 Add a new "tvb_strsize()" routine, which finds the size of a
NUL-terminated string, starting at a given offset.  The size includes
the terminating NUL.  If it doesn't find the terminating NUL, it throws
the appropriate exception, as either there's no terminating NUL in the
packet or there is but it's past the end of the captured data in the
packet.

Use that routine in the TFTP dissector.  As it throws an exception if
the string isn't NUL-terminated, we can just use "%s" to print option
strings; we don't need to use "%.*s" with a string length.

svn path=/trunk/; revision=2783
2000-12-25 23:48:16 +00:00
Guy Harris 50f6a061a7 In "tvb_find_guint8()" and "tvb_pbrk_guint8()", correctly set the limit
of the search if the caller-supplied limit goes past the end of the
tvbuff - the limit should just be what remains in the tvbuff after the
specified starting offset.

In "tvb_find_line_end_unquoted()", after searching for the next
interesting character, check the value we got back from that search, in
"char_offset", not whatever happens to be in "cur_offset", to see if we
found a character.

svn path=/trunk/; revision=2719
2000-11-30 06:11:32 +00:00
Gilbert Ramirez a0729a25dd In tvb_set_reported_length(), don't assert on
reported_length <= tvb->reported_length, but throw a ReportedBoundsError
if that condition is not met.

svn path=/trunk/; revision=2718
2000-11-30 03:24:16 +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
Gilbert Ramirez 29a2973984 Add tvb_set_child_real_data_tvbuff(), which allows you to tell the
tvbuff routines that a particular TVBUFF_REAL_DATA tvbuff is a "child"
of another tvbuff. This link is utilized during a tvb_free_chain(), so that
the child is freed when no longer necessary.

svn path=/trunk/; revision=2642
2000-11-14 04:33:34 +00:00
Guy Harris 99c98f9e74 Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just a
string formatter, like "format_text()", and, as "tvbuff.c" now calls it
(*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h"
in just to declare "bytes_to_str()".  It's now declared in "strutil.h",
so include it in modules that use "bytes_to_str()" and weren't already
including it.

Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a
pointer to a chunk of N bytes at a given offset in a tvbuff and then
hands that chunk to "bytes_to_str()".  Convert the code that was doing
that to use "tvb_bytes_to_str()" instead (which caught what I suspect is
a bug in the Q.2931 dissector, where it was handing an offset of 0 to
"tvb_get_ptr()" - a cut-and-pasteo, I think).

Tvbuffify the ARP dissector.

svn path=/trunk/; revision=2634
2000-11-13 07:19:37 +00:00
Guy Harris f8934eb9e7 Make "tvb_find_line_end()" and "tvb_find_line_end_unquoted()" treat CR
by itself as a line ending, as well as treating CR LF and LF as line
endings.

Tweak the Telnet dissector to treat LF and CR NUL as line endings, but
not to treat CR by itself as a line ending (that's not exactly what the
NVT specification in the Telnet RFC specifies, but the resulting output
may be a bit more readable that way).

svn path=/trunk/; revision=2613
2000-11-12 00:59:09 +00:00
Guy Harris b9d2dd7151 Make the string-to-compare-with arguments to "tvb_strneql()" and
"tvb_strncaseeql()" "const guint8 *", so that you can pass them pointers
to "const".

svn path=/trunk/; revision=2611
2000-11-11 19:55:48 +00:00
Guy Harris b63646ecc0 Allow "tvb_find_guint8()", "tvb_pbrk_guint8()", and "tvb_strnlen()" to
take -1 as a "maxlength" value, meaning "to the end of the tvbuff".

svn path=/trunk/; revision=2598
2000-11-10 09:15:57 +00:00
Guy Harris 07eb30403d Tvbuffify the SAP and SDP dissectors.
Add "tvb_find_line_end_unquoted()" for the benefit of the SDP dissector;
get rid of "find_line_end_unquoted()" as nobody uses it any more.

Add "tvb_pbrk_guint8()" for the benefit of
"tvb_find_line_end_unquoted()"; it searches for any of a number of
characters, unlike "tvb_find_guint8()" which searches for only one.

svn path=/trunk/; revision=2595
2000-11-10 06:50:37 +00:00
Guy Harris 01a890cf95 Tvbuffify the HTTP, NNTP, RSH, RTSP, and Telnet dissectors.
Add "tvb_find_line_end()", to find a CR and/or LF-terminated line in a
tvbuff and return its length and the offset of the character after the
line end, for the use of those dissectors.

Add "tvb_strncaseeql()", which is like "tvb_strneql()" except that it
does a case-insensitive comparison.

svn path=/trunk/; revision=2590
2000-11-09 10:56:33 +00:00
Guy Harris 1a793d05ee Patch from Heikki Vatiainen to make "tvb_strnlen()" return the length of
the string rather than the offset of the end of the string, plus a patch
to "tvb_get_nstringz()" to treat the return value of "tvb_strnlen()" as
a length rather than an end offset.

svn path=/trunk/; revision=2502
2000-10-17 08:50:57 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00