Commit Graph

131 Commits

Author SHA1 Message Date
Ronnie Sahlberg e9ab01f4e3 add some text to discourage using strcpy and friends and how to do string buffer allocation less rpone to memory leaks and buffer overflows.
svn path=/trunk/; revision=16232
2005-10-15 23:44:28 +00:00
Guy Harris 266e1a3491 Add "tvb_get_ipv4()" and "tvb_get_ipv6()" addresses, to fetch IPv4 and
IPv6 addresses.  Use "tvb_get_ipv4()" in the WINS Replication dissector,
so that it gets the right answer on little-endian *AND* big-endian
machines.

svn path=/trunk/; revision=15753
2005-09-10 19:43:41 +00:00
Ronnie Sahlberg 9599cf9e3b add new function tvb_get_ephemeral_stringz()
svn path=/trunk/; revision=15273
2005-08-10 14:25:59 +00:00
Ronnie Sahlberg b4441e6748 rename ep_tvb_fake_unicode() to tvb_get_ephemeral_faked_unicode() and update the README file.
svn path=/trunk/; revision=15271
2005-08-10 13:56:34 +00:00
Ronnie Sahlberg ec3ab9ec3e rename ep_tvb_get_string() to tvb_get_ephemeral_string() asnd update the documentation in README.developer
svn path=/trunk/; revision=15270
2005-08-10 13:41:13 +00:00
Jörg Mayer 6f4033bc83 Don't initialize variables in their declaration with non-constant
values.

svn path=/trunk/; revision=15211
2005-08-04 21:40:58 +00:00
Gerald Combs f97247e3d0 Add a note about fuzz testing.
svn path=/trunk/; revision=14679
2005-06-17 15:03:26 +00:00
Anders Broman 46a9c67335 From Mike Duigou
Minor corrections to README.developer and README.tapping

svn path=/trunk/; revision=14593
2005-06-09 05:40:26 +00:00
Anders Broman d656e253db From Mike Duigou:
A few doxygen updates and an improved section on 
writing dissectors that don't use tcp_dissect_pdus().

svn path=/trunk/; revision=14538
2005-06-03 06:36:07 +00:00
Ronnie Sahlberg fcab322ada Some applications do very naughty things like reusing a port for a different protocol during different stages of an application cycle.
This is very naughty and will cause problems when we have assigned a dissector to a dynamic port using conversation_set_dissector().


To make ethereal handle this case I have changed the try_conversation_dissector() to allow it to fail and return 0,   meaning   yes there is indeed a protocol registered for this conversation but that protocol rejected this packet.
(which only happens for "new" style dissectors, "old" style dissectors will never reject a packet that way)

When this happens  the decode_udp_port() helper will still allow other dissectors to be tried, in the hope that the conversation is now used for some other protocol and thus someone else might be able to decode the packet.


Update SNMP and TFTP dissectors to  check that even if there already is a conversation but that conversation does NOT have snmp/tftp registered as the dissector for it, then create a new conversation anyway and attach the proper dissector.

Since ethereal keeps track of which frame number a conversation started in, this actually works really well.



svn path=/trunk/; revision=14345
2005-05-11 10:40:53 +00:00
Ronnie Sahlberg 4656201984 From Jon R
Update to README.developer for the conversation changes


svn path=/trunk/; revision=14135
2005-04-19 12:05:50 +00:00
Gerald Combs c9be421b16 Add a note about testing to the "Robustness" section.
svn path=/trunk/; revision=14050
2005-04-11 01:57:00 +00:00
Guy Harris 6cacd26f20 Add a note about doing checks before subtracting, for example, the
length of a fixed-length header from the length of the item with that
fixed-length header.

svn path=/trunk/; revision=13926
2005-03-26 23:31:35 +00:00
Guy Harris 5a6cf59062 Thou shalt not g_assert() in a dissector.
svn path=/trunk/; revision=13875
2005-03-23 02:48:47 +00:00
Guy Harris d4d1206ad5 Remind people not to use "g_ntoh[ls]()" or "g_hton[ls]()" to convert
big-endian to little-endian - that doesn't work on big-endian machines.

