Commit Graph

71 Commits

Author SHA1 Message Date
Jonas Blust 32c2ab79a7 GIOP and idl2wrs: Implementation of Any type and fixes and improvements for idl2wrs 2022-09-29 11:40:44 +00:00
Guy Harris 76b08ea083 Fix spelling errors.
The Ubuntu build commented on some spelling errors in executable code
files.  Fix the errors that don't come from external files containing
the spelling errors (USB product and vendor IDs, PCI IDs, ASN.1
specifications), and fix some errors that don't show up in the
executable code files (e.g., in comments and variable names).
2021-09-11 10:01:27 +00:00
Jaap Keuter f399d135e0 IDL: Clean up IDL based dissector generation
Clean up the generators and generated dissectors a bit by updating
the header, removing unwanted includes and completing the modelines
block.

Change-Id: I8ff80b05bb598c3fa5a5f91a24d5caba87eb712e
Reviewed-on: https://code.wireshark.org/review/37154
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-06 03:49:52 +00:00
Jaap Keuter 5e4379f5b5 IDL: make code generation reproducible
The current state of generated code from the IDL specification is not
reproducible with the current omniidl backend. This change brings the
backend in line with the currently committed generated source code.

The exception to this is that the exceptions (no pun intended) were
collected in a dictionary of unspecified ordering, therefore inherently
non-reproducible. These thus differ from the previously committed source
code (packet-parlay.c), but do contain the same lines.

Also this rolls back commit 443df93896
because the committed generated source files were not created with the
backend with this change, nor do they fail to build, as claimed in that
commit.

Special thanks to Luke Mewburn for working on the dictionary problem.

Change-Id: I7707746d263c7556eb06883c877f70f0e9b357c5
Reviewed-on: https://code.wireshark.org/review/37153
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-05 20:12:29 +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
Yannik Enss 3697dd4f5f idl2wrs: clean up and add python3 compatibility
Clean up the python scripts using PEP-8 as a guide, with exceptions
made where necessary.
Includes:
 - Move comments to docstrings
 - Remove unnecessary whitespace
 - Remove brackets from if statements where this improves readability
 - Change the debug print statements to output comments
 - Remove semicolons
 - Prefix debug output with '//'
 - Break long lines

Python 3 compatibility changes are mostly converting print statements
and moving away from the string module in favor of `str` methods.
By including the "future" import, compatibility with python 2 is
maintained.

The changes were tested using both omniORB 4.2.2/Python 3.6 and
omniORB 4.1.7/Python 2.7

Change-Id: I8126a49b2fde13982d34e462fced16b9d7b88306
Reviewed-on: https://code.wireshark.org/review/33850
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-06 17:52:42 +00:00
Yannik Enss 4ebf72d232 idl2wrs: extend aggressive mode
Add a "_loop" header field also when processing attributes

Change-Id: I109b34d8f6cb8fbf3c38dc09f58b740b4d96436b
Reviewed-on: https://code.wireshark.org/review/33460
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-06-06 08:04:57 +00:00
Yannik Enss 443df93896 idl2wrs: fix 'undeclared identifier' error
the 'x_octetx' variables were removed a few years back, replace them with get_CDR_xxx()

Change-Id: I8cf3410d8a152c834e7019f7d1d80de3798530c3
Reviewed-on: https://code.wireshark.org/review/33457
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 17:02:21 +00:00
Yannik Enss 3f3337b2ca idl2wrs: add aggressive mode
add a mode to ignore a few optimisations in favor of working output

Change-Id: I875cec5a80e9449e9fd954d4ff6a21e5b128db5e
Reviewed-on: https://code.wireshark.org/review/33459
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 16:51:50 +00:00
Yannik Enss 1c09af410d idl2wrs: fix recursion loop
wireshark_gen goes into an infinite recursion if it encounters a multi-level
alias, this is prevented

Change-Id: Icec678fb326b7c14344dc6df51015dad980587a9
Reviewed-on: https://code.wireshark.org/review/33458
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 16:48:45 +00:00
Yannik Enss 54db60f4e5 idl2wrs: add debug command line parameter
convert the "DEBUG" constant to a command line parameter

Change-Id: I7f873d85fa053cb9298bd03444125d0160ef4640
Reviewed-on: https://code.wireshark.org/review/33456
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 16:35:00 +00:00
Guy Harris 038470b597 Clean up some signed vs. unsigned warnings.
Octet arrays are octets of guint8s, not gchars/chars.

