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 More...
 
static int startpxe_exec (int argc, char **argv)
 The "startpxe" command. More...
 
static int stoppxe_exec (int argc __unused, char **argv __unused)
 The "stoppxe" command. More...
 

Variables

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

Detailed Description

PXE commands.

Definition in file pxe_cmd.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ startpxe_payload()

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.

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

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

◆ startpxe_exec()

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.

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

References ifcommon_exec(), and startpxe_cmd.

◆ stoppxe_exec()

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.

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 
102  pxe_deactivate();
103 
104  return 0;
105 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
Definition: parseopt.c:447
int pxe_deactivate(void)
Deactivate PXE stack.
Definition: pxe_call.c:307
static struct command_descriptor stoppxe_cmd
"stoppxe" command descriptor
Definition: pxe_cmd.c:84
static union @423 opts
"cert<xxx>" option list
"stoppxe" options
Definition: pxe_cmd.c:78

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

Variable Documentation

◆ startpxe_opts

struct option_descriptor startpxe_opts[] = {}
static

"startpxe" option list

Definition at line 42 of file pxe_cmd.c.

◆ startpxe_cmd

struct ifcommon_command_descriptor startpxe_cmd
static
Initial value:
=
0, MAX_ARGUMENTS, "[<interface>]",
#define MAX_ARGUMENTS
No maximum number of arguments.
Definition: parseopt.h:96
static int startpxe_payload(struct net_device *netdev, struct startpxe_options *opts __unused)
"startpxe" payload
Definition: pxe_cmd.c:51
"startpxe" options
Definition: pxe_cmd.c:39
#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:57
static struct option_descriptor startpxe_opts[]
"startpxe" option list
Definition: pxe_cmd.c:42

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

◆ stoppxe_cmd

struct command_descriptor stoppxe_cmd
static
Initial value:
=
"stoppxe" options
Definition: pxe_cmd.c:78
static struct option_descriptor stoppxe_opts[]
"stoppxe" option list
Definition: pxe_cmd.c:81
#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

"stoppxe" command descriptor

Definition at line 84 of file pxe_cmd.c.

Referenced by stoppxe_exec().

◆ __command

struct command pxe_commands [] __command
Initial value:
= {
{
.name = "startpxe",
.exec = startpxe_exec,
},
{
.name = "stoppxe",
.exec = stoppxe_exec,
},
}
static int stoppxe_exec(int argc __unused, char **argv __unused)
The "stoppxe" command.
Definition: pxe_cmd.c:94
static int startpxe_exec(int argc, char **argv)
The "startpxe" command.
Definition: pxe_cmd.c:73

PXE commands.

Definition at line 108 of file pxe_cmd.c.