iPXE
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...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int login_exec (int argc, char **argv)
 "login" command

Variables

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

Detailed Description

Login commands.

Definition in file login_cmd.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int login_exec ( int  argc,
char **  argv 
) [static]

"login" command

Parameters:
argcArgument count
argvArgument list
Return values:
rcReturn status code

Definition at line 55 of file login_cmd.c.

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

                                                {
        struct login_options opts;
        int rc;

        /* Parse options */
        if ( ( rc = parse_options ( argc, argv, &login_cmd, &opts ) ) != 0 )
                return rc;

        /* Show login UI */
        if ( ( rc = login_ui() ) != 0 ) {
                printf ( "Could not set credentials: %s\n",
                         strerror ( rc ) );
                return rc;
        }

        return 0;
}

Variable Documentation

struct option_descriptor login_opts[] = {} [static]

"login" option list

Definition at line 42 of file login_cmd.c.

struct command_descriptor login_cmd [static]
Initial value:

"login" command descriptor

Definition at line 45 of file login_cmd.c.

struct command login_command __command
Initial value:
 {
        .name = "login",
        .exec = login_exec,
}

Login commands.

Definition at line 74 of file login_cmd.c.