Commit Graph

126 Commits

Author SHA1 Message Date
Joakim Karlsson 4b0bf62791 asn2wrs: disable template line directive by default
Same as with !8955, To debug with line directive build with
-DENABLE_DEBUG_A2W=ON flag
2022-11-30 17:31:46 +00:00
Joakim Karlsson 5b8cb733fa asn2wrs: disable line directive by default
To debug with line directive build with -DENABLE_DEBUG_A2W=ON flag
2022-11-30 11:03:09 +00:00
Evan Huus e69446aa55 asn1: convert most dissectors to pinfo->pool
Part 1/2 as the commits were too big for CI.

Largely find/replace, with a few manual tweaks. Then regenerate the asn1
dissector sources and make sure everything still builds. There are a
handful of cases I skipped as too complex, but this covers most of the
asn1 dissectors.
2021-07-26 15:30:11 +00:00
Anders Broman 0fdbe0839d asn2wrs: Rename duplicated filter names 2020-12-15 10:54:58 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Anders Broman 7edadf9ce3 asn2wrs: Improve filtername of named bits.
Change-Id: Ie22137e95c8752a0783e3e9ff99b45c0b79b0d4a
Reviewed-on: https://code.wireshark.org/review/32714
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 13:26:33 +00:00
Anders Broman c2ac157ac0 ASN.1: Use proto_tree_add_bitmask... () for named bits.
Change-Id: Ied0c91ea070ee76603e7ecb29d874e0c1a65892e
Reviewed-on: https://code.wireshark.org/review/32684
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-03 14:53:08 +00:00
Guy Harris 494508f2d0 Clean up REPORT_DISSECTOR_BUG().
Have it take a format and argument list as arguments, and have the
formatting done inside the reporting code.  That way, we're not relying
on any particular wmem scope working.

If WIRESHARK_ABORT_ON_DISSECTOR_BUG is set, try to add the message to
the crash information (currently only supported in macOS), and print it
to the standard error, before crashing.  We won't necessarily have a
usable crash dump to analyze, so we can't rely on that to find the cause
of the crash.

Ping-Bug: 14490
Change-Id: I2b39169c45c84f2ada31efa1d413bd28c140f8f4
Reviewed-on: https://code.wireshark.org/review/26643
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-25 23:49:35 +00:00
Pascal Quantin d9d6106044 ASN.1: update auto generated dissectors
Change-Id: Ic73e72b3d2e7590eaed07f6eb30f74f4303e7a65
Reviewed-on: https://code.wireshark.org/review/25880
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-02-18 17:47:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
AndersBroman f05f4893fa [ACSE] Get rid of global variable top_tree.
Change-Id: I2084c313e778f0895a4f7a58dee445f0e742e78e
Reviewed-on: https://code.wireshark.org/review/23290
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Tomáš Kukosa <tomas.kukosa@ixperta.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-08-29 19:49:29 +00:00
Michael Mann 9365fd3d3a Convert GHashTable -> wmem_map_t for ASN.1 disseectors
Change-Id: Id749c41947c6300f2c82ed947352c336f9e45b72
Reviewed-on: https://code.wireshark.org/review/19838
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-30 02:25:24 +00:00
Michael Mann a062c80236 ASN.1 dissectors - don't try to find yourself.
If an ASN.1 dissector is calling register_dissector for itself in its proto_register_xxx
function and then calling find_dissector for itself in its proto_reg_handoff_xxx
function then just create a static handle for that dissector and use the return
value of register_dissector, so the find isn't necessary.

Change-Id: I911bdadc2fb4259601c141b955e741a2369cc447
Reviewed-on: https://code.wireshark.org/review/16233
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-01 14:26:20 +00:00
João Valverde 54a520d4a1 Move /asn1 to /epan/dissectors
Change-Id: I1208fe3c2ba428995526f561e8f792b8d871e9a9
Reviewed-on: https://code.wireshark.org/review/14388
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-13 21:30:24 +00:00
Stig Bjørlykke 47fc7ffcb0 asn1: Cleanup space usage
Fix space issues in some ASN.1 dissectors.

Change-Id: I4ceccfbe9a13c93fc91821d1bfe4b7d6bb39c435
Reviewed-on: https://code.wireshark.org/review/13791
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-06 13:27:59 +00:00
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 a391a70b3b "new" dissector API -> dissector API for ASN.1 dissectors.
Change-Id: I7b794cba2feda2cae40411e2b1cb9fb091d08220
Reviewed-on: https://code.wireshark.org/review/12480
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 03:12:23 +00:00
Martin Kaiser 585f944f65 acse: don't THROW() an exception from a dissector
we already have an expert info, we can simply exit

Change-Id: I8adbfb084991195152a02bbef64c38c5aa9e841e
Reviewed-on: https://code.wireshark.org/review/9113
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-06-25 01:02:24 +00:00
Pascal Quantin 9aeb249943 ACSE: get rid of an evil global variable
Bug: 10787
Change-Id: I225dab439e195bbd308bcafd4658e77ef9023c0f
Reviewed-on: https://code.wireshark.org/review/6263
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-04 20:14:11 +00:00
Bill Meier dd859eada4 asn1 generated dissectors: cleanup #include usage
Change-Id: I36b2731d67f9345d2fd0c23800bba7d2be94c387
Reviewed-on: https://code.wireshark.org/review/6008
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-23 05:39:00 +00:00
Michael Mann cd02af56a1 Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions.

Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree.

Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141
Reviewed-on: https://code.wireshark.org/review/3500
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-09 01:57:08 +00:00
Evan Huus 5ed05dd747 batch of manual tvb_length conversions
Change-Id: Ib3a1ddc4342a7a8648d6ed8bfcb35aa229c56a27
Reviewed-on: https://code.wireshark.org/review/2445
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 19:55:31 +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
Pascal Quantin d6548f9301 Remove unused const variables errors seen with recent Clang version
Fixes bug 9886

