DCESRV stuff v3

tridge at samba.org tridge at samba.org
Wed Jan 7 10:12:19 GMT 2004


 > This is the function that will perform the remote call
 > static NTSTATUS remote_handle_call(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r)
 > {
 > 	struct dcesrv_remote_private *private = dce_call->conn->private;
 > 	NTSTATUS status;
 > 	uint16 opnum = dce_call->pkt.u.request.opnum;
 > 	ndr_push_flags_fn_t ndr_push_fn = dce_call->conn->iface->ndr->calls[opnum].ndr_push;
 > 	ndr_pull_flags_fn_t ndr_pull_fn = dce_call->conn->iface->ndr->calls[opnum].ndr_pull;
 > 	size_t struct_size = dce_call->conn->iface->ndr->calls[opnum].struct_size;
 > 	status = dcerpc_ndr_request(private->c_pipe, opnum, mem_ctx,
 > 				    (ndr_push_flags_fn_t) ndr_push_fn,
 > 				    (ndr_pull_flags_fn_t) ndr_pull_fn,
 > 				    r, struct_size);
 > 	return status;
 > }

yep, thats exactly the sort of thing I was thinking of. Combined with
the ability to find a list of possible interfaces using the table in
librpc/gen_ndr/table.c I think we can write a quite small and neat
implementation of the remote rpc backend.

The only slightly tricky parts will be:

1) mapping TCP to TCP and SMB to SMB (we'll need some way of working
   passing along the endpoint information from the incoming

2) we'll need a "private" pointer to hold the established socket
   information for the connection to the backend server

3) handling of authentication. Easiest will be to do what NTVFS does,
   which is to have smb.conf options with username/password.

Cheers, Tridge

More information about the samba-technical mailing list