Commit Graph

54 Commits

Author SHA1 Message Date
Guy Harris bc13e834cc Don't cast away constness for the key in g_hash_table_lookup().
Change-Id: Ibd5cf8947028d90a734de629e3c4202af9d0514b
Reviewed-on: https://code.wireshark.org/review/12887
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28 22:24:56 +00:00
Michael Mann a33209d69e Convert ASN.1 dissectors to remove "new" from "new-style" dissector function names that were generated from asn2wrs.py
This includes:
1. new_create_dissector_handle -> create_dissector_handle
2. new_register_dissector -> register_dissector
3. new_register_ber_oid_dissector -> register_ber_oid_dissector
4. new_register_ber_syntax_dissector -> register_ber_syntax_dissector

Also remove PDU_NEW, SYNTAX_NEW and REGISTER_NEW as there is no need for the distinction anymore.

Change-Id: I82c7de7c8ffeeab3259d1b55bb4afc5f6a1e0329
Reviewed-on: https://code.wireshark.org/review/12491
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-10 17:06:02 +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
Peter Wu a198f47c06 cmake: add asn1 target, avoid unnecessary rebuilds
Add an "asn1" build target that rebuilds all ASN.1 dissectors.

Do not always generate the ASN.1 dissector when invoking the
"generate_dissector-PROTO" target. Use a special "packet-PROTO-stamp"
file to detect whether the dissector is out of date.

This indirection is needed because cmake removes output files from
add_custom_command in the clean target, but we would like to keep the
generated packet-PROTO.c files.

Make all EXTRA_CNF and EXPORT_DEPENDS point to absolute paths for
generated exported configs (PROTO-exp.cnf). This is done by automake too
and is needed for proper dependency tracking. Example: when h225.cnf is
updated, h225-exp.cnf needs to be generated. That is the purpose of the
"generate-h225-exp.cnf" target. Now h235 (and other) dissectors need to
be regenerated as well because the h225-exp.cnf is updated. This is why
there is a separate add_custom_command and add_custom_target.

Change-Id: I8cfc1f8f43cea595267b21eae30b4548f3407c0b
Reviewed-on: https://code.wireshark.org/review/12080
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-26 12:37:21 +00:00
Michael Mann 0cd1a85064 Require BER dissector (OID) registration to be "new style".
Both old and new style API existed, just remove the "old" one.

Change-Id: If725e778a0ecad5a431d634ed5c4856b4a281013
Reviewed-on: https://code.wireshark.org/review/12107
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-25 19:21:14 +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
Alexis La Goutte 3f6af3b4a0 P1: fix 'dissect_p1_T_report_type' defined but not used [-Wunused-function]
Change-Id: Idee443cd35846bb197070cff5fb37e3904afb856
Reviewed-on: https://code.wireshark.org/review/8757
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-23 17:36:33 +00:00
Alexis La Goutte 97255b3a7c P1: fix request for implicit conversion from 'gpointer' to 'struct p1_address_ctx_t *' not permitted in C++ [-Wc++-compat]
Change-Id: I43364dda21abe3281fbd15ad953232093bb1fffa
Reviewed-on: https://code.wireshark.org/review/8756
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-06-04 11:01:16 +00:00
Stig Bjørlykke a34d696377 p1: Fixed do_address for extension attributes
This is not an optimal solution, but fixes the reported problem.
The do_address functionality should probably be rewritten to
only use pinfo for storing data.

Bug: 11210
Ping-Bug: 8515
Change-Id: I2625cc4044ab93b6e943a3c2d2ffd1b26149da29
Reviewed-on: https://code.wireshark.org/review/8585
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-22 16:11:45 +00:00
Stig Bjørlykke f1ea2fae57 p1: Handle OrganizationalUnitName
Added back code removed in commit for bug 8515.