svn path=/trunk/; revision=13874
2005-03-23 02:39:21 +00:00
Ulf Lamping f1f48a30bd fix a bug and add a forward declaration in the example skeleton code
svn path=/trunk/; revision=13745
2005-03-14 00:43:39 +00:00
Ulf Lamping e378098855 from Micheal Duigou: add some doxygen tags and some changes to README.developer
svn path=/trunk/; revision=13725
2005-03-11 21:14:38 +00:00
Guy Harris 6285418a43 Add one more reason to use "tvb_get_string()", as we've had a recent
vulnerability due to somebody fetching a string into a fixed-length
buffer.

svn path=/trunk/; revision=13708
2005-03-11 02:01:17 +00:00
Jörg Mayer 64e12f7518 Add boolean to the list of non-portable types
svn path=/trunk/; revision=13227
2005-02-01 15:45:03 +00:00
Guy Harris 3d06f85155 Grammar and typo fix from Mike Duigou.
svn path=/trunk/; revision=12979
2005-01-07 11:59:05 +00:00
Ulf Lamping 6d161f7dc4 add a more detailed description, how to add a new dissector file
svn path=/trunk/; revision=12847
2004-12-28 00:10:04 +00:00
Guy Harris abd16b297f From Jeff Morriss: PREF_RANGE preference type, for ranges of integers.
svn path=/trunk/; revision=12300
2004-10-14 23:45:09 +00:00
Guy Harris 5a244d166b Note that variadic macros shouldn't be used.
svn path=/trunk/; revision=12224
2004-10-06 17:52:57 +00:00
Guy Harris 7baddd7b91 Note that declarations in the middle of a block aren't supported by all
compilers, and thus shouldn't be used.

svn path=/trunk/; revision=12029
2004-09-17 09:32:53 +00:00
Guy Harris 23f5d0fb5f Note that _WIN32, not WIN32, should be used in #ifdefs and #ifs testing
the platform for which we're building (and that both should be avoided
if possible, i.e. write your code so that it works on all platforms).

svn path=/trunk/; revision=11973
2004-09-11 23:10:14 +00:00
Guy Harris 7e98674443 Note that developers should avoid GTK+ 2.x/GLib 2.x-only stuff (and, in
particularly, should disregard all the renaming they did of some
routines, as the old names work Just Fine in 2.x but the new names don't
work in 1.2[.x]).

svn path=/trunk/; revision=11936
2004-09-07 23:59:49 +00:00
Ulf Lamping 7b71fe2b17 add HFILL to the skeleton example and documentation of the field registration
svn path=/trunk/; revision=11864
2004-08-31 12:39:25 +00:00
Ulf Lamping 5a9fc6543f corrected paths, where the dissectors and the corresponding Makefile.common can be found, to epan/dissectors
svn path=/trunk/; revision=11858
2004-08-31 09:19:41 +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 ff3f10e5a5 Note that "G_GINT64_CONSTANT()" should be used for constant values that
don't fit in 32 bits, rather than using "LL" at the end.

Clean up some other 64-bit-integer items.

svn path=/trunk/; revision=11779
2004-08-19 19:44:57 +00:00
Guy Harris 43b2da02ae Note that you *MUST* make sure "match_strval()" doesn't return null
before using its value, or must check for a null return value and handle
it specially, otherwise you put Ethereal at risk of crashing with bad
packet data.

svn path=/trunk/; revision=11475
2004-07-23 01:37:35 +00:00
Jörg Mayer 1d645fc8c2 SNPRINTF isn't used any more - remove from sample dissector
and coding guidelines.

svn path=/trunk/; revision=11418
2004-07-18 22:36:55 +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 a354e21de5 Give more details on the "don't build the protocol tree if you don't
have to", indicating that if it's too much work to explicitly test for a
null protocol tree, you might want to avoid those tests and rely on the
protocol tree routines not to do much work if passed a null protocol
tree pointer.

svn path=/trunk/; revision=11346
2004-07-08 21:16:04 +00:00
Jörg Mayer 0195deceae tmpnam() really should not be used for security reasons.
Replace it where used and update README.developer accordingly.

svn path=/trunk/; revision=11235
2004-06-25 07:04:03 +00:00
Guy Harris 7002776572 Pick up the stuff I did for tcpdump to figure out the right strings to
use to format 64-bit integers.

Fix the RSVP dissector to use that rather than hardcoding "%ll" in.

