Commit Graph

166 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
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 c65c0149c3 LTE RRC: upgrade dissector to v12.7.0
Change-Id: I95660eb302fde06c2034b023e60c7b83c67fe71b
Reviewed-on: https://code.wireshark.org/review/10680
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-29 05:44:52 +00:00
Pascal Quantin 7a76e36b49 LTE RRC: add a top level function for SBCCH SL BCH messages
Change-Id: I91c66f81d245b4398fecbd4c6b655baad5431b53
Reviewed-on: https://code.wireshark.org/review/10489
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-11 21:50:42 +00:00
Pascal Quantin b11e9a6e18 LTE RRC: remove tree tests before decoding top level messages
It prevents proper update of Info column, and various other things

Change-Id: I355c46e6f6b3f923250d6b5bf720ea052ef3b646
Reviewed-on: https://code.wireshark.org/review/10488
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-11 19:27:18 +00:00
Pascal Quantin e13576f7dc LTE RRC: catch bounds errors triggered by subdissectors
Report the exception and continue dissection of the end of RRC message
This is useful when there is an invalid NAS EPS message like in bug 11513

Change-Id: I74154892fe8125df57ef5a6966273d6df777977a
Reviewed-on: https://code.wireshark.org/review/10463
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-10 18:48:29 +00:00
Pascal Quantin 573b33a5a3 LTE RRC: fix a typo
Let's have consistent naming for dissectors

Change-Id: I03d14e208692f39a7ae5017bd539f38f14abaa1f
Reviewed-on: https://code.wireshark.org/review/9737
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-21 15:30:32 +00:00
Pascal Quantin da914431ce LTE RRC: fix dissection of ETWS/CMAS warning messages
Change-Id: I20bb219a32b6c7e39ac415c5c13ad5379f78cba2
Reviewed-on: https://code.wireshark.org/review/9658
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-16 16:56:43 +00:00
Pascal Quantin f6a482656b LTE RRC: upgrade dissector to v12.6.0
Change-Id: I6e8271f98cba0074b27df73a21337d388efcdc7a
Reviewed-on: https://code.wireshark.org/review/9578
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-10 05:51:19 +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
Pascal Quantin edf62d1e3e LTE RRC: fix a typo introduced in g9aa624d
Change-Id: Ia1bb68c64ca4cb820790dc84abee9cc222a1d0e4
Reviewed-on: https://code.wireshark.org/review/7874
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-01 10:46:37 +00:00
Pascal Quantin 9aa624d117 LTE RRC: upgrade dissector to v12.5.0
Change-Id: I9e3dfb17b4b7f96be999ccea88fec754a936d312
Reviewed-on: https://code.wireshark.org/review/7869
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-31 21:40:10 +00:00
Pascal Quantin 8f9e543d4e LTE RRC: enhance dissection of Extended Access Barring Category
Change-Id: I6e13ae8c4e95f5915541bc33d89faa61dade2058
Reviewed-on: https://code.wireshark.org/review/7674
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-03-13 20:37:31 +00:00
Gerald Combs 3f765b3ef9 Add a CF_FUNC macro for casting BASE_CUSTOM functions.
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid
the following warning:

    warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic]

We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be
more consistent with the other macros in proto.h. Update each instance
of BASE_CUSTOM to use CF_FUNC.

Adjust a dummy variable name generated by asn2wrs.py that was triggering
an invalid error in checkhf.pl.

Fix an encoding arguement in packet-elasticsearch.c found by
fix-encoding-args.pl.

Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22
Reviewed-on: https://code.wireshark.org/review/7150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-18 00:05:38 +00:00
Pascal Quantin 9f4bf6abf3 LTE RRC: only display band mapping for the initial supportedBandListEUTRA IE
Handling bands > 64 would require to store the mapping in file scope and current code is broken for the Carrier Aggregation band combination list

Change-Id: I9f10022a50520ca9bc16a33f2c16361729f1b01b
Reviewed-on: https://code.wireshark.org/review/6917
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-02 16:32:41 +00:00
Pascal Quantin e7593ea19d asn2wrs: autodetect if 64 bits variant is required for constrained integers
It does not work with defines, but is already a great step forward

