Commit Graph

171 Commits

Author SHA1 Message Date
Guy Harris e013c5ec7f Clean up URLs.
Add ui/urls.h to define some URLs on various of our websites.  Use the
GitLab URL for the wiki.  Add a macro to generate wiki URLs.

Update wiki URLs in comments etc.

Use the #defined URL for the docs page in
WelcomePage::on_helpLabel_clicked; that removes the last user of
topic_online_url(), so get rid of it and swallow it up into
topic_action_url().
2020-10-02 20:13:42 -07:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
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
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
Guy Harris dc011cc53e pidl: fix field2name wireshark dissector test.
Pick up change from Samba:

    commit 82778a6d04580fc05f3f83d44f57f221ad4e8ac4
    Author: Günther Deschner <gd@samba.org>
    Date:   Tue Sep 6 22:37:12 2016 +0200

        pidl: fix field2name wireshark dissector test.

        Guenther

        Signed-off-by: Guenther Deschner <gd@samba.org>
        Reviewed-by: Stefan Metzmacher <metze@samba.org>

        Autobuild-User(master): Günther Deschner <gd@samba.org>
        Autobuild-Date(master): Wed Sep  7 16:05:26 CEST 2016 on sn-devel-144

Change-Id: Ia02de7d36b2fcb0e7a5145361548acae844f73ed
Reviewed-on: https://code.wireshark.org/review/23724
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 07:21:00 +00:00
Guy Harris c1a5531b71 pidl: Fix array range checks in python output
Pick up change from Samba:

    commit 67040cf61232dd1cdcc820237919ac1e073c31c2
    Author: Volker Lendecke <vl@samba.org>
    Date:   Tue Jun 20 15:31:18 2017 +0200

        pidl: Fix array range checks in python output

        Without this, we generated code like

        if (ndr_table_dnsserver.num_calls < 0) {
                PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_DnssrvOperation_ndr_pack");
                return NULL;
        }
        call = &ndr_table_dnsserver.calls[0];

        This does not really make sense, and Coverity found comparing the unsigned
        num_calls against <0 a bit pointless.

        Should fix 138 Coverity findings and make the code a bit more correct.

        Signed-off-by: Volker Lendecke <vl@samba.org>
        Reviewed-by: Jeremy Allison <jra@samba.org>

Change-Id: I401e3771e6f3c1125ff847749073693af23884fc
Reviewed-on: https://code.wireshark.org/review/23723
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 07:18:22 +00:00
Guy Harris a98d108916 python3: Use "y#" instead of "s#" for binary data in PyArg_ParseTuple
Pick up change from Samba:

    commit 40e409bf9e89a163c771b2a58493d2c1b496fae7
    Author: Petr Viktorin <pviktori@redhat.com>
    Date:   Wed May 3 16:57:07 2017 +0200

        python3: Use "y#" instead of "s#" for binary data in PyArg_ParseTuple

        The "s#" format code for PyArg_ParseTupleAndKeywords and Py_BuildValue
        converts a char* and size to/from Python str (with utf-8 encoding under
        Python 3).
        In some cases, we want bytes (str on Python 2, bytes on 3) instead. The
        code for this is "y#" in Python 3, but that is not available in 2.

        Introduce a PYARG_BYTES_LEN macro that expands to "s#" or "y#", and use
        that in:
        - credentials.get_ntlm_response (for input and output)
        - ndr_unpack argument in PIDL generated code

        Signed-off-by: Petr Viktorin <pviktori@redhat.com>
        Reviewed-by: Andreas Schneider <asn@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Change-Id: If4d9cdabc5016127f60682caf300f6801a360083
Reviewed-on: https://code.wireshark.org/review/23722
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 07:15:09 +00:00
Guy Harris 141637d327 pidl: Fix Coverity warnings from duplicate NULL checks.
Pick up change from Samba:

    commit 9703464b942fdddbf7bc4380cbd26d1803f9bc00
    Author: Jeremy Allison <jra@samba.org>
    Date:   Tue May 2 08:10:40 2017 -0700

        pidl: Fix Coverity warnings from duplicate NULL checks.

        Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

        Signed-off-by: Jeremy Allison <jra@samba.org>
        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

        Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
        Autobuild-Date(master): Sat May  6 16:03:17 CEST 2017 on sn-devel-144

