dce/rpc "client" api

Elrond elrond at samba.org
Wed Aug 23 14:36:37 GMT 2000


On Wed, Aug 23, 2000 at 10:35:39PM +1000, Andrew Tridgell wrote:
> > believe me when i say that having an IDL compiler would have made the task
> > only marginally easier.
> 
> no, I'm afraid I don't believe that. A very large part of our problems
> was cause directly by the hand generated nature of that code. The code
> was extremely fragile with subtle dependencies on alignments, sizes of
> structures etc. An IDL compiler would have allowed us to concentrate
> on the high level description of the structures rather than having to
> mentallly assemble the ndr wire format for each function.
> 
> That only leaves the semantic meaning of the fields in those
> structures and implementing functions that produce that
> semantics. That is a much easier problem to solve and debug once you
> know that you have the right bytes in the right fields.

I have to agree with Luke.
I will just show a normal usage study (from this Sunday)
and something general about alignment.

Well, I haven't been round long enough to know, what
happened before, but:

Just this Sunday I implemented marshalling and the
server-side for lsa_query_info_policy at level 6. (This
_is_ needed for samba-as-pdc). It took me about
15-30mins... including the time to a) look at ntsecapi.h,
b) create a request to an nt-box to get the correct
alignment c) write the marshaller d) write the actual
implementation.

I wouldn't have been faster with an IDL-compiler. (okay,
info level 6 is _raaly_ simple). I would have only gotten a
client-side implementation, and if the client-side of lsaq
would be the right way, I would have gotten that also with
my hand coding.


About alignment:

Luke and me have understood alignment just about one or two
month ago, when I played a little with midl.exe. (Okay, I
can't be sure for Luke, but I had the impression, that we
fully understood it at that time).

So from that: An idl-compiler would have generated wrong
alignment for a long time. We would have added a whole
bunch of aligning-hacks to the idl-language, because we
would have noticed alignments on the wire, where non were
expected and wise versa.

And from what I see it currently, an idl-compiler will
simply save us a lot of stupid cut&waste-work to write the
marshallers, the structs, and so on. But the debugging will
be exactly the same. Because we don't have the APIs, we
only have on-the-wire-stuff.

And analysing on-the-wire-stuff is still a tricky job. We
still don't know some sizes for some elements in some
structs, because we can't find out them.


    Elrond

... I start to understand, why look unsubscribed... I don't
get to code anything... I don't even get to apply the patch
from Sunday...




More information about the samba-technical mailing list