Change-Id: I346d4124690ec46a2299d4eae8031bbb19a3db8e
Reviewed-on: https://code.wireshark.org/review/6617
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-18 13:30:56 +00:00
Pascal Quantin 25f010b269 MAC LTE: upgrade dissector to v12.4.0
Change-Id: Ieb5395a6ae7a1d7625fe645d0caf14008993d3d9
Reviewed-on: https://code.wireshark.org/review/6521
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-13 20:57:01 +00:00
Pascal Quantin aa9376e0b4 LTE RRC: upgrade dissector to v12.4.0
Change-Id: I0bd6c124bd3aa0efe09db81135adc690751e08ae
Reviewed-on: https://code.wireshark.org/review/6477
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-11 09:43:02 +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
Pascal Quantin 34cd063ae8 LTE RRC: upgrade dissector to v12.3.0
Change-Id: Iac974bf505bed270fc1f9409a7d61c80ebca17a5
Reviewed-on: https://code.wireshark.org/review/5691
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-09 22:48:23 +00:00
Pascal Quantin 74172aee0b LTE: Update MAC and RLC dissectors to Release 12
Change-Id: I036a0d1180b6481e8cc27210ed44eda4ba078a27
Reviewed-on: https://code.wireshark.org/review/5659
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-09 09:49:49 +00:00
Martin Mathieson ffe30fb0d3 Allow the HandoverPreparationInfoPDU dissector to be looked up by name and called.
Change-Id: I9c22b74d5c3329b6c7d74547d26e940c84ffc66c
Reviewed-on: https://code.wireshark.org/review/4247
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-24 07:55:40 +00:00
Martin Mathieson 64225639be Show RRC Release cause in the Info column
Change-Id: I138859ce735a9ff6541d6852dec29a13c1034c36
Reviewed-on: https://code.wireshark.org/review/4114
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-09-15 17:19:58 +00:00
Martin Mathieson 3f0483022b Try to fix build error by giving function a return type
Change-Id: I157b6309bc8cb0bef6fc0cd213fd4ec7e4c375ef
Reviewed-on: https://code.wireshark.org/review/4035
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-09-08 14:38:57 +00:00
Martin Mathieson 806981d156 Show band info for inter-freq entries in UE capabilities. Addresses Pascal's comments.
Change-Id: Ie60dc73e40a2ac1d80197fa712075ccff83cf797
Reviewed-on: https://code.wireshark.org/review/4032
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-09-08 14:12:28 +00:00
Pascal Quantin ddeac70a5a LTE RRC: fix dissection of CDMA System Time broken in gcd02af5
Also put back initial text indentation

Change-Id: I6fe207086018a806a258b1de2888ac0b9310aac6
Reviewed-on: https://code.wireshark.org/review/3524
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-09 16:26:44 +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
Pascal Quantin cfee2019c6 LTE RRC: upgrade dissector to v11.8.0
Change-Id: I2bb0861029d0d30ae372b0b8085fbedeb4932217
Reviewed-on: https://code.wireshark.org/review/2949
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-07-08 22:06:46 +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
Guy Harris ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +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 4eaf1c82c5 MAC LTE: get extended BSR sizes configuration from RRC
Change-Id: I09afa7c17be5e0ed902a2c2f5ea9989df3380615
Reviewed-on: https://code.wireshark.org/review/1550
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-08 06:29:21 +00:00
Martin Mathieson 1ddce8bb4c Have RRC tell MAC about RAPID ranges so it can show for RAPIDs seen
Change-Id: Ie9adbe3015c63e53997068053b6f8ec224a5bf82
Reviewed-on: https://code.wireshark.org/review/1474
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-03 21:39:20 +00:00
Martin Mathieson bd6ffea1cd LTE RRC: break the sr-configIndex down into periodicity and subframe offset
Change-Id: I5e153ebba9957f3dc5551f540cf333a1d0ff89f7
Reviewed-on: https://code.wireshark.org/review/1141
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-15 04:16:52 +00:00
Pascal Quantin 97ab466679 LTE RRC: add file forgotten in gb981173
Change-Id: I1727e56e678c32402f6331463c06c62072c954d8
Reviewed-on: https://code.wireshark.org/review/833
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-26 09:58:15 +00:00
Pascal Quantin 3626f860a6 Upgrade LTE RRC dissector to v11.7.0
Change-Id: If1f64241846cc18463c8c5e9da7dd2a5eaba6733
Reviewed-on: https://code.wireshark.org/review/752
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-20 15:41:44 +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
Martin Mathieson f903141d65 Send news of SecurityModeFailure to PDCP dissector, which will attempt to roll back to previous setting
svn path=/trunk/; revision=54978
2014-01-27 12:06:46 +00:00
Guy Harris c85b34ed66 The strings in question are generated as UTF-8 from the CBS encoding, so
process them as such.

svn path=/trunk/; revision=54891
2014-01-22 04:13:37 +00:00
Pascal Quantin a48b6f4aac Upgrade LTE RRC dissector to v11.6.0
svn path=/trunk/; revision=54789
2014-01-14 16:51:10 +00:00
Pascal Quantin 771dc849f5 Update file forgotten in r54250
svn path=/trunk/; revision=54264
2013-12-19 18:58:31 +00:00
Anders Broman 0d46cdae53 - Forward declaration of register functions.
svn path=/trunk/; revision=53876
2013-12-09 06:20:42 +00:00
Pascal Quantin 93398e794e Use STR_UNICODE display instead of proto_tree_add_unicode_string() in the remaining dissectors
svn path=/trunk/; revision=53867
2013-12-08 20:03:15 +00:00
Pascal Quantin db7405bb13 Dissect UE Rx - Tx time difference field
svn path=/trunk/; revision=53557
2013-11-24 23:09:48 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00