1#ifndef _IPXE_PARSEOPT_H
2#define _IPXE_PARSEOPT_H
50#define OPTION_PARSER( _struct, _field, _parse ) \
51 ( ( int ( * ) ( char *text, void *value ) ) \
52 ( ( ( ( typeof ( _parse ) * ) NULL ) == \
53 ( ( int ( * ) ( char *text, \
54 typeof ( ( ( _struct * ) NULL )->_field ) * ) ) \
55 NULL ) ) ? _parse : _parse ) )
68#define OPTION_DESC( _longopt, _shortopt, _has_arg, _struct, _field, _parse ) \
70 .longopt = _longopt, \
71 .shortopt = _shortopt, \
72 .has_arg = _has_arg, \
73 .offset = offsetof ( _struct, _field ), \
74 .parse = OPTION_PARSER ( _struct, _field, _parse ), \
98#define MAX_ARGUMENTS 0xff
109#define COMMAND_DESC( _struct, _options, _min_args, _max_args, _usage ) \
111 .options = ( ( ( ( typeof ( _options[0] ) * ) NULL ) == \
112 ( ( struct option_descriptor * ) NULL ) ) ? \
113 _options : _options ), \
114 .num_options = ( sizeof ( _options ) / \
115 sizeof ( _options[0] ) ), \
116 .len = sizeof ( _struct ), \
117 .min_args = _min_args, \
118 .max_args = _max_args, \
union @162305117151260234136356364136041353210355154177 key
Sense key.
uint32_t flag
Flag number.
pseudo_bit_t value[0x00020]
static union @024010030001061367220137227263210031030210157031 opts
"cert<xxx>" option list
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
struct settings *(* get_child_settings_t)(struct settings *settings, const char *name)
A child settings block locator function.
int parse_netdev(char *text, struct net_device **netdev)
Parse network device name.
int parse_key(char *text, unsigned int *key)
Parse key.
int parse_flag(char *text __unused, int *flag)
Parse flag.
int reparse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Reparse command-line options.
int parse_existing_setting(char *text, struct named_setting *setting)
Parse existing setting name.
int parse_netdev_configurator(char *text, struct net_device_configurator **configurator)
Parse network device configurator name.
int parse_dynui(char *text, struct dynamic_ui **dynui)
Parse dynamic user interface name.
int parse_string(char *text, char **value)
Parse string value.
int parse_settings(char *text, struct settings **settings)
Parse settings block name.
int parse_uuid(char *text, struct uuid_option *uuid)
Parse UUID.
int parse_autovivified_setting(char *text, struct named_setting *setting)
Parse and autovivify setting name.
int parse_setting(char *text, struct named_setting *setting, get_child_settings_t get_child)
Parse setting name.
void print_usage(struct command_descriptor *cmd, char **argv)
Print command usage message.
int parse_integer(char *text, unsigned int *value)
Parse integer value.
int parse_timeout(char *text, unsigned long *value)
Parse timeout value (in ms)
int parse_parameters(char *text, struct parameters **params)
Parse request parameter list name.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
struct option_descriptor * options
Option descriptors.
uint8_t num_options
Number of option descriptors.
uint8_t max_args
Maximum number of non-option arguments.
uint8_t len
Length of option structure.
uint8_t min_args
Minimum number of non-option arguments.
const char * usage
Command usage.
A dynamic user interface.
struct setting setting
Setting.
struct settings * settings
Settings block.
A network device configurator.
A command-line option descriptor.
uint8_t has_arg
Argument requirement (as for struct option)
int(* parse)(char *text, void *value)
Parse option.
char shortopt
Short option name.
uint16_t offset
Offset of field within options structure.
const char * longopt
Long option name, if any.
A request parameter list.
A UUID command-line option.
union uuid buf
Storage buffer.