101 int default_flags,
int no_root_path_flags ) {
103 struct uri *uris[argc];
115 goto err_parse_options;
119 for ( i = 0 ; i <
count ; i++ ) {
128 flags = default_flags;
129 if (
opts.no_describe )
134 flags |= no_root_path_flags;
144 for ( i-- ; i >= 0 ; i-- )
static union @435 opts
"sanboot" option list
int parse_integer(char *text, unsigned int *value)
Parse integer value.
static struct command_descriptor sanboot_cmd
"sanboot" command descriptor
struct arbelprm_rc_send_wqe rc
struct option_descriptor sanhook[2]
static void uri_put(struct uri *uri)
Decrement URI reference count.
int optind
Current option index.
static struct command_descriptor sanunhook_cmd
"sanunhook" command descriptor
static int sanboot_exec(int argc, char **argv)
The "sanboot" command.
struct command sanboot_commands [] __command
SAN commands.
unsigned int san_default_drive(void)
Get default SAN drive number.
struct option_descriptor sanunhook[1]
uint8_t drive
Drive number.
Uniform Resource Identifiers.
int uriboot(struct uri *filename, struct uri **root_paths, unsigned int root_path_count, int drive, const char *san_filename, unsigned int flags)
Boot from filename and root-path URIs.
static int sanhook_exec(int argc, char **argv)
The "sanhook" command.
#define ENOMEM
Not enough space.
Parse command-line options.
int parse_string(char *text, char **value)
Parse string value.
#define MAX_ARGUMENTS
No maximum number of arguments.
int reparse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Reparse command-line options.
int parse_flag(char *text __unused, int *flag)
Parse flag.
Command line option parsing.
Option does not take an argument.
static int sanunhook_exec(int argc, char **argv)
The "sanunhook" command.
unsigned int drive
Drive number.
const char * name
Name of the command.
struct option_descriptor sanboot[4]
static struct command_descriptor sanhook_cmd
"sanhook" command descriptor
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Option requires an argument.
uint16_t count
Number of entries.
A command-line option descriptor.
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
A Uniform Resource Identifier.
int no_describe
Do not describe SAN device.
static int sanboot_core_exec(int argc, char **argv, struct command_descriptor *cmd, int default_flags, int no_root_path_flags)
The "sanboot", "sanhook" and "sanunhook" commands.
#define NULL
NULL pointer (VOID *)
struct uri * parse_uri(const char *uri_string)
Parse URI.
void * memset(void *dest, int character, size_t len) __nonnull