diff options
author | Günther Deschner <gd@samba.org> | 2015-07-09 15:56:44 +0200 |
---|---|---|
committer | José A. Rivera <jarrpa@samba.org> | 2015-07-14 21:21:21 +0200 |
commit | 6f08d8ab23c37f7511260c4a488e236263584b8b (patch) | |
tree | 81c4d166270240d1f093dbfd3f5035b52100d3ae /source3/rpcclient | |
parent | 0a95932aaded561ee88cee963e7ecaf77884fadf (diff) | |
download | samba-6f08d8ab23c37f7511260c4a488e236263584b8b.tar.gz |
s3-rpcclient: add cmd_clusapi_get_cluster_version2.
Guenther
Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_clusapi.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_clusapi.c b/source3/rpcclient/cmd_clusapi.c index 441a9d85657..b7451dc2760 100644 --- a/source3/rpcclient/cmd_clusapi.c +++ b/source3/rpcclient/cmd_clusapi.c @@ -405,6 +405,46 @@ static WERROR cmd_clusapi_get_resource_state(struct rpc_pipe_client *cli, return WERR_OK; } +static WERROR cmd_clusapi_get_cluster_version2(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + int argc, + const char **argv) +{ + struct dcerpc_binding_handle *b = cli->binding_handle; + NTSTATUS status; + uint16_t lpwMajorVersion; + uint16_t lpwMinorVersion; + uint16_t lpwBuildNumber; + const char *lpszVendorId; + const char *lpszCSDVersion; + struct CLUSTER_OPERATIONAL_VERSION_INFO *ppClusterOpVerInfo; + WERROR rpc_status; + WERROR result; + + status = dcerpc_clusapi_GetClusterVersion2(b, mem_ctx, + &lpwMajorVersion, + &lpwMinorVersion, + &lpwBuildNumber, + &lpszVendorId, + &lpszCSDVersion, + &ppClusterOpVerInfo, + &rpc_status, + &result); + if (!NT_STATUS_IS_OK(status)) { + return ntstatus_to_werror(status); + } + + if (!W_ERROR_IS_OK(result)) { + printf("result: %s\n", win_errstr(result)); + return result; + } + + printf("rpc_status: %s\n", win_errstr(rpc_status)); + + return WERR_OK; +} + + struct cmd_set clusapi_commands[] = { { "CLUSAPI" }, @@ -417,5 +457,6 @@ struct cmd_set clusapi_commands[] = { { "clusapi_online_resource", RPC_RTYPE_WERROR, NULL, cmd_clusapi_online_resource, &ndr_table_clusapi, NULL, "bla", "" }, { "clusapi_offline_resource", RPC_RTYPE_WERROR, NULL, cmd_clusapi_offline_resource, &ndr_table_clusapi, NULL, "bla", "" }, { "clusapi_get_resource_state", RPC_RTYPE_WERROR, NULL, cmd_clusapi_get_resource_state, &ndr_table_clusapi, NULL, "bla", "" }, + { "clusapi_get_cluster_version2", RPC_RTYPE_WERROR, NULL, cmd_clusapi_get_cluster_version2, &ndr_table_clusapi, NULL, "bla", "" }, { NULL } }; |