aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asn2wrs.py
AgeCommit message (Collapse)AuthorFilesLines
2017-10-25asn2wrs.py: use 64 bits variant for constrained integers using MIN or MAX ↵Pavel Strnad1-2/+3
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>
2016-08-04asn2wrs: put back parsetab.py file in ASN.1 source folderPascal Quantin1-1/+1
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-04Ply parser updated to 3.8 from http://www.dabeaz.com/ply/Balint Reczey1-1/+2
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-03-13Move /asn1 to /epan/dissectorsJoão Valverde1-4/+3
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-02-04Fix asn2wrs warnings [-Wredundant-decls]João Valverde1-1/+4
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>
2015-12-10Convert ASN.1 dissectors to remove "new" from "new-style" dissector function ↵Michael Mann1-40/+19
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-11-25asn2wrs.py: always use relative pathsPeter Wu1-6/+10
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-22asn2wrs.py: fix path substitution when generating ASN.1 dissectors with ↵Pascal Quantin1-2/+2
CMake on Windows Change-Id: I48e7d48544274f27d276e7128f8d2a2727c0b9cd Reviewed-on: https://code.wireshark.org/review/12031 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-06-29tools/asn2wrs.py: fix isdn-sup generation with Py3Peter Wu1-16/+10
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-29tools/asn2wrs.py: handle windows-1252 encodingPeter Wu1-3/+12
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-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-3/+3
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-01-18asn2wrs: autodetect if 64 bits variant is required for constrained integersPascal Quantin1-1/+15
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>
2014-10-07asn2wrs: Added support for #.SYNTAX_NEWStig Bjørlykke1-4/+12
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-02-26Remove a trailing space from a line of generated code.Bill Meier1-1/+1
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-14Remove $Id$ and other Subversion leftovers from the tools.Jeff Morriss1-2/+0
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-04asn2wrs: Rewrite relative paths in header.Stig Bjørlykke1-3/+4
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>
2013-12-20Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54314
2013-11-17Add a way to retrieve a PER variable bit string lengthPascal Quantin1-1/+2
svn path=/trunk/; revision=53382
2013-10-23Add an X11/MIT license to asn2wrs.py as it's compatible with our license, that'sEvan Huus1-1/+26
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-06Add support for RELATIVE-OID ASN.1 type. Bug 9192 ↵Michael Mann1-1/+1
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9192) From Ed Beroset. svn path=/trunk/; revision=52393
2013-09-05Add modelines to avoid using tabs in the codeJörg Mayer1-0/+7
svn path=/trunk/; revision=51779
2013-09-05Change the regexp syntax a bit.Jörg Mayer1-6/+3
svn path=/trunk/; revision=51778
2013-09-05Use intended regex modification for absolute paths.Stig Bjørlykke1-4/+4
svn path=/trunk/; revision=51777
2013-09-05Removed TAB as indent.Stig Bjørlykke1-7/+7
Fixed regex for modifying absolute paths in header. svn path=/trunk/; revision=51776
2013-09-05Adapt generated output to always print paths relative toJörg Mayer1-1/+8
the asn1/<proto>/ subdir. This makes cmake generated builds look identical to autotools generated builds. svn path=/trunk/; revision=51775
2013-08-02Make sure we're compatible with Python 2 + 3. Tested with Pythons 2.5,Gerald Combs1-5787/+5791
2.7, and 3.3. svn path=/trunk/; revision=51105
2013-06-04Allow C directives in #.FN_HDR, #.FN_FTR, #.FN_BODY, they have to start with ##Tomas Kukosa1-1/+5
svn path=/trunk/; revision=49763
2013-05-27Postfix FT_NONE fields with "_element" string to reduce number of ↵Pascal Quantin1-1/+4
incompatible filters in ASN.1 dissectors https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2402 svn path=/trunk/; revision=49599
2013-04-10Use consistent "generated automatically" wording which will hopefully beGerald Combs1-2/+2
picked up by licensecheck. svn path=/trunk/; revision=48812
2013-04-03From Tomas Kukosa:Anders Broman1-43/+78
Make it possible to sort LocalCode value_strings. svn path=/trunk/; revision=48720
2013-03-22OPERATION and ERROR tables can loop through only items with either local or ↵Tomas Kukosa1-3/+10
global CODEs svn path=/trunk/; revision=48476
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-6/+9
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-2/+4
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-07-17Use G_MININT32 instead of -2^31 so as to get rid of 'this decimal constant ↵Pascal Quantin1-1/+3
is unsigned only in ISO C90' warning svn path=/trunk/; revision=43764
2011-10-10Build the ASN.1 dissectors directly into epan/dissectors (rather than buildingJeff Morriss1-12/+9
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-09Always generate packet-*-exp.h.Stig Bjørlykke1-1/+0
This fixes a bug when only exporting _PDU objects, and we can have '#include "packet-*-exp.h"' in packet-*-template.h even when having no #.EXPORTS in the conformation file. svn path=/trunk/; revision=39320
2011-08-09Support for Extension Addition Group in PER encodingTomas Kukosa1-33/+106
Fix for bug 6196 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6199 svn path=/trunk/; revision=38421
2011-04-08Add a relative path to the "#line" directives we produce. Regenerate theGerald Combs1-4/+14
SNMP and SPNEGO dissectors to see if it helps Coverity locate the original source files. svn path=/trunk/; revision=36522
2011-01-19Try to enhance output at ValueError to ease debugging.Anders Broman1-1/+1
svn path=/trunk/; revision=35578
2010-12-23Raise Exceptions containing a string instead of string exceptionsBalint Reczey1-2/+2
This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4846 svn path=/trunk/; revision=35258
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-2/+5
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-11-14Sort value_string array by value if used with value_str_ext fcns;Bill Meier1-0/+2
svn path=/trunk/; revision=34874
2010-10-07Generate proper extension flags for empty constructed types SEQUENCE { ... } ↵Tomas Kukosa1-2/+8
and CHOICE { ... } svn path=/trunk/; revision=34400
2010-08-24- fix using hex values as constraintTomas Kukosa1-2/+14
- avoid crash if unknown type is used in type assignment svn path=/trunk/; revision=33905
2010-06-29New "#.SYNTAX" section for the asn2wrs conformance file. Graeme Lunt1-16/+22
This allows syntaxes to be registered separately from PDUs. Within the new section, the ASN.1 types to be used as syntaxes should be iterated. An optional second parameter on each line may be provided to provide an alternative name for the syntax (that the user will see). This name must be in double quotes. svn path=/trunk/; revision=33370
2010-06-28Remove the -R flag (used to generate syntax registrations) and replace with a Graeme Lunt1-15/+15
packet-<proto>-syn-reg.c output file. This is more generic and allows the syntax registrations to the directed from the template file. svn path=/trunk/; revision=33342
2010-06-23New option (-r) to allow a prefix to be removed from type names.Graeme Lunt1-2/+17
Usage: asn2wrs.py -r prefix This is used by x509sat where a prefix is used in type names to avoid conflicts with built-in types. svn path=/trunk/; revision=33298
2010-06-09New option (-R) to asn2wrs to register the PDUs defined in the conformance ↵Graeme Lunt1-2/+25
file as BER syntaxes (register_ber_syntax_dissector()). svn path=/trunk/; revision=33175
2010-05-25Support of value_string_ext in the asn2wrs using new directive #.USE_VALS_EXTTomas Kukosa1-2/+24
Example usage in NBAP svn path=/trunk/; revision=32944
2010-05-13Support of AUTOMATIC tagging environment Tomas Kukosa1-39/+78
(necessary for generating e.g. H.248 from original ASN.1 source) svn path=/trunk/; revision=32782