diff options
author | Günther Deschner <gd@samba.org> | 2009-05-13 16:27:58 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-05-14 14:18:26 +0200 |
commit | 8fd3c8902c5e953a0ddf184b08f9e37f954ee12e (patch) | |
tree | f43289ac577b6f62ad81ae1d44c8a6aba7869e94 /source3/lib/netapi/libnetapi.c | |
parent | 3a2c748cf4626266899103aa719ea6ac2eae3a9f (diff) | |
download | samba-8fd3c8902c5e953a0ddf184b08f9e37f954ee12e.tar.gz samba-8fd3c8902c5e953a0ddf184b08f9e37f954ee12e.tar.bz2 samba-8fd3c8902c5e953a0ddf184b08f9e37f954ee12e.zip |
s3-netapi: add NetShutdownInit and NetShutdownAbort skeletons.
Guenther
Diffstat (limited to 'source3/lib/netapi/libnetapi.c')
-rw-r--r-- | source3/lib/netapi/libnetapi.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c index 043190a1f9..6e366673f1 100644 --- a/source3/lib/netapi/libnetapi.c +++ b/source3/lib/netapi/libnetapi.c @@ -2353,3 +2353,91 @@ NET_API_STATUS NetFileEnum(const char * server_name /* [in] */, return r.out.result; } +/**************************************************************** + NetShutdownInit +****************************************************************/ + +NET_API_STATUS NetShutdownInit(const char * server_name /* [in] */, + const char * message /* [in] */, + uint32_t timeout /* [in] */, + uint8_t force_apps /* [in] */, + uint8_t do_reboot /* [in] */) +{ + struct NetShutdownInit 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.message = message; + r.in.timeout = timeout; + r.in.force_apps = force_apps; + r.in.do_reboot = do_reboot; + + /* Out parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetShutdownInit, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetShutdownInit_l(ctx, &r); + } else { + werr = NetShutdownInit_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetShutdownInit, &r); + } + + return r.out.result; +} + +/**************************************************************** + NetShutdownAbort +****************************************************************/ + +NET_API_STATUS NetShutdownAbort(const char * server_name /* [in] */) +{ + struct NetShutdownAbort 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; + + /* Out parameters */ + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetShutdownAbort, &r); + } + + if (LIBNETAPI_LOCAL_SERVER(server_name)) { + werr = NetShutdownAbort_l(ctx, &r); + } else { + werr = NetShutdownAbort_r(ctx, &r); + } + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetShutdownAbort, &r); + } + + return r.out.result; +} + |