From c8334dc7089e9f615257fff7c1dbf5f9b4a4e1c6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 2 Sep 2008 11:02:43 +0200 Subject: netapi: add skeleton for NetRenameMachineInDomain. Guenther (This used to be commit 03a7f7f33370d65493a81ccead2038ee3ab291d0) --- source3/lib/netapi/joindomain.c | 18 ++++++++++++++++ source3/lib/netapi/libnetapi.c | 48 +++++++++++++++++++++++++++++++++++++++++ source3/lib/netapi/libnetapi.h | 9 ++++++++ 3 files changed, 75 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index c83b0e01ff..6bf1cad312 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -447,3 +447,21 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, done: return werr; } + +/**************************************************************** +****************************************************************/ + +WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, + struct NetRenameMachineInDomain *r) +{ + return WERR_NOT_SUPPORTED; +} + +/**************************************************************** +****************************************************************/ + +WERROR NetRenameMachineInDomain_l(struct libnetapi_ctx *ctx, + struct NetRenameMachineInDomain *r) +{ + LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetRenameMachineInDomain); +} diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c index 3b203b4bcf..3e42254c7e 100644 --- a/source3/lib/netapi/libnetapi.c +++ b/source3/lib/netapi/libnetapi.c @@ -214,6 +214,54 @@ NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] [unique] */, return r.out.result; } +/**************************************************************** + NetRenameMachineInDomain +****************************************************************/ + +NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */, + const char * new_machine_name /* [in] */, + const char * account /* [in] */, + const char * password /* [in] */, + uint32_t rename_options /* [in] */) +{ + struct NetRenameMachineInDomain r; + struct libnetapi_ctx *ctx = NULL; + NET_API_STATUS status; + WERROR werr; + + status = libnetapi_getctx(&ctx); + if (status != 0) { + return status; + } + + /* In parameters */ + r.in.server_name = server_name; + r.in.new_machine_name = new_machine_name; + r.in.account = account; + r.in.password = password; + r.in.rename_options = rename_options; + + /* Out parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetRenameMachineInDomain, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetRenameMachineInDomain_l(ctx, &r); + } else { + werr = NetRenameMachineInDomain_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetRenameMachineInDomain, &r); + } + + return r.out.result; +} + /**************************************************************** NetServerGetInfo ****************************************************************/ diff --git a/source3/lib/netapi/libnetapi.h b/source3/lib/netapi/libnetapi.h index d4d73e6439..d2531a287f 100644 --- a/source3/lib/netapi/libnetapi.h +++ b/source3/lib/netapi/libnetapi.h @@ -35,6 +35,15 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, struct NetGetJoinableOUs *r); WERROR NetGetJoinableOUs_l(struct libnetapi_ctx *ctx, struct NetGetJoinableOUs *r); +NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */, + const char * new_machine_name /* [in] */, + const char * account /* [in] */, + const char * password /* [in] */, + uint32_t rename_options /* [in] */); +WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, + struct NetRenameMachineInDomain *r); +WERROR NetRenameMachineInDomain_l(struct libnetapi_ctx *ctx, + struct NetRenameMachineInDomain *r); NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */, uint32_t level /* [in] */, uint8_t **buffer /* [out] [ref] */); -- cgit