Commit Graph

95 Commits

Author SHA1 Message Date
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
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
Peter Wu 3243b6f964 asn1: split off cleanup routines
General approach:

 1. Split allocation (e.g. g_hash_table_new) from deallocation
    (g_hash_table_destroy) into functions named "init" and "cleanup".
 2. Remove guards that test whether the hash tables are set as
    init is always called before cleanup.
 3. Remove setting hash tables to NULL after destruction.
 4. Copy register_init_routine function call and change init to cleanup.
 5. Add cleanup function that calls reassembly_table_destroy if there
    is a reassembly_table_init function.

Some templates were modified as follows:

 - snmp: split renew into init+cleanup, but keep renew for the uat_new
   callback.
 - ldap,ros: Rename init to cleanup as there was no initialization.
 - camel: remove init function from header, make it static. Remove debug
   print.
 - tcap: remove unused ssn_range assignment.

Files in epan/ were regenerated using cmake && make asn1

Change-Id: Idac16ebf0ec304e0c8becaab5d32904e56eb69b9
Reviewed-on: https://code.wireshark.org/review/9136
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-04 00:17:14 +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 748e522815 ROS: Return dissected length from call_ros_oid_callback
Change-Id: I8d119cd3dc9ac0a724497400680a70f39fc21ede
Reviewed-on: https://code.wireshark.org/review/4641
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-10-13 16:01:19 +00:00
Bill Meier a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +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 791d93a259 Add more files to the distribution.
If it's checked into asn1 or a subdirectory thereof, put it into the
distribution.  (If it's not useful, why is it in Git?)

Change-Id: I4dac8a0d19a770db1513729cf71069a37f1d83fc
Reviewed-on: https://code.wireshark.org/review/3276
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-31 04:31:10 +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
Bill Meier 9ed99d5c4e Strip some trailing whitespace; Fix some indentation; Add editor-modelines as needed.
Change-Id: I943153e28f468070d86535abad7be032e1386118
Reviewed-on: https://code.wireshark.org/review/2994
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 03:20:54 +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
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
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 d5d8c3c359 context is not being passed to dissector, not through pinfo->private_data so check data parameter, not pinfo->private_data.
svn path=/trunk/; revision=53236
2013-11-10 17:17:18 +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 149de99d68 Have rose_ctx_t passed into subdissectors instead of using pinfo->private_data.
svn path=/trunk/; revision=53061
2013-11-03 12:57:58 +00:00
Michael Mann 02a8391535 Require dissector_try_string to pass a data parameter to its subdissectors. There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new.
svn path=/trunk/; revision=53049
2013-11-02 15:52:25 +00:00
Jörg Mayer c5ffff76d8 Fix checkapi warnings (missing id)
Replace Makefile.{am,nmake,common} that did not conform by
their asn1/c133/ version.

svn path=/trunk/; revision=52062
2013-09-15 15:00:03 +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
Michael Mann 00dd0adc0d expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51851
2013-09-09 00:28:48 +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 b1e12ec925 Convert the rest of the ASN1 dissectors from emem to wmem.
svn path=/trunk/; revision=50063
2013-06-19 22:47:36 +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 572d68a33b Small optical change
svn path=/trunk/; revision=49204
2013-05-07 17:52:51 +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 dafdc19d9e -Wmissing-prototypes
svn path=/trunk/; revision=48609
2013-03-28 07:34:13 +00:00
Anders Broman 84241f46ad From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48399
2013-03-18 20:44:36 +00:00
Guy Harris 29715ccc8f How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff?  Let me count the ways....

Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().

svn path=/trunk/; revision=47751
2013-02-19 23:17:07 +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 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +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 fe3168dc2a Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40462
2012-01-13 16:22:50 +00:00
Anders Broman 34ea886454 [-Wunused-but-set-variable]
svn path=/trunk/; revision=39829
2011-11-14 17:35:04 +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
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
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
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
Tomas Kukosa eb503df011 Do not report undecoded message to expert info for ReturnResult without result filed
svn path=/trunk/; revision=34076
2010-09-08 09:02:16 +00:00
Graeme Lunt cfdd4788cf Updates to the ROS dissector to support IDMP and fix to IDMP for implicit declaration of return value of call_ros_oid_callback().
svn path=/trunk/; revision=33182
2010-06-09 14:45:38 +00:00
Jeff Morriss 81da8e0b6b Use find_or_create_conversation() in some ASN.1 dissectors
svn path=/trunk/; revision=32791
2010-05-13 18:55:31 +00:00
Bill Meier 9ade30a7b1 #include <string.h> and/or #include <stdio.h> not needed.
svn path=/trunk/; revision=32417
2010-04-07 16:54:29 +00:00
Bill Meier f8b92f8d0b #include <stdio.h> not needed.
svn path=/trunk/; revision=32405
2010-04-06 17:01:14 +00:00