Commit Graph

365 Commits

Author SHA1 Message Date
Chris Maynard ab10fed503 Trivial: remove extraneous word, 'is'.
svn path=/trunk/; revision=49423
2013-05-20 01:35:17 +00:00
Evan Huus b39cf04f14 Add CppCheck to the list of things to run before submitting code for review.
svn path=/trunk/; revision=49077
2013-04-27 23:11:06 +00:00
Evan Huus 4e3c836273 Major cleanup of skeleton dissector and related bits of README.developer.
Changes of note:
- Removed the 'Copied from' notice, it's only relevant if they're *not* using
  the skeleton code. Added a paragraph to README.developer instead.
- Exorcised all references to if (tree) and placed them in their own section
  at the bottom as an optimization. Hopefully this will be less confusing.

svn path=/trunk/; revision=48861
2013-04-15 21:43:40 +00:00
Evan Huus bb2820deb0 Put the skeleton sample code from README.developer into its own file - it's
much easier to edit/maintain that way as well as much easier to copy for a
new dissector. Explicitly don't set the SVN id tag since this is a template.

svn path=/trunk/; revision=48860
2013-04-15 20:56:55 +00:00
Chris Maynard 07b35a96b7 Add some missing tvb_get_'s, proto_tree_add_'s, fix args and change all little_endian's to encoding. Some detailed descriptions are still missing though.
svn path=/trunk/; revision=48629
2013-03-28 20:22:47 +00:00
Evan Huus 8569907b9f From Steve Magnani via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8339
This patch adds a new public API, proto_tree_add_bitmask_len(), identical to
proto_tree_add_bitmask() but using a caller-supplied length rather than an
inferred one. The underlying proto_item_add_bitmask_tree() code is modified
to display only fields for which all defined bits are available, and to
ignore bits that have no corresponding defined field ("forward compatibility"
cases).

From me: minor edits, see the bug for more details.

svn path=/trunk/; revision=48049
2013-03-04 14:18:18 +00:00
Martin Kaiser 29de8baed5 mention gcrypt wrapper in README.developer
svn path=/trunk/; revision=47812
2013-02-21 22:24:43 +00:00
Alexis La Goutte ecb898db1e Fix the dev guide to use the correct indent (Tab => 4 Spaces) and add Modelines info
svn path=/trunk/; revision=47415
2013-02-01 09:22:40 +00:00
Chris Maynard 8ee3809edc Add 2 more verification steps to run in the "Submitting code for your new dissector" section.
svn path=/trunk/; revision=47388
2013-01-31 17:17:34 +00:00
Evan Huus a19980c23d Replace another instance of emem in README.developer with wmem.
svn path=/trunk/; revision=46847
2012-12-29 20:41:12 +00:00
Jeff Morriss 456acec892 Do a little more to discourage the use of proto_tree_add_text(): don't
use it as example in a few places and point out that if you're not using the
return value to build a subtree, you probably shouldn't be using the function.

svn path=/trunk/; revision=46617
2012-12-19 15:54:40 +00:00
Jeff Morriss ed87fa9e3b Come down harder on the evils of tvb_get_ptr(): advise not to use it.
Combine the two comments in the Portability section (which largely said the
same thing) on the perils of that function.

Don't suggest it as an option to ensure there are enough bytes in the TVB.

svn path=/trunk/; revision=46590
2012-12-18 16:42:16 +00:00
Evan Huus 7f23c2f8b7 Recommend wmem over emem in the READMEs where possible.
svn path=/trunk/; revision=46472
2012-12-08 21:57:05 +00:00
Jörg Mayer 015cdcef78 Fix the main dissect_PROTO signature
svn path=/trunk/; revision=46046
2012-11-16 20:52:30 +00:00
Jeff Morriss 22b7086fb9 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=44997
2012-09-19 01:37:13 +00:00
Chris Maynard b840ba44b4 Trivial typo fix and duplicate word removal.
svn path=/trunk/; revision=44695
2012-08-29 17:05:38 +00:00
Bill Meier 0035a9076b Force extended value string linear search (not binary search) in one case:
Fixed: { -2, -1, 0, 1, 3} (note gap) used a binary search (which would fail);

 Note:  { -2, -1, 0, 1, 2 ,3 } (no gap) allowed; will still do a direct access;

