Commit Graph

17 Commits

Author SHA1 Message Date
Guy Harris 9f7507d0b4 Use "tvb_get_string()" instead of duplicating its functionality by hand.
Don't make a copy of the message in
"dissect_quake2_client_commands_uinfo()" and
"dissect_quake2_client_commands_stringcmd()", just use the copy in the
tvbuff.

svn path=/trunk/; revision=10240
2004-02-25 23:11:16 +00:00
Gerald Combs d47426ec58 Remove a bunch of duplicate semicolons.
svn path=/trunk/; revision=8509
2003-09-21 20:06:02 +00:00
Guy Harris 04a8718528 For the "all the rest of the packet is just text" case, just allocate a
buffer big enough to hold all of it, copy it all, and put in a null
terminator, rather than using "tvb_get_nstringz0()".

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_strsize()", and dynamically-allocated buffers,
instead (even if there's a nominal maximum packet size; that way you
don't have 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*, or remember that, if the
null terminator is found in the buffer, the return value of
"tvb_get_nstringz0()" doesn't include the null terminator).

svn path=/trunk/; revision=7858
2003-06-12 08:29:39 +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
Jörg Mayer 7c4176d868 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=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Uwe Girlich 5fa90a663e Code from Jan Berkel <jan.berkel@gmx.de> to
* fully decode client->server packets (mouse movement, button press etc.)
* start of decoding server->client packets (names of first command as text)

svn path=/trunk/; revision=5912
2002-07-29 09:28:28 +00:00
Uwe Girlich 73bd3782b6 code cleanup, removed unused parameters, inserted some _U_
svn path=/trunk/; revision=5086
2002-04-02 06:28:16 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +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 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a
dissector function and a protocol ID.  Associate dissector handles with
dissector table entries.

svn path=/trunk/; revision=4308
2001-12-03 04:00:26 +00:00
Guy Harris 07b2709f8a Change "conversation_set_dissector()" to take a dissector handle, rather
than a pointer to a dissector function, as an argument.

This means that the conversation dissector is called through
"call_dissector()", so the dissector itself doesn't have to worry about
checking whether the protocol is enabled or setting
"pinfo->current_proto", so get rid of the code that does that in
conversation dissectors.  Also, make the conversation dissectors static.

Get rid of some direct calls to dissectors; replace them with calls
through handles, and, again, get rid of code to check whether a protocol
is enabled and set "pinfo->current_proto" where that code isn't needed.
Make those dissectors static if they aren't already static.

Add a routine "create_dissector_handle()" to create a dissector handle
without registering it by name, if the dissector isn't used outside the
module in which it's defined.

svn path=/trunk/; revision=4281
2001-11-27 07:13:32 +00:00
Ed Warnicke 4877553530 Switched from using CHECK_DISPLAY_AS_DATA to using CHECK_DISPLAY_AS_X
which also takes a handle as an argument and thus doesn't call
dissect_data directly.

svn path=/trunk/; revision=4270
2001-11-26 05:13:14 +00:00
Ed Warnicke a810a01338 Switched from calling dissect_data to using call_dissector
svn path=/trunk/; revision=4263
2001-11-25 22:19:25 +00:00
Uwe Girlich b9a3653c89 Before calling proto_tree_add_string, the correct proto_tree should
be checked and not any upper proto_tree object.

svn path=/trunk/; revision=3766
2001-07-22 18:52:38 +00:00
Uwe Girlich 2d0a2ec04c initial checkin of the Quake II network protocol dissector
svn path=/trunk/; revision=3593
2001-06-21 15:15:57 +00:00