Commit Graph

365 Commits

Author SHA1 Message Date
Anders Broman c2cefb1e10 Document and export:
tvb_bcd_dig_to_ep_str();

svn path=/trunk/; revision=35499
2011-01-12 07:25:34 +00:00
Jeff Morriss 0c4e881911 Introduce, and start using, tvb_get_const_stringz(). This function returns a
pointer to a NULL-terminated string in the TVB.  It is no safer than dissectors
which call tvb_get_strsize() and then tvb_get_ptr() but it makes it clear that
this usage of tvb_get_ptr() is safe.

This function is slightly more efficient than tvb_get_ephemeral_stringz()--but
only as long as we're not using composite TVBs.

svn path=/trunk/; revision=35493
2011-01-12 02:25:08 +00:00
Stephen Fisher 1d4c01023b State in the developer documentation that the tvb_fake_unicode() and
tvb_get_ephemeral_fake_unicode() functions have been superceded by
tvb_get_unicode_string() and tvb_get_ephemeral_unicode_string() respectivey.


svn path=/trunk/; revision=35349
2011-01-03 19:37:13 +00:00
Stephen Fisher 159b55ad12 Document new tvb_get_unicode_string() and tvb_get_ephemeral_string()
functions.


svn path=/trunk/; revision=35345
2011-01-03 18:33:02 +00:00
Stephen Fisher 4f5ccc00f8 Introduce new function called tvb_get_ephemeral_unicode_stringz(), which
is a unicode (UTF-16) version of tvb_get_ephemeral_stringz().  It scans
a tvbuff for a UTF-16 string and converts it to UTF-8 upon return.


svn path=/trunk/; revision=35253
2010-12-23 17:59:34 +00:00
Jaap Keuter fc4d25fcc4 Allow for NULL preference descriptions.
svn path=/trunk/; revision=35242
2010-12-22 06:25:33 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier cd5544679a Revert SVN #35214 based upon comments in the Wireshark-dev list.
http://www.wireshark.org/lists/wireshark-dev/201012/msg00206.html

svn path=/trunk/; revision=35218
2010-12-18 17:55:06 +00:00
Bill Meier 160bee8c16 The Styleguide section has been moved to the Wireshark Developer's Guide.
svn path=/trunk/; revision=35214
2010-12-17 20:55:45 +00:00
Bill Meier 2798debd90 Update the "Following Conversations" section to use se_alloc() instead of GMemChunks.
Also: add information about the conversation_set_dissector() function.

svn path=/trunk/; revision=35185
2010-12-14 14:23:27 +00:00
Bill Meier 2041f87240 Add some info about extended value string to section 1.7.1
svn path=/trunk/; revision=34621
2010-10-22 15:00:37 +00:00
Bill Meier 15851701e8 Rework "extended value strings":
- Allow direct access when a range of values begins with a value other than 0;
- Provide value_string_ext_new() for creating extended value strings at runtime;
- Do access to value_string_ext members via a macro (all but value_string.c);
- Update documentation.

svn path=/trunk/; revision=34514
2010-10-14 17:50:35 +00:00
Jeff Morriss 2a0128c258 Document what prefs_register_string_preference() does with your value pointer.
svn path=/trunk/; revision=33873
2010-08-21 03:54:55 +00:00
Bill Meier 432cfde19c Remove an incorrect line of code from the proto_reg_hanoff prototype.
svn path=/trunk/; revision=33790
2010-08-12 20:05:41 +00:00
Guy Harris f0bb5f4c9a Fix grammaro, indent example code.
svn path=/trunk/; revision=33641
2010-07-27 01:19:06 +00:00
Guy Harris 9f4c3409b2 Tell people to be careful about loops like
for (guint8 = 0; guint8 < guint; guint8++)

(one of which recently caused an infinite loop with a fuzzed packet in
the buildbot).

svn path=/trunk/; revision=33639
2010-07-27 01:06:10 +00:00
Stig Bjørlykke c7ed9aa2b8 Update to reflect changes in defines: REP_* > ENC_*
svn path=/trunk/; revision=33286
2010-06-22 11:54:45 +00:00
Guy Harris 7da29cfe69 Put in a warning about the <stdarg.h> problem that I just found and
fixed in one place (and am now fixing in some other places).

