This commit was manufactured by cvs2svn to create tag
[Samba.git] / source / browserd / browserd.c
blob5ea85a59ba8f0bc8a982e4d16493315f6118a326
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 Main SMB server routines
5 Copyright (C) Andrew Tridgell 1992-1998
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "includes.h"
23 #include "rpc_parse.h"
25 fstring pipe_name;
27 pstring servicesf = CONFIGFILE;
28 extern pstring debugf;
29 extern BOOL append_log;
31 /*****************************************************************************
32 initialise srv_auth_fns array
33 *****************************************************************************/
34 static void auth_init(rpcsrv_struct *l)
38 /*************************************************************************
39 initialise an msrpc service
40 *************************************************************************/
41 static void service_init(char* service_name)
43 add_msrpc_command_processor( pipe_name, service_name, api_brs_rpc );
44 generate_wellknown_sids();
47 /****************************************************************************
48 reload the services file
49 **************************************************************************/
50 static BOOL reload_msrpc(BOOL test)
52 BOOL ret;
54 if (lp_loaded()) {
55 pstring fname;
56 pstrcpy(fname,lp_configfile());
57 if (file_exist(fname,NULL) && !strcsequal(fname,servicesf)) {
58 pstrcpy(servicesf,fname);
59 test = False;
63 reopen_logs();
65 if (test && !lp_file_list_changed())
66 return(True);
68 lp_killunused(NULL);
70 ret = lp_load(servicesf,False,False,True);
72 /* perhaps the config filename is now set */
73 if (!test)
74 reload_msrpc(True);
76 reopen_logs();
78 load_interfaces();
80 return(ret);
83 /****************************************************************************
84 main program
85 ****************************************************************************/
86 static int main_init(int argc,char *argv[])
88 #ifdef HAVE_SET_AUTH_PARAMETERS
89 set_auth_parameters(argc,argv);
90 #endif
92 #ifdef HAVE_SETLUID
93 /* needed for SecureWare on SCO */
94 setluid(0);
95 #endif
97 append_log = True;
99 TimeInit();
101 setup_logging(argv[0],False);
102 fstrcpy(pipe_name, "browser");
103 slprintf(debugf, sizeof(debugf), "%s/log.%s", LOGFILEBASE, pipe_name);
105 return 0;
108 static msrpc_service_fns fn_table =
110 auth_init,
111 service_init,
112 reload_msrpc,
113 main_init,
114 NULL
117 msrpc_service_fns *get_service_fns(void)
119 return &fn_table;
122 /*******************************************************************
123 create_brs_info_100
124 ********************************************************************/
125 static void create_brs_info_100(BRS_INFO_100 *inf)
127 make_brs_info_100(inf);
130 /*******************************************************************
131 _brs_query_info
133 only supports info level 100 at the moment.
135 ********************************************************************/
136 uint32 _brs_query_info( const UNISTR2 *srv_name, uint16 switch_value,
137 void *id)
139 create_brs_info_100(id);
141 return 0x0;