Change-Id: I25c6ae984c6a963c05f33d9a649b64f9795c7292
Reviewed-on: https://code.wireshark.org/review/23721
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 07:13:00 +00:00
Guy Harris 5ea8c70c05 python: pidl: Port Python interface generator
Pick up change from Samba:

    commit 2de5fa45e0abfdb50f604f87e494bf334c39003a
    Author: Lumir Balhar <lbalhar@redhat.com>
    Date:   Mon Jan 23 21:03:17 2017 +0100

        python: pidl: Port Python interface generator

        Port PIDL generator of Python interfaces to generate interfaces in
        Python 3 compatible form.

        Python 2.7 is now required, so we can use PyCapsule in both versions.

        Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
        Pair-programmed-by: Andrew Bartlett <abartlet@samba.org>

Change-Id: I981993e326132a1911bfbb686ca5ae033dd1df49
Reviewed-on: https://code.wireshark.org/review/23720
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 05:11:02 +00:00
Guy Harris 097de92cfb pidl:Python: use of pytalloc_GenericObject_reference*() for pyrpc_{ex,im}port_union() wrapping
Pick up change from Samba:

    commit 2170f556299c6ab4ce33f22169ca26ecad3440e3
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Feb 20 18:02:09 2017 +0100

        pidl:Python: use of pytalloc_GenericObject_reference*() for pyrpc_{ex,im}port_union() wrapping

        BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

        Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
        Autobuild-Date(master): Sat Feb 25 06:33:33 CET 2017 on sn-devel-144

Change-Id: I4d3cb70c79531e5faf5249b67948cc6d354c1bd0
Reviewed-on: https://code.wireshark.org/review/23719
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 05:09:23 +00:00
Guy Harris 4861fbe121 pidl:Python: replace pytalloc_CObject_FromTallocPtr() with pytalloc_GenericObject_reference_ex()
Pick up change from Samba:

    commit 1ee0c0f8280393c708f23361ebcba0776e8b4d33
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Wed Feb 22 09:07:54 2017 +0100

        pidl:Python: replace pytalloc_CObject_FromTallocPtr() with pytalloc_GenericObject_reference_ex()

        BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Change-Id: I19d04a1a248d35799ec41a79113fe588cd05e3de
Reviewed-on: https://code.wireshark.org/review/23718
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 05:03:30 +00:00
Guy Harris 75f78cd49a BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601
Pick up change from Samba:

    commit d62eb3cc9f97b203d21ec6e75c48c739a43bc163
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Wed Feb 22 10:08:46 2017 +0100

        pidl:Python: make sure print HASH references for STRUCT types

        BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Change-Id: Ieef766844ce66160eaaacecc73a51f94f69319fb
Reviewed-on: https://code.wireshark.org/review/23717
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 05:02:04 +00:00
Guy Harris 5bda9bd4cb pidl:Python: add PyTypeObject objects for function structs
Pick up change from Samba:

    commit 57539c84416aeb8fc8e3a8653f790b329e6fa9a1
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 09:20:44 2016 +0200

        pidl:Python: add PyTypeObject objects for function structs

        They provide get/set methods for the in_* and out_* elements
        and the magic __ndr_{push,pull,print}_{in,out}__ hooks to enable
        the marshalling via ndr_{push,pull,print}_{in,out}().

        This provides an easy way to generate and parse the payload of
        DCERPC requests and responses, which is very useful for writing
        tests.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I8f0e70fb771a91ba9590e2e92b5713b48313d2de
Reviewed-on: https://code.wireshark.org/review/23716
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:58:01 +00:00
Guy Harris fd81dea208 pidl:Python: split out a PythonElementGetSet() helper function
Pick up a change from Samba:

    commit a546124f10d1e2bee29bc06c0b8754257d2bdc23
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 09:20:04 2016 +0200

        pidl:Python: split out a PythonElementGetSet() helper function

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: Ica8b699189b69833abfa6049dd3c4e489788ce54
Reviewed-on: https://code.wireshark.org/review/23715
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:52:41 +00:00
Guy Harris 1dd1a13e9f pidl:Python: the py_{import,export}_*() functions can be static now.
Pick up change from Samba:

    commit 40175613519e7405a16e8f896dfdc2949430bc4b
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Tue Sep 13 01:06:18 2016 +0200

        pidl:Python: the py_{import,export}_*() functions can be static now.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I6e06c97b44a04cab36d134916eddf4c501ccc35d
