Commit Graph

241 Commits

Author SHA1 Message Date
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Michael Mann 2f73ac0c8c Remove support for "old style" dissectors in PER API.
Most of it wasn't used in current Wireshark source anyway.

Change-Id: If395e4e940adc76a2701d226ba4f7c9b17cb795d
Reviewed-on: https://code.wireshark.org/review/12108
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-24 23:33:37 +00:00
Michael Mann 74541a9596 Don't allow multiple registrations of a protocol in dissector tables.
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing.

The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not.  It's just ENFORCED for Decode As.

Bug: 3949
Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127
Reviewed-on: https://code.wireshark.org/review/11405
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:39:40 +00:00
Guy Harris ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
Pascal Quantin a77d3db9fe PER: fix ASAN runtime error: left shift of negative value -1
Change-Id: Ibab619ee96b0389df87021156c4bf35a3d52063c
Ping-Bug: 9887
Reviewed-on: https://code.wireshark.org/review/11240
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-24 14:20:49 +00:00
Pascal Quantin 5518ae0787 PER: followup of g59453fb
Change-Id: I45c02a249444e5f17d99eeb0ca8dea6f7a012262
Reviewed-on: https://code.wireshark.org/review/10356
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-02 11:59:42 +00:00
Michael Mann 59453fb54b Eliminate proto_tree_add_text from packet-per.c
Change-Id: I67f572129821fb00e4478a30bfd4a52287b8b1a1
Reviewed-on: https://code.wireshark.org/review/10350
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-02 05:15:41 +00:00
Alexis La Goutte 71b6be7f87 PER: fix indent (use tabs)
Change-Id: I123960f475550b5e3cab9e6eb7eaa6d896fae557
Reviewed-on: https://code.wireshark.org/review/8815
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-08 07:28:07 +00:00
Pascal Quantin c100e1cf52 PER: fix V593 warning reported by PVS-Studio
Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)'.

Change-Id: I162a2d081a70cb39b326d3aa2dc4108f49962169
Reviewed-on: https://code.wireshark.org/review/8821
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-07 19:00:33 +00:00
Guy Harris 2d63e58b47 Fix some more constants to be unsigned.
Change-Id: I714078683cff517c79a15abf29e1ae4a9a60271d
Reviewed-on: https://code.wireshark.org/review/8365
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-09 06:56:10 +00:00
Pascal Quantin 803d120148 PER: fix dissection of known-multiplier character strings with ub less or equal to 2^b-1
See ITU-T X.691 chapter 30.5 for details

Change-Id: I6ac31494997349c6bff19b196e72859a31634af4
Ping-Bug: 11039
Reviewed-on: https://code.wireshark.org/review/7633
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-12 22:00:07 +00:00
Michael Mann e333e4c90f Convert OID APIs to use wmem.
There are a few oid functions that are only called in oids_test.c.  I'll presume the APIs are used in proprietary dissectors rather than just remove them.

Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f
Reviewed-on: https://code.wireshark.org/review/6592
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-19 02:52:11 +00:00
Michael Mann d1d5bf121e Replace proto_tree_add_text in dissector header files where it was used in a macro that should be expert info.
Change-Id: I045368a0a91586231fc4b1e2700c2275088b76af
Reviewed-on: https://code.wireshark.org/review/6244
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-02 22:11:34 +00:00
Martin Mathieson 7e8a4b0927 Deleting unnecessary #includes from dissectors.
Fourth batch (packet-mac-lte.c -> packet-rtp.c).

Will look at cleaning up and committing script afterwards.

Change-Id: Id921f07f4b274f0cfb77ce81abe4a285fdb8b644
Reviewed-on: https://code.wireshark.org/review/6023
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 17:16:40 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
AndersBroman 750d377b30 Add OID dissector table for PER based dissection.
Change-Id: Iaf789017e997eddf7d6dc596eb40fdef413bfd68
Reviewed-on: https://code.wireshark.org/review/4778
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-21 08:32:12 +00:00
Guy Harris a517d500b4 Make sort_alphabet() not fail too badly with characters in [128,255].
Treat all values in the alphabet as unsigned.

