diff options
author | Luke Leighton <lkcl@samba.org> | 2000-01-16 04:01:59 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-01-16 04:01:59 +0000 |
commit | 66b5e490dea571e0d3d635ce5cb342078c3a1f61 (patch) | |
tree | bd1cf0019b27bbc50113a88a8ea8cfb7c2227511 /source | |
parent | 315f30e03fb784c2ae8fb57a30a0f9c420ca9968 (diff) | |
download | samba-66b5e490dea571e0d3d635ce5cb342078c3a1f61.tar.gz samba-66b5e490dea571e0d3d635ce5cb342078c3a1f61.tar.xz samba-66b5e490dea571e0d3d635ce5cb342078c3a1f61.zip |
higher order function table to set up msrpc services.
Diffstat (limited to 'source')
-rw-r--r-- | source/browserd/browserd.c | 25 | ||||
-rw-r--r-- | source/include/ntdomain.h | 9 | ||||
-rw-r--r-- | source/include/proto.h | 40 | ||||
-rw-r--r-- | source/lsarpcd/lsarpcd.c | 25 | ||||
-rw-r--r-- | source/msrpc/msrpcd.c | 29 | ||||
-rw-r--r-- | source/msrpc/msrpcd_process.c | 8 | ||||
-rw-r--r-- | source/netlogond/netlogond.c | 25 | ||||
-rw-r--r-- | source/nmbd/nmbd.c | 88 | ||||
-rw-r--r-- | source/samrd/samrd.c | 25 | ||||
-rw-r--r-- | source/script/mkproto.awk | 4 | ||||
-rw-r--r-- | source/spoolssd/spoolssd.c | 25 | ||||
-rw-r--r-- | source/srvsvcd/srvsvcd.c | 25 | ||||
-rw-r--r-- | source/svcctld/svcctld.c | 25 | ||||
-rw-r--r-- | source/winregd/winregd.c | 25 | ||||
-rw-r--r-- | source/wkssvcd/wkssvcd.c | 25 |
15 files changed, 263 insertions, 140 deletions
diff --git a/source/browserd/browserd.c b/source/browserd/browserd.c index ca386f96253..a6ae53c7afe 100644 --- a/source/browserd/browserd.c +++ b/source/browserd/browserd.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_brs_rpc ); } @@ -45,7 +45,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -69,7 +69,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -81,7 +81,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -100,5 +100,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "browser"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/include/ntdomain.h b/source/include/ntdomain.h index 1702e93040c..12fdc940487 100644 --- a/source/include/ntdomain.h +++ b/source/include/ntdomain.h @@ -200,6 +200,15 @@ typedef struct pipes_struct } pipes_struct; +typedef struct msrpc_service_fns +{ + void (*auth_init)(rpcsrv_struct *); + void (*service_init)(char* ); + BOOL (*reload_services)(BOOL); + int (*main_init)(int,char *[]); + +} msrpc_service_fns; + struct api_struct { char *name; diff --git a/source/include/proto.h b/source/include/proto.h index 58824208145..d7183c5c741 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -5,9 +5,7 @@ /*The following definitions come from browserd/browserd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from client/client.c */ @@ -1068,9 +1066,7 @@ int share_mode_forall(void (*fn)(share_mode_entry *, char *)); /*The following definitions come from lsarpcd/lsarpcd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from lsarpcd/srv_lsa.c */ @@ -1096,7 +1092,6 @@ void *smb_mem_resize(void *ptr,size_t newsize); /*The following definitions come from msrpc/msrpcd.c */ void exit_server(char *reason); -int msrpc_main(int argc,char *argv[]); /*The following definitions come from msrpc/msrpcd_process.c */ @@ -1104,7 +1099,7 @@ BOOL get_user_creds(int c, struct user_creds *usr); void close_srv_auth_array(rpcsrv_struct *l); void add_srv_auth_fn(rpcsrv_struct *l, srv_auth_fns *fn); BOOL msrpcd_init(int c, msrpc_pipes_struct *p); -void msrpcd_process(int c, msrpc_pipes_struct *p); +void msrpcd_process(msrpc_service_fns *fn, int c, msrpc_pipes_struct *p); /*The following definitions come from netlogond/creds_db.c */ @@ -1114,9 +1109,7 @@ BOOL cred_init_db(void); /*The following definitions come from netlogond/netlogond.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from nmbd/asyncdns.c */ @@ -1132,7 +1125,6 @@ void kill_async_dns_child(void); /*The following definitions come from nmbd/nmbd.c */ -BOOL reload_services(BOOL test); /*The following definitions come from nmbd/nmbd_become_dmb.c */ @@ -4245,9 +4237,7 @@ void readline_init(void); /*The following definitions come from samrd/samrd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from smbd/blocking.c */ @@ -4738,21 +4728,15 @@ int smbw_stat(const char *fname, struct stat *st); /*The following definitions come from spoolssd/spoolssd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from srvsvcd/srvsvcd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from svcctld/svcctld.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from tdb/tdb.c */ @@ -4812,13 +4796,9 @@ void status_page(void); /*The following definitions come from winregd/winregd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); /*The following definitions come from wkssvcd/wkssvcd.c */ -void msrpc_auth_init(rpcsrv_struct *l); -void msrpc_service_init(char* service_name); -BOOL reload_services(BOOL test); +msrpc_service_fns *get_service_fns(void); #endif /* _PROTO_H_ */ diff --git a/source/lsarpcd/lsarpcd.c b/source/lsarpcd/lsarpcd.c index 500aba5d1b2..baffbc7dcb1 100644 --- a/source/lsarpcd/lsarpcd.c +++ b/source/lsarpcd/lsarpcd.c @@ -31,11 +31,11 @@ extern int DEBUGLEVEL; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_ntlsa_rpc ); @@ -48,7 +48,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -72,7 +72,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -84,7 +84,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -103,5 +103,18 @@ BOOL reload_services(BOOL test) setup_logging(argv[0],False); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/msrpc/msrpcd.c b/source/msrpc/msrpcd.c index 422cdb33e0f..fd5010de0ed 100644 --- a/source/msrpc/msrpcd.c +++ b/source/msrpc/msrpcd.c @@ -354,8 +354,9 @@ static void usage(char *pname) /**************************************************************************** main program ****************************************************************************/ -int msrpc_main(int argc,char *argv[]) + int main(int argc,char *argv[]) { + msrpc_service_fns *fn = get_service_fns(); extern BOOL append_log; /* shall I run as a daemon */ BOOL is_daemon = False; @@ -364,7 +365,18 @@ int msrpc_main(int argc,char *argv[]) int ClientMSRPC = -1; msrpc_pipes_struct p; fstring service_name; - + + if (fn == NULL) + { + fprintf(stderr,"no services table!\n"); + exit(-1); + } + + if (fn->main_init(argc, argv) != 0) + { + exit_server("fn->main() initialisation failed!"); + } + pstrcpy(remote_machine, pipe_name); split_at_last_component(argv[0], NULL, '/', service_name); @@ -468,7 +480,7 @@ int msrpc_main(int argc,char *argv[]) get_myname(myhostname,NULL); - if (!reload_services(False)) + if (!fn->reload_services(False)) return(-1); init_structs(); @@ -541,23 +553,23 @@ int msrpc_main(int argc,char *argv[]) exit(1); /* possibly reload the services file. */ - reload_services(True); + fn->reload_services(True); if (*lp_rootdir()) { if (sys_chroot(lp_rootdir()) == 0) DEBUG(2,("Changed root to %s\n", lp_rootdir())); } - msrpc_service_init(service_name); + fn->service_init(service_name); dbgflush(); ZERO_STRUCT(p); fstrcpy(p.name, pipe_name); if (msrpcd_init(ClientMSRPC, &p)) { - msrpc_auth_init(p.l); - reload_services(True); - msrpcd_process(ClientMSRPC, &p); + fn->auth_init(p.l); + fn->reload_services(True); + msrpcd_process(fn, ClientMSRPC, &p); } if (ClientMSRPC != -1) { @@ -567,3 +579,4 @@ int msrpc_main(int argc,char *argv[]) exit_server("normal exit"); return(0); } + diff --git a/source/msrpc/msrpcd_process.c b/source/msrpc/msrpcd_process.c index c2ee3645439..a686aa18dc7 100644 --- a/source/msrpc/msrpcd_process.c +++ b/source/msrpc/msrpcd_process.c @@ -408,7 +408,7 @@ BOOL msrpcd_init(int c, msrpc_pipes_struct *p) /**************************************************************************** process commands from the client ****************************************************************************/ -void msrpcd_process(int c, msrpc_pipes_struct *p) +void msrpcd_process(msrpc_service_fns *fn, int c, msrpc_pipes_struct *p) { extern fstring remote_machine; extern fstring local_machine; @@ -427,7 +427,7 @@ void msrpcd_process(int c, msrpc_pipes_struct *p) DEBUG(2, ("msrpc_process: client_name: %s my_name: %s\n", remote_machine, local_machine)); - reload_services(True); + fn->reload_services(True); reopen_logs(); while (True) @@ -472,7 +472,7 @@ void msrpcd_process(int c, msrpc_pipes_struct *p) service_load_counter = counter; /* reload services, if files have changed. */ - reload_services(True); + fn->reload_services(True); } /* @@ -483,7 +483,7 @@ void msrpcd_process(int c, msrpc_pipes_struct *p) if (reload_after_sighup) { DEBUG(0,("Reloading services after SIGHUP\n")); - reload_services(False); + fn->reload_services(False); reload_after_sighup = False; /* * Use this as an excuse to print some stats. diff --git a/source/netlogond/netlogond.c b/source/netlogond/netlogond.c index d9260ef55db..f14f3a76aad 100644 --- a/source/netlogond/netlogond.c +++ b/source/netlogond/netlogond.c @@ -31,7 +31,7 @@ extern int DEBUGLEVEL; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { extern srv_auth_fns netsec_fns; add_srv_auth_fn(l, &netsec_fns); @@ -40,7 +40,7 @@ void msrpc_auth_init(rpcsrv_struct *l) /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_netlog_rpc ); if (!pwdb_initialise(True) || !initialise_password_db()) @@ -82,7 +82,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -106,7 +106,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -118,7 +118,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -137,5 +137,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "NETLOGON"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, "netlogon"); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c index 1471254b4ea..b1f3d77150d 100644 --- a/source/nmbd/nmbd.c +++ b/source/nmbd/nmbd.c @@ -59,6 +59,50 @@ time_t StartupTime = 0; extern struct in_addr ipzero; /**************************************************************************** ** + reload the services file + **************************************************************************** */ +static BOOL reload_services(BOOL test) +{ + BOOL ret; + extern fstring remote_machine; + + fstrcpy( remote_machine, "nmb" ); + + if ( lp_loaded() ) + { + pstring fname; + pstrcpy( fname,lp_configfile()); + if (file_exist(fname,NULL) && !strcsequal(fname,servicesf)) + { + pstrcpy(servicesf,fname); + test = False; + } + } + + if ( test && !lp_file_list_changed() ) + return(True); + + ret = lp_load( servicesf, True , False, False); + + /* perhaps the config filename is now set */ + if ( !test ) + { + DEBUG( 3, ( "services not loaded\n" ) ); + reload_services( True ); + } + + /* Do a sanity check for a misconfigured nmbd */ + if( lp_wins_support() && *lp_wins_server() ) + { + DEBUG(0,("ERROR: both 'wins support = true' and 'wins server = <server>' \ +cannot be set in the smb.conf file. nmbd aborting.\n")); + exit(10); + } + + return(ret); +} /* reload_services */ + +/**************************************************************************** ** catch a sigterm **************************************************************************** */ static void sig_term(int sig) @@ -185,50 +229,6 @@ static void expire_names_and_servers(time_t t) } /* expire_names_and_servers */ /**************************************************************************** ** - reload the services file - **************************************************************************** */ -BOOL reload_services(BOOL test) -{ - BOOL ret; - extern fstring remote_machine; - - fstrcpy( remote_machine, "nmb" ); - - if ( lp_loaded() ) - { - pstring fname; - pstrcpy( fname,lp_configfile()); - if (file_exist(fname,NULL) && !strcsequal(fname,servicesf)) - { - pstrcpy(servicesf,fname); - test = False; - } - } - - if ( test && !lp_file_list_changed() ) - return(True); - - ret = lp_load( servicesf, True , False, False); - - /* perhaps the config filename is now set */ - if ( !test ) - { - DEBUG( 3, ( "services not loaded\n" ) ); - reload_services( True ); - } - - /* Do a sanity check for a misconfigured nmbd */ - if( lp_wins_support() && *lp_wins_server() ) - { - DEBUG(0,("ERROR: both 'wins support = true' and 'wins server = <server>' \ -cannot be set in the smb.conf file. nmbd aborting.\n")); - exit(10); - } - - return(ret); -} /* reload_services */ - -/**************************************************************************** ** The main select loop. **************************************************************************** */ static void process(void) diff --git a/source/samrd/samrd.c b/source/samrd/samrd.c index 249082c194c..06f0b3a5868 100644 --- a/source/samrd/samrd.c +++ b/source/samrd/samrd.c @@ -31,7 +31,7 @@ extern int DEBUGLEVEL; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { extern srv_auth_fns ntlmssp_fns; add_srv_auth_fn(l, &ntlmssp_fns); @@ -40,7 +40,7 @@ void msrpc_auth_init(rpcsrv_struct *l) /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { DEBUG(10,("msrpc_service_init\n")); @@ -80,7 +80,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -104,7 +104,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -116,7 +116,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -135,5 +135,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "samr"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/script/mkproto.awk b/source/script/mkproto.awk index 3a5856f0f26..c146c11cd17 100644 --- a/source/script/mkproto.awk +++ b/source/script/mkproto.awk @@ -106,6 +106,10 @@ END { gotstart = 1; } + if( $0 ~ /^msrpc_service_fns/ ) { + gotstart = 1; + } + if( $0 ~ /^TDB_CONTEXT|^TDB_DATA|^smb_ucs2_t/ ) { gotstart = 1; } diff --git a/source/spoolssd/spoolssd.c b/source/spoolssd/spoolssd.c index d08ed3e6dbb..3814b9c4ee0 100644 --- a/source/spoolssd/spoolssd.c +++ b/source/spoolssd/spoolssd.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_spoolss_rpc ); init_printer_hnd(); /* for SPOOLSS handles */ @@ -46,7 +46,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -72,7 +72,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -84,7 +84,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -103,5 +103,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "spoolss"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/srvsvcd/srvsvcd.c b/source/srvsvcd/srvsvcd.c index ab02b8b7dad..d084330d479 100644 --- a/source/srvsvcd/srvsvcd.c +++ b/source/srvsvcd/srvsvcd.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void msrpc_auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void msrpc_service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_srvsvc_rpc ); } @@ -45,7 +45,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -69,7 +69,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -81,7 +81,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -100,5 +100,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "srvsvc"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + msrpc_auth_init, + msrpc_service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/svcctld/svcctld.c b/source/svcctld/svcctld.c index cd371fce0fb..1047202050f 100644 --- a/source/svcctld/svcctld.c +++ b/source/svcctld/svcctld.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_svcctl_rpc ); } @@ -45,7 +45,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -69,7 +69,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -81,7 +81,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -100,5 +100,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "svcctl"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/winregd/winregd.c b/source/winregd/winregd.c index cc1a37e0b6e..aedb657d8e7 100644 --- a/source/winregd/winregd.c +++ b/source/winregd/winregd.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_reg_rpc ); } @@ -45,7 +45,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -69,7 +69,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -81,7 +81,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -100,5 +100,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "winreg"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } diff --git a/source/wkssvcd/wkssvcd.c b/source/wkssvcd/wkssvcd.c index 6ca0c88418e..d695d10801f 100644 --- a/source/wkssvcd/wkssvcd.c +++ b/source/wkssvcd/wkssvcd.c @@ -30,14 +30,14 @@ extern BOOL append_log; /***************************************************************************** initialise srv_auth_fns array *****************************************************************************/ -void msrpc_auth_init(rpcsrv_struct *l) +static void auth_init(rpcsrv_struct *l) { } /************************************************************************* initialise an msrpc service *************************************************************************/ -void msrpc_service_init(char* service_name) +static void service_init(char* service_name) { add_msrpc_command_processor( pipe_name, service_name, api_wkssvc_rpc ); } @@ -45,7 +45,7 @@ void msrpc_service_init(char* service_name) /**************************************************************************** reload the services file **************************************************************************/ -BOOL reload_services(BOOL test) +static BOOL reload_msrpc(BOOL test) { BOOL ret; @@ -69,7 +69,7 @@ BOOL reload_services(BOOL test) /* perhaps the config filename is now set */ if (!test) - reload_services(True); + reload_msrpc(True); reopen_logs(); @@ -81,7 +81,7 @@ BOOL reload_services(BOOL test) /**************************************************************************** main program ****************************************************************************/ - int main(int argc,char *argv[]) +static int main_init(int argc,char *argv[]) { #ifdef HAVE_SET_AUTH_PARAMETERS set_auth_parameters(argc,argv); @@ -100,5 +100,18 @@ BOOL reload_services(BOOL test) fstrcpy(pipe_name, "wkssvc"); slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name); - return msrpc_main(argc, argv); + return 0; +} + +static msrpc_service_fns fn_table = +{ + auth_init, + service_init, + reload_msrpc, + main_init +}; + +msrpc_service_fns *get_service_fns(void) +{ + return &fn_table; } |