Reviewed-on: https://code.wireshark.org/review/23714
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:51:19 +00:00
Guy Harris 484d114b36 pidl:Python: make use of the pyrpc_{import,export}_union() functions
Pick up a change from Samba:

    commit f7707c04a5e039e757b288ad67a0c3cac9c6466a
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 16:33:38 2016 +0200

        pidl:Python: make use of the pyrpc_{import,export}_union() functions

        This avoids the linking problems at C shared object level.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I62c1d03b10e965552a4d598fa2370692ee0cd12a
Reviewed-on: https://code.wireshark.org/review/23713
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:49:57 +00:00
Guy Harris 0517a05b54 pidl:Python: provide a PyTypeObject with METH_CLASS __import__() and __export__() hooks
Pick up a change from Samba:

    commit e0324c0cf7e7c363a5791c2e35c8820b79640a47
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 16:33:38 2016 +0200

        pidl:Python: provide a PyTypeObject with METH_CLASS __import__() and __export__() hooks

        These are wrappers around the currently public C functions
        'py_import_*() and 'py_export_*().

        In order to let other python module use these function, we should
        resolve the needed type object and call the __import__() or __export__()
        hooks instead of linking to the other shared module at C level.

        We already do the same for structs.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I47813a544365085407a31d174ee180778674e42b
Reviewed-on: https://code.wireshark.org/review/23712
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:48:37 +00:00
Guy Harris 1373f619f9 pidl:Python: provide the abstract syntax as <module>.<interface>_abstract_syntax
Pick up change from Samba:

    commit 3a0ce3e41d9fdab58273c239955862b03396ea19
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Sun Sep 25 00:48:29 2016 +0200

        pidl:Python: provide the abstract syntax as <module>.<interface>_abstract_syntax

        The <module>.abstract_syntax alias is only kept as legacy for
        the first interface in a module.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: Ie6d3d48ea3012bd328eb20e2e6693928fe24ead8
Reviewed-on: https://code.wireshark.org/review/23711
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:46:58 +00:00
Guy Harris aff94cf8f5 pidl:Python: prettify names of constants
Pick up change from Samba:

    commit 1bebccaeb93f7fb7b6e2538d63223f01587ed14d
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Fri Sep 23 06:49:13 2016 +0200

        pidl:Python: prettify names of constants

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: If9905b914c0d559bd6e7808fadbd154ae56ae2b1
Reviewed-on: https://code.wireshark.org/review/23710
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:45:35 +00:00
Guy Harris d7311431b2 pidl:Python: improve the .doc string for the get/set elements
Pick up change from Samba:

    commit a560116aa5228885e5f52fc46fa92151357de69c
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Tue Sep 13 09:07:32 2016 +0200

        pidl:Python: improve the .doc string for the get/set elements

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I8ecb22fd88298ecd4e350b1815d8720b493aac27
Reviewed-on: https://code.wireshark.org/review/23709
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:43:53 +00:00
Guy Harris 1cbb04eaf1 pidl:Python: make use of NDR_ERR_CODE_IS_SUCCESS()
Pick up change from Samba:

    commit 47b40ac96afbd4fb28e519b9658256ecaa304e71
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 15:12:24 2016 +0200

        pidl:Python: make use of NDR_ERR_CODE_IS_SUCCESS()

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I550b83596fe27bad5ba4f7d91eb0ac62380f4eac
Reviewed-on: https://code.wireshark.org/review/23708
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:42:30 +00:00
Guy Harris e3acb2e3eb pidl:Python: __ndr_print__ functions don't get arguments and need METH_NOARGS
Pick up change from Samba:

    commit d4660e869790c7da1cb97e9d95a995e5a32b34ef
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Sun Sep 25 01:07:14 2016 +0200

        pidl:Python: __ndr_print__ functions don't get arguments and need METH_NOARGS

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: Ic0648f65b8c3f60e614361778d2c0bf72d61be35
Reviewed-on: https://code.wireshark.org/review/23707
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:41:05 +00:00
Guy Harris 856ce75060 pidl:Python: check the return values of talloc_ptrtype()
Pick up change from Samba:

    commit b728c63bcb5860aed2db43139d191bc149ceba83
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Sep 12 15:12:50 2016 +0200

        pidl:Python: check the return values of talloc_ptrtype()

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: Icfe8837b5b998e3c5c4ea98df21cf620f53cdcd7
Reviewed-on: https://code.wireshark.org/review/23706
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:17:59 +00:00
Guy Harris da01add662 lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)
Pick up change from Samba:

    commit 306783d6f5d577a0b8bd31d659d8c802f22f0333
    Author: Jeremy Allison <jra@samba.org>
    Date:   Thu Apr 20 12:24:43 2017 -0700

        lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)

        Not currently used - no logic changes inside.

        This will make it possible to pass down a long-lived talloc
        context from the loading function for modules to use instead
        of having them internally all use talloc_autofree_context()
        which is a hidden global.

        Updated all known module interface numbers, and added a
        WHATSNEW.

        Signed-off-by: Jeremy Allison <jra@samba.org>
        Signed-off-by: Ralph Böhme <slow@samba.org>

        Autobuild-User(master): Jeremy Allison <jra@samba.org>
        Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144

