2001-12-03 06:49:47 +00:00
/*
Samba Unix / Linux SMB client library
Distributed SMB / CIFS Server Management Utility
Copyright ( C ) 2001 Andrew Bartlett ( abartlet @ samba . org )
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA . */
2002-07-15 10:35:28 +00:00
2005-01-18 14:46:24 +00:00
/*
* A function of this type is passed to the '
* run_rpc_command ' wrapper . Must go before the net_proto . h
* include
*/
2005-09-30 17:13:37 +00:00
typedef NTSTATUS ( * rpc_command_fn ) ( const DOM_SID * ,
const char * ,
struct cli_state * cli ,
struct rpc_pipe_client * ,
TALLOC_CTX * ,
int ,
const char * * ) ;
2005-06-12 21:18:16 +00:00
typedef struct copy_clistate {
TALLOC_CTX * mem_ctx ;
struct cli_state * cli_share_src ;
struct cli_state * cli_share_dst ;
char * cwd ;
uint16 attribute ;
2005-09-30 17:13:37 +00:00
} copy_clistate ;
2005-06-12 21:18:16 +00:00
2006-02-03 22:19:41 +00:00
struct rpc_sh_ctx {
struct cli_state * cli ;
DOM_SID * domain_sid ;
char * domain_name ;
const char * whoami ;
const char * thiscmd ;
struct rpc_sh_cmd * cmds ;
struct rpc_sh_ctx * parent ;
} ;
struct rpc_sh_cmd {
const char * name ;
struct rpc_sh_cmd * ( * sub ) ( TALLOC_CTX * mem_ctx ,
struct rpc_sh_ctx * ctx ) ;
int pipe_idx ;
NTSTATUS ( * fn ) ( TALLOC_CTX * mem_ctx , struct rpc_sh_ctx * ctx ,
struct rpc_pipe_client * pipe_hnd ,
int argc , const char * * argv ) ;
const char * help ;
} ;
2005-01-18 14:46:24 +00:00
/* INCLUDE FILES */
2004-10-07 04:01:18 +00:00
# include "utils/net_proto.h"
2001-12-03 06:49:47 +00:00
2005-01-18 14:46:24 +00:00
/* MACROS & DEFINES */
2001-12-03 06:49:47 +00:00
# define NET_FLAGS_MASTER 1
# define NET_FLAGS_DMB 2
/* Would it be insane to set 'localhost' as the default
remote host for this operation ?
For example , localhost is insane for a ' join ' operation .
*/
2001-12-05 11:00:26 +00:00
# define NET_FLAGS_LOCALHOST_DEFAULT_INSANE 4
2001-12-03 06:49:47 +00:00
2001-12-04 04:48:01 +00:00
/* We want to find the PDC only */
2001-12-05 11:00:26 +00:00
# define NET_FLAGS_PDC 8
2001-12-04 04:48:01 +00:00
2001-12-05 03:14:35 +00:00
/* We want an anonymous connection */
2001-12-05 11:00:26 +00:00
# define NET_FLAGS_ANONYMOUS 16
2001-12-05 03:14:35 +00:00
2004-02-08 10:59:09 +00:00
/* don't open an RPC pipe */
# define NET_FLAGS_NO_PIPE 32
2001-12-03 06:49:47 +00:00
2005-06-12 21:18:16 +00:00
/* net share operation modes */
# define NET_MODE_SHARE_MIGRATE 1
2001-12-03 06:49:47 +00:00
extern int opt_maxusers ;
2003-01-03 08:28:12 +00:00
extern const char * opt_comment ;
2003-04-21 14:09:03 +00:00
extern const char * opt_container ;
2001-12-03 06:49:47 +00:00
extern int opt_flags ;
2003-01-03 08:28:12 +00:00
extern const char * opt_comment ;
2001-12-04 04:48:01 +00:00
2003-01-03 08:28:12 +00:00
extern const char * opt_target_workgroup ;
extern const char * opt_workgroup ;
2001-12-03 06:49:47 +00:00
extern int opt_long_list_entries ;
2004-04-18 20:22:31 +00:00
extern int opt_verbose ;
2001-12-31 13:00:59 +00:00
extern int opt_reboot ;
extern int opt_force ;
2003-10-23 14:33:19 +00:00
extern int opt_machine_pass ;
2001-12-31 13:00:59 +00:00
extern int opt_timeout ;
2003-01-03 08:28:12 +00:00
extern const char * opt_host ;
extern const char * opt_user_name ;
extern const char * opt_password ;
2002-04-10 13:28:28 +00:00
extern BOOL opt_user_specified ;
2002-07-15 10:35:28 +00:00
2004-02-26 11:29:56 +00:00
extern BOOL opt_localgroup ;
extern BOOL opt_domaingroup ;
extern const char * opt_newntname ;
extern int opt_rid ;
2004-08-10 14:27:17 +00:00
extern int opt_acls ;
2004-08-20 20:13:05 +00:00
extern int opt_attrs ;
extern int opt_timestamps ;
2004-08-10 14:27:17 +00:00
extern const char * opt_exclude ;
2004-08-26 21:37:20 +00:00
extern const char * opt_destination ;
2004-02-26 11:29:56 +00:00
2003-01-03 08:28:12 +00:00
extern BOOL opt_have_ip ;
extern struct in_addr opt_dest_ip ;
2002-07-15 10:35:28 +00:00
extern const char * share_type [ ] ;
2005-07-06 21:02:43 +00:00
/* Structure for mapping accounts to groups */
/* Array element is the group rid */
typedef struct _groupmap {
uint32 rid ;
uint32 gidNumber ;
fstring sambaSID ;
fstring group_dn ;
} GROUPMAP ;
typedef struct _accountmap {
uint32 rid ;
fstring cn ;
} ACCOUNTMAP ;