summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-08-08 11:45:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:35 -0500
commit72c605b4fc518b498688ec032004fded0d2250d7 (patch)
treea26747def255b3e304216995fc141221ba504e61 /source3/rpcclient
parent11673dc07a137e911de3920f0ee6717b365f2ab4 (diff)
downloadsamba-72c605b4fc518b498688ec032004fded0d2250d7.tar.gz
samba-72c605b4fc518b498688ec032004fded0d2250d7.tar.bz2
samba-72c605b4fc518b498688ec032004fded0d2250d7.zip
r17454: Adding dfs_EnumEx for rpcclient (Samba4 IDL to follow).
Guenther (This used to be commit 8c1198c1592e7c07904b448ed7a54b9b23c941df)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_dfs.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_dfs.c b/source3/rpcclient/cmd_dfs.c
index 75543df267..e95b8f7ca0 100644
--- a/source3/rpcclient/cmd_dfs.c
+++ b/source3/rpcclient/cmd_dfs.c
@@ -212,6 +212,38 @@ static NTSTATUS cmd_dfs_enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
return result;
}
+/* Enumerate dfs shares */
+
+static NTSTATUS cmd_dfs_enumex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ NETDFS_DFS_ENUMSTRUCT str;
+ NETDFS_DFS_ENUMINFO_CTR ctr;
+ NTSTATUS result;
+ uint32 info_level = 1;
+ uint32 total = 0;
+
+ if (argc < 2 || argc > 3) {
+ printf("Usage: %s dfs_name [info_level]\n", argv[0]);
+ return NT_STATUS_OK;
+ }
+
+ if (argc == 3)
+ info_level = atoi(argv[2]);
+
+ ZERO_STRUCT(ctr);
+ init_netdfs_dfs_EnumStruct(&str, info_level, ctr);
+ str.e.ptr0 = 1;
+
+ result = rpccli_dfs_EnumEx(cli, mem_ctx, info_level, 0xFFFFFFFF, &str, &total, argv[1]);
+
+ if (NT_STATUS_IS_OK(result))
+ display_dfs_enumstruct(&str);
+
+ return result;
+}
+
+
static NTSTATUS cmd_dfs_getinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
int argc, const char **argv)
{
@@ -253,6 +285,7 @@ struct cmd_set dfs_commands[] = {
{ "dfsremove", RPC_RTYPE_NTSTATUS, cmd_dfs_remove, NULL, PI_NETDFS, NULL, "Remove a DFS share", "" },
{ "dfsgetinfo",RPC_RTYPE_NTSTATUS, cmd_dfs_getinfo, NULL, PI_NETDFS, NULL, "Query DFS share info", "" },
{ "dfsenum", RPC_RTYPE_NTSTATUS, cmd_dfs_enum, NULL, PI_NETDFS, NULL, "Enumerate dfs shares", "" },
+ { "dfsenumex", RPC_RTYPE_NTSTATUS, cmd_dfs_enumex, NULL, PI_NETDFS, NULL, "Enumerate dfs shares", "" },
{ NULL }
};