From 9327ec51d11855ec0ceac3ce1f4e0a75c8b57081 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 14 Jan 2005 01:32:56 +0000 Subject: r4728: split up server_services into: - stream_socket services the smb, ldap and rpc service which sets up a srtam socket end then waits for connections and - task services which this you can create a seperate task that do something (this is also going through the process_model subsystem so with -M standard a new process for this created with -M thread a new thread ... I'll add datagram services later when we whave support for datagram sockets in lib/socket/ see the next commit as an example for service_task's metze (This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0) --- source4/smbd/service.h | 80 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 22 deletions(-) (limited to 'source4/smbd/service.h') diff --git a/source4/smbd/service.h b/source4/smbd/service.h index 20bf6e9b8f..d5335b1cef 100644 --- a/source4/smbd/service.h +++ b/source4/smbd/service.h @@ -42,7 +42,17 @@ struct server_service_ops { const char *name; /* called at startup when the server_service is selected */ - void (*service_init)(struct server_service *service, const struct model_ops *ops); + void (*service_init)(struct server_service *service); +}; + +struct server_stream_socket; + +struct server_stream_ops { + /* the name of the server_service */ + const char *name; + + /* called at startup when the server_service is selected */ + void (*socket_init)(struct server_stream_socket *socket); /* function to accept new connection */ void (*accept_connection)(struct server_connection *); @@ -56,16 +66,16 @@ struct server_service_ops { /* function to close a connection */ void (*close_connection)(struct server_connection *, const char *reason); - - /* function to exit server */ - void (*service_exit)(struct server_service *srv_ctx, const char *reason); }; struct socket_context; -struct server_socket { - struct server_socket *next,*prev; - void *private_data; +struct server_stream_socket { + struct server_stream_socket *next,*prev; + struct { + const struct server_stream_ops *ops; + void *private_data; + } stream; struct { struct event_context *ctx; @@ -75,20 +85,16 @@ struct server_socket { struct socket_context *socket; struct server_service *service; - - struct server_connection *connection_list; }; struct server_service { struct server_service *next,*prev; - void *private_data; - const struct server_service_ops *ops; - - const struct model_ops *model_ops; - - struct server_socket *socket_list; + struct { + const struct server_service_ops *ops; + void *private_data; + } service; - struct server_context *srv_ctx; + struct server_context *server; }; /* the concept of whether two operations are on the same server @@ -106,7 +112,10 @@ typedef uint32_t servid_t; struct server_connection { struct server_connection *next,*prev; - void *private_data; + struct { + void *private_data; + servid_t id; + } connection; struct { struct event_context *ctx; @@ -115,15 +124,42 @@ struct server_connection { struct timeval idle_time; } event; - servid_t server_id; - struct socket_context *socket; - struct server_socket *server_socket; + struct server_stream_socket *stream_socket; - struct server_service *service; + struct { + struct messaging_context *ctx; + } messaging; +}; + +struct server_task; + +struct server_task_ops { + /* the name of the server_task */ + const char *name; + + /* called at startup when the server_task is selected */ + void (*task_init)(struct server_task *task); +}; + +struct server_task { + struct server_task *next,*prev; + struct { + const struct server_task_ops *ops; + void *private_data; + servid_t id; + } task; + + struct { + struct event_context *ctx; + } event; + + struct { + struct messaging_context *ctx; + } messaging; - struct messaging_context *messaging_ctx; + struct server_service *service; }; #endif /* _SERVER_SERVICE_H */ -- cgit