CVS update: tng/source/passdb
tridge at samba.org
Wed Jan 9 13:46:08 GMT 2002
> If *anyone* is considering work on IDL or NDR DCE/RPC code generation,
> it *really* *only* makes sense to contribute that effort into the freedce
> IDL compiler; as Luke says it is a *huge* project to build from scratch.
While I think that freedce is a very worthy effort, and I admire the
work that has gone into it, I'm not completely sure it's the only or
even the best way to do MSRPC on unix.
The problem with the freedce code is that it's based on an extremely
large implementation. There are much smaller IDL compilers out there
and there are IDL compilers that generate tighter code. The H/Direct
compiler (written in Haskell) is quite interesting and Flick shows how
highly optimized code might be produced.
Last time I looked at the dcerpc code the main problem I had with it
apart from its size was the tight linkage to a threads package. Maybe
if I had put more time in I could have seen how to avoid the threads
system, but at the time it certainly seemed to be pretty deeply
embedded in the runtime system and the generated code seemed to be
pretty closely tied to the runtime (due to the interpreted table
approach to IDL compilation).
Having to use a particular threads package (or any threads package at
all) makes freedce a portability nightmare, and also raises really
nasty problems with security contexts (in general OSes don't offer
per-thread security contexts).
For a while now I've been aiming to produce a small IDL compiler that
is appropriate for code generation for Samba while being complete
enough for all of the IDL code that NT uses. As Luke mentioned my
first attempt was 'aparser' which is in the Samba source tree. It was
written in awk, and while it was fun to do the structure means that
it really doesn't have a chance of being a serious compiler.
My 2nd attempt is called pidl (see the cvs module by that name on
samba.org) and I am much more hopeful about this one. I hope that this
year we will see large parts of the MSRPC code in Samba replaced by
auto-generated code from pidl. pidl uses a proper parser generator and
grammmer description which seems to cover enough of IDL for the
current NT calls, and has a structure that I think will make it fairly
easy to extend. The big advantage of pidl is it's size. It weighs in
at about 1k lines of perl now and will probably reach 2 or 3k lines by
the time in can do really useful work.
Of course it may be that freedce really is the future of MSRPC on
unix, but I wouldn't want to completely dismiss other options at this
More information about the samba-technical