1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

530 Commits

Author SHA1 Message Date
Stefan Metzmacher
a0fa1dd6fc pidl/Typelist: let typeIs() do TYPEDEF dereference in the HASH case
metze
2010-09-28 23:06:40 +02:00
Andrew Tridgell
7d380795b6 pidl: added ifdef guards around ndr headers
this prevents us parsing the leading headers needlessly
2010-09-27 22:55:05 -07:00
Stefan Metzmacher
bea4948acb pidl:NDR/Parser: fix range() for arrays
metze
2010-09-23 13:34:08 -07:00
Jelmer Vernooij
049c4fa04d pytalloc: Add default compare function. 2010-09-21 11:47:03 -07:00
Jelmer Vernooij
6a3c687f03 pidl/python: Allow passing in UTF8 string objects as well as unicode
objects for IDL strings.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-20 23:17:41 -07:00
Jelmer Vernooij
c4c6f8f175 s4-pild-python: Fix assignments - even though we reference the mem_ctx
of an object we still use the actual ptr.
2010-09-20 22:40:47 -07:00
Jelmer Vernooij
a7393449eb pidl: Fix segfault when accessing unicode objects. 2010-09-20 22:40:46 -07:00
Jelmer Vernooij
5dd47eeac2 s4-pidl-python: use correct talloc pointer when allocating subobjects. 2010-09-20 22:40:46 -07:00
Andrew Tridgell
83a24ff2ef pidl: prevent ndr_print_*() dying on NULL pointers
when using ndrdump you can get uninitialised structures containing
pointers. Don't segfault when trying to print them
2010-09-16 21:09:17 +10:00
Jelmer Vernooij
0bc53f7d9f pidl: Keep only a single copy of samba.dcerpc.base.ClientConnection. 2010-09-03 02:39:38 +02:00
Jelmer Vernooij
c5449c9298 pidl: Factor out generation of interface type name. 2010-09-03 00:35:29 +02:00
Andrew Tridgell
71f2ebcae0 pidl: cope with dom_sid28 in python generator
treated the same as dom_sid2
2010-09-02 13:37:07 +10:00
Andrew Tridgell
58d92cefe2 pidl-python: cope with NULL pointers in more places
NULL is converted to Py_None
2010-09-02 13:37:07 +10:00
Stefan Metzmacher
831611e221 pidl:Samba4/NDR/Client: support argument based stubs for [in,out,string]
metze
2010-08-28 10:59:20 +02:00
Stefan Metzmacher
94faf0ccbe pidl:NDR: [in,out,string] doesn't need to pointers
metze
2010-08-28 10:59:19 +02:00
Stefan Metzmacher
aa3b75ad1f pidl:Samba4/NDR/Client: correctly copy [out,charset()] buffers
If the conversion from CH_UTF16 to CH_UNIX uses multi-byte characters
in CH_UNIX, we should not silently truncate the string, but return
an error.

metze
2010-08-28 10:59:19 +02:00
Stefan Metzmacher
eeebaa63f1 pidl:Samba4/NDR/Client: fix skip reason for unsized arrays
metze
2010-08-28 10:59:18 +02:00
Andrew Tridgell
9cb771a4a0 pidl-python: ensure we allocate ref ptrs before use
this fixes a crash on samba4.samr.python in the build farm
2010-08-26 22:50:20 +10:00
Stefan Metzmacher
a701484230 pidl:Samba3/ClientNDR: remove unused ParseOutputArgument function
metze
2010-08-26 13:29:21 +02:00
Andrew Tridgell
4f8087cdb9 s4-python: reference substructures onto the parent structure
when a python object that is part of a parent structure is created, we
should reference it on the parent structure. This ensures that when
the child object goes out of scope that the parent structure is still
valid
2010-08-25 23:05:05 +10:00
Andrew Tridgell
895064000d pidl-python: fixed the docstrings for ndr_print, ndr_pack and ndr_unpack 2010-08-23 15:55:38 +10:00
Andrew Tridgell
34b8615574 pidl: cope with bad type conversions in unions
This prevents a crash when converting bad types in NDR unions

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
2010-08-22 14:57:34 +10:00
Andrew Tridgell
5a025c82f5 pidl: added a __ndr_print__() method on python NDR objects
This allows you to print a returned NDR structure using
s.__ndr_print__() which gives an easy view of complex
structures, such as those from netlogon
2010-08-22 14:57:34 +10:00
Volker Lendecke
b3f9345d76 Fix a typo 2010-08-16 21:14:25 +02:00
Stefan Metzmacher
b0b73ca041 pidl:Samba4/NDR/Client.pm: correctly copy fixed size out arrays
metze
2010-08-16 10:08:45 +02:00
Michael Adam
045f4c96d5 pidl: fix printing of server side ndr request debug messages
The macros NDR_PRINT_IN_DEBUG and NDR_PRINT_OUT_DEBUG are made for
the client side. For the server side, the NDR_SET_VALUES flag needs
to be added for the OUT struct and not for the IN struct, otherwise,
the OUT part can print uninitialized data and the IN part may
recalculate string lengths illegally.
2010-08-13 23:50:41 +02:00
Stefan Metzmacher
5130e664b9 pidl:Samba3/ClientNDR: implement rpccli_ stubs on top of dcerpc_ stubs
metze
2010-08-12 14:31:23 +02:00
Stefan Metzmacher
51fb4c3860 pidl:Samba4/NDR/Client: add sync dcerpc_pipe based stubs as compat for OpenChange
This will activate the compat wrappers for all functions of an interface:
 #define DCERPC_IFACE_MYPROTO_COMPAT 1
 #include <ndr_myproto_c.h>

