iPXE
Data Structures | Functions | Variables
pxe_cmd.c File Reference

PXE commands. More...

#include <ipxe/netdevice.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <hci/ifmgmt_cmd.h>
#include <pxe_call.h>

Go to the source code of this file.

Data Structures

struct  startpxe_options
 "startpxe" options More...
struct  stoppxe_options
 "stoppxe" options More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int startpxe_payload (struct net_device *netdev, struct startpxe_options *opts __unused)
 "startpxe" payload
static int startpxe_exec (int argc, char **argv)
 The "startpxe" command.
static int stoppxe_exec (int argc __unused, char **argv __unused)
 The "stoppxe" command.

Variables

static struct option_descriptor startpxe_opts [] = {}
 "startpxe" option list
static struct
ifcommon_command_descriptor 
startpxe_cmd
 "startpxe" command descriptor
static struct option_descriptor stoppxe_opts [] = {}
 "stoppxe" option list
static struct command_descriptor stoppxe_cmd
 "stoppxe" command descriptor
struct command pxe_commands[] __command
 PXE commands.

Detailed Description

PXE commands.

Definition in file pxe_cmd.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int startpxe_payload ( struct net_device netdev,
struct startpxe_options *opts  __unused 
) [static]

"startpxe" payload

Parameters:
netdevNetwork device
optsCommand options
Return values:
rcReturn status code

Definition at line 51 of file pxe_cmd.c.

References netdev_is_open(), and pxe_activate().

                                                                       {

        if ( netdev_is_open ( netdev ) )
                pxe_activate ( netdev );

        return 0;
}
static int startpxe_exec ( int  argc,
char **  argv 
) [static]

The "startpxe" command.

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

Definition at line 73 of file pxe_cmd.c.

References ifcommon_exec().

                                                   {
        return ifcommon_exec ( argc, argv, &startpxe_cmd );
}
static int stoppxe_exec ( int argc  __unused,
char **argv  __unused 
) [static]

The "stoppxe" command.

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

Definition at line 94 of file pxe_cmd.c.

References parse_options(), pxe_deactivate(), and rc.

                                                                    {
        struct stoppxe_options opts;
        int rc;

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

        pxe_deactivate();

        return 0;
}

Variable Documentation

struct option_descriptor startpxe_opts[] = {} [static]

"startpxe" option list

Definition at line 42 of file pxe_cmd.c.

Initial value:

"startpxe" command descriptor

Definition at line 61 of file pxe_cmd.c.

struct option_descriptor stoppxe_opts[] = {} [static]

"stoppxe" option list

Definition at line 81 of file pxe_cmd.c.

Initial value:

"stoppxe" command descriptor

Definition at line 84 of file pxe_cmd.c.

struct command pxe_commands [] __command
Initial value:
 {
        {
                .name = "startpxe",
                .exec = startpxe_exec,
        },
        {
                .name = "stoppxe",
                .exec = stoppxe_exec,
        },
}

PXE commands.

Definition at line 108 of file pxe_cmd.c.