Commit Graph

143 Commits

Author SHA1 Message Date
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
Michael Mann bcabd8df0f register_dissector -> new_register_dissector for ASN.1 dissectors.
Change-Id: I0476519c02ffdd426b4fdfe8a206d61b728c327a
Reviewed-on: https://code.wireshark.org/review/12026
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-22 08:38:50 +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
AndersBroman 99e7395e9e Replace deprecated API tvb_length... with tvb_reported_length...
Change-Id: I44732d2743ba461d1791bb3795b0aef5a314bc1f
Reviewed-on: https://code.wireshark.org/review/8001
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-09 11:41:32 +00:00
Luke Mewburn 119416ef27 TCAP: support dialogue confirmation
TCAP permits the changing of the originating address on the first
backwards continue (i.e. the establishment of the dialogue).
See ITU-T Q.771 (06/97) clause 3.1.2.2.2.2 Confirmation of the dialogue.
In practice, a BEGIN replied to with an END can also exhibit this behaviour.

For example, a BEGIN from GT A TID TA -> GT B,
and the reply CONTINUE from GT B2 TID TB -> GT A TID TA.
To support this, only support a single address hash in
tcaphash_begin_info_key_t and tcaphash_end_info_key_t.
The match of the first CONTINUE should find the appropriate
tcaphash_begin and create the appropriate tcaphash_end entries.

Also fix compile warning with DEBUG_TCAPSRT.

Bug: 10841
Change-Id: Ibe75e3940e757727357b20be10f9c195c5888fdd
Reviewed-on: https://code.wireshark.org/review/6446
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-19 03:08:54 +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 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
Guy Harris a41c1223cc Consistent white space.
Change-Id: I7c19a16a671db7b68ef2f680813a9a190ed1e13d
Reviewed-on: https://code.wireshark.org/review/4109
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-14 17:23:56 +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
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
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
Evan Huus e047e3a007 Convert tcap dissector to wmem
As far as I can tell these calls were just missed in the first initial pass,
they're not in a weird scope.

Close review from somebody else please to verify that!

Change-Id: Ic3188879124dcb8fdf42e79d200d4f244200aa7b
Reviewed-on: https://code.wireshark.org/review/2266
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-17 00:06:17 +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
Pascal Quantin 54be3eaaec TCAP: set a fence on info column after calling sub dissector
Bug: 10091
Change-Id: I7af57345e31209fb4dd02cdab7960c44c69dc0a5
Reviewed-on: https://code.wireshark.org/review/1555
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-08 10:50:59 +00:00
Alexis La Goutte acd640c861 Fix mix tab and space
Change-Id: Ife12c5118dcd70ba6b2540d53697f7c9cc9207c9
Reviewed-on: https://code.wireshark.org/review/1196
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-18 19:22:14 +00:00
Alexis La Goutte d685e9b3fe Fix warning found by -Wunused-const-variable (Clang 3.5)
Change-Id: I246aa28be28194576b4bd58714b2e6ac36f7a29a
Reviewed-on: https://code.wireshark.org/review/1121
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-14 18:23:43 +00:00
Michael Mann fdeed480bf Convert ep_address_to_str -> address_to_str(wmem_packet_scope, ...) for all dissectors
Change-Id: I7489e2fb3a1f2630ca17b0a5fe1aa873992f1061
Reviewed-on: https://code.wireshark.org/review/975
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 01:31:28 +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
Guy Harris f862fc40ba Don't cast away constness.
svn path=/trunk/; revision=54800
2014-01-14 18:35:36 +00:00
Michael Mann 58346b6327 Move tcap and camel "persistent data" functionality to the dissectors themselves instead of being part of epan directory.
svn path=/trunk/; revision=54499
2013-12-30 22:07:38 +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
Michael Mann 3b91b9586f Pass tcap_private into the dissectors that need it rather than use private_data. Not sure if value_ptr is the "proper" place to pass tcap_private "internally" within the TCAP dissector, but it gets away from (potential) private_data (ab)use.
svn path=/trunk/; revision=52916
2013-10-28 13:36:49 +00:00
Jörg Mayer d266d38af0 Now all disectors requiring asn2wrs can be generated using
cmake.

svn path=/trunk/; revision=49254
2013-05-11 20:52:50 +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 a6fbd905a5 Make the oid memeber a const.
svn path=/trunk/; revision=48558
2013-03-26 05:20:55 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +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 b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18: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
Pascal Quantin 02b7064a87 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7372 :
tcap.otid and tcap.dtid can be used as display filters

svn path=/trunk/; revision=43288
2012-06-16 19:13:48 +00:00
Anders Broman 42b44648c8 Get rid of Warnings.
svn path=/trunk/; revision=39954
2011-11-20 08:59:19 +00:00
Anders Broman 24a011d8db Let subdissectors have a stab at the packet even if it's cut short.
svn path=/trunk/; revision=39472
2011-10-19 17:59:47 +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
Anders Broman 0f2e6c6cc5 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39164
2011-09-27 12:05:32 +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
Jeff Morriss 2efec6f8c5 tcaphash_context_t.oid is of size LENGTH_OID+1, not LENGTH_OID. Just use sizeof(tcaphash_context_t.oid) instead of LENGTH_OID so we can use that last byte. This allows us to retrieve the whole ACN when the ACN is LENGTH_OID bytes long.
svn path=/trunk/; revision=33089
2010-06-04 19:28:39 +00:00
Bill Meier f8b92f8d0b #include <stdio.h> not needed.
svn path=/trunk/; revision=32405
2010-04-06 17:01:14 +00:00
Stig Bjørlykke 6d1dae6f28 Make all proto_* values static.
svn path=/trunk/; revision=30516
2009-10-11 16:24:29 +00:00
Kovarththanan Rajaratnam 7ab993bee7 Remove unused NEED_PACKET_PROTO_H variable
svn path=/trunk/; revision=30409
2009-10-08 17:26:57 +00:00
Kovarththanan Rajaratnam c19f7978db Sanitize epan includes
svn path=/trunk/; revision=29500
2009-08-21 20:32:50 +00:00
Kovarththanan Rajaratnam 6110a96f68 Don't guard col_set_str (COL_INFO/COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29345
2009-08-09 07:59:51 +00:00
Stig Bjørlykke e3ef20f3ea From Kovarththanan Rajaratnam:
Clean up header field info in asn1/*-template.c files.

From me:
Fixed a few typos in the patch.

svn path=/trunk/; revision=28817
2009-06-23 06:02:12 +00:00
Stig Bjørlykke 8b156ecfc8 Removed some "statement not reached" warnings.
svn path=/trunk/; revision=27827
2009-03-23 13:03:18 +00:00