This will activates the compat wrappers just for specific functions:
 #define DCERPC_CALL_MYFN1_COMPAT 1
 #define DCERPC_CALL_MYFN2_COMPAT 1
 #include <ndr_myproto_c.h>

metze
2010-08-12 14:31:20 +02:00
Stefan Metzmacher
719981adfd pidl:Samba4/NDR/Client: add non struct base dcerpc_binding_handle client stubs
metze
2010-08-12 14:31:20 +02:00
Stefan Metzmacher
62297dff8f pidl:Samba4/NDR/Client: convert code to $self->pidl()
metze
2010-08-12 14:31:19 +02:00
Stefan Metzmacher
570eefc57a pidl:Samba4/NDR/Client: s/interface/if/
metze
2010-08-12 14:31:19 +02:00
Stefan Metzmacher
76691e9eaf pidl:Samba4/NDR/Client: make use of the new dcerpc_binding_handle_call() infrastructure
metze
2010-08-12 14:31:18 +02:00
Stefan Metzmacher
db89fdac73 pidl:Samba4/NDR/Client: remove old dcerpc_pipe based sync stubs
They're unused in Samba and only used by OpenChange.
I'll add a compat functions for OpenChange later.

metze
2010-08-12 14:31:18 +02:00
Stefan Metzmacher
a2e1f54b3e pidl:Samba3/ClientNDR: ignore "todo" functions
metze
2010-08-12 14:31:16 +02:00
Stefan Metzmacher
a22989a54a pidl:NDR: correctly handle no pointer bracket arrays with 'string'
metze
2010-08-09 19:39:10 +02:00
Stefan Metzmacher
0a7f749bc8 pidl:NDR: correctly handle bracket arrays with 'string'
metze
2010-08-08 11:05:19 +02:00
Stefan Metzmacher
33d1879d5b pidl: Samba3/ClientNDR - Correctly copy arrays, if r.out.size < r.in.size.
metze

Signed-off-by: Andreas Schneider <asn@samba.org>
2010-08-06 14:20:08 +02:00
Andrew Tridgell
a41dffcb6a pidl: added a new type dnsp_name
This is a name type used in DNS where each DNS component maps to a
length byte followed by the string

We want these to map to a char *, which is why we need to do this in
PIDL
2010-08-05 17:31:29 +10:00
Andreas Schneider
c1e81686af pidl: Use struct pipes_struct. 2010-07-28 10:39:22 +02:00
Andreas Schneider
5cefbfef26 s3-rpc_server: Added callbacks for init and shutdown of a rpc service.
This adds two callback function for each rpc service. One is for
initialisation and the other for shutdown. rpc_<service>_unregister()
needs to be called to execute the shutdown function.
2010-07-19 12:59:18 +02:00
Simo Sorce
100d37fc46 s3-dcerpc: Use DATA_BLOB for pipes_struct input data
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:18 +02:00
Simo Sorce
31b59bbf99 s3-dcerpc: Convert rdata from prs_struct to a simple DATA_BLOB
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-16 01:51:16 +02:00
Günther Deschner
690ed0c5e2 s3-rpc: when using rpc_pipe_open_internal, make sure to go through NDR.
Otherwise a lot of information that is usually generated in the ndr_push remains
in an uninitialized state.