Remove the "only if G_HAVE_GINT64 is defined" bit from the discussion of
64-bit integers - we're too dependent on having them to support
compilers that don't have a 64-bit integral data type.  Do, however,
note that neither "long" nor "long long" are acceptable, and also note
that you shouldn't assume "%ll" does the trick for printing them.

svn path=/trunk/; revision=11182
2004-06-19 00:07:23 +00:00
Guy Harris 911bad80f0 Have two strings in an enum_val_t - one that's a short string that is
convenient to put into a command line (no capital letters, no spaces to
require quotes), and one that's a detailed description for use in the
UI.  Allow either of them in the preferences file or "-o" option; use
the detailed description in the UI, and also use it when writing the
preferences out, so that the preference will be readable by older
versions of Ethereal (assuming the preference existed in that version).

Update "README.developer" to give more detail about an enum_val_t (and
to put the _t in), and to give a more detailed description of the
"radio_buttons" argument to "prefs_register_enum_preference()".

svn path=/trunk/; revision=10982
2004-05-24 02:25:21 +00:00
Ulf Lamping 5a40b73898 added hint to use g_snprintf instead of snprintf and sprintf
svn path=/trunk/; revision=10481
2004-03-25 16:01:12 +00:00
Guy Harris e39c338b07 Update to reflect current reality.
svn path=/trunk/; revision=10408
2004-03-19 07:49:29 +00:00
Guy Harris 2b832414fb Describe some problems with processing data pointed to by the result of
"tvb_get_ptr()".

Add a section on roubustness, giving a number of potential problems that
aren't just portability problems.

Document "tvb_get_string()" and "tvb_get_stringz()", better document
"tvb_memcpy()" and "tvb_memdup()".

Fix a typo.

svn path=/trunk/; revision=10239
2004-02-25 22:45:51 +00:00
Jörg Mayer fe1279ed9a Remove a comment on ancient Ethereal
svn path=/trunk/; revision=10115
2004-02-19 11:45:02 +00:00
Olivier Biot 6bd7b570b5 Add a note on white space conventions (tab expansion different from 8 spaces is
a Bad Idea).

Add a note on the new col_append_sep_str() and col_append_sep_fstr() methods.

svn path=/trunk/; revision=10061
2004-02-14 10:37:22 +00:00
Jörg Mayer 5abba20365 Move the list of dissectors (DISSECTOR_SRC) out of Makefile.am and
Makefile.nmake into a shared file named Makefile.common

svn path=/trunk/; revision=9772
2004-01-21 21:46:59 +00:00
Olivier Biot 8770bdb794 Header files proto-ABBREV.h must not exist if there are no functions
to export to other dissectors.

Describe the "if (tree)" construct and its sense by introducing 2 operation
modes of Ethereal:
	(a) operational dissection (tree == NULL)
and
	(b) detailed dissection (tree != NULL).

Fix some typos.

svn path=/trunk/; revision=9495
2003-12-30 15:49:12 +00:00
Guy Harris 87347d7867 Note that "uchar", "u_char", "u_short", "u_int", and "u_long" are also
forbidden.

svn path=/trunk/; revision=9356
2003-12-19 19:08:00 +00:00
Guy Harris 257fb6c7dd Fix the stuff that talks about adding to DISSECTOR_SOURCES to talk about
adding to DISSECTOR_SRC instead, and update it to mention
"Makefile.nmake" in the first instance.

svn path=/trunk/; revision=8966
2003-11-14 19:20:24 +00:00
Guy Harris 35ad6fc26f Warn people not to use the "numbered argument" feature that many UNIX
printf's implement.

svn path=/trunk/; revision=8898
2003-11-06 09:47:06 +00:00
Guy Harris 3de139644b Clarify the previous checkin - that applies to the 'value' argument.
svn path=/trunk/; revision=8797
2003-10-28 05:50:52 +00:00
Guy Harris 5900986044 As per a suggestion by Olivier Biot, note that objects pointed to by
pointer arguments to "proto_tree_add_XXX" functions are copied - if you
allocated a buffer for one of them (e.g., a string), and you don't free
that buffer when you're done with it, you'll leak memory.

svn path=/trunk/; revision=8796
2003-10-28 05:49:29 +00:00
Guy Harris d4fcd2d0a9 Warn about Yet Another GCCism.
svn path=/trunk/; revision=8742
2003-10-20 23:07:43 +00:00