Change-Id: I8624ef1c5874aea5521d21c998510fc29c838936
Reviewed-on: https://code.wireshark.org/review/657
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-15 17:52:16 +00:00
Bill Meier 1dff4e309d Remove trailing whitespace from asn1 .cnf & template.[hc] files. Regenerate dissectors.
Change-Id: I0e779b2ac2f608356649c5bbfca438141070dea4
Reviewed-on: https://code.wireshark.org/review/412
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-26 19:38:21 +00:00
Jeff Morriss 8c608e6e82 Remove $Id$ from the ASN.1 dissectors and regenerate them.
Change-Id: Ie476c6f82f318188b41ed922b92c6fec119ea954
Reviewed-on: https://code.wireshark.org/review/244
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-18 03:05:28 +00:00
Anders Broman b693f74b89 - Forward declaration of register functions.
svn path=/trunk/; revision=53877
2013-12-09 06:50:09 +00:00
Chris Maynard 42a64c3557 If data is NULL, the bug, if any, is not with *this* dissector, but with whichever one failed to pass the data properly.
svn path=/trunk/; revision=53706
2013-12-02 02:07:42 +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
Evan Huus 5f2c75e940 Add missing cast.
svn path=/trunk/; revision=53096
2013-11-05 22:58:50 +00:00
Michael Mann b6b78d69db In an effort to reduce the use of pinfo->private_data (and some true global variables), I converted the ASN.1 dissectors that use pinfo->private_data to exchange a SESSION_DATA_STRUCTURE to instead only exchange it in the context of ASN.1. This meant converting dissectors to the "new" style to pass the SESSION_DATA_STRUCTURE as well as providing a pointer to it in asn1_ctx_t.private_data. Yes, it's still "private data", but it's not used by all dissectors like pinfo->private data is.
svn path=/trunk/; revision=53090
2013-11-05 18:47:26 +00:00
Michael Mann c0fcebb07a Add a data parameter to call_ber_oid_callback to be able to pass data to subdissectors found with dissector_try_string_new.
The intention is to aid in the removal of pinfo->private_data use as well as static global variables in a dissector.  For now, all calls to call_ber_oid_callback have the data parameter set to NULL.

svn path=/trunk/; revision=52994
2013-10-31 00:57:03 +00:00
Michael Mann eec311ef39 Fix duplicate diplay filter names found by checkfiltername.pl
svn path=/trunk/; revision=50396
2013-07-06 01:20:38 +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 8b0f1addd9 Apparently one of our major global headers must include emem.h, because I just
found a bunch more asn1 dissectors using emem without ever directly including
the header. Convert those to wmem as well, which involves add a number of
#include directives since dissectors do *not* automatically pull in the wmem
headers.

svn path=/trunk/; revision=50066
2013-06-19 23:08:58 +00:00
Evan Huus 9fa4a8e6b6 Convert a batch of asn1 dissectors from emem to wmem.
svn path=/trunk/; revision=50057
2013-06-19 20:43:03 +00:00
Michael Mann 7fe5422c4b Convert ASN.1 dissectors to use filterable expert info.
NOTE: Kerberos ASN.1 template was updated, but not generated to source.

svn path=/trunk/; revision=49707
2013-06-03 03:42:36 +00:00
Pascal Quantin 0ee4d0a00a Postfix FT_NONE fields with "_element" string to reduce number of incompatible filters in ASN.1 dissectors
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2402

svn path=/trunk/; revision=49599
2013-05-27 20:26:49 +00:00
Pascal Quantin a37c044203 Update the ASN.1 based dissectors following the changes done in r48812
svn path=/trunk/; revision=48820
2013-04-11 18:14:53 +00:00
Jakub Zawadzki 7a9d27c33f Regenerate asn.1 dissectors.
svn path=/trunk/; revision=45110
2012-09-24 19:38:46 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier 24cf0aad06 Update generated ASN1 *.[hc] files after recent work done by Jeff Morriss;
The only change in each file is in a comment showing the asn2wrs cmd used to build that file.

svn path=/trunk/; revision=39427
2011-10-15 19:27:27 +00:00
Stig Bjørlykke ba2aae0f8e Use ENC_NA as encoding for FT_PROTOCOL, FT_NONE and FT_BYTES.
svn path=/trunk/; revision=38122
2011-07-19 18:48:31 +00:00
Stig Bjørlykke f282154ab0 Use correct encoding for proto_tree_add_item().
svn path=/trunk/; revision=38107
2011-07-19 10:51:12 +00:00
Stig Bjørlykke a7c5d642d5 Regenerate ASN.1 dissectors to update the #line directive.
svn path=/trunk/; revision=37118
2011-05-13 08:12:27 +00:00
Stig Bjørlykke 8b9c15d68f Added info column descriptions for AARQ and AARE.
svn path=/trunk/; revision=34519
2010-10-15 08:39:48 +00:00
Stig Bjørlykke c403378c36 Show Abort source in info column.
svn path=/trunk/; revision=34202
2010-09-23 07:39:38 +00:00
Stig Bjørlykke a2be950c5a Print correct RLRE reason in Info column.
Dump RLRQ/RLRE text in Info column even when having no reason code.

svn path=/trunk/; revision=33178
2010-06-09 14:27:09 +00:00