r13924: Split more prototypes out of include/proto.h + initial work on header
[jelmer/samba4-debian.git] / source / ntvfs / ipc / rap_server.c
1 /* 
2    Unix SMB/CIFS implementation.
3    RAP handlers
4
5    Copyright (C) Volker Lendecke 2004
6
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.
11    
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.
16    
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.
20 */
21
22 #include "includes.h"
23 #include "libcli/rap/rap.h"
24 #include "librpc/gen_ndr/ndr_srvsvc.h"
25 #include "rpc_server/common/common.h"
26
27 /* At this moment these are just dummy functions, but you might get the
28  * idea. */
29
30 NTSTATUS rap_netshareenum(struct smbsrv_request *req,
31                           struct rap_NetShareEnum *r)
32 {
33         int i;
34         r->out.status = 0;
35         r->out.available = dcesrv_common_get_count_of_shares(req, NULL);
36         r->out.info = talloc_array(req,
37                                      union rap_shareenum_info, r->out.available);
38
39         for (i=0;i<r->out.available;i++) {
40                 strncpy(r->out.info[i].info1.name, 
41                         dcesrv_common_get_share_name(req, NULL, i),
42                         sizeof(r->out.info[0].info1.name));
43                 r->out.info[i].info1.pad = 0;
44                 r->out.info[i].info1.type = dcesrv_common_get_share_type(req, NULL, i);
45                 r->out.info[i].info1.comment = talloc_strdup(req, 
46                                                              dcesrv_common_get_share_comment(req, NULL, i));
47         }
48         
49         return NT_STATUS_OK;
50 }
51
52 NTSTATUS rap_netserverenum2(struct smbsrv_request *req,
53                                    struct rap_NetServerEnum2 *r)
54 {
55         r->out.status = 0;
56         r->out.available = 0;
57         return NT_STATUS_OK;
58 }