2 Samba Unix/Linux SMB client library
3 Distributed SMB/CIFS Server Management Utility
4 Copyright (C) Gerald (Jerry) Carter 2005
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #include "utils/net.h"
23 /********************************************************************
24 ********************************************************************/
26 static NTSTATUS rpc_service_list_internal( const DOM_SID *domain_sid, const char *domain_name,
27 struct cli_state *cli, TALLOC_CTX *mem_ctx,
28 int argc, const char **argv )
31 WERROR result = WERR_GENERAL_FAILURE;
34 d_printf("Usage: net rpc service list\n");
38 if ( !W_ERROR_IS_OK(result = cli_svcctl_open_scm( cli, mem_ctx, &hSCM, SC_RIGHT_MGR_ENUMERATE_SERVICE )) ) {
39 d_printf("Failed to open Service Control Manager. [%s]\n", dos_errstr(result));
40 return werror_to_ntstatus(result);
43 d_printf("Successfully opened Service Control Manager.\n");
47 close_service_handle( cli, mem_ctx, &hSCM );
53 /********************************************************************
54 ********************************************************************/
56 static int rpc_service_list( int argc, const char **argv )
58 return run_rpc_command( NULL, PI_SVCCTL, 0,
59 rpc_service_list_internal, argc, argv );
62 /********************************************************************
63 ********************************************************************/
65 static int rpc_service_start( int argc, const char **argv )
67 d_printf("not implemented\n");
71 /********************************************************************
72 ********************************************************************/
74 static int rpc_service_stop( int argc, const char **argv )
76 d_printf("not implemented\n");
80 /********************************************************************
81 ********************************************************************/
83 static int rpc_service_pause( int argc, const char **argv )
85 d_printf("not implemented\n");
89 /********************************************************************
90 ********************************************************************/
92 static int rpc_service_status( int argc, const char **argv )
94 d_printf("not implemented\n");
98 /********************************************************************
99 ********************************************************************/
101 static int net_help_service( int argc, const char **argv )
103 d_printf("net rpc service list View configured Win32 services\n");
104 d_printf("net rpc service start <service> Start a service\n");
105 d_printf("net rpc service stop <service> Stop a service\n");
106 d_printf("net rpc service pause <service> Pause a service\n");
107 d_printf("net rpc service status <service> View the current status of a service\n");
112 /********************************************************************
113 ********************************************************************/
115 int net_rpc_service(int argc, const char **argv)
117 struct functable func[] = {
118 {"list", rpc_service_list},
119 {"start", rpc_service_start},
120 {"stop", rpc_service_stop},
121 {"pause", rpc_service_pause},
122 {"status", rpc_service_status},
127 return net_run_function( argc, argv, func, net_help_service );
129 return net_help_service( argc, argv );