Bug: 11210
Change-Id: I23bf56f88d8a1320da8404a82a8d9d3aacc3dace
Reviewed-on: https://code.wireshark.org/review/8537
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-05-19 12:13:48 +00:00
AndersBroman c2a1d8feed Replace deprecated API tvb_length -> tvb_reported_length
Change-Id: I9c8bf6beec47afb901e492723b335a28a24f455e
Reviewed-on: https://code.wireshark.org/review/8004
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-09 12:38:04 +00:00
gal 0a6d1f9821 Support for P3 over RTSE.
Resolve mixed space/tab issue in the RTSE and BER dissectors and included modelines in both templates.

Change-Id: I4b75bad94ed111d0faee205e026b2322b7dafbd1
Reviewed-on: https://code.wireshark.org/review/6932
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-04 12:34:15 +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
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
Stig Bjørlykke 313c4005f9 P1: Added ORAddress and ORName syntax.
Change-Id: Icf8e8cb2988d9134aa65f04a3459e4a4c4a5721f
Reviewed-on: https://code.wireshark.org/review/4640
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-13 11:40:00 +00:00
Stig Bjørlykke 4e1b5ea866 ASN1: Register PDU-dissectors as NEW
Change-Id: I1a317b19d8076588c9305dae6287bb80cc14da64
Reviewed-on: https://code.wireshark.org/review/4494
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-13 11:24:07 +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
Guy Harris 4d90d6e38d Add some files under asn1 to the distribution.
Include CMakeLists.txt files and the gnm subdirectory, along with the
top-level Makefile.inc and Makefile.preinc files.  Don't explicitly
include Custom.make, as automake does that automatically given that it's
included by asn1/Makefile.am.

Add some files to EXTRA_DIST lists.

Move some .asn files to EXTRA_DIST; they don't need to be in SRC_FILES,
as SRC_FILES always includes EXTRA_DIST, and they *do* need to be in
EXTRA_DIST so that they're in the distribution.

Change-Id: Id91df577260fa57028d40fe098be1d79c59398e6
Reviewed-on: https://code.wireshark.org/review/3273
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-30 23:42:55 +00:00
Michael Mann 9356d5c689 convert to proto_tree_add_subtree[_format] for ASN.1 dissectors
Change-Id: I753ca95e2e1b38bad2c09955317e648c525e40ef
Reviewed-on: https://code.wireshark.org/review/2509
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:08:21 +00:00
Evan Huus 37b903d7ab batch of tvb-length conversions
Change-Id: I76ca4d075756e3ac691070e0c05344a410ea2498
Reviewed-on: https://code.wireshark.org/review/2507
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-21 04:01:52 +00:00
Pascal Quantin d0ac937567 Revert "Update ASN.1 source files with the API changes done in g021e7af"
This reverts commit e308e7c4de.

Change-Id: I079616d63f643f79f1bc03ef5fdf724f36df4071
Reviewed-on: https://code.wireshark.org/review/2435
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-19 18:42:28 +00:00
Pascal Quantin e308e7c4de Update ASN.1 source files with the API changes done in g021e7af
Change-Id: I52ecfccbce423206242e3cf99401a8c9e1655d88
Reviewed-on: https://code.wireshark.org/review/2385
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 16:15:42 +00:00
Stig Bjørlykke 9ce003a620 Added P1 extension 34.
Change-Id: Iccaaf39d4de21e1a12a26c40a184321a67b41f3e
Reviewed-on: https://code.wireshark.org/review/1068
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-04-11 11:21:58 +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
Chris Maynard 79fa0d0a3f Reject the packet if data is NULL without doing anything else.
Note: We *might* want to do _something_ but that _something_ should be well-defined and consistent across all dissectors.  Previously, some dissectors called proto_tree_add_text() to add some error message text to the tree, while others called DISSECTOR_ASSERT().

svn path=/trunk/; revision=53895
2013-12-09 22:23:44 +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
Jörg Mayer de20bbf0ac More dependeny updates for asn1 -exp.cnf files.
Only three remaining: p7, p22, x509ce - thanks to Chris Maynard for the list.

