Data Structures | Functions | Variables
reboot_cmd.c File Reference

Reboot command. More...

#include <getopt.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/reboot.h>

Go to the source code of this file.

Data Structures

struct  reboot_options
 "reboot" options More...


static int reboot_exec (int argc, char **argv)
 The "reboot" command. More...


static struct option_descriptor reboot_opts []
 "reboot" option list More...
static struct command_descriptor reboot_cmd
 "reboot" command descriptor More...
struct command reboot_command __command
 "reboot" command More...

Detailed Description

Reboot command.

Definition in file reboot_cmd.c.

Function Documentation



◆ reboot_exec()

static int reboot_exec ( int  argc,
char **  argv 

The "reboot" command.

argcArgument count
argvArgument list
Return values
rcReturn status code

Definition at line 60 of file reboot_cmd.c.

60  {
61  struct reboot_options opts;
62  int rc;
64  /* Parse options */
65  if ( ( rc = parse_options ( argc, argv, &reboot_cmd, &opts ) ) != 0 )
66  return rc;
68  /* Reboot system */
69  reboot ( opts.warm );
71  return 0;
72 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
static struct command_descriptor reboot_cmd
"reboot" command descriptor
Definition: reboot_cmd.c:50
static union @424 opts
"cert<xxx>" option list
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
Definition: parseopt.c:447
"reboot" options
Definition: reboot_cmd.c:38
void reboot(int warm)
Reboot system.

References opts, parse_options(), rc, reboot(), and reboot_cmd.

Variable Documentation

◆ reboot_opts

struct option_descriptor reboot_opts[]
Initial value:
= {
OPTION_DESC ( "warm", 'w', no_argument,
int parse_flag(char *text __unused, int *flag)
Parse flag.
Definition: parseopt.c:200
int warm
Perform a warm reboot.
Definition: reboot_cmd.c:40
Option does not take an argument.
Definition: getopt.h:16
"reboot" options
Definition: reboot_cmd.c:38
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Definition: parseopt.h:66

"reboot" option list

Definition at line 44 of file reboot_cmd.c.

◆ reboot_cmd

struct command_descriptor reboot_cmd
Initial value:
static struct option_descriptor reboot_opts[]
"reboot" option list
Definition: reboot_cmd.c:44
"reboot" options
Definition: reboot_cmd.c:38
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
Definition: parseopt.h:107
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

"reboot" command descriptor

Definition at line 50 of file reboot_cmd.c.

Referenced by reboot_exec().

◆ __command

struct command reboot_command __command
Initial value:
= {
.name = "reboot",
.exec = reboot_exec,
static int reboot_exec(int argc, char **argv)
The "reboot" command.
Definition: reboot_cmd.c:60

"reboot" command

Definition at line 75 of file reboot_cmd.c.