Change-Id: I549e24e2e1fec12d8e7d3f3304cdac29882892a5
Reviewed-on: https://code.wireshark.org/review/23705
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:13:30 +00:00
Guy Harris 3183465351 s4-rpc_server: Allow each interface to declare if it uses handles
Pick up change from Samba:

    commit ffb8b50e3c07c833fb7b1a583d21f9dc1166a0a6
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Mon Nov 14 11:24:03 2016 +1300

        s4-rpc_server: Allow each interface to declare if it uses handles

        This will allow the NETLOGON server in the AD DC to declare that it does not use
        handles, and so allow some more flexibility with association groups

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Stefan Metzmacher <metze@samba.org>

Change-Id: Ic09452d27493ff913f5a5c064a038e3783e91df2
Reviewed-on: https://code.wireshark.org/review/23704
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:10:12 +00:00
Guy Harris 07a21ba6f6 s4-rpc_server: Add back support for lsa over \\pipe\\netlogon optionally
Pick up change from Samba:

    commit 31d625bcd2b0cb33dd98a37c202f5b371b871362
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Tue Dec 13 09:06:25 2016 +1300

        s4-rpc_server: Add back support for lsa over \\pipe\\netlogon optionally

        The idea here is that perhaps some real client relies on this (and not just Samba torture
        commands), so we need a way to support it for the 4.6 release.

        If no such client emerges, it can be deprecated and removed in the normal way.

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Stefan Metzmacher <metze@samba.org>

Change-Id: Id20f98ffbc5eb4752bebee455e7b2b2c0f5017e0
Reviewed-on: https://code.wireshark.org/review/23703
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:08:05 +00:00
Guy Harris dc7a03486c pidl: Make dcesrv\_$name\_interface "static const"
Pick up change from Samba:

    commit 50dff7e094d48793b432992a28571a6f7e5cc73c
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Mon Nov 21 11:21:50 2016 +1300

        pidl: Make dcesrv\_$name\_interface "static const"

        This moves it out of the global namespace

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Stefan Metzmacher <metze@samba.org>

        Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
        Autobuild-Date(master): Thu Dec  8 13:25:57 CET 2016 on sn-devel-144

Change-Id: Ifa9fca377dc217b131f87cef4463624a679660f9
Reviewed-on: https://code.wireshark.org/review/23702
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:06:14 +00:00
Guy Harris a19fdccf51 pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)
Pick up change from Samba:

    commit 778fc58eb281e38eb1a3346b58cfdf9682f104c4
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Mon Nov 21 11:38:24 2016 +1300

        pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>
        Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Change-Id: I5bbc8cfdd94f4c13250fc3b1cb0a61351220116c
Reviewed-on: https://code.wireshark.org/review/23701
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 04:04:34 +00:00
Guy Harris ad0417cb78 libndr/compression: pass down compressed length in ndr_pull_compression_start
Pick up change from Samba:

    commit a44bce6dfab59a6440ccc30ef0968d59b9f43fd3
    Author: Günther Deschner <gd@samba.org>
    Date:   Tue Sep 20 00:18:43 2016 +0200

        libndr/compression: pass down compressed length in ndr_pull_compression_start

        Guenther

        Signed-off-by: Guenther Deschner <gd@samba.org>
        Reviewed-by: Jeremy Allison <jra@samba.org>

