2004-02-02 16:43:03 +03:00
/*
Unix SMB / CIFS implementation .
2005-01-30 03:54:57 +03:00
process model manager - structures
Copyright ( C ) Andrew Tridgell 1992 - 2005
2004-02-02 16:43:03 +03:00
Copyright ( C ) James J Myers 2003 < myersjj @ samba . org >
2005-01-14 04:32:56 +03:00
Copyright ( C ) Stefan ( metze ) Metzmacher 2004 - 2005
2004-02-02 16:43:03 +03:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2004-02-02 16:43:03 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2004-02-02 16:43:03 +03:00
*/
2006-03-14 18:03:25 +03:00
# ifndef __PROCESS_MODEL_H__
# define __PROCESS_MODEL_H__
2005-02-10 09:59:29 +03:00
# include "lib/socket/socket.h"
2007-01-10 13:52:09 +03:00
# include "smbd/service_task.h"
2005-02-10 09:59:29 +03:00
2004-02-02 16:43:03 +03:00
/* modules can use the following to determine if the interface has changed
* please increment the version number after each interface change
* with a comment and maybe update struct process_model_critical_sizes .
*/
/* version 1 - initial version - metze */
# define PROCESS_MODEL_VERSION 1
/* the process model operations structure - contains function pointers to
the model - specific implementations of each operation */
struct model_ops {
/* the name of the process_model */
const char * name ;
/* called at startup when the model is selected */
2005-01-30 03:54:57 +03:00
void ( * model_init ) ( struct event_context * ) ;
2004-02-02 16:43:03 +03:00
/* function to accept new connection */
2008-01-06 04:03:43 +03:00
void ( * accept_connection ) ( struct event_context * ,
struct loadparm_context * ,
struct socket_context * ,
void ( * ) ( struct event_context * ,
struct loadparm_context * ,
struct socket_context * ,
2007-01-10 13:52:09 +03:00
struct server_id , void * ) ,
2005-01-30 03:54:57 +03:00
void * ) ;
2004-07-14 01:04:56 +04:00
2005-01-30 05:55:30 +03:00
/* function to create a task */
void ( * new_task ) ( struct event_context * ,
2008-01-06 04:03:43 +03:00
struct loadparm_context * lp_ctx ,
void ( * ) ( struct event_context * ,
struct loadparm_context * , struct server_id ,
void * ) ,
2005-01-30 05:55:30 +03:00
void * ) ;
2006-03-09 20:48:41 +03:00
/* function to terminate a connection or task */
2005-01-30 05:55:30 +03:00
void ( * terminate ) ( struct event_context * , const char * reason ) ;
2006-03-09 20:48:41 +03:00
/* function to set a title for the connection or task */
void ( * set_title ) ( struct event_context * , const char * title ) ;
2004-02-02 16:43:03 +03:00
} ;
/* this structure is used by modules to determine the size of some critical types */
struct process_model_critical_sizes {
int interface_version ;
int sizeof_model_ops ;
} ;
2006-03-07 14:07:23 +03:00
2007-09-03 17:13:25 +04:00
extern const struct model_ops single_ops ;
2006-03-07 14:07:23 +03:00
# include "smbd/process_model_proto.h"
2006-03-14 18:03:25 +03:00
# endif /* __PROCESS_MODEL_H__ */