Also: Add a comment to README.developer extended value string section.

svn path=/trunk/; revision=44659
2012-08-24 20:44:33 +00:00
Bill Meier 7d891022e6 Minor update to tcp_dissect_pdus() section.
svn path=/trunk/; revision=44658
2012-08-24 20:22:48 +00:00
Jörg Mayer 409f711889 Add a link where to find some GUIs for git.
svn path=/trunk/; revision=44554
2012-08-17 18:13:39 +00:00
Evan Huus 81f3e4f4a8 Add note to README.developer about not passing NULL to %s format strings.
Part of wireshark-dev conversation starting with:
http://www.wireshark.org/lists/wireshark-dev/201208/msg00125.html

svn path=/trunk/; revision=44548
2012-08-17 01:12:10 +00:00
Jeff Morriss 4fdc3c3cc2 Create, and start using, file name preferences.
File name preferences are basically just string preferences except that the
GUI will present a "Browse" button that allows the user to go and find the
file s/he wants (rather than having to blindly type in the full path).

svn path=/trunk/; revision=43228
2012-06-13 01:13:12 +00:00
Bill Meier 5b53b81835 Note that calls to "expert" functions should not be under 'if (tree)'.
svn path=/trunk/; revision=43224
2012-06-12 13:03:05 +00:00
Guy Harris 1c7269a6d1 Mention ENC_UCS_2 and ENC_UTF_16.
svn path=/trunk/; revision=42602
2012-05-12 20:10:18 +00:00
pascal c69d317daf Fix typo errors
svn path=/trunk/; revision=42340
2012-04-29 18:25:06 +00:00
pascal e94974887c Convert spaces to tabs
svn path=/trunk/; revision=42247
2012-04-25 21:37:10 +00:00
Bill Meier 7ee82aac06 Update descriptions of hf[] FIELDDISPLAY and BITMASK fields.
svn path=/trunk/; revision=41400
2012-03-07 16:38:08 +00:00
Bill Meier ae54957153 Emphasize corrext usage of FT_BOOLEAN 'display' field.
Specificaly:
 For a field type FT_BOOLEAN:
 - If the bitmask field is zero, then the 'display' field
   must be 'BASE_NONE';
 - If the bitmask field is non-zero, then the 'display' field
   must be the field-width of the parent bit field.

svn path=/trunk/; revision=41379
2012-03-06 20:51:50 +00:00
Bill Meier 24fc709aad (Trivial) Fix a typo.
svn path=/trunk/; revision=41343
2012-03-04 23:01:39 +00:00
Anders Broman d5851a0953 forgotten update
svn path=/trunk/; revision=41340
2012-03-04 19:03:03 +00:00
Anders Broman 872c2094c4 From Mike Morrin:
The attached patches add the uses
proto_tree_add_split_bits_ret_val()
proto_tree_add_split_bits_crumb()

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6885