Guenther
2010-07-08 16:35:26 +02:00
Günther Deschner
1dcf0e917e pidl: s3 server stubs: make sure LIBNDR_FLAG_BIGENDIAN is set when negotiated.
Guenther
2010-07-05 18:06:30 +02:00
Matthieu Patou
7703b89ae5 pidl: Finish to fix the python generated code for 64bit integers
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-06-25 11:33:16 +02:00
Jelmer Vernooij
700fcfbc63 pidl/python: Make sure to always increment reference counter when using
Py_None.
2010-06-25 00:16:18 +02:00
Jelmer Vernooij
4a75cb9cd5 pidl/python: Increment reference counter on Py_None to prevent us from
accidentally deallocating it.
2010-06-24 23:17:51 +02:00
Günther Deschner
bd4bbd9beb pidl: make sure to fill in cli->pipes_struct->hdr_req.opnum in s3 server dispatch tables.
Guenther
2010-06-16 12:15:24 +02:00
Andrew Bartlett
f5f184a77c pidl: Allow new property 'no_srv_register'.
This Samba-only property prevents pild from emitting the
rpc_wbint_init function, which causes problems because it needs
rpc_srv_register().

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-18 17:17:29 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Julien Kerihuel
9cddf891ad Choose between local tevent_status.h header file and installed one
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-12 19:30:56 +02:00
Günther Deschner
0798ddf63a pidl: add NDR_PRINT_DEBUG output to generated s3 server dispatch tables.
This dramatically helps tracking and debugging usage of the
rpc_pipe_open_internal users.

Guenther
2010-05-08 23:00:20 +02:00
Günther Deschner
094ee6cb43 pidl: indent cosmetics for s3 server stubs.
Guenther
2010-05-03 14:44:57 +02:00
Matthieu Patou
831336293d pidl: Fix the generation of py helper for 64 bit integer
Up to now the generation of code for python helpers dealing with 64 bits (NTTIME,hyper, ...)
was broken because they were assumed to be Int (PyInt_From ...) as Integer is always 32 bits
in python.
This fix use PyLong and states that the incomming data is a long long as it should be 64 bit at least.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2010-05-02 15:59:49 +02:00
Jeff Morriss
0f57a39916 pidl: Fix display field for time fields with newer versions of Wireshark.
Pidl generates some Wireshark dissector fields of type FT_ABSOLUTE_TIME.
Starting some time not too long ago, these fields need a 'display' field
other than BASE_NONE or BASE_DEC.  This commit fixes this,
*assuming* that all the times are "local."
2010-04-30 13:13:16 +02:00
Stefan Metzmacher
a8e81c25eb pidl:Samba4/NDR/Client: map NT_STATUS_NET_WRITE_FAULT to the matching NT_STATUS_RPC_* code
metze
2010-04-15 09:34:03 +02:00
Andrew Bartlett
738ac53037 pidl:python Allow 'nopython' to work
The 'nopython' flag wasn't available for use, as it failed to get past
the syntax checker.

Andrew Bartlett
2010-04-09 12:21:27 +03:00
Stefan Metzmacher
e230c8dd24 pidl:Samba4/Client: don't mix rpc and application NTSTATUS errors anymore for the new bindings
The new dcerpc_binding_handle based client stubs don't mix error codes anymore,
while the old dcerpc_pipe based ones still do to keep OpenChange happy for now.

metze
2010-03-29 15:35:53 +02:00
Stefan Metzmacher
4985720e81 pidl:Samba4/Python: librpc/rpc/dcerpc.h isn't needed anymore
metze
2010-03-23 18:44:33 +01:00
Stefan Metzmacher
30aa55a998 pidl:Samba4/Python: make use of dcerpc_binding_handle stubs
metze
2010-03-18 13:34:04 +01:00
Stefan Metzmacher
f055fce74c pidl:Samba4/Python: remove compiler warnings
metze
2010-03-18 13:34:04 +01:00
Stefan Metzmacher
2624bafca5 pidl:Samba4/Python: remove compiler warnings when using -Wc++
metze
2010-03-18 13:34:04 +01:00
Stefan Metzmacher
d0662ac4d0 pidl:Samba4/NDR/Client: make the old rpc_request style async functions static
metze
2010-03-12 15:25:49 +01:00
Stefan Metzmacher
15d9675b04 pidl:Samba4/NDR/Client: generate stubs for dcerpc_binding_handle abstraction
metze
2010-03-12 15:25:41 +01:00
Stefan Metzmacher
454bedcb80 pidl:Samba4/NDR/Client: don't generate client stubs for function marked as [todo]
metze
2010-03-12 15:25:40 +01:00
Stefan Metzmacher
8844acf424 pidl:Samba/Python: don't generate methods for functions marked as [todo]
metze
2010-03-12 15:25:40 +01:00
Stefan Metzmacher
20980eb787 pidl:NDR/Client.pm: generate explicit _recv functions
metze
2010-03-01 16:11:51 +01:00
Andrew Bartlett
f74ce57cb5 s4:rpc_server Add a 'if_version' parameter to the bind operation.
This allows the interface version to be forwarded to the remote server
in the RPC proxy, both in the endpoint lookup and the subsequent bind.

