summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r8518: ensure all constructed NDR packets are null terminated. This is neededAndrew Tridgell1-8/+9
by the new ldb code dealing with binary records, but is also a good defensive strategy in general (This used to be commit 17decd129928290a6916a1d1cec73dad924d64f8)
2007-10-10r8210: - make the ndr_token_* function publicStefan Metzmacher1-18/+29
- allow comparison function to be passed for ndr_token_retrive_cmp_fn(), this is for matching the keys, if NULL is passed, the old behavior tok->key == key is used metze (This used to be commit 019f3dc767ef703768df3acdbbd80808c122855c)
2007-10-10r8108: Fix indentation, and remove a discard_const_p() that we don't need ↵Andrew Bartlett1-4/+4
any more. Perhaps like minimal_includes.pl, we should have a way to find these automaticly. Hmm... Andrew Bartlett (This used to be commit d13b9f548e9d3696505178476d2615835cae8fe2)
2007-10-10r7865: changed pidl to take a "const void *" instead of a "void *" for theAndrew Tridgell1-1/+1
structure in ndr_push_*() and ndr_print_*(). The push and print functions really should not modify the structure. metze, to make this work I had to change your spoolss hand marshaller. Can you please check it is OK? I think that the IN and OUT sides of that function are not ever called on the same structure, so I think that attempt at remembering the value by assigning to r->in._offered was not doing anything anyway, but please correct me if I have misunderstood it. If you really do need to remember something on those structures I'd suggest the ndr_token_store() and ndr_token_retrieve() functions, which are used by pidl for just this sort of thing. (This used to be commit eee528be97fa43ca53bdc5652b4d29a0a2caf563)
2007-10-10r7193: add some bail out checks and fix pushing of relative pointersStefan Metzmacher1-2/+19
metze (This used to be commit 58a214d98fc7a2b46a0876e57e05dec82438bc53)
2007-10-10r7186: add [relative_base] property, which is allowed on typedef'sStefan Metzmacher1-53/+123
(maybe we could add them to elements latter...) with this property all relative pointers from inside the struct or union are relative to the struct/union start metze (This used to be commit c0dd18326c058e3e218d43f48ecff418f4b0b51e)
2007-10-10r7184: remove unused ndr_pull/push_struct_start/end() functionsStefan Metzmacher1-30/+0
metze (This used to be commit 95d3286a327467c32ee25fcac913fc5f3113a74b)
2007-10-10r7182: remove current support for RELATIVE_CURRENT, this will be replaced ↵Stefan Metzmacher1-11/+2
with a better aproach later metze (This used to be commit 9a4e9f68fbddaae3fc86e30d39b69fc76261c0ea)
2007-10-10r6973: Merge new version of pidl into the main SAMBA_4_0 branch.Jelmer Vernooij1-117/+3
The main difference in this new version is the extra data structure generated between the IDL data structure and the NDR parser: IDL -> NDR -> { ndr_parser, ndr_header, eparser, etc } This makes the ndr_parser.pm internals much more sane. Other changes include: - Remove unnecessary calls with NDR_BUFFERS (for example, GUID doesn't have any buffers, just scalars) as well as some (unnecessary) nested setting of flags. - Parse array loops in the C code rather then calling ndr_pull_array(). This allows us to have, for example, arrays of pointers or arrays of pointers to arrays, etc.. - Use if() {} rather then if () goto foo; everywhere - NDR_IN no longer implies LIBNDR_FLAG_REF_ALLOC - By default, top level pointers are now "ref" (as is the default in most other IDL compilers). This can be overridden using the default_pointer_top() property. - initial work on new ethereal parser generators by Alan DeKok and me - pidl now writes errors in the standard format used by compilers, which is parsable by most editors - ability to warn about the fact that pidl extension(s) have been used, useful for making sure IDL files work with other IDL compilers. oh, and there's probably some other things I can't think of right now.. (This used to be commit 13cf227615f6b9e0e5fa62e59197024410254f01)
2007-10-10r6932: Comment out static function - not used anywhere?Tim Potter1-0/+6
(This used to be commit 742989c952421ebdf2d21c98e1de1b2b74b9f435)
2007-10-10r6795: Make some functions static and remove some unused ones.Jelmer Vernooij1-2/+2
(This used to be commit 46509eb89980bfe6dabd71264d570ea356ee5a22)
2007-10-10r6746: added ndr_push_union_blob() for pushing IDL unions into a DATA_BLOBAndrew Tridgell1-0/+23
(This used to be commit dc25be9d69a65680f7942ed29c2d791d6ce7248a)
2007-10-10r6720: added support for the remaining 2 types of CLDAP netlogonAndrew Tridgell1-0/+39
response. To work around the fact that the type of the returned data is not encoded in the packet, this required adding ndr_pull_union_blob() which allows us to pull a blob into a union with a specified switch value, in this case the switch value comes from the calling NtVer field. (This used to be commit bd27e626c27be72913d1a1569ee6e2e2711df84e)
2007-10-10r6690: added ndr_pull_struct_blob_all(), which is like ↵Andrew Tridgell1-0/+21
ndr_pull_struct_blob() but checks that all bytes are consumed (This used to be commit 7951e9bd647b35d2f92d7ba4dbbc2ac05f31491a)
2007-10-10r6189: move function to the right placeStefan Metzmacher1-8/+5
metze (This used to be commit 08d22a07cfa84fe959320058e8574c8983e1d71f)
2007-10-10r6188: correct fix for rev 6182Stefan Metzmacher1-6/+2
we should start with an empty switch_list in ndr_print as we do for ndr_pull/ndr_push metze (This used to be commit 848f553117b369fc6697086b3f7d36dd17b60f5b)
2007-10-10r6182: Jelmer, I think we need to initialize the switch_list, else we areRichard Sharpe1-0/+4
crash city. (This used to be commit 6526f21fb72094e8ff62bfc2693a49a3b1679a95)
2007-10-10r6180: Use token_lists for storing switch valuesJelmer Vernooij1-17/+13
(This used to be commit f66e11137eed69b44f0739f1064625cbd96243bd)
2007-10-10r5797: - add idl property [subcontext_size()]Stefan Metzmacher1-16/+39
this can be used like this [subcontext_size(28),subcontext(0)] dom_sid sid; this descripes a fixed 28 byte buffer which contains a dom_sid, and the rest of the buffer is padded with zero bytes if the dom_sid doesn't need all 28 byte in it's ndr encoding. - only push and pull the subcontext when we are in the NDR_SCALARS section (tridge, jelmer: I hope this is correct for all cases...!?:-) metze (This used to be commit 483bb1418fd5c70c418142ade80c1e286adfa05a)
2007-10-10r5775: Remove some unused functions (unions are no longer as special as they ↵Jelmer Vernooij1-21/+7
used to be) Add oxid mapping table support in DCOM (This used to be commit e193555f0eec2dda8c8760e9668181200fef0a1e)
2007-10-10r5736: fix to avoid endless recursion in ndr_size_*() calculationStefan Metzmacher1-2/+8
metze (This used to be commit eaac0f214703f91f186eb54f97e15e56461762bd)
2007-10-10r5672: Use switch_type() and the token storage mechanism for unions:Jelmer Vernooij1-0/+26
- Makes union handling less special - Allows unions in arrays, etc - Compatible with midl - Pidl will warn about switch_type() and the type of the switch_is() variable being different (This used to be commit dc6b4ffc82a191631bc16a4b93a4916a39183ec6)
2007-10-10r5663: Revert some changes I didn't mean to commit...Jelmer Vernooij1-26/+0
(This used to be commit 54e0be6f1eccbd870eb0e60ae8cdb90d2dc7f657)
2007-10-10r5661: Be a little stricter on syntax regarding arrays. A pointer to anJelmer Vernooij1-0/+26
array can now only be : type *name[]; rather then : type *name; which was supported in the past. Warnings will be given when the first syntax is used. Reasons for this change in behaviour include improved readability and the fact that the second format makes dealing with multiple levels of pointers harder. (This used to be commit a416de5825c540fd3741731c4be05e9a659a6fdb)
2007-10-10r5506: Simplify the use of subcontexts and make them a bit less a special case.Jelmer Vernooij1-76/+2
(This used to be commit 48d54a9b57c0b233c7c60392b23876b426bbdec1)
2007-10-10r5363: - ndr_%_ptr -> ndr_%_unique_ptrJelmer Vernooij1-4/+4
- ndr_%_relative% -> ndr_%_relative_ptr% - Change pointer_default() default to "unique" (DCE uses "ptr" as default, MIDL doesn't follow the standard and uses "unique") (This used to be commit 53b4ecbcc7a8da67cde1377de6f24a3de6d229e3)
2007-10-10r5360: Remove a couple of unused functions.Jelmer Vernooij1-34/+0
(This used to be commit d8a0a6972156c3211001b7f98e990c167be2468c)
2007-10-10r5286: Some first steps in making the pidl code somewhat more generic for theJelmer Vernooij1-11/+11
various data types: Add ndr_flags argument to all ndr push/pull scalar functions (This used to be commit ab490c0c882bb13de190546c50a0631ecb8255ad)
2007-10-10r5109: - fixed handling of zero-length subcontexts in the ndr libraryAndrew Tridgell1-3/+0
- added error checking on socket startup in nbtd (This used to be commit 5707ebc9ecdce5c195a2788ab1e4214788a086ea)
2007-10-10r5084: - handle arbitrary data in the NULL record reply type for nbt name ↵Andrew Tridgell1-0/+2
queries - fixed unaligned pulls at the end of the packet in the ndr lib (This used to be commit 61c43509f7a538541d87bd505ca241e08a50f605)
2007-10-10r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for theAndrew Tridgell1-7/+7
large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10r4885: added a new NBT client library. Features include:Andrew Tridgell1-0/+21
- structures defined using IDL in nbt.idl - build around our events structure, and talloc - fully async - supports all NBT packet fields as per rfc1002 - easy interfaces for name query and status For the moment there are just a couple of test functions in namequery.c, test_name_query() and test_name_status(). These will be removed when we hook the new library into libcli/ fully The new library will also be a fairly good basis for a nbt server. Although it can't be a server as-is, I wrote it with the needs of a server in mind (for example, extremely scalable idtree based packet handling) (This used to be commit ae7e625bfa4b4a3ee32c64566064b6a4c84ee4b9)
2007-10-10r4591: - converted the other _p talloc functions to not need _pAndrew Tridgell1-1/+1
- added #if TALLOC_DEPRECATED around the _p functions - fixes the code that broke from the above while doing this I fixed quite a number of places that were incorrectly using the non type-safe talloc functions to use the type safe ones. Some were even doing multiplies for array allocation, which is potentially unsafe. (This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
2007-10-10r4549: got rid of a lot more uses of plain talloc(), instead usingAndrew Tridgell1-1/+1
talloc_size() or talloc_array_p() where appropriate. also fixed a memory leak in pvfs_copy_file() (failed to free a memory context) (This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
2007-10-10r4526: - much simpler (and more accurate!) ndr_size_*() code generation. ItAndrew Tridgell1-0/+21
is less efficient, but I really doubt that matters. - use enum in epmapper.idl for protocol type - added support for "enum8bit" flag, used in epmapper.idl (This used to be commit 1a24a50384b7f588844cd012f1218ca242ca4507)
2007-10-10r4139: 2nd attempt at fixing the null ptr in size_is() problem.Andrew Tridgell1-8/+2
(This used to be commit 3040cd65151dbcc54404f9be9d1fbcf539c7b635)
2007-10-10r4110: fixed pidl to allow arrays to have size_is() and length_is() elementsAndrew Tridgell1-18/+100
that depend on variables that come after the array in the structure or function. This has been something that has been problematic for a while, but the winreg QueryValue problem finally prompted me to fix it properly. We should now go back and fix up all the ugly workarounds we have used to avoid this problem in other calls. Unfortunately the solution is fairly complex, and involves the use of the internal ndr token lists (similar to the solution for relative pointers). I wonder if anyone else will be able to follow the logic if I get run over by a bus :-) (This used to be commit e839b19ec5581f669f2a7705b1fb80845313251c)
2007-10-10r4052: fixed a bunch of code to use the type safe _p allocation macrosAndrew Tridgell1-1/+1
(This used to be commit 80d15fa3402a9d1183467463f6b21c0b674bc442)
2007-10-10r3545: initial support for using extended attributes to hold extended dos ↵Andrew Tridgell1-40/+18
attributes of files. I decided to use IDL/NDR to encode the attribute, as it gives us a simple way to describe and extend the saved attributes. The xattr code needs to hook into quite a few more places in the pvfs code, but this at least gets the basics done. I will start encoding alternate data streams streams, DOS EAs etc soon using the same basic mechanism. I'll probably stick to "version 1" for the xattr.idl for quite a while even though it will be changing, as I don't expect anyone to be deploying this in production just yet. Once we have production users we will need to keep compatibility by supporting all the old version numbers in xattr.idl. (This used to be commit c54253ed1b7dce1d14f43e747da61089aea87094)
2007-10-10r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ↵Andrew Tridgell1-0/+1
ioctl.h) (This used to be commit b97e395c814762024336c1cf4d7c25be8da5813a)
2007-10-10r3322: fixed a bunch of warnings in the build, including one case where it ↵Andrew Tridgell1-0/+2
was a real bug (This used to be commit 02d5d0f685e44bd66aff4a007f0bf34c8f915574)
2007-10-10r3036: Add function to pull an array of structures. Abstracts away theTim Potter1-0/+21
individual routines in ndr_spoolss_buf.c. (This used to be commit e080a2483da61ee95d21b0355471a4af13c20a81)
2007-10-10r2968: fixed the byte order problem with the new RHS parsing on ncacn_ip_tcpAndrew Tridgell1-0/+11
(This used to be commit cc00f9b6b87783d189df00de0ce9ae92b907e21a)
2007-10-10r2671: we're getting too many errors caused by the talloc_realloc() API notAndrew Tridgell1-1/+1
taking a context (so when you pass a NULL pointer you end up with memory in a top level context). Fixed it by changing the API to take a context. The context is only used if the pointer you are reallocing is NULL. (This used to be commit 8dc23821c9f54b2f13049b5e608a0cafb81aa540)
2007-10-10r2625: use talloc_p, not talloc when possible (when allocating a structure ↵Andrew Tridgell1-1/+1
in particular), as it gives us type checking. (This used to be commit dabc7ddd9f940db414d1c3c7bf3cebcd108fbf6f)
2007-10-10r2247: talloc_destroy -> talloc_freeTim Potter1-1/+1
(This used to be commit 6c1a72c5d667245b1eec94f58e68acd22dd720ce)
2007-10-10r2208: little attempt to (almost) fix spoolss relativeVolker Lendecke1-1/+1
(This used to be commit ef5414676ea07004aaa78d5f4c1746b3c8669d16)
2007-10-10r2206: another (untested) attempt to make RELATIVE_CURRENT work for volker,Andrew Tridgell1-40/+6
plus removed unused ndr_pull_relative() function once volker commits a test for this I'll be able to ensure it really works as expected (This used to be commit 8ffe136ad2be52f3504d73ead0785c9c5f5d8770)
2007-10-10r2204: added [flag(RELATIVE_CURRENT)] to change [relative] pointer behaviourAndrew Tridgell1-6/+10
for this struct and all sub-structures to be like spoolss relative pointers (where offset is relative to current position). volker will test this for me :) (This used to be commit bd45329a3fb55a5d9f006ad601ae26a80b9a563f)
2007-10-10r2121: fix compiler warningStefan Metzmacher1-1/+0
metze (This used to be commit 2de544181ec75da63fdcd5ecdde9e6a533603a38)