libmsrpc for Samba 3

Gerald (Jerry) Carter jerry at samba.org
Tue Jul 19 18:14:26 GMT 2005


Chris Nicholls wrote:

> I'm thinking that modelling the client interface in 
 > a similar way to the MSDN api is probably the way to go,
 > at the very least for winreg and lsarpc, as the
 > functions seem to parallel the possible operations on
> those pipes.  I may be wrong but it seems like at least
> rpc_client/cli_lsarpc.c is modelled after this as well.  

Our client api is roughly based on the wire structures
defined in include/rpc_*.  Since these structure normally
bubble up to the user api, there are a lot of
similarities.

 > For other pipes that might not have an API that parallels
 > with it (I'm not sure what wkssvc would be under) using
 > the current rpc_client interface along with the
 > possible operations on the pipe would be a good guide.
> I think the next step should be hammering out the 
 > details of how  a server handle will operate. Any
 > objections?

Tridge had suggested to me looking at the rpc client
interface in Samba 4.

Tridge, I looked at torture/rpc/*.c.  Is this what
you meant?  All of the client functions have a prototype
by fn( pipe *p, mem_ctx *ctx, rpc_struct *r ) where for
example, r could be defined as

struct svcctl_EnumServicesStatusW {
	struct {
		struct policy_handle *handle;/* [ref] */
		uint32_t type;
		uint32_t state;
		uint32_t buf_size;
		uint32_t *resume_handle;/* [unique] */
	} in;

	struct {
		uint8_t *service;/* [size_is(buf_size)] */
		uint32_t bytes_needed;
		uint32_t services_returned;
		uint32_t *resume_handle;/* [unique] */
		WERROR result;
	} out;
};

Is this what you were suggesting?  That the client fill in
the necessary components of r prior to the call ?

Is so then Samba 4 has simply pushed the application
layer into what samba 3 uses for rpc_client/cli_*.c
and you interface is based on the CLI_DO_RPC interface
used by our newer client code (cli_spoolss.c in trunk,
cli_reg.c, etc ...).

So then I'm confused by your comment to me about using
a compatible client interface between Samba 3 and 4
for this library.  I'm not sure how I see that is possible.
Am I looking in the right place ?

> Also, I haven't seen much information around regarding 
 > the spoolss pipe. Do you know of any good reference material?
 > If not I'll try to learn as much as I can from ethereal
 > captures.

The spoolss pipe roughly corresponds to the
OpenPrinter(), et. al. set of calls in msdn.
I have just cleaned up the rpc_client/cli_spoolss.c
file in trunk.  That should be easer to read.



jerry


More information about the samba-technical mailing list