From 340d9b71f9e75d634389104da5949ba59669ede2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Dec 2003 02:20:40 +0000 Subject: added a basic dcerpc endpoint mapper to Samba4. Currently only implements the epm_Lookup() call, I'll add the other important calls soon. I was rather pleased to find that epm_Lookup() worked first time, which is particularly surprising given its complexity. This required quite a bit of new infrastructure: * a generic way of handling dcerpc policy handles in the rpc server * added type checked varients of talloc. These are much less error prone. I'd like to move to using these for nearly all uses of talloc. * added more dcerpc fault handling code, and translation from NTSTATUS to a dcerpc fault code * added data_blob_talloc_zero() for allocating an initially zero blob * added a endpoint enumeration hook in the dcerpc endpoint server operations (This used to be commit 3f85f9b782dc17417baf1ca557fcae22f5b6a83a) --- source4/rpc_server/dcerpc_server.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server/dcerpc_server.h') diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h index 165eddc5e6..3f2f5d039f 100644 --- a/source4/rpc_server/dcerpc_server.h +++ b/source4/rpc_server/dcerpc_server.h @@ -23,7 +23,8 @@ enum endpoint_type {ENDPOINT_SMB, ENDPOINT_TCP}; -/* a description of a single dcerpc endpoint */ +/* a description of a single dcerpc endpoint. Not as flexible as a full epm tower, + but much easier to work with */ struct dcesrv_endpoint { enum endpoint_type type; union { @@ -32,6 +33,13 @@ struct dcesrv_endpoint { } info; }; +/* a endpoint combined with an interface description */ +struct dcesrv_ep_iface { + struct dcesrv_endpoint endpoint; + const char *uuid; + uint32 if_version; +}; + struct dcesrv_state; /* the dispatch functions for an interface take this form */ @@ -50,8 +58,20 @@ struct dcesrv_call_state { } *replies; }; + +/* a dcerpc handle in internal format */ +struct dcesrv_handle { + struct dcesrv_handle *next, *prev; + struct policy_handle wire_handle; + TALLOC_CTX *mem_ctx; + void *data; +}; + /* the state associated with a dcerpc server connection */ struct dcesrv_state { + /* the top level context for this server */ + struct server_context *smb; + TALLOC_CTX *mem_ctx; /* the endpoint that was opened */ @@ -75,6 +95,11 @@ struct dcesrv_state { /* private data for the endpoint server */ void *private; + + /* current rpc handles - this is really the wrong scope for + them, but it will do for now */ + uint32 next_handle; + struct dcesrv_handle *handles; }; @@ -92,6 +117,10 @@ struct dcesrv_endpoint_ops { /* disconnect() is called when the endpoint is disconnected */ void (*disconnect)(struct dcesrv_state *); + + /* this function is used to ask an endpoint server for a list + of endpoints it wants to handle */ + int (*lookup_endpoints)(TALLOC_CTX *mem_ctx, struct dcesrv_ep_iface **); }; -- cgit