iPXE
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.
 COMMAND (startpxe, startpxe_exec)
 PXE commands.
 COMMAND (stoppxe, stoppxe_exec)

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

Detailed Description

PXE commands.

Definition in file pxe_cmd.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ startpxe_payload()

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.

52 {
53
54 if ( netdev_is_open ( netdev ) )
56
57 return 0;
58}
static struct net_device * netdev
Definition gdbudp.c:53
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
Definition netdevice.h:662
void pxe_activate(struct net_device *netdev)
Activate PXE stack.
Definition pxe_call.c:269

References __unused, netdev, netdev_is_open(), opts, and pxe_activate().

◆ startpxe_exec()

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.

73 {
74 return ifcommon_exec ( argc, argv, &startpxe_cmd );
75}
int ifcommon_exec(int argc, char **argv, struct ifcommon_command_descriptor *ifcmd)
Execute if<xxx> command.
Definition ifmgmt_cmd.c:52
static struct ifcommon_command_descriptor startpxe_cmd
"startpxe" command descriptor
Definition pxe_cmd.c:61

References ifcommon_exec(), and startpxe_cmd.

Referenced by COMMAND().

◆ stoppxe_exec()

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.

94 {
95 struct stoppxe_options opts;
96 int rc;
97
98 /* Parse options */
99 if ( ( rc = parse_options ( argc, argv, &stoppxe_cmd, &opts ) ) != 0 )
100 return rc;
101
103
104 return 0;
105}
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
static union @024010030001061367220137227263210031030210157031 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:485
int pxe_deactivate(void)
Deactivate PXE stack.
Definition pxe_call.c:300
static struct command_descriptor stoppxe_cmd
"stoppxe" command descriptor
Definition pxe_cmd.c:84
"stoppxe" options
Definition pxe_cmd.c:78

References __unused, opts, parse_options(), pxe_deactivate(), rc, and stoppxe_cmd.

Referenced by COMMAND().

◆ COMMAND() [1/2]

COMMAND ( startpxe ,
startpxe_exec  )

PXE commands.

References startpxe_exec().

◆ COMMAND() [2/2]

COMMAND ( stoppxe ,
stoppxe_exec  )

References stoppxe_exec().

Variable Documentation

◆ startpxe_opts

struct option_descriptor startpxe_opts[] = {}
static

"startpxe" option list

Definition at line 42 of file pxe_cmd.c.

42{};

◆ startpxe_cmd

struct ifcommon_command_descriptor startpxe_cmd
static
Initial value:
=
0, MAX_ARGUMENTS, "[<interface>]",
#define IFCOMMON_COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage, _payload, _stop_on_first_success)
Construct "if<xxx>" command descriptor.
Definition ifmgmt_cmd.h:58
#define MAX_ARGUMENTS
No maximum number of arguments.
Definition parseopt.h:98
static int startpxe_payload(struct net_device *netdev, struct startpxe_options *opts __unused)
"startpxe" payload
Definition pxe_cmd.c:51
static struct option_descriptor startpxe_opts[]
"startpxe" option list
Definition pxe_cmd.c:42
"startpxe" options
Definition pxe_cmd.c:39

"startpxe" command descriptor

Definition at line 61 of file pxe_cmd.c.

Referenced by startpxe_exec().

◆ stoppxe_opts

struct option_descriptor stoppxe_opts[] = {}
static

"stoppxe" option list

Definition at line 81 of file pxe_cmd.c.

81{};

◆ stoppxe_cmd

struct command_descriptor stoppxe_cmd
static
Initial value:
=
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
Definition parseopt.h:109
static struct option_descriptor stoppxe_opts[]
"stoppxe" option list
Definition pxe_cmd.c:81

"stoppxe" command descriptor

Definition at line 84 of file pxe_cmd.c.

Referenced by stoppxe_exec().