2009-07-28 18:46:53 +04:00
/*
Copyright Red Hat , Inc . 2006
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 , 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 ; see the file COPYING . If not , write to the
Free Software Foundation , Inc . , 675 Mass Ave , Cambridge ,
MA 0213 9 , USA .
*/
# ifndef _XVM_OPTIONS_H
# define _XVM_OPTIONS_H
typedef enum {
F_FOREGROUND = 0x1 ,
F_NOCCS = 0x2 ,
F_ERR = 0x4 ,
F_HELP = 0x8 ,
F_USE_UUID = 0x10 ,
F_VERSION = 0x20 ,
F_CCSERR = 0x40 ,
F_CCSFAIL = 0x80 ,
F_NOCLUSTER = 0x100
} arg_flags_t ;
typedef enum {
MODE_MULTICAST = 0 ,
2009-08-17 17:58:06 +04:00
/*MODE_BROADCAST = 1,*/
2009-07-28 18:46:53 +04:00
MODE_SERIAL = 2 ,
2012-06-01 23:22:02 +04:00
MODE_VMCHANNEL = 3 ,
MODE_TCP = 4
2009-07-28 18:46:53 +04:00
} client_mode_t ;
typedef struct {
char * domain ;
fence_cmd_t op ;
client_mode_t mode ;
int debug ;
int timeout ;
2012-06-08 02:10:49 +04:00
int delay ;
2009-07-28 18:46:53 +04:00
int retr_time ;
arg_flags_t flags ;
struct network_args {
char * addr ;
2012-06-01 23:22:02 +04:00
char * ipaddr ;
2009-07-28 18:46:53 +04:00
char * key_file ;
int port ;
fence_hash_t hash ;
fence_auth_type_t auth ;
int family ;
unsigned int ifindex ;
} net ;
struct serial_args {
char * device ; /* Serial device */
char * speed ;
2010-01-14 07:34:35 +03:00
char * address ; /* vmchannel IP */
2009-07-28 18:46:53 +04:00
} serial ;
} fence_virt_args_t ;
/* Private structure for commandline / stdin fencing args */
struct arg_info {
char opt ;
char * opt_desc ;
char * stdin_opt ;
2010-01-14 23:26:53 +03:00
int eh ;
char * content_type ;
char * default_value ;
2009-07-28 18:46:53 +04:00
char * desc ;
void ( * assign ) ( fence_virt_args_t * , struct arg_info * , char * ) ;
} ;
/* Get options */
void args_init ( fence_virt_args_t * args ) ;
void args_finalize ( fence_virt_args_t * args ) ;
2010-01-09 22:20:59 +03:00
void args_get_getopt ( int argc , char * * argv , const char * optstr ,
2009-07-28 18:46:53 +04:00
fence_virt_args_t * args ) ;
2010-01-09 22:20:59 +03:00
void args_get_stdin ( const char * optstr , fence_virt_args_t * args ) ;
void args_get_ccs ( const char * optstr , fence_virt_args_t * args ) ;
void args_usage ( char * progname , const char * optstr , int print_stdin ) ;
2009-07-28 18:46:53 +04:00
void args_print ( fence_virt_args_t * args ) ;
2010-01-14 23:26:53 +03:00
void args_metadata ( char * progname , const char * optstr ) ;
2009-07-28 18:46:53 +04:00
# endif