Andrew Bartlett
2010-02-20 02:55:29 +11:00
Günther Deschner
a049d75193 pidl: use ndr_push_relative_ptr2_start and ndr_push_relative_ptr2_end.
Guenther
2010-02-18 13:43:59 +01:00
Matthias Dieter Wallnöfer
04cf9b81eb pidl - Remove "Py_RETURN_NONE" compatibility code
This was needed only by Python 2.3 which we no longer support.
2010-02-09 17:53:09 +01:00
Jelmer Vernooij
4b11e0c67c pidl: Include Python.h first, to avoid warnings. 2010-01-21 16:15:10 +13:00
Matthieu Patou
678f2ca14b pidl: Introduce new dirrective: relative_short
relative_short is like relative but instead of having the offset coded on 4 bytes
it's coded on 2 bytes. Such things happen in GET_DFS_REFERAL messages.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-12-12 10:26:05 +01:00
Günther Deschner
79f82998b1 pidl: fix handling of output arguments in s3 client stubs.
a20e095 used (uint8_t) instead of (uint8_t *).

Guenther
2009-11-27 16:15:33 +01:00
Stefan Metzmacher
a20e095b1f pidl:Samba3/ClientNDR: $size can be 'foo / 2' so we need to add '(' and ')'
foo / 5 * sizeof(bar)' isn't the same as
'(foo / 2) * sizeof(bar)'.

metze
2009-11-26 11:47:42 +01:00
Stefan Metzmacher
ab1c92950f pidl:NDR/Parser: $size can be 'foo / 2' so we need to add '(' and ')'
foo / 5 * sizeof(bar)' isn't the same as
'(foo / 2) * sizeof(bar)'.

metze
2009-11-26 11:47:41 +01:00
Stefan Metzmacher
2cd88197f8 Revert "Work around ndr_unpack failing on structures with relative pointers."
This reverts commit c2cdb4ad5c.

It's not needed anymore.

metze
2009-11-20 13:48:36 +01:00
Stefan Metzmacher
05850d1894 pidl:NDR/Parser.pm: update ndr_pull->relative_highest_offset after handling relative pointers
metze
2009-11-20 13:48:36 +01:00
Volker Lendecke
e181b88978 Revert "s3: Do not reference ndr_table_<pipe> in the cli_ routines directly"
This reverts commit daa964013b.
2009-11-08 19:43:47 +01:00
Volker Lendecke
47455b4d1a Revert "s3: Do not reference the ndr_tables in the server calls directly"
This reverts commit 98fb71782e.
2009-11-08 19:43:46 +01:00
Volker Lendecke
82c35e460e Revert "s3: Do not reference ndr_table when calling rpc_srv_register"
This reverts commit 494b2aff88.
2009-11-08 19:43:46 +01:00
Volker Lendecke
494b2aff88 s3: Do not reference ndr_table when calling rpc_srv_register 2009-11-08 13:12:15 +01:00
Volker Lendecke
98fb71782e s3: Do not reference the ndr_tables in the server calls directly
This involves storing the interface table in the pipes_struct
2009-11-08 13:12:14 +01:00
Volker Lendecke
daa964013b s3: Do not reference ndr_table_<pipe> in the cli_ routines directly 2009-11-08 13:12:13 +01:00
Volker Lendecke
5cdee7ae05 s3: Do the printing for DEBUGLEVEL>=10 centrally
12 insertions(+), 10651 deletions(-)

I think that says it all :-)
2009-11-07 11:07:37 +01:00
Andrew Tridgell
dfbaf79a1b pidl: don't warn for compatible scalar types in unions
When we have an enum that is used as a union discriminator, what
matters is that the scalar mappings are the same, not if the types are
the same (otherwise we get warnings about uint1632).

Thanks to gd for noticing this.
2009-10-13 10:03:27 +11:00
Andrew Tridgell
1d0fb1e0fb tdr: teach TDR about uint1632 enums
TDB doesn't have NDR64, but it needs to know how to map the new types
from pidl
2009-10-07 09:56:23 +11:00
Andrew Tridgell
2bf8a7485c pidl: get the alignment right for uint1632 enums (NDR64)
The default enum in NDR63 is 32 bits, not 16 bits. We need a uint1632
type to get the alignment right.
2009-10-07 09:56:22 +11:00
Ronnie Sahlberg
e9f126421d add trailer alignment to structures 2009-10-06 19:14:11 +11:00
ronnie sahlberg
d26016c198 PIDL fix for using external types with wireshark backend
List,

Please review this patch to pidl.