Change-Id: I038c28cafce1248f4208119ba47f1c94ce970067
Reviewed-on: https://code.wireshark.org/review/23700
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 03:59:07 +00:00
Guy Harris 7c56a5affb pidl:NDR/Parser: add missing {start,end}_flags() to ParseElementPrint()
Pick up change from Samba:

    commit 81bbfb010599b65308aca89cc50532372ca4cb00
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Jun 12 18:58:49 2017 +0200

        pidl:NDR/Parser: add missing {start,end}_flags() to ParseElementPrint()

        BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: Iaf4192083c49a15eaf722da1a3b55ad987bdbc82
Reviewed-on: https://code.wireshark.org/review/23699
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 03:52:56 +00:00
Guy Harris 8fdcc95456 pidl:NDR/Parser: initialize [skip] values in ndr_pull_*
Pick up change from Samba:

    commit 823bc4c07add242a5a1d0cd25942ebaab3cd0e23
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Tue Jun 13 09:57:33 2017 +0200

        pidl:NDR/Parser: initialize [skip] values in ndr_pull_*

        It's too dangerous to leave values uninitialzed!
        [skip_noinit] can be used if required.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Volker Lendecke <vl@samba.org>

Change-Id: I85a173e21fca509fc417ff2532097fd9a220ccd9
Reviewed-on: https://code.wireshark.org/review/23698
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 03:05:57 +00:00
Guy Harris 67522b6130 pidl:NDR/Parser: add "skip_noinit" element
Pick up change from Samba:

    commit b922472fd683235fde3abc69ee09d9d8bfdb8644
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Wed Jun 21 15:05:35 2017 +0200

        pidl:NDR/Parser: add "skip_noinit" element

        In future "skip" will be changed to initialize the element
        with ZERO_STRUCT() on ndr_pull_*.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Volker Lendecke <vl@samba.org>

Change-Id: I4b886c18c9eff27ae446e68fb7220e812721c4e0
Reviewed-on: https://code.wireshark.org/review/23697
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 03:04:04 +00:00
Guy Harris d037bc66c1 pidl:NDR/Parser: fix "skip" for pointers
Pick up change from Samba:

    commit 3bc6b55385894691792962ecc15978a3b158eca4
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Mon Jun 19 12:15:21 2017 +0200

        pidl:NDR/Parser: fix "skip" for pointers

        We should handle the "skip" at the element level before
        we traverse trough the element levels.

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Volker Lendecke <vl@samba.org>

Change-Id: I8b52e1ad0e0ad2c8a4fc20b94f07441b458e5638
Reviewed-on: https://code.wireshark.org/review/23696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 03:01:18 +00:00
Guy Harris 7bb3df70b1 pidl: use ndr_push_charset_to_null() when [to_null] keyword is used in IDL
Pick up change from Samba:

    commit d30b008a642c9bb0d85519f42aef56a53e44cc77
    Author: Günther Deschner <gd@samba.org>
    Date:   Mon Jan 23 14:50:45 2017 +0100

        pidl: use ndr_push_charset_to_null() when [to_null] keyword is used in IDL

        Guenther

        Signed-off-by: Guenther Deschner <gd@samba.org>
        Reviewed-by: Stefan Metzmacher <metze@samba.org>

Change-Id: I26d53e3c4d0aa9fc959f2d9f0455e480c6cd45e2
Reviewed-on: https://code.wireshark.org/review/23695
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 02:58:36 +00:00
Guy Harris 2558728ff9 s4: COM: Remove talloc_autofree_context() from (unused) COM code.
Pick up change from Samba:

    commit fe2ac3e304201d18ca15d388b622a4f15f72ad0a
    Author: Jeremy Allison <jra@samba.org>
    Date:   Mon Jul 24 12:00:21 2017 -0700

        s4: COM: Remove talloc_autofree_context() from (unused) COM code.

        BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932

        Signed-off-by: Jeremy Allison <jra@samba.org>
        Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Change-Id: I44a4e3794569957c3cdf0721e78e73972ba06085
