Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
[nivanova/samba-autobuild/.git] / source3 / rpc_server / srv_wkssvc.c
1 /* 
2  *  Unix SMB/Netbios implementation.
3  *  Version 1.9.
4  *  RPC Pipe client / server routines
5  *  Copyright (C) Andrew Tridgell              1992-1997,
6  *  Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7  *  Copyright (C) Paul Ashton                       1997.
8  *  
9  *  This program is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 2 of the License, or
12  *  (at your option) any later version.
13  *  
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *  
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, write to the Free Software
21  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  */
23
24 /* This is the interface to the wks pipe. */
25
26 #include "includes.h"
27
28 /*******************************************************************
29  api_wks_query_info
30  ********************************************************************/
31
32 static BOOL api_wks_query_info(pipes_struct *p)
33 {
34         WKS_Q_QUERY_INFO q_u;
35         WKS_R_QUERY_INFO r_u;
36         prs_struct *data = &p->in_data.data;
37         prs_struct *rdata = &p->out_data.rdata;
38
39         ZERO_STRUCT(q_u);
40         ZERO_STRUCT(r_u);
41
42         /* grab the net share enum */
43         if(!wks_io_q_query_info("", &q_u, data, 0))
44                 return False;
45
46         r_u.status = _wks_query_info(p, &q_u, &r_u);
47
48         /* store the response in the SMB stream */
49         if(!wks_io_r_query_info("", &r_u, rdata, 0))
50                 return False;
51
52         return True;
53 }
54
55
56 /*******************************************************************
57  \PIPE\wkssvc commands
58  ********************************************************************/
59 struct api_struct api_wks_cmds[] =
60 {
61         { "WKS_Q_QUERY_INFO", WKS_QUERY_INFO, api_wks_query_info },
62         { NULL             , 0            , NULL }
63 };
64
65 /*******************************************************************
66  receives a wkssvc pipe and responds.
67  ********************************************************************/
68 BOOL api_wkssvc_rpc(pipes_struct *p)
69 {
70         return api_rpcTNP(p, "api_wkssvc_rpc", api_wks_cmds);
71 }