Make some strings arrays of chars/gchars, not guint8s; this needs more
thought (throughout Wireshark).

Offsets into tvbuffs are signed, not unsigned.  (This is to support
negative offsets, which are offsets from the end of the tvbuff.  We
might want to remove that and go with unsigned offsets, and have the
few, if any, places where that feature is used explicitly calculate the
offset from the end based on the tvbuff's length; most if not all of our
handling of trailers/end-of-packet FCSes/etc. does so, and makes sure it
handles the case where the end-of-packet information isn't present, to
better report errors and dissect the stuff before it.)

Change-Id: Ia46ed3fc7c2d8ac97cd14824d521cbc461fb7f45
Reviewed-on: https://code.wireshark.org/review/33239
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-17 02:55:59 +00:00
Guy Harris 32a014a4f1 Update the warning-suppression statements in idl2wrs.
Update them to use ws_diag_control.h and ws_compiler_tests.h, and the
DIAG_OFF() macros therein.

Regenerate the CORBA dissectors.

Change-Id: I26f0add0ec8dd920bfe80571b4141c1b0e2f0640
Reviewed-on: https://code.wireshark.org/review/33238
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-17 01:41:20 +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
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Alexis La Goutte 2d6e634f34 dissectors (and tools): fix typo dependant -> dependent
found by lintian

Change-Id: I50907b9721f3941c291cf322916f553ab3b4b168
Reviewed-on: https://code.wireshark.org/review/20638
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-19 21:55:21 +00:00
Balint Reczey 9a9b1c9bba Spelling fixes for errors found by lintian
Change-Id: I889283902875193f4d3f3fd59788f59f8d9bcc20
Reviewed-on: https://code.wireshark.org/review/11945
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-07 07:11:54 +00:00
Michael Mann a9445a4d36 idl2wrs: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
It looks like "items" could have contributed to fields/data being at an incorrect level off of a tree.

Change-Id: I93616ef8b6b364c578f989882045dee42cb6d3c3
Reviewed-on: https://code.wireshark.org/review/8558
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-28 20:11:05 +00:00
Michael Mann f735d4b3ec Need to generate hf_ variable for aliases in structs.
Change-Id: I6bd995d42cf54aaf2ad90d0322056c7ff0830ea9
Ping-Bug: 11156
Reviewed-on: https://code.wireshark.org/review/8324
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-07 06:07:37 +00:00
Michael Mann 718e900824 Remove proto_tree_add_text from idl2wrs generation.
Change-Id: Iab9df3e68d2a3878c3081c6352c45f7c329b983e
Reviewed-on: https://code.wireshark.org/review/8323
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-07 06:05:50 +00:00
Michael Mann 64c2bf7727 Fix the need to manually adjust packet-gias.c (take 2)
Need to have packet-gias.c in the DIRTY_CORBA_IDL_DISSECTOR_SRC grouping to work around the warnings still generated.

Change-Id: I08ea1f7d90577cc112b85e7fc00171827f58d6d2
Reviewed-on: https://code.wireshark.org/review/8266
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-06 06:09:20 +00:00
Alexis La Goutte 0d7087cc4c Revert "Fix the need to manually adjust packet-gias.c"
This reverts commit 3ca9318d82.

Mac OS X buildbot are not happy

packet-gias.c:356: warning: 'hf_UCO_InvalidInputParameter_details' defined but not used
packet-gias.c:359: warning: 'hf_UCO_ProcessingFault_details' defined but not used
packet-gias.c:360: warning: 'hf_UCO_SystemFault_details' defined but not used
packet-gias.c:5275: warning: 'decode_UCO_Ratio_st' defined but not used
packet-gias.c:5303: warning: 'decode_UCO_DirectAccessLocation_st' defined but not used
packet-gias.c:5588: warning: 'decode_UCO_Coordinate3d_st' defined but not used
packet-gias.c:5612: warning: 'decode_UCO_Circle_st' defined but not used
packet-gias.c:5625: warning: 'decode_UCO_Ellipse_st' defined but not used
packet-gias.c:5656: warning: 'decode_UCO_SimpleGSImage_st' defined but not used
packet-gias.c:5671: warning: 'decode_UCO_SimpleCImage_st' defined but not used
packet-gias.c:5694: warning: 'decode_UCO_CompressedImage_st' defined but not used
packet-gias.c:5836: warning: 'decode_GIAS_ImageSpec_st' defined but not used