svn path=/trunk/; revision=41249
2012-02-29 20:38:39 +00:00
Alexis La Goutte 5de89fbb74 Add tvb_ip_to_str and tvb_ip6_to_str to the Dev Guide
svn path=/trunk/; revision=40941
2012-02-09 17:41:22 +00:00
Chris Maynard c2eacb6f27 Fix some typos.
svn path=/trunk/; revision=40759
2012-01-29 15:51:21 +00:00
Chris Maynard 77e062c425 Mention the other integer accessors.
svn path=/trunk/; revision=40704
2012-01-24 20:31:35 +00:00
Jeff Morriss 3b0625c340 Fix a spelling mistake. Wrap a few long lines.
svn path=/trunk/; revision=39587
2011-10-26 01:42:55 +00:00
Bill Meier 024230ece0 Update information about 'encoding' arg values for particular field-types.
svn path=/trunk/; revision=39568
2011-10-25 17:27:48 +00:00
Alexis La Goutte bc5639cdf6 FT_EUI64 need also to specifies encoding !
svn path=/trunk/; revision=39191
2011-09-30 14:26:43 +00:00
Guy Harris f45ade999f Update README.developer to take into account the disappearance of
FT_EBCDIC and the addition of support for character encodings.

svn path=/trunk/; revision=39190
2011-09-29 22:40:32 +00:00
Chris Maynard e69df476e7 Add default modeline settings to the end of the skeleton code.
svn path=/trunk/; revision=39178
2011-09-28 19:40:34 +00:00
Guy Harris 76a2642927 Future tense -> present tense for the encoding argument to
proto_tree_add_item() having more than just a byte order.

svn path=/trunk/; revision=39170
2011-09-27 19:43:54 +00:00
Stig Bjørlykke 5603cef9f2 Remove support for libpcre, we use GRegex in GLib.
svn path=/trunk/; revision=38683
2011-08-23 09:25:06 +00:00
Jörg Mayer 6dace04493 Add instructions how to work with "git svn" instead of "svn"
svn path=/trunk/; revision=38080
2011-07-18 12:44:19 +00:00
Bill Meier f6b5df0c45 Update ptvcursor API description to reflect 'endianness' --> 'encoding' parameter change.
svn path=/trunk/; revision=38048
2011-07-15 17:44:24 +00:00
Gerald Combs 49b92440de More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versions
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove
tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and
reassemble_cleanup() since they were only used for older GLib versions
which didn't support GSlices. Assume we always support the "matches"
operator.

svn path=/trunk/; revision=37978
2011-07-11 20:32:19 +00:00
Alexis La Goutte 7d317e553b Add FT_EUI64 Field Type
* Remove proto_tree_add_eui64 function from 802.15.4 Dissector 
* Replace print_eui64/print_eui64 by eui64_to_str/get_eui64_name
* Update Documentation (README.dev)
* Add new function in libwireshark.def
* Support of encoding for tvb_eui64_to_str
* Use FT_EUI64 for ICMPv6, CAPWAP, Zbee ... dissector

svn path=/trunk/; revision=37015
2011-05-08 10:23:53 +00:00
Bill Meier f8ce3da390 Add some info as to the determination of the length of a FT_STRINGZ item.
Add a note not leaving trailing whitespace on a line.

svn path=/trunk/; revision=36434
2011-04-01 20:48:56 +00:00
Jeff Morriss fddb50a582 Document that proto_tree_add_bytes_format() and
proto_tree_add_bytes_format_value() may be given a NULL value_ptr.


svn path=/trunk/; revision=35907
2011-02-10 22:57:50 +00:00
Jeff Morriss 69b78fc118 Document that NTP times can be added with proto_tree_add_item().
svn path=/trunk/; revision=35884
2011-02-09 02:43:10 +00:00
Jaap Keuter a3611f713e Sharpen the description of preference names.
svn path=/trunk/; revision=35671
2011-01-26 21:20:09 +00:00
Jeff Morriss 4eb43096b1 From Alexis La Goutte via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5603 :
Following the discussion on the dev mailing list about ett_ value in subtree
http://www.wireshark.org/lists/wireshark-dev/201101/msg00039.html

a small to update the Readme Developer Guide !

svn path=/trunk/; revision=35610
2011-01-21 17:08:35 +00:00
Chris Maynard 116d67e164 Add tvb_get_[n|le]toh[40|48|56]() accessors. Addresses bug 5082.
svn path=/trunk/; revision=35538
2011-01-14 19:02:38 +00:00
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