2 Unix SMB/CIFS implementation.
4 Copyright (C) Tim Potter 2000-2001,
5 Copyright (C) Jeremy Allison 2005.
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.
24 /* Query DFS support */
26 NTSTATUS rpccli_dfs_exist(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
29 prs_struct qbuf, rbuf;
32 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
37 /* Marshall data and send request */
39 init_dfs_q_dfs_exist(&q);
41 CLI_DO_RPC( cli, mem_ctx, PI_NETDFS, DFS_EXIST,
46 NT_STATUS_UNSUCCESSFUL);
50 *dfs_exists = (r.status != 0);
52 result = NT_STATUS_OK;
57 NTSTATUS rpccli_dfs_add(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
58 const char *entrypath, const char *servername,
59 const char *sharename, const char *comment, uint32 flags)
61 prs_struct qbuf, rbuf;
64 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
69 /* Marshall data and send request */
71 init_dfs_q_dfs_add(&q, entrypath, servername, sharename, comment,
74 CLI_DO_RPC( cli, mem_ctx, PI_NETDFS, DFS_ADD,
79 NT_STATUS_UNSUCCESSFUL);
83 result = werror_to_ntstatus(r.status);
88 NTSTATUS rpccli_dfs_remove(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
89 const char *entrypath, const char *servername,
90 const char *sharename)
92 prs_struct qbuf, rbuf;
95 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
100 /* Marshall data and send request */
102 init_dfs_q_dfs_remove(&q, entrypath, servername, sharename);
104 CLI_DO_RPC( cli, mem_ctx, PI_NETDFS, DFS_REMOVE,
109 NT_STATUS_UNSUCCESSFUL);
113 result = werror_to_ntstatus(r.status);
118 NTSTATUS rpccli_dfs_get_info(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
119 const char *entrypath, const char *servername,
120 const char *sharename, uint32 info_level,
124 prs_struct qbuf, rbuf;
125 DFS_Q_DFS_GET_INFO q;
126 DFS_R_DFS_GET_INFO r;
127 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
132 /* Marshall data and send request */
134 init_dfs_q_dfs_get_info(&q, entrypath, servername, sharename,
137 CLI_DO_RPC( cli, mem_ctx, PI_NETDFS, DFS_GET_INFO,
140 dfs_io_q_dfs_get_info,
141 dfs_io_r_dfs_get_info,
142 NT_STATUS_UNSUCCESSFUL);
146 result = werror_to_ntstatus(r.status);
152 /* Enumerate dfs shares */
154 NTSTATUS rpccli_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
155 uint32 info_level, DFS_INFO_CTR *ctr)
157 prs_struct qbuf, rbuf;
160 NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
165 /* Marshall data and send request */
167 init_dfs_q_dfs_enum(&q, info_level, ctr);
171 CLI_DO_RPC( cli, mem_ctx, PI_NETDFS, DFS_ENUM,
176 NT_STATUS_UNSUCCESSFUL);
180 result = werror_to_ntstatus(r.status);