Basically,  we need to process the wireshark conformance file BEFORE
we process the idl file since this file may define external types
and set the alignment for them (using the TYPE directive).
Otherwise pidl will default all external types to use 4byte alignment
which breaks (much more often) on NDR64

regards
ronnie sahlberg

From 8f86903fc353d0906bd82e72ce19c5af09beb001 Mon Sep 17 00:00:00 2001
From: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Date: Mon, 5 Oct 2009 15:22:43 +1100
Subject: [PATCH] In the PIDL wireshark backend, we define external types in the conformance
 file using the TYPE directive.
 If we declare external types here, we must parse this file before we process
 the IDL file, or else these external types will all default to 4byte padding
 (pidl assumes all unknown types are 4byte aligned).

Make sure we read the conformance file and create these new types before
we parse the idl file.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2009-10-06 19:11:51 +11:00
Andrew Tridgell
f21fb4b395 pidl: added int3264 as a base type
This is the type used for a variable that is 32 bits for NDR32 and 64
bits for NDR64
2009-10-03 18:17:23 +10:00
Andrew Tridgell
9eb78be4a6 ndr64: added support for trailing gap alignment
NDR64 has a 'trailing gap' alignment, which aligns the end of a
structure on the overall structure alignment.

This explains the discrepancy we had with the RPC-SAMR test and NDR64
2009-10-02 12:05:59 +10:00
Andrew Tridgell
64e08fef16 pidl: added union padding for NDR64
This fixes the problem with samr UserInfo16 when NDR64 is enabled
2009-09-29 18:08:22 +10:00
Jelmer Vernooij
830adcd58d pidl: Avoid using talloc_free as function pointer, since it may be a
macro.
2009-09-28 15:03:17 +02:00
Jelmer Vernooij
390cd90c8f pidl(s4.python): Fix arguments to PyCObject_FromVoidPtr for string_array's.
Caught by Guenther.
2009-09-26 01:34:22 +02:00
Andrew Tridgell
1a1cb92583 ndr: split out ndr enum functions
This allows for easier implementation of the NDR32/NDR64 split
2009-09-17 15:19:30 -07:00
Andrew Tridgell
db5e7f3d05 s4-pidl: add support for NDR64
Added support for NDR64 to the samba4 pidl generator
2009-09-17 15:19:28 -07:00
Jeremy Allison
02dc4a1e4e Ensure we enclose the enum values in brackets to make the cast work.
Jeremy.
2009-09-17 11:27:51 -07:00
Jeremy Allison
95311a220e Fix the problem with pidl generating invalid C for enums. According
to the C standard an enum is guarenteed to be an (int), which means
for 4 byte ints specifying a type of 0x80000000 is an invalid value.
The Solaris compiler complains about this. Fix by adding an (int)
cast in front of the value generation.
Jeremy.
2009-09-17 11:11:06 -07:00
Andrew Tridgell
011f103501 when we get an NDR error in the logs, it is useful to know where it happened 2009-08-12 15:33:37 +10:00
Stefan Metzmacher
558ff911df pidl: parse idl 'pipe' typedefs, but print out a not supported message for now
metze
2009-08-07 11:50:24 +02:00
Stefan Metzmacher
20a6fb5cdb pidl: fix formatting in expr.yp
metze
2009-08-07 11:50:24 +02:00
Stefan Metzmacher
bfa9624946 pidl: fix formatting in idl.yp
metze
2009-08-07 11:50:24 +02:00
Stefan Metzmacher
2ed71264e1 pidl:Samba3/ClientNDR: add support tevent_req based _send/recv() client functions
metze
2009-07-31 14:10:14 +02:00
Stefan Metzmacher
28a4656738 pidl:Samba3/ClientNDR: rename ParseFunction => ParseFunctionSync and add ParseFunction as glue
This prepares the following ParseFunctionAsync* commits.

metze
2009-07-31 12:49:47 +02:00
Stefan Metzmacher
6a1ff90708 pidl:Samba3/ClientNDR: allow passing optional variable prefixes to ParseOutputArgument()
metze
2009-07-31 12:49:46 +02:00
Stefan Metzmacher
9e4cf82b74 pidl/Samba4.pm: allow an optional prefix passed to DeclLong()
metze
2009-07-31 12:49:46 +02:00
Stefan Metzmacher
41b95da435 pidl:Samba4/Python: fix mapType() => mapTypeName()
This tries to fix commit 8eff9f9a31.

The problem was:

Undefined subroutine &Parse::Pidl::Samba4::Python::mapType called at /home/metze/master4/pidl/lib/Parse/Pidl/Samba4/Python.pm line 848.

Jelmer: please check this.