Reviewed-on: https://code.wireshark.org/review/23694
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 02:56:14 +00:00
Guy Harris c73e940526 pidl: Make static struct api_struct also const
Pick up change from Samba:

    commit c6c1463852533ed8234911835b8b1fce29b2d3d8
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Mon Nov 21 11:58:07 2016 +1300

        pidl: Make static struct api_struct also const

        This moves the table to read-only memory

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>
        Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Change-Id: I2a7ce154dff4584c5db445cfd789a8c4f928a338
Reviewed-on: https://code.wireshark.org/review/23693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 02:46:43 +00:00
Guy Harris 18d258ac46 pidl: Change *_get_pipe_fns() to return const struct api_struct *
Pick up change from Samba:

    commit d368ee2298bc472caca940a3db7a4f855df6ca21
    Author: Andrew Bartlett <abartlet@samba.org>
    Date:   Mon Nov 21 11:57:48 2016 +1300

        pidl: Change *_get_pipe_fns() to return const struct api_struct *

        This will allow the table to be made static const in the next commit

        Signed-off-by: Andrew Bartlett <abartlet@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>
        Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Change-Id: Ib8cecaf695ccf70a78f97152e3286723cbc233ec
Reviewed-on: https://code.wireshark.org/review/23692
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 02:44:42 +00:00
Guy Harris f6d956cf92 pidl:NDR: add ReturnTypeElement() helper function
Pick up change from Samba:

    commit d5e4707e98f3613acebb9d0de7e6f944f0b1efaf
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Tue Sep 13 09:06:50 2016 +0200

        pidl:NDR: add ReturnTypeElement() helper function

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I3f4c8fb9b18ee10b031d9c58209d1c6c45bbec63
Reviewed-on: https://code.wireshark.org/review/23691
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 01:34:49 +00:00
Guy Harris 9ab7b538f0 pidl:NDR: keep interface->{ORIGINAL}
Pick up change from Samba:

    commit 7423d8106ef08b94821f5fc666892234feff6f05
    Author: Stefan Metzmacher <metze@samba.org>
    Date:   Tue Sep 13 07:57:25 2016 +0200

        pidl:NDR: keep interface->{ORIGINAL}

        Signed-off-by: Stefan Metzmacher <metze@samba.org>
        Reviewed-by: Andreas Schneider <asn@samba.org>

Change-Id: I8f088a7bbbdbd756a0d28169f8ed00f99d9a8cc3
Reviewed-on: https://code.wireshark.org/review/23690
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-09-25 01:33:13 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Guy Harris 5ae9af9e50 Get rid of Boolean "flags" that don't have any bit set.
And tweak the Pidl generator for Wireshark not to generate "flags" like
that.

(The generator also does field name and true/false strings' case
differently, so I didn't use it to regenerate the dissectors; that needs
to be looked at.)

Change-Id: Ie1657a782ebdb107e58792cedd29bbaa79b17bd4
Reviewed-on: https://code.wireshark.org/review/18695
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-06 19:03:21 +00:00
Alexis La Goutte c52d9209cc Driver.pm (pidl): fix spelling typo found by lintian
Change-Id: Idb288beb54c91e100c164e0026b39bfe27daec39
Reviewed-on: https://code.wireshark.org/review/18485
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-26 23:05:38 +00:00
Günther Deschner 6e3ebccf22 tools/pidl: support HRESULT as return code in wireshark autogenerated dissectors.
Guenther

Change-Id: I68b7c579c5a519e429d2f4c2b3f63247e02f24e3
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-on: https://code.wireshark.org/review/16718
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-06 15:34:02 +00:00
Günther Deschner 29cc1817b9 tools/pidl: Keep case from fieldnames.
Change-Id: I5626cfa0487cc88eb65cc349c05ae1762bc953f4
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-on: https://code.wireshark.org/review/16720
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-06 14:06:24 +00:00
Guy Harris 62eb424d80 Copy over change from Samba repository:
commit ed11ce8f12d567a3e0edc1d24aab1784a171ac33
  Author: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
  Date:   Wed May 4 16:51:37 2016 +1200

    Python pidl: avoid segfault with "del obj->attr"

    Deleting an attribute in Python (using the "del" statement) is (at
    some stages along a winding path, for C objects) converted into
    setting the attribute to NULL. Not None, actual NULL. The way we
    handled this NULL was to dereference it. This changes the behaviour to
    raising an AttributeError, which is more or less what Python does in
    similar situations with builtin objects.

    Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Shouldn't affect us, but it makes diffing cleaner.

