Commit Graph

181 Commits

Author SHA1 Message Date
Guy Harris 5cf3fd03f1 HTTPS In More Places, update some URLs.
Change-Id: Ice2e1e2e4d94f6c9da7c651866cfa1a8ac4a31d8
Reviewed-on: https://code.wireshark.org/review/34096
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27 07:55:36 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Peter Wu 7dfcb4425a asn2wrs: use system lex and yacc from ply if available
Tested with python-ply 3.11 and Python 3.7.3 on Arch Linux using the
'ninja asn1' command.

Bundling lex.py and yacc.py is one distribution method suggested by PLY
upstream (https://www.dabeaz.com/ply/README.txt), but since it is also
available in many Linux distributions, we could potentially remove it in
the future. Windows developers can install it through pip if needed.

Change-Id: I9c847072916ee33da49994820b435ec1d7110303
Reviewed-on: https://code.wireshark.org/review/33708
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-06-23 17:31:15 +00:00
Gerald Combs 20568aa8b9 tools: Switch some scripts exclusively to Python 3.
Convert asn2wrs.py to Python 3 via `2to3 --print-function --write` along
with additional tweaks.

Convert asn2deb and idl2deb using `2to3 --write`.

Work around what appears to be a Debian packaging bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818609

Change-Id: I5cc246f7162c2d713673955c10c092e1b91adf82
Reviewed-on: https://code.wireshark.org/review/33504
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-09 04:53:08 +00:00
Anders Broman 85773a21a9 OER: Dissect Boolean and IA5String types.
Change-Id: I12f1f605807809b94a7e51a5be2a4c3588f2d16f
Reviewed-on: https://code.wireshark.org/review/33106
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-08 12:50:59 +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 ca694eb078 PER: Use proto_tree_add_bitmask... () for named bits.
Change-Id: I2f4258e2f4fd11c26bdc101e1375d0b5708610b7
Reviewed-on: https://code.wireshark.org/review/32713
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 12:28:11 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +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
Martin Mathieson ea7b7f052c ASN1: Also show root node for exports.
For now, only apply to nr-rrc.

Change-Id: I9be4bc5c3af33acad76c0a24ac04547e5f302c73
Reviewed-on: https://code.wireshark.org/review/32058
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-02-16 23:20:21 +00:00
Martin Mathieson d6879b6c24 For ASN.1-based protocols, make sure protocol filter will match.
This is optional, and enabled by setting PROTO_ROOT_NAME to the name
of the item in the OPT section of the .cnf file.  For now, setting
only in nr-rrc.

Change-Id: Ibe96c7de982af0346af90bc0e095f20d1a7ac506
Reviewed-on: https://code.wireshark.org/review/31876
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-02-04 18:17:25 +00:00
Christophe GUERBER b9473c46f7 Fix asn2wrs.py: always add BASE_VAL64_STRING
In some cases (e.g. when a field has a user defined dissection function)
the type reported for this field is a 'virtual' one and the latter is not
contained in selt.type. Consequently, BASE_VAL64_STRING is not set.

Function eth_get_type_attr should return all the attributes of a type and
it seems resonable to expect it to return the BASE_VAL64_STRING. This
will solve the above mentioned error and may solve any possible issue in
other parts that call this function.

Change-Id: Iaee9ce5bd30f2a768cfcecf628df23bf1ed54e55
Reviewed-on: https://code.wireshark.org/review/31287
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-01-01 14:59:28 +00:00
Christophe GUERBER c007afa7c2 asn2wrs.py: use BASE_VAL64_STRING and val64_string
When UINT64 contains value strings, in addition to using VALS64 to give
the list of names, the type of the structure has to be val64_string and
the display parameter has to be ORed with BASE_VAL64_STRING.

Change-Id: I0a619c91027df1eaae8209ada816f45b85d6431d
Reviewed-on: https://code.wireshark.org/review/31268
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-31 08:23:16 +00:00
Pascal Quantin fc90970796 asn2wrs.py: fix regression introduced by gf4b0b2109
FT_(U)INT64 are restricted to integer types only currently.
Do not use VALS64() for other types.

Change-Id: Id2299a9291c53ef246b90d732eb84811510ccb85
Reviewed-on: https://code.wireshark.org/review/31257
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-12-30 10:52:23 +00:00
Christophe GUERBER f4b0b21092 Fixes ASN.1 generation for VALS using 64 bits
VALS generation did not take into account the constraints on integers.
We now generate VALS if no constraints are present and VALS64 if the
interger needs 64 bits.

Change-Id: Ia044ee1ba1bd5b45554c19a458876e20110b1b7f
Reviewed-on: https://code.wireshark.org/review/31252
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-30 07:43:51 +00:00
Pascal Quantin eb5bfcf144 IEEE1609dot2: generate automatically dissector from ASN.1 description
Add basic OER support to asn2wrs.py. There is still work required as we
miss many basic functions in packet-oer.c file.

Change-Id: I3ebebdb2e9b0c90eb1dfa8885cebbb077b16f246
Reviewed-on: https://code.wireshark.org/review/30434
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-30 15:33:44 +00:00
Guy Harris 47b1ec984b Fix WITHOUT_VALS.
It was setting EF_TYPE and then clearing it; it should set EF_TYPE and
clear EF_VALS.

Change-Id: Ie0a85a12646c0395e50abb34caf32367e4191da0
Reviewed-on: https://code.wireshark.org/review/29621
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-12 02:07:27 +00:00
Dario Lombardo e7ab7a907c spdx: more licenses converted.
Change-Id: I8f6693108c43959e54911d35b4fbf730c59add60
Reviewed-on: https://code.wireshark.org/review/26361
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-09 04:50:23 +00:00
Pavel Strnad 93fba33e95 asn2wrs.py: use 64 bits variant for constrained integers using MIN or MAX keywords
Change-Id: Iffc7c81e9653e8c1cd938de8f4fc26c5912eceec
Reviewed-on: https://code.wireshark.org/review/24049
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-25 21:10:11 +00:00
Pascal Quantin 5661420d7f asn2wrs: put back parsetab.py file in ASN.1 source folder
Otherwise it breaks multi threaded compilation.
Follow-up of gd04be01

Bug: 12621
Change-Id: I2f6b7d6ca85a1cf5a6713c2b36c823a520d3bf3d
Reviewed-on: https://code.wireshark.org/review/16886
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-08-04 18:54:05 +00:00
Balint Reczey d04be0149d Ply parser updated to 3.8 from http://www.dabeaz.com/ply/
The Ubuntu packaged Ply 3.7 with Ubuntu 16.04's Python makes
ASN.1 based dissector generation fail.

Ply's API changed after 3.5 and the small change to asn2wrs.py
adapts to that.
The commit breaking the API in Ply's repository is the following:

 commit af651673ba6117a0a5405055a92170fffd028106
 Author: David Beazley <dave@dabeaz.com>
 Date:   Tue Apr 21 16:31:32 2015 -0500

    Added optional support for defaulted states

Change-Id: I1db33fdcccf7c39ecdb0e435a5ea9183362471ad
Bug: 12621
Reviewed-on: https://code.wireshark.org/review/16864
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
Petri-Dish: Balint Reczey <balint@balintreczey.hu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: João Valverde <j@v6e.pt>
2016-08-04 08:20:24 +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
João Valverde 8d0455c910 Fix asn2wrs warnings [-Wredundant-decls]
Change-Id: Iced801f17c56618eaaf1bb7c85d68ecdebd633a1
Reviewed-on: https://code.wireshark.org/review/13705
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04 09:47:01 +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
Peter Wu 992a7ee6e7 asn2wrs.py: always use relative paths
Avoids absolute paths when using cmake and doing an in-tree build.

Before (source directory is /tmp/wireshark):

    /*--- Included file: /tmp/wireshark/asn1/t38/packet-t38-exp.h ---*/

After:

    /*--- Included file: packet-t38-exp.h ---*/

Change-Id: Id5c98bff7b97447479e1a09751701f2f52132b20
Reviewed-on: https://code.wireshark.org/review/12118
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-25 16:29:01 +00:00
Pascal Quantin d61c3d592b asn2wrs.py: fix path substitution when generating ASN.1 dissectors with CMake on Windows
Change-Id: I48e7d48544274f27d276e7128f8d2a2727c0b9cd
Reviewed-on: https://code.wireshark.org/review/12031
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-22 11:30:54 +00:00
Peter Wu b1ab36a813 tools/asn2wrs.py: fix isdn-sup generation with Py3
Python 3 has removed the cmp function for sort functions, relying on a
key function instead.

Tested with Python 2.7.10 and 3.4.3.

Change-Id: Id571b836304528ecc3b23a0f8a2843c4538c3e1b
Reviewed-on: https://code.wireshark.org/review/9212
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-29 22:46:58 +00:00
Peter Wu 149d0b7e91 tools/asn2wrs.py: handle windows-1252 encoding
The RRC ASN.1 definitions resulted in a decode error in Python because
the file is encoded as windows-1252 instead of UTF-8. This patch makes
the tool more forgiving in handling windows-1252 encodings.

Tested with Python 2.6.9, 2.7.10, 3.4.3.

Change-Id: I9c9269e1065c98b8bcfb57ab4bfd21d5e183a656
Reviewed-on: https://code.wireshark.org/review/9133
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-29 09:36:34 +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 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
Stig Bjørlykke 683165272f asn2wrs: Added support for #.SYNTAX_NEW
This allows syntaxes to be registered as "new" dissectors.

Change-Id: Ibb76688d9d3cbf47222610956aa627fa374bcbce
Reviewed-on: https://code.wireshark.org/review/4524
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-07 20:28:10 +00:00
Bill Meier b4850149dd Remove a trailing space from a line of generated code.
Change-Id: Ib95c0db932c54f5664905bde9286aad7a195570f
Reviewed-on: https://code.wireshark.org/review/411
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-26 19:37:20 +00:00
Jeff Morriss 82e2865739 Remove $Id$ and other Subversion leftovers from the tools.
There are a few things in here which could still use attention.

Don't regenerate anything now.

Change-Id: I283c224d3523212144707fca3d6265916cb11792
Reviewed-on: https://code.wireshark.org/review/205
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-14 01:35:57 +00:00
Stig Bjørlykke 4e7e5a63c3 asn2wrs: Rewrite relative paths in header.
Change both absolute paths and relative paths generated outside
source directory to paths relative to asn1/<proto> subdir.

Change-Id: I867d3a31c687b08347b11336ce69fc70db2d7c7b
Reviewed-on: https://code.wireshark.org/review/88
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-02-04 08:17:54 +00:00
Jakub Zawadzki 064082e68a Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)
svn path=/trunk/; revision=54314
2013-12-20 22:39:32 +00:00
Pascal Quantin ea45be32c5 Add a way to retrieve a PER variable bit string length
svn path=/trunk/; revision=53382
2013-11-17 13:31:32 +00:00
Evan Huus 918df38a05 Add an X11/MIT license to asn2wrs.py as it's compatible with our license, that's
what the original base code was, and Tomas (who made most of the
wireshark-specific changes) has no particular preference.

