libmsrpc for Samba 3
cnicholl at uoguelph.ca
Wed Jul 20 15:55:55 GMT 2005
>Having spent many, many years working with networking protocol software, I
>have encountered and worked with both methods many times. I refer to the
>Samba 4 method as "control block" in that one passes a control block structure
>to each function rather than numerous parameters. I have found the control
>block method to be *far* easier to work with. When I've worked with the
>parameter method, I would often end up putting a comment next to each
>parameter (so that it ends up looking like the control block method anyway)
>just to keep myself sane. I've found that it's just too hard to keep track of
>what each parameter is otherwise.
This 'control block' structure has grown on me since i first looked at
this thread last night. It definately makes for much more readable code
and makes it really easy to pass a number of parameters out of a
function (as a lot of rpc operations seem to do). The only question I
have right now is what happens if an application developer forgets to
initialize a particular in.* member? Even with error checking on all
the parameters, in theory something weird can get through but I guess it
would be quite infrequent for some freak 'valid' value to get in through
error checking and cause problems.
Overall though, I think i prefer control blocks to the alternative which
is passing in a ton of paramaters to a function.
I can't really comment on compatabilities with the Samba4 API as i
haven't spent much time at all looking through the Samba4 code yet.
More information about the samba-technical