Change-Id: Iee076c00eb4e48571a99f6b854b7e3e52983c2f8
Reviewed-on: https://code.wireshark.org/review/8265
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-05-01 09:38:29 +00:00
Michael Mann 3ca9318d82 Fix the need to manually adjust packet-gias.c
Change-Id: I11beada78d2f2b4359d3638cdbcb6f43623fd10c
Reviewed-on: https://code.wireshark.org/review/8262
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-05-01 08:36:42 +00:00
Jeff Morriss 3a42b55ac9 idl2wrs: don't use -1 for the protocol-item length.
It doesn't work any more for empty (length==0) PDUs.

Similar to bug 10646/Ifb96768969a43c59367b73e7bb940ceeb02cf6b0 (for RPC).

Untested as I'm not set up to build IDL dissectors now.

Bug: 11134
Change-Id: I77aacc2590acbacbe02edb1768e754f92f87bc23
Reviewed-on: https://code.wireshark.org/review/8163
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-04-23 02:09:16 +00:00
Michael Mann 6ec73981ac Cleanup "excess" from trying to support sequence of "native types". Last installment of bug 9532.
Cleaned up wireshark_gen.py so that it no longer generates duplicate fields and greatly minimized the number of useless hf_ variables generated.

Change-Id: I26b2ddb5b65fcde99787cc2771348aa1b37f919f
Reviewed-on: https://code.wireshark.org/review/1329
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 04:08:59 +00:00
Michael Mann be13690c3c Continuation of bug 9532.
Ie4d1edfd67a8e6f02834573f29f07baf79058534 created a several duplicate hf_ registrations.  That led to the exposure of some other potential problems with generating sequences.

Still not quite complete, but want to pacify the buildbots, so there is a small amount of manual editing to comment out a few duplicated hfs in packet-parlay.c.

Change-Id: I0ff8a9795e213ab966db8d6333b9477bad06250b
Reviewed-on: https://code.wireshark.org/review/1302
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-23 15:47:33 +00:00
Michael Mann fccf62ece2 Bugfix generating a sequence of "native" types. Bug 9532.
Previously a sequence of "native" types (int, float, etc) generated a proto_tree_add_uint (for the loop over the sequence) and a proto_tree_add_XXX (for the "native" type), but only 1 hf variable was created for the "loop" field, so DISSECTOR_ASSERT_NOT_REACHED would be generated if "native" type != uint.  Now a separate hf_ variable is generated for the "loop" and "native" type.

Also update existing IDL dissectors with new generator logic.

Change-Id: Ie4d1edfd67a8e6f02834573f29f07baf79058534
Reviewed-on: https://code.wireshark.org/review/1274
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 06:24:33 +00:00
Michael Mann 0f90397d29 Fix generator to remove Dead Store (Dead assignement/Dead increment) warning found by Clang.
(not sure why, but regeneration also "moved" some hf_ variables from previous version)

Change-Id: I197eacbb3f892dbdca6e6bc354fc88240c1bfb34
Reviewed-on: https://code.wireshark.org/review/1291
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 04:44:59 +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
Alexis La Goutte 0e120c16df Fix warnings in packet-parlay.c
packet-parlay.c:53643:9: warning: passing argument 2 of 'get_CDR_wchar' from incompatible pointer type [enabled by default]

packet-parlay.c:53667:9: warning: passing argument 2 of 'get_CDR_wstring' from incompatible pointer type [enabled by default]