svn path=/trunk/; revision=52801
2013-10-23 17:22:54 +00:00
Michael Mann ee208c8dcc Add support for RELATIVE-OID ASN.1 type. Bug 9192 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192)
From Ed Beroset.

svn path=/trunk/; revision=52393
2013-10-06 02:31:10 +00:00
Jörg Mayer c248e3c5b2 Add modelines to avoid using tabs in the code
svn path=/trunk/; revision=51779
2013-09-05 09:23:50 +00:00
Jörg Mayer a5e2a30fc7 Change the regexp syntax a bit.
svn path=/trunk/; revision=51778
2013-09-05 08:55:09 +00:00
Stig Bjørlykke 06c27f8749 Use intended regex modification for absolute paths.
svn path=/trunk/; revision=51777
2013-09-05 08:32:00 +00:00
Stig Bjørlykke fadd2ae1c8 Removed TAB as indent.
Fixed regex for modifying absolute paths in header.

svn path=/trunk/; revision=51776
2013-09-05 08:22:44 +00:00
Jörg Mayer 8b842aeb02 Adapt generated output to always print paths relative to
the asn1/<proto>/ subdir. This makes cmake generated builds
look identical to autotools generated builds.

svn path=/trunk/; revision=51775
2013-09-05 07:38:32 +00:00
Gerald Combs e6202124eb Make sure we're compatible with Python 2 + 3. Tested with Pythons 2.5,
2.7, and 3.3.

svn path=/trunk/; revision=51105
2013-08-02 00:16:14 +00:00
Tomas Kukosa fd5c1ddf5c Allow C directives in #.FN_HDR, #.FN_FTR, #.FN_BODY, they have to start with ##
svn path=/trunk/; revision=49763
2013-06-04 14:07: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
Gerald Combs a6131151f5 Use consistent "generated automatically" wording which will hopefully be
picked up by licensecheck.

svn path=/trunk/; revision=48812
2013-04-10 21:24:19 +00:00
Anders Broman a9ed804565 From Tomas Kukosa:
Make it possible to sort LocalCode value_strings.

svn path=/trunk/; revision=48720
2013-04-03 16:52:56 +00:00
Tomas Kukosa 109c2326e2 OPERATION and ERROR tables can loop through only items with either local or global CODEs
svn path=/trunk/; revision=48476
2013-03-22 07:30:32 +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