svn path=/trunk/; revision=52127
2013-09-17 19:43:37 +00:00
Jörg Mayer c65459c729 emem -> wmem (don't forget about .cnf)
svn path=/trunk/; revision=52058
2013-09-15 14:33: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
Chris Maynard 17772df943 Fix Coverity CID 1040373 (Dereference before null check). Minor whitespace changes come along for the ride on this one.
svn path=/trunk/; revision=50297
2013-07-01 15:09:56 +00:00
Guy Harris 95daae2290 Squelch some warnings.
svn path=/trunk/; revision=50286
2013-07-01 06:13:21 +00:00
Chris Maynard bfcaf93bff Fix Coverity CID 1040372 (Printf arg count mismatch) by eliminating the double %'s.
svn path=/trunk/; revision=50283
2013-07-01 05:47:13 +00:00
Michael Mann 9009944d51 Remove all global variables in P1 dissector. Bug 8515 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8515)
Added a "subtree context" structure to asn1_ctx_t. This should allow other ASN.1 dissector global variables to be replaced when only used for transferring data between fields in a subtree.

svn path=/trunk/; revision=50208
2013-06-28 12:43:29 +00:00
Martin Mathieson 64e15853fc Fix for bug 8826.
The global variable 'address_item' was not always being set to NULL
before the dissection of a new frame.  Do more to set it in the general
case, and in the particular case of an MTSBindResult_PDU, which was
triggering an error in the supplied capture.

There may be other entry points where this still safely isn't being
set.

svn path=/trunk/; revision=50083
2013-06-20 18:54:58 +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
Michael Mann 2dbf6c59a2 Remove check_col() from ASN.1 dissectors
svn path=/trunk/; revision=49927
2013-06-14 12:44:50 +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
Jörg Mayer 369c7b75ee Allow generating some more dissectors with cmake.
svn path=/trunk/; revision=49196
2013-05-07 04:40:37 +00:00
Jörg Mayer 243e9c0ba5 Just whitespace changes
svn path=/trunk/; revision=49167
2013-05-05 08:49:18 +00:00
Jörg Mayer 8faa262e90 Stub cmake support for generating the asn1 dissectors.
It doesn't do anything yet, it is just to make svn status
readable again.

svn path=/trunk/; revision=49007
2013-04-23 23:05:33 +00:00
Anders Broman 9991973c37 Use explicit casts.
svn path=/trunk/; revision=48008
2013-03-02 14:51:04 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +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
Alexis La Goutte 8cc44ff4f0 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41297
2012-03-02 10:58:29 +00:00
Jeff Morriss b21b495f9f Don't generate the conformance file for exported types when building the
dissector; instead built it only when the separate target (generate_export)
is built.

Built generate_export when building "all".

This prevents the exp_*.cnf files from being regenerated each time another one
of the exp_*.cnf files (which the current dissector depends on) has changed
(despite the fact that the exported types does not depe

Also fix the CLEANFILES definition so it actually cleans things.

svn path=/trunk/; revision=39421
2011-10-14 10:22:01 +00:00
Stig Bjørlykke df5adb7f3c Export MessageSecurityLabel_PDU.
svn path=/trunk/; revision=39414
2011-10-14 07:44:40 +00:00
Jeff Morriss cf012d27b1 Build the ASN.1 dissectors directly into epan/dissectors (rather than building
them and then copying them over).  The "all" target to builds these dissectors
now (instead of "generate_files" and/or "copy_files").

asn2wrs's "-O" option now means "the dissector goes in this directory" (rather
than "all output goes in this directory"); it also means that the "-s" (single
output file) option is now required.

Fix things up so that it's possible to build all of the ASN.1 dissectors in
one shot.

Fix building of conformance files when doing out-of-source-tree builds.


Unfortunately "make all" in the asn1 directory always builds something--I think
because of circular depedencies.

svn path=/trunk/; revision=39333
2011-10-10 02:31:11 +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