Change-Id: I027809139e74b563e759f28e2e141951166e53d0
Reviewed-on: https://code.wireshark.org/review/170
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Tested-by: Anders Broman <a.broman58@gmail.com>
2014-02-10 22:54:02 +00:00
Alexis La Goutte 6b10f16ca8 From Anders request Add prototype for corba/idl dissector
svn path=/trunk/; revision=53778
2013-12-04 09:53:21 +00:00
Alexis La Goutte 3fc5a3e845 Add modelines info to idl generate file
svn path=/trunk/; revision=53754
2013-12-03 13:38:38 +00:00
Alexis La Goutte de65892796 Fix indent for generated file (Use 4 space)
svn path=/trunk/; revision=53753
2013-12-03 13:38:30 +00:00
Alexis La Goutte a637d81706 Fix generator don't generate trailing whitespace
svn path=/trunk/; revision=53752
2013-12-03 13:38:23 +00:00
Alexis La Goutte 76db825c84 Add #pragma to idl generator...
svn path=/trunk/; revision=53746
2013-12-03 13:37:31 +00:00
Gerald Combs 4e2b6b13f6 Use 4-space (PEP 8) indentation. Add modelines.
svn path=/trunk/; revision=53685
2013-12-01 01:53:26 +00:00
Michael Mann a50c42821d expert_add_info_format_text -> expert_add_info_text
svn path=/trunk/; revision=51849
2013-09-08 23:47:06 +00:00
Guy Harris 5d87a8c461 WS_DLL_PUBLIC is now always WS_DLL_PUBLIC_NOEXTERN with "extern" added;
just define WS_DLL_PUBLIC_NOEXTERN inside the ifdefs, and define
WS_DLL_PUBLIC as WS_DLL_PUBLIC_NOEXTERN followed by "extern".

Then rename WS_DLL_PUBLIC_NOEXTERN to WS_DLL_PUBLIC_DEF, to clarify that
it's what should be used for definitions; at least on Windows, you
*have* to use it when declaring arrays without a size, and, whilst you
might be able to use WS_DLL_PUBLIC for definitions of functions and
perhaps data definitions other than no-size arrays, it might be clearer
to rename WS_DLL_PUBLIC to WS_DLL_PUBLIC_DECL and use it only for
declarations.

svn path=/trunk/; revision=50334
2013-07-03 01:43:39 +00:00
Michael Mann 5e86cb9bf4 Use new expert info API in idl dissectors. These generated about 50% of the add_expert_info_format() calls.
svn path=/trunk/; revision=49561
2013-05-24 18:09:57 +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
Jaap Keuter 6e1c54c8fd Fix for CID 761911-761984 and CID 761985-761994.
Try to convince Coverity that the passed in item pointer is appreciated,
but not used.
This time see if it pleases the Windows compiler too.

svn path=/trunk/; revision=47217
2013-01-22 22:07:44 +00:00
Anders Broman 332012288b Revert 47201 it does not compile on Windows.
svn path=/trunk/; revision=47208
2013-01-22 07:05:39 +00:00
Jaap Keuter 86dd0abcd3 Fix for CID 761911-761984 and CID 761985-761994.
Try to convince Coverity that the passed in item pointer is appreciated,
but not used.

svn path=/trunk/; revision=47201
2013-01-21 22:38:11 +00:00
Jaap Keuter 69489bc85a Try and see if we can suppress about half of the Coverity issues.
svn path=/trunk/; revision=47157
2013-01-18 23:25:22 +00:00
Guy Harris c1245c6b32 Change wireshark_gen.py to make the operation argument to routines a
"const char *", as it is now expected to be.  Regenerate the dissectors.

Update the URL for OmniOrb.

In README.parlay, use idl2wrs in the sample command.

svn path=/trunk/; revision=46765
2012-12-26 10:28:03 +00:00
Michael Mann 7d39afa6f8 Use proto_tree_add_<signed integer> functions for signed giop datatypes
svn path=/trunk/; revision=46021
2012-11-13 13:20:39 +00:00
Michael Mann 9f84a8d340 Add a few more expert_add_info_format calls to giop dissector which requires packet_info* structure and proto_item* to be filtered down through the generated functions.
Also removed some excessive whitespace.

svn path=/trunk/; revision=45911
2012-11-05 03:36:07 +00:00
Michael Mann a5d56d30b4 Make idl2wrs dissectors filterable - Part 1
Updated wireshark_gen.py to generate hf_ variables for all of the IDL "types".  The "simple" types use proto_tree_add_* (not text), while the "complex" types use the GIOP dissector API.  checkhf.pl generates some warnings because (some of) the hf_ variables are being generated for the "complex" types, but are not being used.  That will be done in Part 2.

expert_add_info_format now linked to a real item instead of being attached to a duplicative proto_tree_add_text().  This cleaned up literally thousands of unnecessary proto_tree_add_text()s

svn path=/trunk/; revision=45472
2012-10-11 14:42:33 +00:00
Jeff Morriss 22b7086fb9 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=44997
2012-09-19 01:37:13 +00:00
Pascal Quantin e6538311a6 Replace process_RequestOperation macro by a real function to speedup compilation time
svn path=/trunk/; revision=44779
2012-09-05 12:45:54 +00:00