metze
2009-07-31 10:16:40 +02:00
Jelmer Vernooij
8eff9f9a31 python: Cope with the dom_sid2 alias in pidl's python generating code.
This fixes some problems in the samr Python bindings that pidl was
(correctly) warning about.
2009-07-30 20:28:29 +02:00
Jelmer Vernooij
6768cfe624 DCE/RPC(Python): Rename py_talloc_import to py_talloc_steal.
Use py_talloc_reference in DCE/RPC code, fixes
					access to SAMR pipe.
2009-07-30 20:04:42 +02:00
Ronnie Sahlberg
c6d7f3bdb5 pidl: import a patch to pidl made in the wireshark reporitory.
Original commit message in wireshark SVN (rev 28961):
====
From Kovarththanan Rajaratnam:
More "Cleanup header_field_info definitions"
====

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-07-28 12:30:16 +02:00
Stefan Metzmacher
92791ce9a8 pidl: allow foo being on the wire after [length_is(foo)] uint8 *buffer
metze
2009-07-27 17:51:32 +02:00
Stefan Metzmacher
7ccc9a6ef5 pidl: add support for [string] on fixed size arrays.
midl also supports this:

struct {
	long l1;
	[string] wchar_t str[16];
	long l2;
};

Where the wire size of str is encoded like a length_is() header:
4-byte offset == 0;
4-byte array length;

The strings are zero terminated.

metze
2009-07-27 17:51:32 +02:00
Jelmer Vernooij
7889823783 pidl: Print actual type names in errors about unknown origins rather than 'HASH(0x....)'. 2009-07-19 21:12:56 +02:00
Jelmer Vernooij
54a2f51d57 pidl: Print proper errors when arrays don't have a specified size rather than spewing pages of perl warnings. 2009-07-19 20:42:52 +02:00
Brad Hards
00bfe9c286 Add support for double type in pidl.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-06-02 18:05:42 +02:00
Andrew Bartlett
8ab74e948a Revert "pidl/python: Add explicit casts, fixing implicit cast warnings."
It was creating new objects with bogus data.

This reverts commit 2108303929.
2009-04-21 15:07:10 +02:00
Stefan Metzmacher
9930e5b3db pidl:Samba4/client: fix dcerpc_ndr_request_send() callers
For samba4 you need one of this:
samba/source4# make full_idl
samba/source4# make clean
samba# git clean -x -f

metze
2009-04-20 18:17:09 +02:00
Stefan Metzmacher
ed98cba5ab pidl:Samba4/client: use dcerpc_ndr_request() for sync requests
metze
2009-04-20 18:15:01 +02:00
Jelmer Vernooij
4638633308 Move tdr to top-level. 2009-03-14 21:57:44 +01:00
Tim Prouty
cfb4757386 pidl: Don't generate variables declarations for pointless array counters.
Code isn't generated to iterate over arrays of length 0, but the
variable declarations still are.  The result is 'unused variable'
warnings. This only seems to be happening in one place right now, so I
targeted the fix to this case, but refactoring could be done to make
all variable declarations do this zero length check.  Making it the
default would be a much more invasive fix.