svn path=/trunk/; revision=32962
2010-05-26 02:21:23 +00:00
Bill Meier 9bafe20643 Minor rewording; Also: add note to not use "" for a hf[] array blurb.
svn path=/trunk/; revision=32940
2010-05-25 00:00:58 +00:00
Guy Harris 1b444c55fd Refer to the endianness arguments as "encoding" rather than
"representation" - we already use "representation" to refer to the text
representation of fields.

Change some routines with an endianness argument to make it a
representation argument instead; 

svn path=/trunk/; revision=32929
2010-05-24 06:06:17 +00:00
Guy Harris 5e8cbc60d4 Use the new REP_ values for proto_tree_add_item().
svn path=/trunk/; revision=32925
2010-05-24 03:05:19 +00:00
Anders Broman be717625ff Describe values_string_ext.
svn path=/trunk/; revision=32916
2010-05-23 10:00:50 +00:00
Jeff Morriss 37abd28d34 Document find_or_create_conversation()
svn path=/trunk/; revision=32792
2010-05-13 18:57:41 +00:00
Stephen Fisher 63a9ceeb6c Change copyright date in sample dissector code to 201x from 200x for the
new decade.


svn path=/trunk/; revision=32553
2010-04-25 08:23:12 +00:00
Jeff Morriss 6c5201f39a 64-bit integers take the same FIELDDISPLAY as shorter integers
svn path=/trunk/; revision=32551
2010-04-24 14:53:30 +00:00
Bill Meier e635180aeb (Trivial changes)
svn path=/trunk/; revision=32497
2010-04-16 17:28:03 +00:00
Bill Meier e740706aeb Updates:
1. Include stdio.h, stdlib.h and string.h only if needed;
2. Add dissector source filename to epan/CMakeLists.txt as well as 
   epan/Makefile.common.

