rpc_client/cli_shutdown.c

説明を見る。
00001 /* 
00002    Unix SMB/CIFS implementation.
00003    RPC Pipe client
00004  
00005    Copyright (C) Andrew Tridgell              1992-1998,
00006    Largely rewritten by Jeremy Allison (C)         2005.
00007    Copyright (C) Jim McDonough (jmcd@us.ibm.com)   2003.
00008    
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 2 of the License, or
00012    (at your option) any later version.
00013    
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018    
00019    You should have received a copy of the GNU General Public License
00020    along with this program; if not, write to the Free Software
00021    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022 */
00023 
00024 #include "includes.h"
00025 
00026 /* Shutdown a server */
00027 
00028 NTSTATUS rpccli_shutdown_init(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00029                            const char *msg, uint32 timeout, BOOL do_reboot,
00030                            BOOL force)
00031 {
00032         prs_struct qbuf;
00033         prs_struct rbuf; 
00034         SHUTDOWN_Q_INIT q;
00035         SHUTDOWN_R_INIT r;
00036         WERROR result = WERR_GENERAL_FAILURE;
00037 
00038         if (msg == NULL) 
00039                 return NT_STATUS_INVALID_PARAMETER;
00040 
00041         ZERO_STRUCT (q);
00042         ZERO_STRUCT (r);
00043 
00044         /* Marshall data and send request */
00045 
00046         init_shutdown_q_init(&q, msg, timeout, do_reboot, force);
00047 
00048         CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT,
00049                 q, r,
00050                 qbuf, rbuf,
00051                 shutdown_io_q_init,
00052                 shutdown_io_r_init,
00053                 NT_STATUS_UNSUCCESSFUL);
00054 
00055         result = r.status;
00056         return werror_to_ntstatus(result);
00057 }
00058 
00059 /* Shutdown a server */
00060 
00061 NTSTATUS rpccli_shutdown_init_ex(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
00062                            const char *msg, uint32 timeout, BOOL do_reboot,
00063                            BOOL force, uint32 reason)
00064 {
00065         prs_struct qbuf;
00066         prs_struct rbuf; 
00067         SHUTDOWN_Q_INIT_EX q;
00068         SHUTDOWN_R_INIT_EX r;
00069         WERROR result = WERR_GENERAL_FAILURE;
00070 
00071         if (msg == NULL) 
00072                 return NT_STATUS_INVALID_PARAMETER;
00073 
00074         ZERO_STRUCT (q);
00075         ZERO_STRUCT (r);
00076 
00077         /* Marshall data and send request */
00078 
00079         init_shutdown_q_init_ex(&q, msg, timeout, do_reboot, force, reason);
00080 
00081         CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_INIT_EX,
00082                 q, r,
00083                 qbuf, rbuf,
00084                 shutdown_io_q_init_ex,
00085                 shutdown_io_r_init_ex,
00086                 NT_STATUS_UNSUCCESSFUL);
00087 
00088         result = r.status;
00089         return werror_to_ntstatus(result);
00090 }
00091 
00092 
00093 /* Abort a server shutdown */
00094 
00095 NTSTATUS rpccli_shutdown_abort(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
00096 {
00097         prs_struct rbuf;
00098         prs_struct qbuf; 
00099         SHUTDOWN_Q_ABORT q;
00100         SHUTDOWN_R_ABORT r;
00101         WERROR result = WERR_GENERAL_FAILURE;
00102 
00103         ZERO_STRUCT (q);
00104         ZERO_STRUCT (r);
00105 
00106         /* Marshall data and send request */
00107 
00108         init_shutdown_q_abort(&q);
00109 
00110         CLI_DO_RPC(cli, mem_ctx, PI_SHUTDOWN, SHUTDOWN_ABORT,
00111                 q, r,
00112                 qbuf, rbuf,
00113                 shutdown_io_q_abort,
00114                 shutdown_io_r_abort,
00115                 NT_STATUS_UNSUCCESSFUL);
00116 
00117         result = r.status;
00118         return werror_to_ntstatus(result);
00119 }

Sambaに対してSat Aug 29 21:23:16 2009に生成されました。  doxygen 1.4.7