Change-Id: I4476c75352f32673a9cd131ea233465f3376fa25
Reviewed-on: https://code.wireshark.org/review/4747
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-16 21:56:03 +00:00
Bill Meier 24d50bc290 Adjust indentation to match editor modelines; Do other minor whitespace changes.
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353
Reviewed-on: https://code.wireshark.org/review/4502
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 17:12:33 +00:00
Bill Meier b14bf98c06 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6
Reviewed-on: https://code.wireshark.org/review/4124
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 13:51:51 +00:00
Michael Mann fc63343a4e convert to proto_tree_add_subtree[_format]
Change-Id: I8df48b25de784a48a25f0e48aac1e1545ed92c35
Reviewed-on: https://code.wireshark.org/review/2865
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-05 20:36:36 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 026fae3855 Don't use 'L' as a constant modifier.
svn path=/trunk/; revision=54343
2013-12-21 21:42:18 +00:00
Guy Harris 317b828986 Use proto_tree_add_item() or tvb_get_string_enc() instead of
tvb_get_unicode_string().  If there's an indication that the encoding is
UCS-2, use that, otherwise use UTF-16.  (For example, "BMP" stands for
"Basic Multilingual Plane", which is the part of Unicode that can be
encoded in 16 bits, hence UCS-2.)

In the description of the "Use Heuristics for UDP" preference for the
XML dissector, note that it's not just trying to recognize XML in UCS-2,
it's trying to recognize XML in *big-endian* UCS-2.

svn path=/trunk/; revision=54245
2013-12-19 09:19:33 +00:00
Anders Broman e6d09c1634 Make local functions static. Include *.h when needed.
svn path=/trunk/; revision=54201
2013-12-17 22:07:32 +00:00
Jakub Zawadzki 715e2d6699 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54095
2013-12-14 16:09:57 +00:00
Pascal Quantin b4b5d00712 Fix the number of highlighted bytes in case of unaligned PER constrained integer
svn path=/trunk/; revision=53400
2013-11-17 17:00:11 +00:00
Pascal Quantin ea45be32c5 Add a way to retrieve a PER variable bit string length
svn path=/trunk/; revision=53382
2013-11-17 13:31:32 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Pascal Quantin f02d2f8705 Update function name in debug info
svn path=/trunk/; revision=52434
2013-10-07 08:14:15 +00:00
Pascal Quantin e5d29e2bd4 Add support for relative OID to PER dissector
svn path=/trunk/; revision=52423
2013-10-06 21:23:39 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Pascal Quantin a6ae13dee9 Slightly different fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9117 :
Check that tvb returned by dissect_per_bit_string is not null before trying to use it

svn path=/trunk/; revision=51846
2013-09-08 21:10:36 +00:00
Evan Huus e69ec10794 Callers of tvb_per_bit_string expect that the returned value_tvb is non-NULL.
Ensure that is the case even in certain peculiar error conditions, by filling it
with a 0-length subset TVB. Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9117

Also add modelines.

svn path=/trunk/; revision=51821
2013-09-07 13:48:13 +00:00
Pascal Quantin b46f9bebe2 Change some dissectors to use pinfo memory pool instead of malloc if it can trigger an exception between between buffer allocation and tvb_set_free_cb call
svn path=/trunk/; revision=51427
2013-08-19 14:55:41 +00:00
Chris Maynard 365d223fdd Trivial. Fix warning: Value stored to 'str_index' is never read.
svn path=/trunk/; revision=51392
2013-08-16 19:28:24 +00:00
Pascal Quantin 23d40bcfcf Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8841 :
Fix PER normally small non-negative whole number dissection when it is greater than or equal to 64

svn path=/trunk/; revision=50969
2013-07-28 12:36:48 +00:00
Michael Mann 7878e93cad expert_add_info_format_text + proto_tree_add_text = proto_tree_add_expert_format, where applicable.
svn path=/trunk/; revision=50377
2013-07-03 23:43:26 +00:00
Michael Mann 98492c5619 expert_add_info + proto_tree_add_text = proto_tree_add_expert, where applicable
svn path=/trunk/; revision=50337
2013-07-03 02:59:31 +00:00
Evan Huus 3098636502 Ensure that the length parameter to dissect_per_length_determinant is
initialized even in cases where we error or otherwise fail to dissect.

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

Thanks to Pascal for his help digging through this one.

svn path=/trunk/; revision=49985
2013-06-17 19:25:45 +00:00
Michael Mann 2ee48f150d Batch of filterable expert infos.
svn path=/trunk/; revision=49868
2013-06-10 02:18:55 +00:00
Anders Broman 3eb06be97d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48425
2013-03-19 19:28:57 +00:00
Martin Kaiser 8772db463a actx is used, remove _U_
svn path=/trunk/; revision=48284
2013-03-13 22:54:46 +00:00
Pascal Quantin 3ff81e9332 Fix error: declaration of 'j' shadows a previous local
svn path=/trunk/; revision=47445
2013-02-02 13:31:46 +00:00
Pascal Quantin eac8585dc9 Increase the maximum number of OPTIONAL / DEFAULT components per SEQUENCE to 128 and make it configurable through a define
svn path=/trunk/; revision=47444
2013-02-02 13:13:19 +00:00