svn path=/trunk/; revision=32495
2010-04-16 16:37:31 +00:00
Guy Harris fd29d27282 Rename FIELDBASE to FIELDDISPLAY, as it's a "how to display this"
indication, not necessarily a base (the base is "how to display" some
numeric fields, but it's not how to display some other fields).

Note that FIELDDISPLAY is the number of bits in the field containing an
FT_BOOLEAN bitfield.

svn path=/trunk/; revision=32480
2010-04-15 20:54:27 +00:00
Bill Meier b92603b395 Fix a typo
svn path=/trunk/; revision=32475
2010-04-15 19:33:33 +00:00
Guy Harris 500eb99cd9 Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year.  Move the formats
to a "time_fmt.h" file, included by the headers that use it.  Have
abs_time_to_str() and abs_time_secs_to_str() take the date format value,
rather than a Boolean "show this as UTC" flag, as an argument.  Document
the ABSOLUTE_TIME_ formats a bit better.  Use that format in the CCSDS
and VCDU dissectors, rather than having those dissectors do the
formatting themselves.

svn path=/trunk/; revision=32034
2010-02-27 19:01:27 +00:00
Bill Meier f7440d43e4 Add note about not using C99 features.
svn path=/trunk/; revision=31933
2010-02-20 17:36:18 +00:00
Guy Harris 94b8c6433b Rewrite the bit about null vs. non-null "tree" dissector arguments a
bit, so as not to imply that there's some form of global "mode"
Wireshark is in when it passes a null or non-null pointer (there isn't),
and to explicitly note that there is *no* guarantee about the value of
"tree" on the first call to the dissector.  (I.e., please do not build a
mental model of how Wireshark works in that regard, and write your
dissector based on that mental model - you *will* be wrong.)

svn path=/trunk/; revision=31560
2010-01-18 23:21:13 +00:00
Guy Harris 8e236e55de For fields of type FT_ABSOLUTE_TIME, have the "display" value be one of
ABSOLUTE_TIME_LOCAL or ABSOLUTE_TIME_UTC, indicating whether to display
the date/time in local time or UTC. (int)ABSOLUTE_TIME_LOCAL ==
(int)BASE_NONE, so there's no source or binary compatiblity issue,
although we might want to eliminate BASE_NONE at some point and have the
BASE_ values used with integral types start at 0, so that you can't
specify BASE_NONE for an integral field.

svn path=/trunk/; revision=31319
2009-12-19 03:17:44 +00:00
Guy Harris ed9f7440e3 Clarify that BASE_RANGE_STRING is a flag set in the display field, not
itself a valid value for that field - it should be ORed with a value.

Indicate that it will never be possible to record in a header_field_info
a byte order for all fields, as some protocols do not specify the
endianness of fields (for example, DCE RPC uses "receiver makes it
right", with the sender sending data in its byte order, with an
indication in the packet of what that byte order is).

svn path=/trunk/; revision=31248
2009-12-12 02:33:16 +00:00
Jaap Keuter 6af0e4e002 From Richard Pecl:
Adding prefs_register_protocol_subtree to libwireshark.def

svn path=/trunk/; revision=31246
2009-12-11 17:35:10 +00:00
Guy Harris 0551d2edf8 From Nemeth Marton: in an example of a valid (at least at the C language
level) way to handle passing the result of strlen() to a routine
expecting a int-sized value, mark it as "OK", not "Compiler warning".

svn path=/trunk/; revision=30747
2009-10-28 18:19:54 +00:00
Bill Meier 7b58b17af7 Update: Remove references to the use of check_col() since no longer required.
svn path=/trunk/; revision=29897
2009-09-14 15:28:09 +00:00
Kovarththanan Rajaratnam 49930eff58 We don't use PRId64, PRIu64, PRIx64, PRIX64, and PRIo64 internally in Wireshark, so don't encourage people to use them. Use G_GINT64_FORMAT + friends instead.
svn path=/trunk/; revision=29636
2009-08-31 18:28:10 +00:00
Bill Meier cfde59d509 From dragonlinux AT gmail.com: Fix incorrect location of a right brace;
svn path=/trunk/; revision=29565
2009-08-26 16:39:34 +00:00
Bill Meier 89a44fcd36 Fix a typo
svn path=/trunk/; revision=29241
2009-07-29 23:18:34 +00:00
Stig Bjørlykke 884ef57f1e From Kovarththanan Rajaratnam:
Update to include the new constraints.

svn path=/trunk/; revision=29015
2009-07-08 08:04:30 +00:00
Guy Harris d5289354ab Recommend the expert mechanism, rather than DISSECTOR_ASSERT(), for
checks that really check whether the packet is valid; DISSECTOR_ASSERT()
should only be used for cases where the dissector is making an
assumption about its internal state.

svn path=/trunk/; revision=29006
2009-07-08 00:57:01 +00:00
Anders Broman 568054f777 From Kovarththanan Rajaratnam:
More "Cleanup header_field_info definitions"

svn path=/trunk/; revision=28961
2009-07-06 18:35:05 +00:00
Stig Bjørlykke 9dd57bd754 Use NULL for empty blurb.
svn path=/trunk/; revision=28846
2009-06-26 03:24:08 +00:00
Guy Harris ec5dbeca71 Note that non-ASCII characters in source files cause problems.
svn path=/trunk/; revision=28742
2009-06-15 16:54:07 +00:00
Guy Harris 5dadbecd97 Fix tpyo.
svn path=/trunk/; revision=28708
2009-06-11 17:25:57 +00:00
Stig Bjørlykke 76dfdd6d6f Update the GPL statement used in dissectors.
svn path=/trunk/; revision=28695
2009-06-11 10:29:34 +00:00
Jaap Keuter 8e6cd9ba37 From Reinhard Speyerer:
This patch fixes several misspellings/typos in Wireshark documentation.

svn path=/trunk/; revision=28242
2009-05-02 06:43:24 +00:00
Gerald Combs 31a7e6f676 Add a note about LLP64 portability.
svn path=/trunk/; revision=28080
2009-04-17 20:58:18 +00:00
Gerald Combs 446d43351c Add initial support for string buffers - ep_allocated, growable strings
similar to GLib's GStrings. Use them to create the list of TCP flags.

svn path=/trunk/; revision=27872
2009-03-27 23:05:37 +00:00
Stephen Fisher 1a71ec7c45 Introduce two new functions:
tvb_get_seasonal_string();
  tvb_get_seasonal_stringz();

.. which work the same as the ephemeral versions of the functions, but use
se_alloc() instead of ep_alloc().


svn path=/trunk/; revision=27868
2009-03-27 19:40:23 +00:00
Bill Meier 58f69d7383 Trivial spacing change
svn path=/trunk/; revision=27376
2009-02-05 15:49:52 +00:00
Bill Meier c7450a6a89 Update the description & skeleton code for the use of proto_reg_handoff.
svn path=/trunk/; revision=27239
2009-01-15 16:52:15 +00:00
Stephen Fisher 45ef29a0a8 Wrap "USA." in the address of the FSF onto a new line with a * in front of it.
svn path=/trunk/; revision=26801
2008-11-18 05:15:10 +00:00
Jaap Keuter f1db2a5e83 Update tabsize, re-group bitfield proto_tree functions, extend fieldinfo macro descriptions.
svn path=/trunk/; revision=26667
2008-11-01 14:31:43 +00:00
Bill Meier 6bfb1a0cde Add tvb_bytes_to_str() & tvb_bytes_to_str_punct(); fix a few typos.
svn path=/trunk/; revision=26519
2008-10-23 00:19:58 +00:00
Jaap Keuter 00f08adddb Polish up the proto_tree_add_bitmask() description example.
svn path=/trunk/; revision=26249
2008-09-22 22:15:26 +00:00
Jaap Keuter cc692da997 Fix for bug 2889:
Add description of FT_UINT_BYTES.

svn path=/trunk/; revision=26248
2008-09-22 21:53:44 +00:00
Ulf Lamping e8dedf19b4 compile a document about heuristic dissectors, following:
http://www.wireshark.org/lists/wireshark-dev/200808/msg00234.html

svn path=/trunk/; revision=26146
2008-09-06 11:28:58 +00:00
Bill Meier f2bdbd6a7f Minor rewording; fix a type
svn path=/trunk/; revision=26056
2008-08-22 13:32:25 +00:00
Anders Broman da85c3dfab From Alexey Neyman :
This patch implements a function for dissecting bitfields with better control
over the resulting representation than the existing proto_tree_add_bitmask()
routine. This function will be used by reworked IPMI/ATCA dissector (bug 2048).

The function is described in README.developer. In short, the differences are as
follows:

- The new function does not require a hf_XXX field for the whole bitmask. When
the bitmask includes several unrelated fields, such hf_XXX field does not make
sense.

- The new function allows better control over the way the sub-item descriptions
are added to the top-level item. For example, proto_tree_add_bitmask() function
does not add non-enumerated integers, does not use true_false_string to display
boolean.

- The new function allows to specify "fallback" text for the top-level item
which is used if no items were added to the top-level item.

svn path=/trunk/; revision=25920
2008-08-04 20:41:43 +00:00
Anders Broman 876e751069 From Alexey Neyman :
Implement BASE_CUSTOM display type

svn path=/trunk/; revision=25870
2008-07-30 12:30:02 +00:00
Anders Broman 2e6f9d0dd1 Add information about
tvb_get_bits proto_tree_add_bits_item and proto_tree_add_bits_item_ret_val.

svn path=/trunk/; revision=25866
2008-07-30 10:03:46 +00:00
Jeff Morriss acd338f422 Remove the (long deprecated) proto_tree_add_*_hidden() functions
svn path=/trunk/; revision=25820
2008-07-24 15:35:29 +00:00
Guy Harris 8fa5c9aada Hyphenate "per-packet information".
svn path=/trunk/; revision=25767
2008-07-18 23:44:35 +00:00
Jeff Morriss b54acc9ad7 From Abhik Sarkar via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2661 : fix prototypes of tvb_fake_unicode() and tvb_get_ephemeral_faked_unicode()
svn path=/trunk/; revision=25636
2008-06-30 13:46:34 +00:00
Jaap Keuter 4eb851906f Fix for bug 2612:
cleaned up FT_UINT_STRING type description.

svn path=/trunk/; revision=25459
2008-06-16 05:33:08 +00:00
Bill Meier 007f598798 eth_ --> ws_
svn path=/trunk/; revision=25370
2008-05-23 10:43:04 +00:00
Bill Meier b23ecff0d5 Fix typo
svn path=/trunk/; revision=25346
2008-05-21 19:46:22 +00:00
Bill Meier cfeb34f62b Only Glib/GTK+ >= 2.4/2.4 supported; checkAPIs.pl should be used to verify code.
svn path=/trunk/; revision=25340
2008-05-21 14:27:31 +00:00
Jaap Keuter 1fb551a7ba Clean up PTV cursor documentation.
svn path=/trunk/; revision=25321
2008-05-20 06:28:12 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Jaap Keuter d08a9666b2 From William Pursell:
typos in documentation.

svn path=/trunk/; revision=24719
2008-03-23 09:05:57 +00:00
Stephen Fisher b906bf1708 Fix bug #2382: Typos in README.developer
svn path=/trunk/; revision=24712
2008-03-21 23:41:04 +00:00
Jaap Keuter 0612b830c7 Complete binary tree description with string keys.
Update some entries in developer doc.
Add some preference description in POD.

svn path=/trunk/; revision=24594
2008-03-09 19:48:50 +00:00
Anders Broman e9eb4ce2c2 from Andrew Feren :
Trivial agreement problem in documentation.

svn path=/trunk/; revision=24568
2008-03-05 20:47:36 +00:00
Bill Meier 150fa49c3c Back out useing $Id$; There's a reason for using Date/Author/etc. (Oops)
svn path=/trunk/; revision=24387
2008-02-19 03:44:10 +00:00
Bill Meier b1e58cea59 Fix typo
svn path=/trunk/; revision=24381
2008-02-18 21:07:35 +00:00
Bill Meier 2f9f8d7df8 Fix some some properties
svn path=/trunk/; revision=24380
2008-02-18 21:01:11 +00:00
Stig Bjørlykke f4ad6f2ac0 From Marton Nemeth:
- The "showHex" name cannot be the name paramter. Changing it to "show_hex" should be fine.
- There is also a missing ';' at the end of a line in the example.

This fixes bug 2092.

svn path=/trunk/; revision=23840
2007-12-11 18:39:34 +00:00
Stig Bjørlykke ac3f5f885d From Michael:
Fixed two typos in ReadMe.Developer documentation:
In the example code given, a comment is not properly closed and a semicolon was
missing in variable definition.

This fixes bug 2085.

svn path=/trunk/; revision=23824
2007-12-10 09:22:03 +00:00
Jaap Keuter 73a7469bb1 Update FIELDDESCR with NULL option.
Example code should never show what not to do.

svn path=/trunk/; revision=23779
2007-12-06 08:02:58 +00:00
Stephen Fisher 849e628334 Introduce a new field type called FT_EBCDIC. This field works the same as
FT_STRING, except that it converts the data from the packet from EBCDIC
to ASCII for display in Wireshark.


svn path=/trunk/; revision=23503
2007-11-19 21:27:01 +00:00
Bill Meier c74d7d243a From Andrew Feren: Fix an assortment of typos and other minor errors
svn path=/trunk/; revision=23277
2007-10-26 15:26:04 +00:00
Jeff Morriss 853e791444 Change more fopen() to eth_fopen() to finish fixing bug 1827:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1827

Update README.developer to tell developers not to use fopen() and friends
directly.

svn path=/trunk/; revision=23206
2007-10-16 15:43:18 +00:00
Sake Blok 6a0b11a1dd Update to README.developer describing the use of conversation timestamps
(which was added in SVN 22966 and 23058)


svn path=/trunk/; revision=23169
2007-10-13 07:33:32 +00:00
Jeff Morriss 8ec05eb569 Add a small note saying not to use proto_tree_add_text() in new code unless you have a specific reason (like those given in the next paragraphs).
svn path=/trunk/; revision=23011
2007-09-28 13:39:20 +00:00
Jeff Morriss 7efd1b9a76 Add notes suggesting not to use hidden fields but if you're going to, use PROTO_ITEM_SET_HIDDEN() instead of proto_tree_add_*_hidden(). (I thought that was in here already...) Suggest putting fields-you-want-hidden in subtrees where they can be found by ordinary users.
svn path=/trunk/; revision=23010
2007-09-28 13:33:54 +00:00
Stephen Fisher 5775a1dca8 The dissector packet-dcp.c now fails to compile on MacOS X (gcc 4.0.1/Apple). Change G_INLINE_FUNC back to inline per GLib documentation (also remove recommendation in developer's guide to not use inline):
http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#id2571572

G_INLINE_FUNC

#define             G_INLINE_FUNC
This macro is used to export function prototypes so they can be linked with an external version when no inlining is performed. The file which implements the functions should define G_IMPLEMENTS_INLINES before including the headers which contain G_INLINE_FUNC declarations. Since inlining is very compiler-dependent using these macros correctly is very difficult. Their use is strongly discouraged.

This macro is often mistaken for a replacement for the inline keyword; inline is already declared in a portable manner in the glib headers and can be used normally.


svn path=/trunk/; revision=22980
2007-09-26 03:05:42 +00:00
Guy Harris cd4d203af2 Don't use
case N ... M:

as that's not supported by all compilers.

Say so in the Portability section of README.developer, in the hopes of
discouraging others from using that GCCism.

svn path=/trunk/; revision=22976
2007-09-26 00:41:00 +00:00
Jaap Keuter b989e08afd Added remark on anonymous unions.
svn path=/trunk/; revision=22294
2007-07-13 06:28:44 +00:00
Jeff Morriss 25df9f2133 From Guillem Hernandez: fix decoding of EOSP bit. From Jaap Keuter: fix description of 'value' in proto_tree_add_boolean() that caused the former bug.
svn path=/trunk/; revision=22293
2007-07-12 22:36:35 +00:00
Jaap Keuter 29b56573a0 Add a note on how to handle obsolete preferences
svn path=/trunk/; revision=22279
2007-07-09 16:44:30 +00:00
Guy Harris 2c1e75d519 Update to reflect the use of G_GINT64_MODIFIER, rather than PRI[douxX],
with GLib routines and the routines that love them.

svn path=/trunk/; revision=21991
2007-05-29 18:59:50 +00:00
Jeff Morriss a5f4e7b85a Make RX a new style dissector: return 0 if there isn't at least 28 bytes of message or if it receives an unknown Type. Add a check of tvb length to README.developer's cut-n-paste dissector code.
svn path=/trunk/; revision=21300
2007-04-02 08:25:43 +00:00
Ulf Lamping b05d384d71 add a small section, that code should be warning free
svn path=/trunk/; revision=21291
2007-03-31 15:32:06 +00:00
Sebastien Tandel 0ca67aef30 - new ptvcursor subtrees management functions :
* ptvcursor_push_subtree(), ptvcursor_pop_subtree() for pushing/popping
    subtrees. Multiple levels of subtrees (256 max.), allocation per 8 levels.
  * Two new functions creating an item in the tree and pushing a subtree at the
    same time. These two functions accept an undefined length
    (SUBTREE_UNDEFINED_LENGTH). The length of the item is set at the next pop.
        1) ptvcursor_add_with_subtree
	2) ptvcursor_add_text_with_subtree
- get rid of potential memory leaks with g_new in ptvcursor_new().

- Documentation of the new ptvcursor functions in README.developer


svn path=/trunk/; revision=21276
2007-03-30 00:21:39 +00:00
Jeff Morriss 62596bffb3 Fix bug 552:
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=552

by enforcing that header fields have names of length > 0.  This should fix
the display of those fields and also make them filterable (which was the
subject of the bug).  Abbreviations are (still) optional: if they are empty
then the field is not filterable.

Update README.developer with this information.

Add header field names in several dissectors where they were missing.

In packet-arp.c give "packet-storm-detected" a name (as above) but also set it
as _GENERATED.

Also remove trailing white space from all the files checked in.

svn path=/trunk/; revision=21018
2007-03-11 06:16:00 +00:00
Jaap Keuter 88a508d407 From Richard van der Hoff:
I've had a good look at the code in packet-tcp.c, and whilst it's
somewhat impenetrable, I've come to the conclusion that it just doesn't
support multiple pdus as described.

That's not entirely unreasonable in itself; my objection is solely to
the fact that README.developer is completely misleading. In fact, even
the example dissect_cstr won't work on the tcp dissector, because if you
set desegment_len=1 the tcp dissector believes that you know what you
are doing and doesn't let you change your mind later.

Furthermore, 2.7.2 says that you can set desegment_len=-1; that doesn't
work either, because the tcp dissector expects
DESEGMENT_ONE_MORE_SEGMENT, which is 0x0fffffff, which is nowhere near -1.

In short, I think the relevant section of README.developer needs a
rewrite. I attach a patch - comments welcome.

svn path=/trunk/; revision=20974
2007-03-05 20:25:54 +00:00
Stephen Fisher aa897723ff From Sebastien Tandel:
Here is an updated patch for proto_tree_add_item and the
range_string structure. The new macro RVALS() can be used as the macro
VALS() in the declaration of your hf_register_info with another
structure (range_string).  Be aware that you *have to* ORed the value of
the field display with BASE_RANGE_STRING constant and it can 'only' be
used with FT_(U)INT* types in a header_field_info.


svn path=/trunk/; revision=20805
2007-02-14 00:39:48 +00:00
Stephen Fisher 0ebc01dc03 From Sebastien Tandel:
Create two new files (ws_strsplit.[ch]) that use GTK2 code to override
the buggy g_strsplit() function when compiling for GTK1.  Include this
work-around function (ws_strsplit) in libwireshark.def.  Add notes on usage
to README.developer.  Include epan/ws_strsplit.h in all files that use
g_strsplit().


svn path=/trunk/; revision=20804
2007-02-13 20:57:22 +00:00
Jeff Morriss e166f9c4e6 Explain what 'base' in 'prefs_register_uint_preference()' is: it's used in 'strtoul()'
svn path=/trunk/; revision=20636
2007-01-31 01:59:12 +00:00
Jaap Keuter e4e739a5ca From Graham Bloice:
In the Developers Guide, Section 9.3, Example 9.17. Decompressing data
packets for dissection

The code calls tvb_set_free_cb() for the newly created next_tvb.  This
is unnecessary as the call to tvb_set_child_real_data() adds next_tvb to
the chained list of tvb, thus ensuring that next_tvb is correctly
deleted.  In fact when I had the call in, Visual Studio kept breaking
deep down in ntdll.dll, probably because of a double free every time the
main tvb was deleted.

In README.developer, para 2..2.7 The example conversation code doesn't
assign the result of conversation_new() back into the conversation variable.

svn path=/trunk/; revision=20569
2007-01-26 17:12:00 +00:00
Jaap Keuter f8422ab7db Extending true_false_string support
- Separate tfs.[ch]
- Add larger sample collection
- Properly export DATA

svn path=/trunk/; revision=20373
2007-01-10 07:47:00 +00:00
Stephen Fisher 8b8b648ad6 From Stig Bjorlykke:
* Fixed a typo in README.developer


svn path=/trunk/; revision=20132
2006-12-14 00:05:03 +00:00
Stephen Fisher c980cede98 From Francesco Fondelli:
I defined a range_string struct. It's like value_string
but stores range <-> string pairs.
Moreover I wrote rval_to_str(), match_strrval_idx()
match_strrval() which are behaving exactly as
val_to_str(), match_strval_idx() and match_strval().


svn path=/trunk/; revision=20061
2006-12-07 20:29:40 +00:00
Jeff Morriss 39c6f8bf89 Add documentation of the col_set_fence() and col_prepend_fence_fstr() calls. I *think* I got the description of col_prepend_fence_fstr() right.
svn path=/trunk/; revision=20015
2006-11-29 13:42:16 +00:00
Ronnie Sahlberg 3ea6b058d9 add description of proto_tree_add_bitmask()
svn path=/trunk/; revision=20011
2006-11-28 09:09:58 +00:00
Jeff Morriss 09078377d9 Change to show how to write a 'new style' dissector (that is, one that returns the number of bytes it was able to dissect). I think the Developer's Guide (docbook/) probably needs similar updates but I'm a bit shy about editing XML with good old vi; maybe if I can figure out if I can build the doc in the first place... Also rewrap a few pararaphs that went past 80 columns.
svn path=/trunk/; revision=19989
2006-11-26 14:00:01 +00:00
Guy Harris 9bf2e75f68 If you're doing TCP reassembly by hand rather than with
tcp_dissect_pdus(), pinfo->desegment_len indicates whether your
dissector needs more data from TCP or not - the return value doesn't
indicate that.

Fix typo.

It appears that the Id keyword is one of the case-insensitive ones in
the svn:keywords property, so if you set it to "ID" it still expands
"$Id$"; it also appears not to expand "$ID$".  We use Revision, Date,
and Author in the document to indicate the revision, and don't expand
Id, so that references to "$Id$" get left alone.

Rewrap paragraphs.

svn path=/trunk/; revision=19950
2006-11-21 20:10:10 +00:00
Jaap Keuter 45aa24f1ec Correct comments and examples on get_pdu_len().
svn path=/trunk/; revision=19949
2006-11-21 14:18:46 +00:00
Gerald Combs 50998dea36 Add comments to the indentation style section.
svn path=/trunk/; revision=19910
2006-11-16 18:28:09 +00:00
Guy Harris 8f3f19975d Add Yet Another Portability Recommendation.
svn path=/trunk/; revision=19855
2006-11-07 09:12:30 +00:00
Guy Harris 6c0027f4a9 Mention the 64-bit-integer accessors.
svn path=/trunk/; revision=19703
2006-10-26 10:27:16 +00:00
Ulf Lamping 2117343868 - some more cleanup
- mention the other README files
- encode some @ chars to [AT] in mail addresses

svn path=/trunk/; revision=19551
2006-10-16 03:25:50 +00:00
Ulf Lamping 262774ad51 split the display filter engine doc into it's own file
svn path=/trunk/; revision=19549
2006-10-16 02:37:06 +00:00
Ulf Lamping 565d3841b9 add a prerequisites section and some minor changes
svn path=/trunk/; revision=19545
2006-10-15 22:42:22 +00:00
Jaap Keuter aafce04fd4 Update FSF address in code template
svn path=/trunk/; revision=19531
2006-10-14 19:00:31 +00:00
Jaap Keuter a4ed1160e0 Cleanup sample code.
Cleanup some text and headings.
Play trick with keyword so text remains untouched.

svn path=/trunk/; revision=19504
2006-10-12 10:38:24 +00:00
Ulf Lamping 27b3b45627 from Stephen Fisher:
"I ran doc/README.developer through a spell checker and conservatively 
changed misspelled words.  Attached is a compressed patch with the 
corrections."

svn path=/trunk/; revision=19070
2006-08-29 00:15:09 +00:00
Jörg Mayer bffc4ab0e5 Stephen Fisher:
This patch fixes two typos in README.developer

svn path=/trunk/; revision=18870
2006-08-10 10:21:44 +00:00
Jaap Keuter cc1a6ebfa6 Update the ptvcursors chapter.
svn path=/trunk/; revision=18639
2006-07-03 09:26:19 +00:00
Jaap Keuter 257f76d96a Stricter wording for PROTOABBREV
svn path=/trunk/; revision=18535
2006-06-21 19:33:05 +00:00
Gerald Combs eb71f7fb96 Rename the main executable to "wireshark", along with more conversions:
ethereal.com -> wireshark.org
  mailing lists and addresses
  ETHEREAL -> WIRESHARK
  Man pages
  Automake/Autoconf names


svn path=/trunk/; revision=18271
2006-05-31 19:12:15 +00:00
Gerald Combs 8958bab6de Tethereal/tethereal -> TShark/tshark.
svn path=/trunk/; revision=18268
2006-05-31 17:38:42 +00:00
Ronnie Sahlberg 6075ec39fb ethereal->wireshark
svn path=/trunk/; revision=18207
2006-05-22 08:21:22 +00:00
Ronnie Sahlberg f0b33a4789 ethereal->wireshark updates
svn path=/trunk/; revision=18206
2006-05-22 08:14:01 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Tomas Kukosa d31072a9a2 update with FT_GUID, FT_OID, BASE_DEC_HEX, BASE_HEX_DEC
svn path=/trunk/; revision=18163
2006-05-15 16:28:49 +00:00
Gilbert Ramirez e3899ed4a4 Add infrastructure for display filter functions.
Add upper() and lower() display filter functions for string fields.

svn path=/trunk/; revision=18071
2006-05-02 14:26:17 +00:00
Jörg Mayer c7a3dd2938 Remove references to README.tvbuff. The Makefile.am should fix the
buildbot failure.

svn path=/trunk/; revision=17405
2006-02-25 02:02:36 +00:00
Jaap Keuter 6a8533fbb0 Remove obsolete document README.tvbuff
svn path=/trunk/; revision=17401
2006-02-24 21:54:54 +00:00
Guy Harris 13a8667b08 Document the proto_tree_add_XXX_format_value() routines.
svn path=/trunk/; revision=17318
2006-02-16 11:51:02 +00:00
Gilbert Ramirez 7764c48771 Document ptvcursors.
svn path=/trunk/; revision=16308
2005-10-25 17:10:04 +00:00
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