Data Structures | Functions | Variables
login_cmd.c File Reference

Login commands. More...

#include <string.h>
#include <stdio.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/login_ui.h>

Go to the source code of this file.

Data Structures

struct  login_options
 "login" options More...


static int login_exec (int argc, char **argv)
 "login" command More...


static struct option_descriptor login_opts [] = {}
 "login" option list More...
static struct command_descriptor login_cmd
 "login" command descriptor More...
struct command login_command __command
 Login commands. More...

Detailed Description

Login commands.

Definition in file login_cmd.c.

Function Documentation



◆ login_exec()

static int login_exec ( int  argc,
char **  argv 

"login" command

argcArgument count
argvArgument list
Return values
rcReturn status code

Definition at line 55 of file login_cmd.c.

55  {
56  struct login_options opts;
57  int rc;
59  /* Parse options */
60  if ( ( rc = parse_options ( argc, argv, &login_cmd, &opts ) ) != 0 )
61  return rc;
63  /* Show login UI */
64  if ( ( rc = login_ui() ) != 0 ) {
65  printf ( "Could not set credentials: %s\n",
66  strerror ( rc ) );
67  return rc;
68  }
70  return 0;
71 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
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
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
static struct command_descriptor login_cmd
"login" command descriptor
Definition: login_cmd.c:45
"login" options
Definition: login_cmd.c:39
int login_ui(void)
Definition: login_ui.c:51

References login_cmd, login_ui(), opts, parse_options(), printf(), rc, and strerror().

Variable Documentation

◆ login_opts

struct option_descriptor login_opts[] = {}

"login" option list

Definition at line 42 of file login_cmd.c.

◆ login_cmd

struct command_descriptor login_cmd
Initial value:
static struct option_descriptor login_opts[]
"login" option list
Definition: login_cmd.c:42
"login" options
Definition: login_cmd.c:39
#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

"login" command descriptor

Definition at line 45 of file login_cmd.c.

Referenced by login_exec().

◆ __command

struct command login_command __command
Initial value:
= {
.name = "login",
.exec = login_exec,
static int login_exec(int argc, char **argv)
"login" command
Definition: login_cmd.c:55

Login commands.

Definition at line 74 of file login_cmd.c.