1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-25 19:33:18 +03:00

r4640: first stage in the server side support for multiple context_ids on one pipe

this stage does the following:

 - simplifies the dcerpc_handle handling, and all the callers of it

 - split out the context_id depenent state into a linked list of established contexts

 - fixed some talloc handling in several rpc servers that i noticed while doing the above
This commit is contained in:
Andrew Tridgell
2005-01-10 12:15:26 +00:00
committed by Gerald (Jerry) Carter
parent c215372eb0
commit fde042b3fc
15 changed files with 217 additions and 256 deletions

View File

@@ -44,8 +44,7 @@ struct dcesrv_interface {
NTSTATUS (*bind)(struct dcesrv_call_state *, const struct dcesrv_interface *);
/* this function is called when the client disconnects the endpoint */
void (*unbind)(struct dcesrv_connection *, const struct dcesrv_interface *);
void (*unbind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);
/* the ndr_pull function for the chosen interface.
*/
@@ -67,6 +66,7 @@ struct dcesrv_interface {
struct dcesrv_call_state {
struct dcesrv_call_state *next, *prev;
struct dcesrv_connection *conn;
struct dcesrv_connection_context *context;
struct dcerpc_packet pkt;
DATA_BLOB input;
@@ -85,9 +85,10 @@ struct dcesrv_call_state {
/* a dcerpc handle in internal format */
struct dcesrv_handle {
struct dcesrv_handle *next, *prev;
struct dcesrv_connection_context *context;
struct policy_handle wire_handle;
void *data;
void (*destroy)(struct dcesrv_connection *, struct dcesrv_handle *);
void (*destroy)(struct dcesrv_connection_context *, struct dcesrv_handle *);
};
/* hold the authentication state information */
@@ -98,6 +99,24 @@ struct dcesrv_auth {
NTSTATUS (*session_key)(struct dcesrv_connection *, DATA_BLOB *session_key);
};
struct dcesrv_connection_context {
struct dcesrv_connection_context *next, *prev;
uint32_t context_id;
/* the connection this is on */
struct dcesrv_connection *conn;
/* the ndr function table for the chosen interface */
const struct dcesrv_interface *iface;
/* private data for the interface implementation */
void *private;
/* current rpc handles - this is really the wrong scope for
them, but it will do for now */
struct dcesrv_handle *handles;
};
/* the state associated with a dcerpc server connection */
struct dcesrv_connection {
@@ -107,8 +126,8 @@ struct dcesrv_connection {
/* the endpoint that was opened */
const struct dcesrv_endpoint *endpoint;
/* the ndr function table for the chosen interface */
const struct dcesrv_interface *iface;
/* a list of established context_ids */
struct dcesrv_connection_context *contexts;
/* the state of the current calls */
struct dcesrv_call_state *call_list;
@@ -116,13 +135,6 @@ struct dcesrv_connection {
/* the maximum size the client wants to receive */
uint32_t cli_max_recv_frag;
/* private data for the interface implementation */
void *private;
/* current rpc handles - this is really the wrong scope for
them, but it will do for now */
struct dcesrv_handle *handles;
DATA_BLOB partial_input;
/* the current authentication state */