delineation between smb and msrpc more marked. smbd now constructs
[kai/samba.git] / source3 / rpc_server / srv_brs.c
1
2 /* 
3  *  Unix SMB/Netbios implementation.
4  *  Version 1.9.
5  *  RPC Pipe client / server routines
6  *  Copyright (C) Andrew Tridgell              1992-1999,
7  *  Copyright (C) Luke Kenneth Casson Leighton 1996-1999,
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
25 #include "includes.h"
26 #include "nterr.h"
27
28 extern int DEBUGLEVEL;
29 extern pstring global_myname;
30
31
32 /*******************************************************************
33  create_brs_info_100
34  ********************************************************************/
35 static void create_brs_info_100(BRS_INFO_100 *inf)
36 {
37         DEBUG(5,("create_brs_info_100: %d\n", __LINE__));
38
39         make_brs_info_100(inf);
40 }
41
42 /*******************************************************************
43  brs_reply_query_info
44  
45  only supports info level 100 at the moment.
46
47  ********************************************************************/
48 static void brs_reply_query_info(BRS_Q_QUERY_INFO *q_u,
49                                 prs_struct *rdata,
50                                 int status)
51 {
52         BRS_R_QUERY_INFO r_u;
53         BRS_INFO_100 brs100;
54
55         DEBUG(5,("brs_query_info: %d\n", __LINE__));
56
57         create_brs_info_100(&brs100);
58         make_brs_r_query_info(&r_u, q_u->switch_value1, &brs100, status);
59
60         /* store the response in the SMB stream */
61         brs_io_r_query_info("", &r_u, rdata, 0);
62
63         DEBUG(5,("brs_query_info: %d\n", __LINE__));
64 }
65
66 /*******************************************************************
67  api_brs_query_info
68  ********************************************************************/
69 static void api_brs_query_info( rpcsrv_struct *p, prs_struct *data,
70                                     prs_struct *rdata )
71 {
72         BRS_Q_QUERY_INFO q_u;
73
74         /* grab the net share enum */
75         brs_io_q_query_info("", &q_u, data, 0);
76
77         /* construct reply.  always indicate success */
78         brs_reply_query_info(&q_u, rdata, 0x0);
79 }
80
81
82 /*******************************************************************
83  \PIPE\brssvc commands
84  ********************************************************************/
85 struct api_struct api_brs_cmds[] =
86 {
87         { "BRS_Q_QUERY_INFO", BRS_QUERY_INFO, api_brs_query_info },
88         { NULL             , 0            , NULL }
89 };
90
91 /*******************************************************************
92  receives a browser pipe and responds.
93  ********************************************************************/
94 BOOL api_brs_rpc(rpcsrv_struct *p, prs_struct *data)
95 {
96         return api_rpcTNP(p, "api_brssvc_rpc", api_brs_cmds, data);
97 }
98