Change-Id: I8e681dc79c8f4e62b74e2aa5ac2b4924134735c4
Reviewed-on: https://code.wireshark.org/review/16741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 23:22:47 +00:00
Guy Harris f0ed91f79d Copy over change from Samba repository:
commit f6c79072ca50e05a68b73a80a0ebd635a9bac068
  Author: Andrew Bartlett <abartlet@samba.org>
  Date:   Thu Apr 21 21:44:56 2016 +1200

    pidl: Correct string handling to use talloc and be in common

    The previous string handling assumed the python variables referenced
    by PyString_AS_STRING had infinite life.  When they were re-used
    the C structure started to point at unexpected things.

    We now check correctly for Unicode in every case, and we always
    duplicate the string with talloc_strdup()

    Signed-off-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Shouldn't affect us, but it makes diffing cleaner.

Change-Id: Ib54b62f5630df46cff6fb0582acd109b263142d2
Reviewed-on: https://code.wireshark.org/review/16740
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 23:20:58 +00:00
Guy Harris 5623b7917e Copy over change from Samba repository:
commit 90bf114f6370ee837d97e36eb25f38f8234dcd39
  Author: Andrew Bartlett <abartlet@samba.org>
  Date:   Thu Feb 25 13:57:37 2016 +1300

    pidl: Use a tmp_ctx helper variable

    This is so we free the ndr_push_struct_blob() return value after
    we make it into a string

    Signed-off-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Shouldn't affect us, but it makes diffing cleaner.

Change-Id: I52ee911f89813e6f5a90445be4eb52494e3f69d3
Reviewed-on: https://code.wireshark.org/review/16739
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 23:19:14 +00:00
Guy Harris 692f0145f4 Copy change from Samba repository:
commit dffa2dbfabca14f07af12663fc93c8dc3bc837cf
  Author: Andrew Bartlett <abartlet@samba.org>
  Date:   Thu Feb 25 13:57:00 2016 +1300

    pidl: Use the $mem_ctx helper variable

    This is already set to pytalloc_get_mem_ctx(py_obj)

    Signed-off-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Shouldn't affect us, but it makes diffing cleaner.

Change-Id: I60fddc0a1055095ecad51180c9e1fc2223d2c017
Reviewed-on: https://code.wireshark.org/review/16738
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 23:17:00 +00:00
Guy Harris d47f174f9e Copy over change from Samba repository:
commit 9e07f3a13b41be1f019887581b2a2bd049039a3d
  Author: Andrew Bartlett <abartlet@samba.org>
  Date:   Tue Feb 16 14:06:28 2016 +1300

    pidl: Fix our python reference handling

    The new talloc.BaseObject allow us to hold a talloc context per
    python object (there may be many referring to the same C object)
    and the talloc context that the actual object pointer is under.

    Another advantage is that talloc.BaseObject(), has less of
    an ABI surface.

    Signed-off-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Shouldn't affect us, but it makes diffing cleaner.

Change-Id: If4a7d9d3f5eb0acf9f94b10af870a0e01fa52b5c
Reviewed-on: https://code.wireshark.org/review/16737
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 23:14:56 +00:00
Guy Harris bd0280e8d6 Pick up changes from the Samba repository:
commit 59d530c0b692dae41ea271bfdb473f212615041b
  Author: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
  Date:   Tue Mar 1 14:18:52 2016 +1300

    ndr: Use ndr_steal to avoid long lists

    When pulling complex structures like nt-acls, a long list of tokens may
    be produced. By removing tokens along the way with ndr_token_steal,
    future calls to retrieve from the token list are not as expensive.

    Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Garming Sam <garming@catalyst.net.nz>

  commit 9af628a488d2b628e6c33917be7030602eeb5fde
  Author: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
  Date:   Fri Feb 26 17:01:37 2016 +1300

    ndr: avoid unnecessary searches of token list

    When pulling complex structures like nt-acls, a long list of tokens
    may be produced. This change means the token list won't be walked in the
    buffers case if the switch value is not needed.

    Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet@samba.org>
    Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Change-Id: I0e0ce345e5184e0cd180b0079dd693a7ed3f31ef
Reviewed-on: https://code.wireshark.org/review/16736
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27 22:53:59 +00:00