Jelmer, please check!
2009-03-04 18:32:13 -08:00
Jelmer Vernooij
e2469e3748 Don't generate array iterators when the length of the array is always 0.
(bug #6140)
2009-03-01 17:09:07 +01:00
Jelmer Vernooij
d7c7b31bba Only define _GNU_SOURCE if it's not defined yet. 2009-02-25 16:54:35 +01:00
Jelmer Vernooij
f71db89256 Include header with NTSTATUS, as some IDL files use it. 2009-02-25 15:21:36 +01:00
Jelmer Vernooij
fc3ffedcfe Don't define _GNU_SOURCE if it's already defined on the command-line. 2009-02-25 15:05:43 +01:00
Andrew Bartlett
c2cdb4ad5c Work around ndr_unpack failing on structures with relative pointers.
This disgusting hack works around the fact that
ndr_pull_struct_blob_all will always fail on structures with relative
pointers.  So, map ndr_unpack to ndr_pull_struct_blob_all only if we
don't have any relative pointers in this structure.

Andrew Bartlett
2009-02-25 17:43:07 +11:00
Stefan Metzmacher
6563c2b7e4 pidl:NDR/Parser: don't call [noopnum] function when creating the ndr_interface_table
metze
2009-02-19 11:13:33 +01:00
Jelmer Vernooij
69fff2d750 Revert "Fix errornos assumption that all compilers are gcc"
This breaks (some?) files with gcc.

This reverts commit 98a4327b19.
2009-02-09 23:29:41 +01:00
Torgeir Lerkerod
98a4327b19 Fix errornos assumption that all compilers are gcc
When compiling Samba 4's IDL files buildsystem assumes that compiler
knows about -xc, which is a gcc spesefic switch as this switch isn't
needed on gcc either the flag was uneeded and can be removed. Thus no
warnings on non gcc systems.

Signed-off-by: Torgeir Lerkerod <Torgeir.Lerkerod@gmail.com>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2009-02-09 22:12:45 +01:00
Jelmer Vernooij
39172b5ce9 Remove an invalid discard_const_p() - it masks an actual
bug in pidl where pidl uses "const" in a struct where there should not be
const.

There is only a single place in the Samba codebase where this triggers a
warning.
2009-02-09 18:39:27 +01:00
Jelmer Vernooij
fa1ead3aa0 Use discard_const_p rather than CONST_DISCARD. 2009-02-09 17:50:35 +01:00
Tim Prouty
7168cf440e pidl: Fix a const build warning in the samba3 merged build
../librpc/gen_ndr/cli_spoolss.c: In function `rpccli_spoolss_EnumPrinterData':
../librpc/gen_ndr/cli_spoolss.c:3400: warning: passing arg 1 of `memcpy' discards qualifiers from pointer target type

This is a very similar fix to:
2337f402f0
2009-02-07 00:47:32 -08:00
Günther Deschner
2bbe0c2859 pidl: return early when AllocOutVar() in s3 server generator has nothing to do.
Jelmer, Metze, please check.

Guenther
2009-02-06 18:53:40 +01:00
Michael Adam
2108303929 pidl/python: Add explicit casts, fixing implicit cast warnings.
Michael
2009-01-22 08:16:55 +01:00
Michael Adam
842d24f23d pidl: reduce implicit cast warnings in gen_ndr server code
Michael
2009-01-22 08:16:54 +01:00
Jelmer Vernooij
293acaf92e pidl/python: Add explicit casts, fixes warnings about casts when enabled. 2009-01-21 18:38:40 +01:00
Jelmer Vernooij
11a25f9050 Allow calling DCE/RPC server implementations directly using
rpc_pipe_client.
2009-01-21 14:05:51 +01:00
Tim Prouty
142b2a61f8 pidl: Remove "max" and make "range" smarter about unsigned types
This eliminates a warning in pidl generated code, while preserving
cross-platform idl compatibility.
2009-01-17 19:37:52 -08:00
Tim Prouty
7c861cac53 pidl: Add max property to be used instead of range for unsigned types.
Compilers complain about ranges starting at 0 for unsigned types,
since an unsigned type is never less than 0.  The max property
implicitly makes 0 the lower bound when used with unsigned types.
2009-01-15 14:52:35 -08:00
Volker Lendecke
125696b73d Pass the full ndr_interface_table into the s3 rpcserver when registering 2009-01-09 23:17:57 +01:00
Jelmer Vernooij
ba5d6e6d70 Avoid using a utility header for Python replacements included in Samba,
since this will not be shipped with talloc/tdb/tevent/etc.
2009-01-08 12:20:20 +01:00
Tim Prouty
61a23c5eea s3/s4 build: Fix Py_RETURN_NONE to work with python versions < 2.4 2009-01-07 15:03:16 -08:00
Jelmer Vernooij
d2c70d24e1 py: Properly increase the reference counter of Py_None. 2009-01-06 04:13:57 +01:00
Jelmer Vernooij
af744e0954 Merge branch 'master' of ssh://git.samba.org/data/git/samba 2009-01-04 22:48:23 +01:00
Stefan Metzmacher
96266d2f50 pidl: add dummy element for empty unions
This hopefully fixes the build on Solaris and IRIX.

metze
2009-01-02 16:32:55 +01:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Tim Prouty
2337f402f0 pidl: Fix a const build warning in the samba3 merged build
The warning:
../librpc/gen_ndr/ndr_spoolss.c: In function ‘ndr_pull_spoolss_EnumPrinterData’:
../librpc/gen_ndr/ndr_spoolss.c:14792: warning: passing argument 1 of ‘memset’ discards qualifiers from pointer target type

In some case the pidl generated code needs to memset a const struct
field.  This causes the above warning.  This patch discardeds the const
in this case.  I'm open to a more elegant fix, but this eliminates the
warning and should be relatively safe.
2008-12-30 16:19:43 -08:00
Stefan Metzmacher
791459f61b pidl: don't generate invalid C code
When we don't know how to handle a type for the python bindings,
we should not generate invalid C code.

Jelmer: please fix do the full fix for this.

metze
2008-12-29 23:23:27 +01:00
Jelmer Vernooij
1807b0870b pidl/python: Factor out connect code rather than duplicating it in each
Python module.
2008-12-22 04:56:41 +01:00
Jelmer Vernooij
a6bd295229 pidl/python: Skip unknown types, rather than dieing. 2008-12-22 03:22:28 +01:00
Jelmer Vernooij
7ebc7e677d pidl: Allow location argument to warning() and error() to be undef, in case it is
not known.
2008-12-22 03:21:10 +01:00
Jelmer Vernooij
2c58c9497c Import types from other Python mechanisms using the Python import mechanism, to ensure they are initialized. 2008-12-22 01:51:38 +01:00
Jelmer Vernooij
7e651c7ef3 Simplify customization of pidl-generated Python modules. 2008-12-21 21:10:40 +01:00
Jelmer Vernooij
38a4749d2c Allow providing extra module-level Python functions. 2008-12-21 18:46:59 +01:00
Jelmer Vernooij
c1a9b68623 Create and use convenience function for creating new talloc-wrapping Python Objects, support subtypes of DCE/RPC interfaces properly 2008-12-21 00:37:31 +01:00
Jelmer Vernooij
42b7762f9b Support custom constructors for pidl-created types and support types based on pidl-created types. 2008-12-21 00:09:30 +01:00
Jelmer Vernooij
97f3720038 Don't write out forward declarations for enums, as some compilers don't
seem to like it.
2008-12-16 22:58:10 +01:00
Jelmer Vernooij
9692c71aa1 Make some fatal errors non-fatal. This means we generate invalid code in
some cases, but we do print errors. We don't use all generated code yet at the
moment, so this isn't much of a problem.
2008-12-16 18:02:14 +01:00
Jelmer Vernooij
5bf0c0bf9c Remove pidl SWIG backend; the native Python one works much better, and
that's also the best way to go for any other languages.
2008-12-16 16:48:48 +01:00
Jelmer Vernooij
121970d224 Only create (D)COM output files if there were COM objects in the IDL files. 2008-12-16 16:37:54 +01:00
Jelmer Vernooij
0727fbe87d Don't allow specifying arguments to pidl object constructors, as they'll
be ignored anyway atm.
2008-12-12 19:01:40 +01:00
Jelmer Vernooij
3e2c070395 Allow overriding repr function for pidl-defined types. 2008-12-12 13:31:42 +01:00
Jelmer Vernooij
850abaffbe Support pyhelper property to allow additional methods to be tucked onto a
pidl-generated type.
2008-12-12 12:40:11 +01:00
Jelmer Vernooij
d1101dba79 Remove noejs property, which is no longer used. 2008-12-12 11:48:42 +01:00
Jelmer Vernooij
0f8d749144 Add convenience function for determining if an array should be allocated with talloc. 2008-12-12 11:16:36 +01:00
Jelmer Vernooij
076479aac3 Remove EJS backend for PIDL, as we don't have EJS anymore. 2008-12-12 10:30:13 +01:00
Günther Deschner
2865be8a1c pidl: fix generated s3-server in,out,ref qualifiers that are used for buffer allocation.
Guenther
2008-11-19 21:50:02 +01:00
Günther Deschner
216c788b0c pidl: skip generation of noopnum functions in generated s3 server.
Guenther
2008-11-15 00:32:55 +01:00
Günther Deschner
cf06b75f0a pidl: do not generate cli_ functions for noopnum flaged functions.
Guenther
2008-11-15 00:32:55 +01:00
Jelmer Vernooij
2f438b4cde Remove unused variable, fix return. 2008-11-11 17:10:24 +01:00
Jelmer Vernooij
a1cc278142 Remove use of global_loadparm during initialization of gensec. 2008-11-02 17:04:22 +01:00
Jelmer Vernooij
c537f7a914 Fix the build. 2008-11-02 05:49:36 +01:00
Jelmer Vernooij
dccf1b2c9f Remove another use of global_loadparm. 2008-11-02 00:26:04 +01:00
Jelmer Vernooij
23b04a31f1 Fix include path to pytalloc. 2008-10-24 02:58:12 +02:00
Jelmer Vernooij
358e9931bc Also check include dirs for IDL files. 2008-10-15 02:06:41 +02:00
Jelmer Vernooij
9f2ed1e00f Share RPC binding string utility functions. 2008-10-12 19:05:46 +02:00
Jelmer Vernooij
20b73b1309 Print proper error if include file can't be found. 2008-10-08 02:18:59 +02:00
Jelmer Vernooij
454122ab09 make sure dcerpc is always initialized. 2008-09-30 06:05:05 +02:00
Günther Deschner
44f7c1c216 pidl: fix samba3 server wrt to samba4 ndr_pull_init_blob protype.
this is in preparation for the final nbt merge.

Guenther
2008-09-23 23:34:27 +02:00
Jelmer Vernooij
79190992b3 Move pidl to top-level directory. 2008-09-17 17:12:27 +02:00